silly-spring-18687
08/17/2023, 1:46 AMdocker_environment(
name="linux_go",
platform="linux_x86_64",
image="golang:1.20"
)
with this target
go_binary(
name="bin",
cgo_enabled=False,
environment=parametrize("osx", "linux_go")
)
and getting the following error
Engine traceback:
in `package` goal
ProcessExecutionFailure: Process 'Link Go binary: ./package_analyzer' failed with exit code 1.
stdout:
loadinternal: cannot find runtime/cgo
stderr:
2023/08/17 01:39:45 go/build: reference to nonexistent package runtime
I’ve tried messing around with a few other go-based docker images but they all fail somehow related to the runtime package. Is there a recommended way to utilize docker environments for this? My assumption was it just needed the tools to compile the binary, but it looks like some of the dependency inference is occurring in that environment as well. Thanks!happy-kitchen-89482
08/17/2023, 2:41 PMhappy-kitchen-89482
08/17/2023, 2:41 PMfast-nail-55400
08/17/2023, 8:57 PMfast-nail-55400
08/17/2023, 8:58 PM./package_analyzer is the support Go binary used by the Go backend to parse Go code for its imports and other metadatasilly-spring-18687
08/17/2023, 8:59 PMfast-nail-55400
08/17/2023, 9:00 PMfast-nail-55400
08/17/2023, 9:00 PMfast-nail-55400
08/17/2023, 9:03 PM2023/08/17 01:39:45 go/build: reference to nonexistent package runtimefast-nail-55400
08/17/2023, 9:03 PMruntime package in the SDK should always be available in the GOROOTsilly-spring-18687
08/17/2023, 9:03 PMfast-nail-55400
08/17/2023, 9:04 PMfast-nail-55400
08/17/2023, 9:05 PMgo_binary target into two different targets and see if the issue persists?fast-nail-55400
08/17/2023, 9:05 PMfast-nail-55400
08/17/2023, 9:06 PMsilly-spring-18687
08/17/2023, 9:09 PMgo_binary(
name="bin-linux",
cgo_enabled=False,
environment="linux_go"
)
with a slightly more verbose error?
17:08:29.02 [ERROR] 1 Exception encountered:
Engine traceback:
in `package` goal
ProcessExecutionFailure: Process 'Link Go binary: ./package_analyzer' failed with exit code 1.
stdout:
loadinternal: cannot find runtime/cgo
stderr:
link: reference to undefined builtin "runtime.morestack_noctxt" from package "runtime"
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.silly-spring-18687
08/17/2023, 9:10 PMThe environment support for the Go backend is not stable; certainly I have not tried to test it in all possible combinations.No worries! Luckily this is just for a hobby project. If you want to dig in further, here’s the repo/PR i’m working on https://github.com/ianwesleyarmstrong/distributed-services-with-go-pants/pull/10
fast-nail-55400
08/17/2023, 9:34 PM-ldebug and upload the logs into a GitHub issue.silly-spring-18687
08/17/2023, 10:18 PMloud-nightfall-4213
09/15/2023, 9:56 PMgolang:1.20 as the image will work as unzip is not installed. I guess one option would be to extend the image and install the unzip lib