-
Notifications
You must be signed in to change notification settings - Fork 35
history: export build using history command support #652
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
Conversation
02c9436
to
684c055
Compare
Sources?: any; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
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.
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
Signed-off-by: CrazyMax <[email protected]>
Signed-off-by: CrazyMax <[email protected]>
684c055
to
1354fce
Compare
Signed-off-by: CrazyMax <[email protected]>
1354fce
to
4731c96
Compare
} | ||
|
||
// wait 3 seconds to ensure build records are finalized: https://github.com/moby/buildkit/pull/5109 | ||
await Util.sleep(3); |
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.
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).
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.
We should update
buildx history export
to do it as well (eg. when a flag is set).
Yes sounds good
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.
Opened docker/buildx#3149
fixes #646
relates to