history: export build using history command support#652
Merged
Conversation
02c9436 to
684c055
Compare
crazy-max
commented
Apr 11, 2025
Comment on lines
+96
to
+97
| Sources?: any; | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any |
Member
Author
There was a problem hiding this comment.
As follow-up we could print the sources along the error logs similar to inspect command:
Name: buildx (binaries)
Context: /mnt/x/dev/www/github/docker_org/buildx
Dockerfile: Dockerfile
VCS Repository: https://github.com/crazy-max/buildx.git
VCS Revision: f8de3c3bdcb956aa4b6671d36644c7af7a7989c5
Target: binaries
Platforms: linux/amd64
Keep Git Dir: true
Started: 2025-04-10 19:53:59
Duration: 58.7s
Error: Unknown process "/bin/sh -c set -e\n xx-go --wrap\n DESTDIR=/usr/bin VERSION=$(cat /buildx-version/version) REVISION=$(cat /buildx-version/revision) GO_EXTRA_LDFLAGS=\"-s -w\" ./hack/build\n file /usr/bin/docker-buildx\n xx-verify --static /usr/bin/docker-buildx\n" did not complete successfully: exit code: 1
Build Steps: 14/15 (27% cached)
Image Resolve Mode: local
Dockerfile:80
--------------------
79 | ARG GO_EXTRA_FLAGS
80 | >>> RUN --mount=type=bind,target=. \
81 | >>> --mount=type=cache,target=/root/.cache \
82 | >>> --mount=type=cache,target=/go/pkg/mod \
83 | >>> --mount=type=bind,from=buildx-version,source=/buildx-version,target=/buildx-version <<EOT
84 | >>> set -e
85 | >>> xx-go --wrap
86 | >>> DESTDIR=/usr/bin VERSION=$(cat /buildx-version/version) REVISION=$(cat /buildx-version/revision) GO_EXTRA_LDFLAGS="-s -w" ./hack/build
87 | >>> file /usr/bin/docker-buildx
88 | >>> xx-verify --static /usr/bin/docker-buildx
89 | >>> EOT
90 |
--------------------
Logs:
> => [buildx-build 1/1] RUN --mount=type=bind,target=. --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go/pkg/mod --mount=type=bind,from=buildx-version,source=/buildx-version,target=/buildx-version <<EOT (set -e...):
> + CGO_ENABLED=0 go build -mod vendor -trimpath -ldflags '-X github.com/docker/buildx/version.Version=v0.23.0-rc1-2-gf8de3c3b.m -X github.com/docker/buildx/version.Revision=f8de3c3bdcb956aa4b6671d36644c7af7a7989c5.m -X github.com/docker/buildx/version.Package=github.com/docker/buildx -s -w' -o /usr/bin/docker-buildx ./cmd/buildx
> # github.com/docker/buildx/commands
> commands/bake.go:428:6: declared and not used: resp
> commands/bake.go:429:16: undefined: sp
Enable --debug to see stack traces for error
Print build logs: docker buildx history logs mutgx2wmrwjpu4jm17yenzwn9
This was referenced Apr 14, 2025
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
684c055 to
1354fce
Compare
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1354fce to
4731c96
Compare
tonistiigi
approved these changes
Apr 23, 2025
| } | ||
|
|
||
| // wait 3 seconds to ensure build records are finalized: https://github.com/moby/buildkit/pull/5109 | ||
| await Util.sleep(3); |
Member
There was a problem hiding this comment.
Ah, I forgot this. Buildx finalizes trace on buildx history trace automatically. This could be used in here instead but would be messy. We should update buildx history export to do it as well (eg. when a flag is set).
Member
Author
There was a problem hiding this comment.
We should update
buildx history exportto do it as well (eg. when a flag is set).
Yes sounds good
This was referenced Apr 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #646
relates to