The issue is caused by the rule: py3_image, container_image
No
When building py3_image, I failed and got errors like function undefined in go.
Errors also occurred when I built container_image(xx).
I have tried to manually upgrade external/go_sdk version, unfortunately i got similar errors after replacement.
I didn't figure out whether this is a bug or an environment problem.How can I solve this problem?
ERROR: /home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/BUILD.bazel:3:11: GoCompile external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a failed (Exit 1): builder failed: error executing command
(cd /home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/sandbox/processwrapper-sandbox/526/execroot/hippo && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/external/local_config_cc:/usr/bin:/bin \
bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go -arc 'github.com/containerd/stargz-snapshotter/estargz/errorutil=github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil.a=' -arc 'github.com/opencontainers/go-digest=github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/opencontainers/go-digest/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest.a=' -arc 'github.com/pkg/errors=github.com/google/go-containerregistry/vendor/github.com/pkg/errors=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/pkg/errors/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/pkg/errors.a=' -arc 'golang.org/x/sync/errgroup=github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/golang.org/x/sync/errgroup/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup.a=' -o bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz -- -trimpath .)
Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox builder failed: error executing command
(cd /home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/sandbox/processwrapper-sandbox/526/execroot/hippo && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/external/local_config_cc:/usr/bin:/bin \
bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go -arc 'github.com/containerd/stargz-snapshotter/estargz/errorutil=github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil.a=' -arc 'github.com/opencontainers/go-digest=github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/opencontainers/go-digest/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest.a=' -arc 'github.com/pkg/errors=github.com/google/go-containerregistry/vendor/github.com/pkg/errors=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/pkg/errors/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/pkg/errors.a=' -arc 'golang.org/x/sync/errgroup=github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/golang.org/x/sync/errgroup/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup.a=' -o bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz -- -trimpath .)
Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox
compile: error running compiler: exit status 2
/home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/sandbox/processwrapper-sandbox/526/execroot/hippo/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go:323:7: undefined: "github.com/google/go-containerregistry/vendor/github.com/pkg/errors".Is
ERROR: /home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/BUILD.bazel:3:11: GoCompile external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a failed (Exit 1): builder failed: error executing command
(cd /home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/sandbox/processwrapper-sandbox/544/execroot/hippo && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/external/local_config_cc:/usr/bin:/bin \
bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go -arc 'github.com/containerd/stargz-snapshotter/estargz/errorutil=github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil.a=' -arc 'github.com/opencontainers/go-digest=github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/opencontainers/go-digest/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest.a=' -arc 'github.com/pkg/errors=github.com/google/go-containerregistry/vendor/github.com/pkg/errors=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/pkg/errors/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/pkg/errors.a=' -arc 'golang.org/x/sync/errgroup=github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/golang.org/x/sync/errgroup/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup.a=' -o bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz -- -trimpath .)
Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox builder failed: error executing command
(cd /home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/sandbox/processwrapper-sandbox/544/execroot/hippo && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/external/local_config_cc:/usr/bin:/bin \
bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go -arc 'github.com/containerd/stargz-snapshotter/estargz/errorutil=github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil.a=' -arc 'github.com/opencontainers/go-digest=github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/opencontainers/go-digest/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest.a=' -arc 'github.com/pkg/errors=github.com/google/go-containerregistry/vendor/github.com/pkg/errors=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/pkg/errors/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/pkg/errors.a=' -arc 'golang.org/x/sync/errgroup=github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/golang.org/x/sync/errgroup/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup.a=' -o bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz -- -trimpath .)
Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox
compile: error running compiler: exit status 2
/home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/sandbox/processwrapper-sandbox/544/execroot/hippo/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go:323:7: undefined: "github.com/google/go-containerregistry/vendor/github.com/pkg/errors".Is
Target //app/gw/femas_gw:femas_image failed to build
ERROR: /home/franco/project/hippo/app/gw/femas_gw/BUILD.bazel:40:16 GoCompile external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a failed (Exit 1): builder failed: error executing command
(cd /home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/sandbox/processwrapper-sandbox/544/execroot/hippo && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/external/local_config_cc:/usr/bin:/bin \
bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go -arc 'github.com/containerd/stargz-snapshotter/estargz/errorutil=github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil.a=' -arc 'github.com/opencontainers/go-digest=github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/opencontainers/go-digest/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest.a=' -arc 'github.com/pkg/errors=github.com/google/go-containerregistry/vendor/github.com/pkg/errors=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/pkg/errors/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/pkg/errors.a=' -arc 'golang.org/x/sync/errgroup=github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/golang.org/x/sync/errgroup/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup.a=' -o bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz -- -trimpath .)
Execution platform: @local_config_platform//:host
Target //app/monitor:futures_md_img failed to build
Use --sandbox_debug to see verbose messages from the sandbox builder failed: error executing command
(cd /home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/sandbox/processwrapper-sandbox/544/execroot/hippo && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/home/franco/.cache/bazel/_bazel_franco/694686dede1ce1fded177f0c3e5868af/external/local_config_cc:/usr/bin:/bin \
bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go -arc 'github.com/containerd/stargz-snapshotter/estargz/errorutil=github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil.a=' -arc 'github.com/opencontainers/go-digest=github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/opencontainers/go-digest/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest.a=' -arc 'github.com/pkg/errors=github.com/google/go-containerregistry/vendor/github.com/pkg/errors=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/pkg/errors/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/pkg/errors.a=' -arc 'golang.org/x/sync/errgroup=github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/golang.org/x/sync/errgroup/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup.a=' -o bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz -- -trimpath .)
Execution platform: @local_config_platform//:host
## 馃實 Your Environment
**Operating System:**
Linux FrancosDebian 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
Output of bazel version:
3.7.0
Rules_docker version:
0.17.0
Anything else relevant?
external/go_sdk version:
go1.12.5
I second this
I third this, plus my entire organization.
I got the same error, any solution found?
Hey everyone! Would it be possible to produce a minimal reproduction example of the repository? @KHTee, what is the bazel version you are attempting to build with?
@gravypod my bazel version is 4.0.0
Below is error message in --sandbox_debug mode.
ERROR: /home/isaac/.cache/bazel/_bazel_isaac/fe5d404045cd36d494318b999148e32e/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/BUILD.bazel:3:11: GoCompile external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a [for host] failed: (Exit 1): process-wrapper failed: error executing command
(cd /home/isaac/.cache/bazel/_bazel_isaac/fe5d404045cd36d494318b999148e32e/sandbox/processwrapper-sandbox/1/execroot/kyc && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/usr/bin:/bin \
TMPDIR=/tmp \
/home/isaac/.cache/bazel/_bazel_isaac/install/1a4a2fac02d50c77031d44c0d91b8920/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go -arc 'github.com/containerd/stargz-snapshotter/estargz/errorutil=github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil.a=' -arc 'github.com/opencontainers/go-digest=github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/opencontainers/go-digest/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest.a=' -arc 'github.com/pkg/errors=github.com/google/go-containerregistry/vendor/github.com/pkg/errors=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/pkg/errors/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/pkg/errors.a=' -arc 'golang.org/x/sync/errgroup=github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/golang.org/x/sync/errgroup/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup.a=' -o bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz -- -trimpath .) process-wrapper failed: error executing command
(cd /home/isaac/.cache/bazel/_bazel_isaac/fe5d404045cd36d494318b999148e32e/sandbox/processwrapper-sandbox/1/execroot/kyc && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/usr/bin:/bin \
TMPDIR=/tmp \
/home/isaac/.cache/bazel/_bazel_isaac/install/1a4a2fac02d50c77031d44c0d91b8920/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/go_sdk/builder compile -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go -src external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go -arc 'github.com/containerd/stargz-snapshotter/estargz/errorutil=github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil.a=' -arc 'github.com/opencontainers/go-digest=github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/opencontainers/go-digest/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/opencontainers/go-digest.a=' -arc 'github.com/pkg/errors=github.com/google/go-containerregistry/vendor/github.com/pkg/errors=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/pkg/errors/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/pkg/errors.a=' -arc 'golang.org/x/sync/errgroup=github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup=bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/golang.org/x/sync/errgroup/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/golang.org/x/sync/errgroup.a=' -o bazel-out/host/bin/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a -package_list bazel-out/host/bin/external/go_sdk/packages.txt -p github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz -- -trimpath .)
compile: error running compiler: exit status 2
/home/isaac/.cache/bazel/_bazel_isaac/fe5d404045cd36d494318b999148e32e/sandbox/processwrapper-sandbox/1/execroot/kyc/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go:323:7: undefined: "github.com/google/go-containerregistry/vendor/github.com/pkg/errors".Is
I checked in build.go the line that causes the error is
if errors.Is(err, errNotFound) && missedPrioritized != nil {
*missedPrioritized = append(*missedPrioritized, l)
continue // allow not found
}
I can build it successfully if I comment out that section.
Hey everyone! Would it be possible to produce a minimal reproduction example of the repository? @KHTee, what is the
bazel versionyou are attempting to build with?
3.7.0
Just attempted to reproduce this. In my workspace file I have:
workspace(name = "trd")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_docker",
sha256 = "59d5b42ac315e7eadffa944e86e90c2990110a1c8075f1cd145f487e999d22b3",
strip_prefix = "rules_docker-0.17.0",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.17.0/rules_docker-v0.17.0.tar.gz"],
)
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")
container_deps()
load(
"@io_bazel_rules_docker//python3:image.bzl",
_py3_image_repos = "repositories",
)
_py3_image_repos()
In test/BUILD I have:
load("@io_bazel_rules_docker//python3:image.bzl", "py3_image")
py3_image(
name = "test_py",
main = "main.py",
srcs = ["main.py"],
)
I can run bazel run //test:test_py and it prints out my hello world.
System config:
Ubuntu 20.04.2 LTSLinux desktop 5.8.0-55-generic #62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux4.1.03.8.5 (installed with apt)Attempted the exact "system config" as @gravypod.
Rules docker 0.17
Python 3.8.5
Ubuntu 20.04.2 LTS
Bazel 4.1.0
Same error as @KHTee
ERROR: /home/ryan/.cache/bazel/_bazel_ryan/c5bcbaa35f3c9b5e41b36da2262ed650/external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/BUILD.bazel:3:11: GoCompile external/com_github_google_go_containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz/linux_amd64_stripped/go_default_library%/github.com/google/go-containerregistry/vendor/github.com/containerd/stargz-snapshotter/estargz.a [for host] failed: (Exit 1): linux-sandbox failed: error executing command
(cd /home/ryan/.cache/bazel/_bazel_ryan/c5bcbaa35f3c9b5e41b36da2262ed650/sandbox/linux-sandbox/45/execroot/__main__ && \
exec env - \
CGO_ENABLED=1 \
GOARCH=amd64 \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=/usr/bin:/bin \
TMPDIR=/tmp \
/home/ryan/.cache/bazel/_bazel_ryan/install/f95ca91ebc34d56aa0f8ad499de91220/linux-sandbox -t 15
I got the same error, any solution found?
I removed sha256 checking key in go_containerregistry, then all goes well. Auto-downloaded go_sdk might cause this problem.
@francoccc could you describe what file you modified?
Base on tag: v0.16.0 (commit 2a208c1b27533faed8afb723eb309ecc51828bb2)
git diff HEAD~1
--- a/repositories/go_repositories.bzl
+++ b/repositories/go_repositories.bzl
@@ -39,7 +39,6 @@ def go_deps():
name = "com_github_google_go_containerregistry",
urls = ["https://api.github.com/repos/google/go-containerregistry/tarball/8a2841911ffee4f6892ca0083e89752fb46c48dd"], # v0.1.4
strip_prefix = "google-go-containerregistry-8a28419",
- sha256 = "60b9a600affa5667bd444019a4e218b7752d8500cfa923c1ac54ce2f88f773e2",
importpath = "github.com/google/go-containerregistry",
type = "tar.gz",
)
Last I package the source code for bazel.
This is my way. @ryan-hnarakis-techlabs