go1.15.6 has problem to build, such as src/cmnd/compile/internal/amd64/gsubr.go:34, while compiling bootstrap. Has anyone tried it? Kenji
Done. Thank you.
(This time hopefuly not [SPAM]) Applied. Thank you.
I've never had luck building the bootstrap package on 9front. However, 1.15.6 builds fine for me (on amd64) from a bootstrap tarball compiled on another system. --Kyle
> go1.15.6 has problem to build, such as src/cmnd/compile/internal/amd64/gsubr.go:34,
> while compiling bootstrap.
> Has anyone tried it?
using 9legacy bootstrap (go1.14), i was able to build 386 and amd64.
using my own go1.13 bootstrap, i got all kinds of failures.
sl
Quoth kokamoto@hera.eonet.ne.jp: > go1.15.6 has problem to build, such as src/cmnd/compile/internal/amd64/gsubr.go:34, > while compiling bootstrap. > Has anyone tried it? > > Kenji This version of go currently works for me sufficiently to bootstrap go master: go version go1.14.1 plan9/amd64 I believe I obtained it from ports. However, there's an important fix that I submitted to go which you'll really want in any program that execs commands, if you're running a recent 9front: https://github.com/golang/go/pull/43533 The patch on its own is below: From 18789896e6efa659df589f31c13df1c18f625896 From: Ori Bernstein <ori@eigenstate.org> Date: Wed, 06 Jan 2021 02:12:45 +0000 Subject: [PATCH] syscall/plan9: remove spooky fd action at a distance Change Plan 9 fork/exec to use the O_CLOEXEC file descriptor, instead of relying on spooky at a distance. Historically, Plan 9 has set the O_CLOEXEC flag on the underlying channels in the kernel, rather than the file descriptors -- if two fds pointed at a single channel, as with dup, changing the flags on one of them would be observable on the other. The per-Chan semantics are ok, if unexpected, when a chan is only handled within a single process, but this isn't always the case. Forked processes share Chans, but even more of a problem is the interaction between /srv and OCEXEC, which can lead to unexectedly closed file descriptors in completely unrelated proceses. For example: func exists() bool { // If some other thread execs here, // we don't want to leak the fd, so // open it O_CLOEXEC fd := Open("/srv/foo", O_CLOEXEC) if fd != -1 { Close(fd) return true } return false } would close the connection to any file descriptor (maybe even for the root fs) in ALL other processes that have it open if an exec were to happen(!), which is quite undesriable. As a result, 9front will be changing this behavior for the next release. Go is the only code observed so far that relies on this behavior on purpose, and It's easy to make the code work with both semantics: simply using the file descriptor that was opened with O_CEXEC instead of throwing it away. So we do that here. --- diff 3e1e13ce6d1271f49f3d8ee359689145a6995bad 18789896e6efa659df589f31c13df1c18f625896 --- a/src/syscall/exec_plan9.go Mon Dec 21 15:06:35 2020 +++ b/src/syscall/exec_plan9.go Tue Jan 5 18:12:45 2021 @@ -320,14 +320,15 @@ return e } - fd, e := Open("#d/"+itoa(p[1]), O_CLOEXEC) + fd, e := Open("#d/"+itoa(p[1]), O_RDWR|O_CLOEXEC) if e != nil { Close(p[0]) Close(p[1]) return e } - Close(fd) + Close(p[1]) + p[1] = fd return nil }
> using 9legacy bootstrap (go1.14), i was able to build 386 and amd64.
ls /sys/lib/go
amd64-1.13.1-bootstrap/ amd64-1.15.6/
amd64-1.14.6/ go-plan9-amd64-bootstrap/ <-- 9legacy's one
I'm using GOROOT_BOOTSTRAP=/sys/lib/go/go-plan9-amd64-bootstrap and GOROOT=/sys/lib/go/amd64-1.15.6.
Under $GOROOT/src directory,
./make.rc, and I got:
Building Go toolchain1 using /sys/lib/go/go-plan9-amd64-bootstrap.
../../../../src/cmd/compile/internal/amd64/gsubr.go:34: package bootstrap/cmd/compile/internal/big is not in GOROOT (/sys/lib/go/go-plan9-amd64-bootstrap/src/bootstrap/cmd/compile/internal/big)
Here, the bootstrap compiler recongnizes GOROOT as /sys/lib/go/go-plan9-amd64-bootstrap/src...
What's wrong?
Kenji
I recompiled /sys/ports/dev-lang/bootstrap by patching the ori's src/syscall/exec_plan9.go, and got a different error messages like: lc /sys/lib/go amd64-1.13.1-bootstrap/ amd64-1.15.6/ amd64-1.14.6/ go-plan9-amd64-bootstrap/ Under the amd64-1.15.6/src defined GOROOT_BOOTSTRAP=/sys/lib/go/amd64-1.13.1-bootstrap and GOROOT=/sys/lib/go/amd64-1.15.6, cpu% ./make.rc Building Go cmd/dist using /sys/lib/go/amd64-1.13.1-bootstrap Building Go toolchain1 using /sys/lib/go/amd64-1.13.1-bootstrap. build bootstrap/cmd/compile: cannot load bootstrap/cmd/compile/internal/big: malformed module path "bootstrap/cmd/compile/internal/big": missing dot in first path element go tool dist: FAILED: /sys/lib/go/amd64-1.13.1-bootstrap/bin/go install -gcflags=-l -tags=math_big_pure_go compiler_bootstrap bootstrap/cmd/...: exit status: 'go 205056: 1' cpu% lc .. Kenji
> I've never had luck building the bootstrap package on 9front.
> However, 1.15.6 builds fine for me (on amd64) from a bootstrap tarball compiled on another system.
Yes, I did it, too.
I forgot to define GOROOT_FINAL to /sys/lib/go/amd64-1.15.6.
Kenji
I am using my own amd64 bootstrap tarball for Go built from 1.15.3. (http://9project.net/go-plan9-amd64-bootstrap.tar.gz) Using this, I am able to bootstrap Go on 9front. As a side note, I used to have trouble using the bootstrap package to cross-compile (i.e. using my amd64 bootstrap tarball on amd64 to compile plan9 386) so I instead built for plan9 amd64 first, and then use that as a bootstrap for any other arches I want, like this: 1. go-plan9-amd64-bootstrap.tar.gz to bootstrap Plan9 Go amd64 2. Plan9 Go amd64 to bootstrap other arches (386, arm) I just tried it again, and that doesn't seem to be an issue for me anymore, but I thought I'd mention it. With the bootstrap unpacked into /sys/lib/go/amd64, my command and output (building 1.15.6 for 386 on amd64) look like this: GOOS=plan9 GOARCH=386 GOHOSTARCH=amd64 GOROOT_FINAL=/sys/lib/go/386 GOROOT_BOOTSTRAP=/sys/lib/go/amd64 ./make.rc Building Go cmd/dist using /sys/lib/go/amd64 Building Go toolchain1 using /sys/lib/go/amd64. 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 host, plan9/amd64. Building packages and commands for target, plan9/386. --- Installed Go for plan9/386 in /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6 Installed commands in /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6/bin The binaries expect /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6 to be copied or moved to /sys/lib/go/386
For me bootstrapping also worked with the 9legacy Go1.14.1 when doing this on the amd64 iso of 9front - although I had problems in the beginning, maybe because of the env vars. So in the end I've been putting the bootstrapped Go into /usr/glenda/go-plan9-amd64-bootstrap, set the /usr/glenda/env/GOROOT_BOOTSTRAP (bind -a /usr/glenda/env /env) permanently to /usr/glenda/go-plan9-amd64-bootstrap with GOROOT - and I believe also GOPROXY - being unset. Also I've then set: bind -a $home/go-plan9-amd64-bootstrap/bin /bin Afterwards: cd $home/go1.15.6/src and all.rc. Still need to try the patch though. By the way, there are also scripts for that, like here: http://shithub.us/git/fulton/rc-scripts/HEAD/install/install-go.rc/f.html Greetings, Philip ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ Am Mittwoch, 6. Januar 2021 21:45 schrieb <kylejnusbaum@gmail.com>: > I am using my own amd64 bootstrap tarball for Go built from 1.15.3. > (http://9project.net/go-plan9-amd64-bootstrap.tar.gz) > > Using this, I am able to bootstrap Go on 9front. > > As a side note, I used to have trouble using the bootstrap package to > cross-compile (i.e. using my amd64 bootstrap tarball on amd64 to > compile plan9 386) so I instead built for plan9 amd64 first, and then > use that as a bootstrap for any other arches I want, like this: > > 1. go-plan9-amd64-bootstrap.tar.gz to bootstrap Plan9 Go amd64 > 2. Plan9 Go amd64 to bootstrap other arches (386, arm) > > I just tried it again, and that doesn't seem to be an issue for me > anymore, but I thought I'd mention it. > > With the bootstrap unpacked into /sys/lib/go/amd64, my command > and output (building 1.15.6 for 386 on amd64) look like this: > > GOOS=plan9 GOARCH=386 GOHOSTARCH=amd64 GOROOT_FINAL=/sys/lib/go/386 GOROOT_BOOTSTRAP=/sys/lib/go/amd64 ./make.rc > Building Go cmd/dist using /sys/lib/go/amd64 > Building Go toolchain1 using /sys/lib/go/amd64. > 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 host, plan9/amd64. > Building packages and commands for target, plan9/386. > > > Installed Go for plan9/386 in /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6 > Installed commands in /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6/bin > > The binaries expect /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6 to be copied or moved to /sys/lib/go/386
[-- Attachment #1: Type: text/plain, Size: 684 bytes --] I tried both of 9legacy's bootstrap and that for 9front, and got success for both without any patches. Your method looks difficult to me.☺ 1) follow the method by kylejnusbaum@gmail.com 2) put 1.14.1 bootstrap files to /sys/lib/go/go-plan9-amd64-bootstrap, and go-plan9-1.15.6 to /sys/lib/go/amd64-1.15.6 (which is written by sl's FAQ) set GOROOT_BOOTSTRAP=/sys/lib/go/go-plan9-amd64-bootstrap, GOROOT=/sys/lib/go/amd64-1.15.6, GOPAS=$home/Go then, cd to /sys/lib/go/amd64-1.15.6, and ./make.rc By the way, I'm looking your opossum source now, which looks like very compact, because many are hidden under the $home/Go/git.hub etc... Go is beautiful to me. Kenji [-- Attachment #2: Type: message/rfc822, Size: 4810 bytes --] From: Philip Silva <philip.silva@protonmail.com> To: "9front@9front.org" <9front@9front.org> Subject: Re: [9front] Patch to update Go to 1.14.6 (and ca-certificates while here) Date: Sat, 09 Jan 2021 19:02:42 +0000 Message-ID: <Y2XSomn3IALPKgibQUGVKGaXha-_TVjSCG1TyaDccrI2QhN-q4QE7J32iZKSTUuzfRJr99TBMyzLFDgAb8nOrEosz8a0LccYsIA_uH2FQSE=@protonmail.com> For me bootstrapping also worked with the 9legacy Go1.14.1 when doing this on the amd64 iso of 9front - although I had problems in the beginning, maybe because of the env vars. So in the end I've been putting the bootstrapped Go into /usr/glenda/go-plan9-amd64-bootstrap, set the /usr/glenda/env/GOROOT_BOOTSTRAP (bind -a /usr/glenda/env /env) permanently to /usr/glenda/go-plan9-amd64-bootstrap with GOROOT - and I believe also GOPROXY - being unset. Also I've then set: bind -a $home/go-plan9-amd64-bootstrap/bin /bin Afterwards: cd $home/go1.15.6/src and all.rc. Still need to try the patch though. By the way, there are also scripts for that, like here: http://shithub.us/git/fulton/rc-scripts/HEAD/install/install-go.rc/f.html Greetings, Philip ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ Am Mittwoch, 6. Januar 2021 21:45 schrieb <kylejnusbaum@gmail.com>: > I am using my own amd64 bootstrap tarball for Go built from 1.15.3. > (http://9project.net/go-plan9-amd64-bootstrap.tar.gz) > > Using this, I am able to bootstrap Go on 9front. > > As a side note, I used to have trouble using the bootstrap package to > cross-compile (i.e. using my amd64 bootstrap tarball on amd64 to > compile plan9 386) so I instead built for plan9 amd64 first, and then > use that as a bootstrap for any other arches I want, like this: > > 1. go-plan9-amd64-bootstrap.tar.gz to bootstrap Plan9 Go amd64 > 2. Plan9 Go amd64 to bootstrap other arches (386, arm) > > I just tried it again, and that doesn't seem to be an issue for me > anymore, but I thought I'd mention it. > > With the bootstrap unpacked into /sys/lib/go/amd64, my command > and output (building 1.15.6 for 386 on amd64) look like this: > > GOOS=plan9 GOARCH=386 GOHOSTARCH=amd64 GOROOT_FINAL=/sys/lib/go/386 GOROOT_BOOTSTRAP=/sys/lib/go/amd64 ./make.rc > Building Go cmd/dist using /sys/lib/go/amd64 > Building Go toolchain1 using /sys/lib/go/amd64. > 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 host, plan9/amd64. > Building packages and commands for target, plan9/386. > > > Installed Go for plan9/386 in /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6 > Installed commands in /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6/bin > > The binaries expect /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6 to be copied or moved to /sys/lib/go/386
Nice! Yes the dependency management is quite a breeze! I definitely need to try that method together with some patching and updating. I like putting stuff in the home folder though but I guess that might just result in more work :) ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ Am Sonntag, 10. Januar 2021 00:24 schrieb <kokamoto@hera.eonet.ne.jp>: > I tried both of 9legacy's bootstrap and that for 9front, and got > success for both without any patches. > > Your method looks difficult to me.☺ > > 1. follow the method by kylejnusbaum@gmail.com > 2. put 1.14.1 bootstrap files to /sys/lib/go/go-plan9-amd64-bootstrap, > and go-plan9-1.15.6 to /sys/lib/go/amd64-1.15.6 (which is written by sl's FAQ) > set GOROOT_BOOTSTRAP=/sys/lib/go/go-plan9-amd64-bootstrap, > GOROOT=/sys/lib/go/amd64-1.15.6, > GOPAS=$home/Go > then, cd to /sys/lib/go/amd64-1.15.6, and ./make.rc > > By the way, I'm looking your opossum source now, which looks like > very compact, because many are hidden under the $home/Go/git.hub etc... > Go is beautiful to me. > > Kenji > For me bootstrapping also worked with the 9legacy Go1.14.1 when doing this on the amd64 iso of 9front - although I had problems in the beginning, maybe because of the env vars. So in the end I've been putting the bootstrapped Go into /usr/glenda/go-plan9-amd64-bootstrap, set the /usr/glenda/env/GOROOT_BOOTSTRAP (bind -a /usr/glenda/env /env) permanently to /usr/glenda/go-plan9-amd64-bootstrap with GOROOT - and I believe also GOPROXY - being unset. Also I've then set: bind -a $home/go-plan9-amd64-bootstrap/bin /bin > > Afterwards: cd $home/go1.15.6/src and all.rc. Still need to try the patch though. > > By the way, there are also scripts for that, like here: http://shithub.us/git/fulton/rc-scripts/HEAD/install/install-go.rc/f.html > > Greetings, Philip > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > Am Mittwoch, 6. Januar 2021 21:45 schrieb kylejnusbaum@gmail.com: > > > > I am using my own amd64 bootstrap tarball for Go built from 1.15.3. > > (http://9project.net/go-plan9-amd64-bootstrap.tar.gz) > > Using this, I am able to bootstrap Go on 9front. > > As a side note, I used to have trouble using the bootstrap package to > > cross-compile (i.e. using my amd64 bootstrap tarball on amd64 to > > compile plan9 386) so I instead built for plan9 amd64 first, and then > > use that as a bootstrap for any other arches I want, like this: > > > > 1. go-plan9-amd64-bootstrap.tar.gz to bootstrap Plan9 Go amd64 > > > > 2. Plan9 Go amd64 to bootstrap other arches (386, arm) > > I just tried it again, and that doesn't seem to be an issue for me > > anymore, but I thought I'd mention it. > > With the bootstrap unpacked into /sys/lib/go/amd64, my command > > and output (building 1.15.6 for 386 on amd64) look like this: > > GOOS=plan9 GOARCH=386 GOHOSTARCH=amd64 GOROOT_FINAL=/sys/lib/go/386 GOROOT_BOOTSTRAP=/sys/lib/go/amd64 ./make.rc > > Building Go cmd/dist using /sys/lib/go/amd64 > > Building Go toolchain1 using /sys/lib/go/amd64. > > 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 host, plan9/amd64. > > Building packages and commands for target, plan9/386. > > > > > > Installed Go for plan9/386 in /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6 > > Installed commands in /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6/bin > > The binaries expect /9bps/buildroot/go-1.15.6_1/build/go-go1.15.6 to be copied or moved to /sys/lib/go/386 </kokamoto@hera.eonet.ne.jp>