Skip to content

Build/test fails with "Undefined symbols for architecture x86_64" error on Apple M1 & go1.16beta1 #1087

Closed
@PieterVoorwinden

Description

@PieterVoorwinden

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.16beta1 darwin/arm64
  • Run gopls -v version to get version of Gopls if you are using the language server.
    • golang.org/x/tools/gopls v0.6.2
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.52.1
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.20.1
  • Run go env to get the go development environment details

GO111MODULE="on"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/pietervoorwinden/Library/Caches/go-build"
GOENV="/Users/pietervoorwinden/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/pietervoorwinden/Repositories/pkg/mod"
GONOPROXY="git.profects.com"
GONOSUMDB="git.profects.com"
GOOS="darwin"
GOPATH="/Users/pietervoorwinden/Repositories"
GOPRIVATE="git.profects.com"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.15.6/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.15.6/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16beta1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/pietervoorwinden/Repositories/src/git.profects.com/agro4all/comparison-api/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/j8/kln9bkmn77d3qkw5f9tnzrh80000gn/T/go-build817711015=/tmp/go-build -gno-record-gcc-switches -fno-common"

Share the Go related settings you have added/edited

"go.formatTool": "goimports",
"go.useLanguageServer": true,
"gopls": {
    "gofumpt": true,
},
"go.testTimeout": "45s",

Describe the bug

Testing in VScode isn't working for me. Running go test -timeout 45s -run ^TestComparison$ git.profects.com/agro4all/comparison-api/handler in my terminal works without any issue:
ok git.profects.com/agro4all/comparison-api/handler 0.425s

But when I press Run test inside VSCode it fails with an error.
The same error occurs when testing via the integrated terminal.

I am not sure whether this is a problem on my side but the test succeeds when running in my terminal, which is weird. Thanks for the help in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeupstream-goIssues that are caused by bugs in the Go toolchain.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions