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

build: the build of go bootstrap in case of compilation errors does not stop cleanly #45410

Closed
perillo opened this issue Apr 6, 2021 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@perillo
Copy link
Contributor

perillo commented Apr 6, 2021

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

$ go version
go version go1.16.3 linux/amd64

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="on"
GOARCH="amd64"
GOBIN="/home/manlio/.local/bin"
GOCACHE="/home/manlio/.cache/go-build"
GOENV="/home/manlio/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE="*.local"
GOMODCACHE="/home/manlio/.local/lib/go/pkg/mod"
GONOPROXY=""
GONOSUMDB="*.local"
GOOS="linux"
GOPATH="/home/manlio/.local/lib/go:/home/manlio/src/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/manlio/src/contrib/go/go.googlesource.com/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/manlio/src/contrib/go/go.googlesource.com/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/manlio/src/contrib/go/go.googlesource.com/go/src/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build213926523=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version devel go1.17-84162b8832 Tue Apr 6 09:22:20 2021 +0000 linux/amd64
GOROOT/bin/go tool compile -V: compile version devel go1.17-84162b8832 Tue Apr 6 09:22:20 2021 +0000
uname -sr: Linux 5.11.10-arch1-1
/usr/lib/libc.so.6: GNU C Library (GNU libc) release release version 2.33.
gdb --version: GNU gdb (GDB) 10.1

What did you do?

I'm building the go distribution using all.bash, with an error in one of the standard packages.

What did you expect to see?

The build process to print the compilation errors, stop the build and cleaning up all the temporary resources.

What did you see instead?

This is the output:

Building Go cmd/dist using /usr/lib/go. (go1.16.3 linux/amd64)
Building Go toolchain1 using /usr/lib/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
/home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/match.go:5:9: package filepath; expected filepath_test
/home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/path.go:12:9: package filepath; expected filepath_test
/home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/path_unix.go:8:9: package filepath; expected filepath_test
/home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/symlink.go:5:9: package filepath; expected filepath_test
/home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/symlink_unix.go:4:9: package filepath; expected filepath_test

go tool dist: FAILED: /home/manlio/src/contrib/go/go.googlesource.com/go/pkg/tool/linux_amd64/compile -std -pack -o /tmp/go-tool-dist-818923994/path/filepath/_go_.a -p path/filepath -importcfg /tmp/go-tool-dist-818923994/path/filepath/importcfg /home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/example_unix_getwd.go /home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/match.go /home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/path.go /home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/path_unix.go /home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/symlink.go /home/manlio/src/contrib/go/go.googlesource.com/go/src/path/filepath/symlink_unix.go: exit status 2
go tool dist: open /tmp/go-tool-dist-818923994/log/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/go/token/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/cmd/go/internal/par/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/debug/dwarf/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/encoding/xml/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/encoding/hex/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/cmd/vendor/golang.org/x/xerrors/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/net/url/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/path/filepath/_go_.a: no such file or directory"
go tool dist: open /tmp/go-tool-dist-818923994/text/template/parse/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/compress/flate/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/encoding/json/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-818923994/flag/_go_.a: no such file or directory

Also, some temporary directories in /tmp have not been removed:

cgo-gcc-input-1520319032
cgo-gcc-input-1520319032.c
go-build1561461267
go-build2690360732
go-build3893457982
go-build4083322296
go-tool-dist-133532080
go-tool-dist-212743231
go-tool-dist-4058507942
go-tool-dist-509174233
@ALTree
Copy link
Member

ALTree commented Apr 8, 2021

I'm not sure how easy it would be to handle every possible failure mode in all.bash. I suspect it would require a good amount of code; the number of corner cases to be handled must be high.

some temporary directories in /tmp have not been removed

I don't think this is a problem, that's the whole point of /tmp, and applications using it don't have to remove the temporary files and folders they create.

@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 8, 2021
@ALTree ALTree added this to the Unplanned milestone Apr 8, 2021
@perillo
Copy link
Contributor Author

perillo commented Apr 10, 2021

On my system /tmp is on tmpfs and I usually only reboot the system once in a week (normally using suspend). This means that having a lot of files in /tmp will consume my available memory.

@gopherbot
Copy link

Change https://golang.org/cl/320311 mentions this issue: cmd/dist: exit early in bgwait after a fatal error

@dmitshur
Copy link
Contributor

dmitshur commented May 21, 2021

The CL that fixes this makes a small change. Given that, it seems okay to move this to NeedsFix.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels May 21, 2021
@dmitshur dmitshur modified the milestones: Unplanned, Go1.18 Nov 9, 2021
@golang golang locked and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants