-
Notifications
You must be signed in to change notification settings - Fork 18k
x/benchmarks/sweet: go-build failed when install cmd/compile and cmd/link #72920
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
Comments
The cause is
Besides, the possible reason for "permission denied" is that the automatically downloaded toolchain is read-only. So installing cmd/compile and cmd/link is not allowed. The permissions for these file are as follows: .r-xr-xr-x 20M 20M lqw lqw 17 3月 21:46 compile
.r-xr-xr-x 5.7M 5.7M lqw lqw 17 3月 21:46 link Support more go versions might be beneficial. But using new Go version is welcomed possibly. |
I think for benchmarking purposes, it should run with the exact Go toolchain specified in the config file. No auto-download etc.. Especially for working on the Go toolchain, this ensures we're benchmarking the toolchain we are actually working on. Otherwise it would be confusing. Perhaps we should run the install command in the goroot directory. And perhaps we want to set GOTOOLCHAIN=local.
Could be, but as a separate feature. E.g. we can have a special syntax in the config file to specify cc @mknyszek @golang/runtime |
Sorry for the ambiguity.
Here I mean supporting older versions like go1.22.0 might be beneficial for ones working on older versions. go1.24.1 is supported currently. go1.22.0 however is not supported.
Here I mean always using the latest Go is a good practice. Supporting older versions like go1.22.0 in a benchmark may not be a top priority and can be quite challenging. This is because, firstly, dependency issues need to be resolved. Secondly, older versions often have inferior functionality and performance compared to newer ones. So, it's likely to be an ungrateful task. Therefore I say "using new Go version is welcomed possibly".
go.mod:
downloading go1.23.7 automatically because of dependency issue. (base) ➜ benchmarks git:(understand) ✗ /home/lqw/golangs/go1.22.0/bin/go mod tidy
go: golang.org/x/[email protected] requires go >= 1.23.0; switching to go1.23.7
go: downloading go1.23.7 (linux/amd64)
^C |
After using the following configuration and replacing [[config]]
name = "go1.22.0"
goroot = "/home/lqw/golangs/go1.22.0"
envbuild = ["GOTOOLCHAIN=go1.22.0"]
envexec = ["GOTOOLCHAIN=local"] $ ./sweet run -work-dir /data/sweet-work -shell -run go-build go1.22.0.toml
...
[shell] cd /data/sweet-work/go-build/go1.22.0/bin/tsgo/cmd/tsgo
[shell] GOROOT=/data/sweet-work/go-build/go1.22.0/bin/goroot GOTOOLCHAIN=local /data/sweet-work/go-build/go1.22.0/bin/goroot/bin/go build -o /data/sweet-work/go-build/go1.22.0/bin/dummy
[shell] cd /home/lqw/mygit/research/vm/go-bench/benchmarks/sweet
[sweet] error: build go-build for go1.22.0: error building tsgo cmd/tsgo: exit status 1. stderr:
go: errors parsing ../../go.mod:
../../go.mod:20: unknown directive: tool
[sweet] error: failed to execute benchmarks: go-build After removing cmd/tsgo, a new error occurs. The benchmark go-build itself requires >=go1.23.0 but GOROOT is go1.22.0. [shell] cd /home/lqw/mygit/research/vm/go-bench/benchmarks/sweet
[sweet] error: build go-build for go1.22.0: error building go-build tool: exit status 1. stderr:
go: ../../../go.mod requires go >= 1.23.0 (running go 1.22.0; GOTOOLCHAIN=go1.22.0)
[sweet] error: failed to execute benchmarks: go-build Possibly Thanks for the pointer to But I give up to support go1.22.0. |
Go version
go version go1.24.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
First, my go environment is complex. I installed go1.22.0, go1.20.10 and go1.24.1. The GOPATH is always
/home/lqw/go
when using different go version.go build ./cmd/sweet
under sweet directory../sweet get
to get assests in zip format.gsutil cp gs://go-sweet-assets/assets-v0.3.0.zip $HOME/.cache/go-sweet
command sincesweet get
does not provide a progress bar. I'm impatient and I have some network issues. So I have to download the zip file manually through gsutils, which provides a progress bar and shows the file size. I thinksweet get
can be improved here?./sweet run -run go-build -work-dir /data/sweet-work -shell config.toml
with the following configuration.What did you see happen?
What did you expect to see?
no
permission denied
error and successfully installcmd/compile
andcmd/link
.I inspect how the error is thrown. I found that after changing
Do("", ...)
in sweet/harnesses/go-build.go#L113-L116 toDo(cfg.GoRoot, ...)
, the above error did not occur.When I call
GOROOT=/home/lqw/golangs/go1.22.0 GOFLAGS=-pgo=off /home/lqw/golangs/go1.22.0/bin/go install cmd/compile cmd/link
insweet
directory directly in zsh, the same error occurs. But if I call the same command in/data/sweet-work/go-build/baseline/bin/goroot
directory, no error occurs.The go version of
go.mod
in commit bd1e389d5239692b3cdb5b40375bbfb507567f63 of https://github.com/golang/benchmarks is go1.23.0. That might be the reason why the tool is installed in 1.23.0 toolchain mod andgo-build
fails.The text was updated successfully, but these errors were encountered: