Skip to content

Conversation

@AkihiroSuda
Copy link
Member

Fix #5915

Test (on ARM):

FROM hello-world
buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt attest:sbom=
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has broken a couple of times now and I think needs a bigger refactor (can be in follow-up if needed). It isn't even that important what the real key normalization pattern is but the callback and sbom-attach need to always match in their result. I don't think that is still guaranteed even with the current test.

func normalizePlatform(p, imgP ocispecs.Platform) exptypes.Platform {
var k string
if p.OS == "windows" {
k = platforms.FormatAll(p)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be normalized as well before formatting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't change the logic for Windows, as I don't have an env to test the changes

@tonistiigi tonistiigi added this to the v0.21.1 milestone Apr 28, 2025
@tonistiigi
Copy link
Member

@AkihiroSuda I pushed update to https://github.com/moby/buildkit/compare/master...tonistiigi:buildkit:fix-5915?expand=1 but looks like I don't have permissions to push to your PR branch.

Making sure ID is always normalized is needed to make sure we match this line https://github.com/moby/buildkit/blob/master/frontend/dockerfile/builder/build.go#L165

AkihiroSuda and others added 3 commits April 29, 2025 23:50
Make sure key is always normalized and improve tests.

Signed-off-by: Tonis Tiigi <[email protected]>
@AkihiroSuda
Copy link
Member Author

Thanks, cherry-picked your commit @tonistiigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment