go icon indicating copy to clipboard operation
go copied to clipboard

all: add freebsd/riscv64 port

Open dmgk opened this issue 3 years ago • 13 comments

This issue is intended to serve both as a proposal and to track the progress of adding the freebsd/riscv64 port.

The majority of porting work is done, there's an out-of-tree port at https://github.com/MikaelUrankar/go/tree/freebsd_riscv64 which builds and passes all run.bash tests, including cgo (tested under QEMU and on Unmatched).

@mengzhuo has graciously agreed to setup and maintain the freebsd/riscv64 builder (on SiFive Unmatched) and @MikaelUrankar has agreed to be the port maintainer.

cc @golang/freebsd @golang/riscv64 @mengzhuo @MikaelUrankar

dmgk avatar Jun 20 '22 18:06 dmgk

CC @rsc

mengzhuo avatar Jun 22 '22 01:06 mengzhuo

This proposal has been added to the active column of the proposals project and will now be reviewed at the weekly proposal review meetings. — rsc for the proposal review group

rsc avatar Jun 22 '22 18:06 rsc

I tried to install the prometheus node_exporter and got undefined errors from golang.org/x/sys

I think we should update golang.org/x/sys and other x/ moduels first and leave alone the Go main develope cycle.

mengzhuo avatar Jun 27 '22 01:06 mengzhuo

I'm already updating golang.org/x/sys as part of https://github.com/golang/go/issues/53280. It is indeed horribly out of date. For example Time_t on freebsd/arm is still 32-bit. It was switched to 64-bit more than 16 years ago (I guess it originates directly from the syscall package). There ptrace constants which are defined only on the x86 arches, not available on both ARMs (because these were probably not generated on actual hosts). I shudder to think of what state the golang.org/x/net/route is in. std still carries a hand copied if_data8 and if_msghdr8 types.

paulzhol avatar Jun 27 '22 07:06 paulzhol

The new port policy (#53383) will require two maintainers for the port. Assuming that is accepted, is there anyone else who would be willing to be a second maintainer for freebsd/riscv64?

rsc avatar Jun 29 '22 17:06 rsc

Assuming nobody else volunteers, I'll be willing to be a second maintainer for the freebsd/riscv64 (can we have more than two?). I think more people will be interested when this port is closer to be merged.

dmgk avatar Jul 01 '22 12:07 dmgk

I want to be the third maintainer since the freebsd/riscv64 stage0 is up and ready.

mengzhuo avatar Jul 01 '22 14:07 mengzhuo

Change https://go.dev/cl/416834 mentions this issue: unix: add freebsd/riscv64 support

gopherbot avatar Jul 11 '22 07:07 gopherbot

Thanks to @MikaelUrankar, @dmgk, and @mengzhuo for volunteering to be maintainers.

rsc avatar Jul 13 '22 17:07 rsc

Based on the discussion above, this proposal seems like a likely accept. — rsc for the proposal review group

rsc avatar Jul 13 '22 18:07 rsc

No change in consensus, so accepted. 🎉 This issue now tracks the work of implementing the proposal. — rsc for the proposal review group

rsc avatar Jul 20 '22 18:07 rsc

Change https://go.dev/cl/418814 mentions this issue: all: add FreeBSD riscv64 support

gopherbot avatar Jul 21 '22 16:07 gopherbot

CC @golang/release.

dmitshur avatar Aug 08 '22 15:08 dmitshur

Change https://go.dev/cl/425937 mentions this issue: build/dashboard: add freebsd-riscv64

gopherbot avatar Aug 26 '22 19:08 gopherbot

Is it right for this issue to be closed now? go tool dist list at tip doesn't include freebsd/riscv64.

dmitshur avatar Aug 30 '22 18:08 dmitshur

@dmitshur No, the riscv64 port is still not merged, please reopen.

dmgk avatar Aug 30 '22 18:08 dmgk

Change https://go.dev/cl/431655 mentions this issue: syscall: add support for freebsd/riscv64

gopherbot avatar Sep 18 '22 16:09 gopherbot

Change https://go.dev/cl/431656 mentions this issue: runtime: add support for freebsd/riscv64

gopherbot avatar Sep 18 '22 16:09 gopherbot

Change https://go.dev/cl/431661 mentions this issue: cmd/link: skip tests on freebsd/riscv64 that requires internal cgo linking

gopherbot avatar Sep 18 '22 16:09 gopherbot

Change https://go.dev/cl/431658 mentions this issue: cmd/nm, runtime/cgo: add cgo support for freebsd/riscv64

gopherbot avatar Sep 18 '22 16:09 gopherbot

Change https://go.dev/cl/431657 mentions this issue: cmd/dist: enable cgo tests on freebsd/riscv64

gopherbot avatar Sep 18 '22 16:09 gopherbot

Change https://go.dev/cl/431660 mentions this issue: cmd/link/internal/riscv64: add support for freebsd/riscv64

gopherbot avatar Sep 18 '22 16:09 gopherbot

Change https://go.dev/cl/431659 mentions this issue: cmd/dist: add support for freebsd/riscv64

gopherbot avatar Sep 18 '22 16:09 gopherbot

@mengzhuo the freebsd/riscv64 builder entry exists on the build dashboard, however the builder does not appear to be online (farmer.golang.org says "host-freebsd-riscv64-unmatched: 0/0 (1 missing)" - are we able to resolve this?

4a6f656c avatar Sep 22 '22 09:09 4a6f656c

@mengzhuo the freebsd/riscv64 builder entry exists on the build dashboard, however the builder does not appear to be online (farmer.golang.org says "host-freebsd-riscv64-unmatched: 0/0 (1 missing)" - are we able to resolve this?

It's running (stage0, buildlet are modified by hand). However it can't download the buildlet from GCP repo for now. I will submit those CLs today.

mengzhuo avatar Sep 22 '22 09:09 mengzhuo

Change https://go.dev/cl/432656 mentions this issue: cmd/buildlet/stage0: add freebsd-riscv64-unmatched

gopherbot avatar Sep 22 '22 10:09 gopherbot

Change https://go.dev/cl/432658 mentions this issue: cmd/buildlet: add freebsd-riscv64

gopherbot avatar Sep 22 '22 11:09 gopherbot

It's running (stage0, buildlet are modified by hand). However it can't download the buildlet from GCP repo for now. I will submit those CLs today.

@mengzhuo per step 6 on https://github.com/golang/go/wiki/DashboardBuilders#how-to-set-up-a-builder (and the "WIP ports" comment at the bottom), you should be able to build and run the stage1 buildlet locally - I'm not sure that it can be built/made available for download until the port has already been upstreamed.

4a6f656c avatar Sep 22 '22 13:09 4a6f656c

Change https://go.dev/cl/432756 mentions this issue: cmd/link: return correct default linker for the platform

gopherbot avatar Sep 22 '22 15:09 gopherbot

@4a6f656c It looks like we have to wait the port complete.

2022/09/24 09:50:07 Not on GCE; not remounting root filesystem.
2022/09/24 09:50:10 Dialing coordinator farmer.golang.org:443 ...
2022/09/24 09:50:20 dialing proxy "uplink.golangcn.org:8123" ...
2022/09/24 09:50:20 Dialed coordinator farmer.golang.org:443.
2022/09/24 09:50:20 Doing TLS handshake with coordinator (verifying hostname "farmer.golang.org")...
2022/09/24 09:50:21 Registering reverse mode with coordinator...
2022/09/24 09:50:21 Connected to coordinator; reverse dialing active
2022/09/24 09:50:21 Dialing coordinator farmer.golang.org:443 ...
2022/09/24 09:50:31 Dialing coordinator farmer.golang.org:443 ...
2022/09/24 09:50:31 dialing proxy "uplink.golangcn.org:8123" ...
2022/09/24 09:50:31 dialing proxy "uplink.golangcn.org:8123" ...
2022/09/24 09:50:31 Dialed coordinator farmer.golang.org:443.
2022/09/24 09:50:31 Doing TLS handshake with coordinator (verifying hostname "farmer.golang.org")...
2022/09/24 09:50:31 Dialed coordinator farmer.golang.org:443.
2022/09/24 09:50:31 Doing TLS handshake with coordinator (verifying hostname "farmer.golang.org")...
2022/09/24 09:50:32 Removing .
2022/09/24 09:50:32 writetgz: untarring Request.Body into /tmp/workdir-host-freebsd-riscv64-unmatched/go
2022/09/24 09:50:32 extracted tarball into /tmp/workdir-host-freebsd-riscv64-unmatched/go: 1 files, 1 dirs (1.503999ms)
2022/09/24 09:50:32 Dialing coordinator farmer.golang.org:443 ...
2022/09/24 09:50:32 dialing proxy "uplink.golangcn.org:8123" ...
2022/09/24 09:50:33 Dialed coordinator farmer.golang.org:443.
2022/09/24 09:50:33 Doing TLS handshake with coordinator (verifying hostname "farmer.golang.org")...
2022/09/24 09:50:33 writetgz: failed to fetch tgz URL https://storage.googleapis.com/go-builder-data/gobootstrap-freebsd-riscv64-go1.17.13.tar.gz: status=403 Forbidden
2022/09/24 09:50:33 writetgz: untarring Request.Body into /tmp/workdir-host-freebsd-riscv64-unmatched/go
2022/09/24 09:50:54 extracted tarball into /tmp/workdir-host-freebsd-riscv64-unmatched/go: 11349 files, 1241 dirs (20.368625001s)
2022/09/24 09:50:54 Halting in 1 second.
2022/09/24 09:50:54 http.Serve on reverse connection complete: revdial: Listener closed
2022/09/24 09:50:54 buildlet reverse mode exiting.

mengzhuo avatar Sep 24 '22 06:09 mengzhuo