GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — core: fix $BUILDPLATFORM resolving to the target platform in dockerBuild (cross-platform cache regression) by sipsma · Pull Request #13571 · dagger/dagger Conversation
Contributor
ProblemUsers upgrading Dagger from 0.20.8 to 0.21.x reported losing layer caching that used to hit — most visibly when building a Dockerfile for a non-native platform. Their setup: a large multi-stage Dockerfile built for both The core symptom: in 0.21.x the amd64 and arm64 builds no longer shared cache for the Root causeThe predefined In the dagql-native Dockerfile build path, if opt.TargetPlatform != nil && opt.BuildPlatforms == nil { buildPlatforms = []ocispecs.Platform{*opt.TargetPlatform} } so This is a regression from #11856 ("migrate all caching to dagql"), which switched off the BuildKit solver. Previously these builds went through BuildKit's FixSet BuildPlatforms: []specs.Platform{query.Platform().Spec()},
The change is scoped to the Dockerfile build path; it's the only place in core that constructs TestAdds
This test fails on
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…rBuild The dagql-native Dockerfile build path built dockerfile2llb.ConvertOpt with TargetPlatform set but BuildPlatforms left unset. When BuildPlatforms is nil, buildPlatformOpt falls back to using the target platform as the build platform, so the predefined BUILDPLATFORM/BUILDOS/BUILDARCH build args tracked the target platform instead of the engine's native/host platform. That regressed multi-platform Dockerfile builds that use FROM --platform=$BUILDPLATFORM to keep stages on the build host: those stages were emulated to the target arch and, because their value diverged per target, they no longer shared cache across target platforms. Set BuildPlatforms to the engine's native platform, matching what BuildKit's dockerui frontend does. Regression from dagger#11856 (the buildkit-solver -> dagql migration). Signed-off-by: Erik Sipsma <[email protected]>
grouville
self-requested a review
grouville
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very clear, thanks 🙏
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
tiborvass
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |