-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[v0.10] cache: add fallback for snapshotID #3595
Conversation
In older BuildKit versions snapshotID was not always set if record was not created with GetByBlob method. Old code defaulted to cache record ID in that case but that broke with the metadata interface refactor. Signed-off-by: Tonis Tiigi <[email protected]>
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.
Two quick questions as someone who is naive to BuildKit:
- Does this fix also need to go in v0.11, as an old cache could still be loaded?
- Does it make more sense to encapsulate this logic inside
md.GetString()
?
Yes. If we want cache from 20.10 to not break Moby master.
No, this is specific fallback only for the |
Any idea what this failiure is / was ? Looks weird https://github.com/moby/buildkit/actions/runs/4120008980/jobs/7114304809
|
Yes catch this one in #3587 (review). I'm not sure yet but best guess is this could be linked to libseccomp package from alpine repo: Line 45 in b8fdb4b
|
Can we tag a release for this fix before we re-vendor in Moby? |
Also, just thinking about this change/bug a bit more:
|
We do not have any version upgrade tests atm. that could have caught this.
Sure, but the old code was pretty strict that this variable could never be empty. A regression that broke that seems to have been an oversight during a big refactor, and there was no intention to change the behavior behind it. This way, any time we pass a variable to a function, we would need to do a |
If there's not an explicit way to catch it without nil-guarding, fair enough. ZSTs are certainly the thing that makes the most sense here, but we don't work with a language that has such a rich type system 😆 It seems like the best thing to add is a regression for this case/upgrade tests with a gold corpus in general, that way we can guard against future similar regressions. |
Related: #3605 |
fix for moby/moby#44943
In older BuildKit versions, snapshotID was not always set if the record was not created with GetByBlob method. Old code defaulted to cache record ID in that case, but that broke with the metadata interface refactor.
Regression for this fallback is in:
before: a9f1980#diff-e4a99c1c50054f36891bbe03da3784b5d2d4ca6b279ff32c7999d3ac5db48dc7L81
after: a9f1980#diff-e4a99c1c50054f36891bbe03da3784b5d2d4ca6b279ff32c7999d3ac5db48dc7R250
It doesn't appear in current versions (at least) because
snapshotID
is explicitly set infinalize/commit
a9f1980#diff-94cb4012b7ea73b110c7ac219d52793e11b96d9141c3ad631603f34a7fc9289aR917finalize:
commit:
@neersighted @thaJeztah @sipsma
Signed-off-by: Tonis Tiigi [email protected]