-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
track and clean output files for builds #1291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, because we rely on Cargo to detect changes, buildsys knows that it must rebuild, but sometimes it doesn't because rpmbuild sees the output files? Therefore you we now always delete those output RPM files? Do I understand correctly? Thanks.
BuildType::Variant => "variants", | ||
}; | ||
|
||
let path = [&getenv("BUILDSYS_STATE_DIR")?, prefix, name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point it might be nice to move all of these variables to a StructOpt, which can get its values from environment variables. This would make it easier to understand all of the inputs to the program by centralizing them.
In the related issue, we observed that if we updated Deleting the RPMs avoids the mismatch between what we expect the build system to do - packages and images should always use the most recently built dependencies - and what it actually does. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to block, but I do think documentation is important here. The process makes some assumptions about the outputs of builds, and is something that could have subtle effects we're not anticipating.
Personally, I'm also worried about the removal of old artifacts, because of the impact to developer build time. I don't think working on different branches should mean abandoning prior artifacts if relevant sources on the given branch haven't changed. We should be able to figure out use of the latest artifacts, but I know it's a hard problem, and we're solving something else here.
b81493c
to
9cab4e5
Compare
Essentially this code only runs when If you're seeing spurious package rebuilds, it's possible we have another issue like the one in #996 that needs to be root caused. |
This adds a layer of indirection between the build artifacts and the final output directory, so we can keep track of what we've previously built for a given package or variant. That allows us to remove the files before the next build, so they do not interact with other builds in unexpected ways. Signed-off-by: Ben Cressey <[email protected]>
9cab4e5
to
32a76fc
Compare
Issue number:
Fixes #1027
Description of changes:
Add a layer of indirection between the build artifacts and the final output directory, so we can keep track of what we've previously built for a given package or variant.
That allows us to remove the files before the next build, so they do not interact with other builds in unexpected ways.
Testing done:
Verified that the
state
directory is populated with marker files.Confirmed that the corresponding files in
packages
andimages
are removed before another build. For example, old variant images are cleaned up on each build, so we no longer accumulate artifacts named for older commits. I also bumped the release package to version 1000.0, built it, then reverted it to 0.0. The older package with the higher version number was cleaned up as expected.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.