Hello! Hoping maybe someone has seen this issue. I...
# general
l
Hello! Hoping maybe someone has seen this issue. I'm building a golang binary and getting the following error after moving to an m3 mac from an an intel one
Copy code
22:25:26.08 [ERROR] Completed: Compile with Go - (environment:docker-golang-linux-amd64, <http://github.com/tmthrgd/go-hex|github.com/tmthrgd/go-hex>) - <http://github.com/tmthrgd/go-hex|github.com/tmthrgd/go-hex> failed (exit code 1).
gopath/pkg/mod/github.com/tmthrgd/go-hex@v0.0.0-20190904060850-447a3041c3bc/hex_amd64.go:10:8: could not import <http://golang.org/x/sys/cpu|golang.org/x/sys/cpu> (open : no such file or directory)

22:26:01.41 [ERROR] 1 Exception encountered:

Engine traceback:
  in `package` goal

Exception: Failed to compile main:
gopath/pkg/mod/github.com/tmthrgd/go-hex@v0.0.0-20190904060850-447a3041c3bc/hex_amd64.go:10:8: could not import <http://golang.org/x/sys/cpu|golang.org/x/sys/cpu> (open : no such file or directory)
previously i had setup environments so i could build a linux binary on OSX. here is my environment configuration
Copy code
local_environment(
    name="golang-linux-amd64",
    compatible_platforms=["linux_x86_64"],
    fallback_environment="docker-golang-linux-amd64",
)

docker_environment(
    name="docker-golang-linux-amd64",
    image="golang:1.23.0-bookworm",
    golang_go_search_paths=["/usr/local/go/bin"],
    platform="linux_x86_64",
)
this worked fine before on the intel mac. the binary would build inside the container and produce a valid linux x86_64 image. i can also build the package fine using
go build .
inside the docker container. i validated it produced an x86-64 binary by running
file <binaryname>
. right now i'm unsure how to resolve this issue. any suggestions/hints would be appreciated.
i was able to get past this issue by re-installing my go binary to be an x86_64 based binary and killing pantsd. i also tried using an x86_64 version of the scie launcher from https://github.com/pantsbuild/scie-pants/releases/, but still go the same issue. seems potentially related to https://github.com/pantsbuild/pants/issues/21113 ?