Skip to content
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

cmd/compile: "cannot use concurrent backend compilation with provided flags" reported after building go1.18beta1 from source #50293

Closed
cuishuang opened this issue Dec 21, 2021 · 3 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@cuishuang
Copy link
Contributor

cuishuang commented Dec 21, 2021

What version of Go are you using (go version)?

$ go version

 devel go1.18-becaeea119 Tue Dec 14 17:43:51 2021 +0000 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE="auto"
GOARCH="arm64"
GOBIN="/Users/fliter/go/bin"
GOCACHE="/Users/fliter/Library/Caches/go-build"
GOENV="/Users/fliter/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/fliter/go/pkg/mod"
GONOPROXY="g.hz.netease.com"
GONOSUMDB="g.hz.netease.com"
GOOS="darwin"
GOPATH="/Users/fliter/go"
GOPRIVATE="g.hz.netease.com"
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="devel go1.18-becaeea119 Tue Dec 14 17:43:51 2021 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/fliter/source_lab/go/src/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9t/839s3jmj73bcgyp5x_xh3gw00000gn/T/go-build4211396876=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I clone the new version of source code, use ./all.sh and compile successfully. But when I use the binary file to run demo.go as follows:

package main

func main() {
	m := make(map[int]string, 10)
	m[1] = "cuishuang"

	println(m[1])
}

What did you expect to see?

cuishuang

What did you see instead?

The output is as follows:

# runtime/internal/sys
compile: cannot use concurrent backend compilation with provided flags; invoked as [/usr/local/go/pkg/tool/darwin_arm64/compile -o $WORK/b008/_pkg_.a -trimpath $WORK/b008=> -p runtime/internal/sys -std -+ -complete -buildid M2oPX2HiuTsx5AMULRO_/M2oPX2HiuTsx5AMULRO_ -shared -c=4 -nolocalimports -importcfg $WORK/b008/importcfg -pack /usr/local/go/src/runtime/internal/sys/arch.go /usr/local/go/src/runtime/internal/sys/arch_arm64.go /usr/local/go/src/runtime/internal/sys/intrinsics.go /usr/local/go/src/runtime/internal/sys/intrinsics_common.go /usr/local/go/src/runtime/internal/sys/stubs.go /usr/local/go/src/runtime/internal/sys/sys.go /usr/local/go/src/runtime/internal/sys/zgoarch_arm64.go /usr/local/go/src/runtime/internal/sys/zgoos_darwin.go /usr/local/go/src/runtime/internal/sys/zversion.go]
# internal/cpu
compile: cannot use concurrent backend compilation with provided flags; invoked as [/usr/local/go/pkg/tool/darwin_arm64/compile -o $WORK/b004/_pkg_.a -trimpath $WORK/b004=> -p internal/cpu -std -+ -buildid bZn0-nG2D-qVhCGWsVek/bZn0-nG2D-qVhCGWsVek -symabis $WORK/b004/symabis -shared -c=4 -nolocalimports -importcfg $WORK/b004/importcfg -pack -asmhdr $WORK/b004/go_asm.h /usr/local/go/src/internal/cpu/cpu.go /usr/local/go/src/internal/cpu/cpu_arm64.go /usr/local/go/src/internal/cpu/cpu_arm64_darwin.go /usr/local/go/src/internal/cpu/cpu_no_name.go]
# runtime/internal/atomic
compile: cannot use concurrent backend compilation with provided flags; invoked as [/usr/local/go/pkg/tool/darwin_arm64/compile -o $WORK/b006/_pkg_.a -trimpath $WORK/b006=> -p runtime/internal/atomic -std -+ -buildid Wh4PYLD6KyWgsgy5uHLX/Wh4PYLD6KyWgsgy5uHLX -symabis $WORK/b006/symabis -shared -c=4 -nolocalimports -importcfg $WORK/b006/importcfg -pack -asmhdr $WORK/b006/go_asm.h /usr/local/go/src/runtime/internal/atomic/atomic_arm64.go /usr/local/go/src/runtime/internal/atomic/stubs.go /usr/local/go/src/runtime/internal/atomic/unaligned.go]
@dmitshur dmitshur changed the title runtime/internal/sys: cmd/compile: "cannot use concurrent backend compilation with provided flags" reported after building go1.18beta1 from source Dec 21, 2021
@dmitshur
Copy link
Contributor

This problem doesn't reproduce when I build Go from source at that commit:

gotip $ git status
HEAD detached at becaeea119
nothing to commit, working tree clean
gotip $ cd src 
src $ ./make.bash
Building Go cmd/dist using /usr/local/go. (go1.18beta1 darwin/arm64)
Building Go toolchain1 using /usr/local/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/arm64.
---
Installed Go for darwin/arm64 in /Users/gopher/gotip
Installed commands in /Users/gopher/gotip/bin
src $ export PATH="$(pwd)/../bin:$PATH"
src $ which go                         
/Users/gopher/gotip/src/../bin/go
src $ go version
go version devel go1.18-becaeea119 Tue Dec 14 17:43:51 2021 +0000 darwin/arm64
src $ go run /tmp/demo.go 
cuishuang

I clone the new version of source code, use ./all.sh and compile successfully. But when I use the binary file to run demo.go

Did you add go to PATH after running all.bash?

What does which go print?

In your go env, it says the inferred value of GOROOT is /usr/local/go. If you tried to build Go in another directory, then the problem is that the wrong directory is being used. This is possibly because the wrong go binary is in PATH.

@dmitshur dmitshur added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 21, 2021
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@cuishuang
Copy link
Contributor Author

This problem doesn't reproduce when I build Go from source at that commit:

I clone the new version of source code, use ./all.sh and compile successfully. But when I use the binary file to run demo.go

Did you add go to PATH after running all.bash?

What does which go print?

In your go env, it says the inferred value of GOROOT is /usr/local/go. If you tried to build Go in another directory, then the problem is that the wrong directory is being used. This is possibly because the wrong go binary is in PATH.

Thanks Sir

@golang golang locked and limited conversation to collaborators Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants