Skip to content
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

Abort on indeterminstic checkout #623

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jkloetzke
Copy link
Member

No description provided.

Bob handles situations where the checkout step hash was predicted but
the actual checkout yielded another result by restarting the build.
While this case may indeed happen for indeterministic checkouts, it is
an error if it happens for officially stable checkouts.

So instead of restarting the build, give an error message. The user
should probably fix the recipe. Halting the build at this stage makes
the analysis easier.
Make sure the build stops if predicted sources of deterministic
checkouts do not match.
Copy link

codecov bot commented Mar 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.95%. Comparing base (64dd214) to head (86c6b1a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #623   +/-   ##
=======================================
  Coverage   88.94%   88.95%           
=======================================
  Files          48       48           
  Lines       15616    15618    +2     
=======================================
+ Hits        13890    13893    +3     
+ Misses       1726     1725    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rhubert
Copy link
Contributor

rhubert commented Mar 15, 2025

Thanks. I'm wondering if there should be a command line argument or a policy to disable this abort? Otherwise it might break existing builds as the warning might not have been recognized before.

@jkloetzke
Copy link
Member Author

You can always restart the build manually. So this is not a permanent error and you should still be able to build projects that trigger this error. Or do you mean that we should suppress even that and optionally support the old behaviour?

@rhubert
Copy link
Contributor

rhubert commented Mar 15, 2025

We have a (known broken but god given) CI Setup. Bob build runs in a container without persistent storage and with not enough resources for a complete build. This only works because we have the cache - so we can (automatically) retry the build several times....
I fear that with this change we might end up in a situation where we hit the nondeterministic package on each retry. This is not a problem for HEAD since we could apply a patch to fix the package. But for bugfix-releases additional fixes just to make the CI happy again are near to impossible.

@jkloetzke
Copy link
Member Author

I see. Thanks for the explanation. Then a new policy is probably needed, I guess...

@rhubert
Copy link
Contributor

rhubert commented Mar 15, 2025

🤔 for our current releases we can also use an older bob version without the abort.
For further releases we just need to be sure there is no indeterministic checkout. Something like a --verfiy-checkout build doing the checkout and compare the result to the expected result hash from the buildid file?

@jkloetzke
Copy link
Member Author

🤔 for our current releases we can also use an older bob version without the abort.

Usually, this is something that we should avoid. Taken to it's logical end, we would not even need policies. Just use the right Bob version for the project. But this is a usability nightmare. My goal is that older projects work with newer Bob versions. We might break something by accident but that should happen rarely.

For further releases we just need to be sure there is no indeterministic checkout. Something like a --verfiy-checkout build doing the checkout and compare the result to the expected result hash from the buildid file?

That could turn out to be tricky. We fully allow the user to tinker with the sources. The check that I patched here is only running when the sources have been checkout out initially, which is the only safe state for such a check. But you will only ever notice the problem when artifacts were uploaded.

To make it even worse, even if we would introduce something like --verify-checkout that runs the checkout twice, we would probably not detect problems. The autoconf class will not call autoconf again unless configure.ac was changed. So you might not even detect the problem until you delete the source workspace and re-run it. :-/ Tricky...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants