fix: enable building for openbsd, dragonfly, and solaris/illumos #1135

Merged
mfenniak merged 2 commits from :main into main 2025-11-11 01:32:49 +00:00
Contributor

What it says on the tin. No idea if it actually runs; I'll find out in the near future when I source CI machines running these OSs.

  • bug fixes
    • PR: fix: enable building for openbsd, dragonfly, and solaris/illumos
What it says on the tin. No idea if it actually runs; I'll find out in the near future when I source CI machines running these OSs. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1135): <!--number 1135 --><!--line 0 --><!--description Zml4OiBlbmFibGUgYnVpbGRpbmcgZm9yIG9wZW5ic2QsIGRyYWdvbmZseSwgYW5kIHNvbGFyaXMvaWxsdW1vcw==-->fix: enable building for openbsd, dragonfly, and solaris/illumos<!--description--> <!--end release-notes-assistant-->
Author
Contributor

Note that, for solaris/illumos, this also requires: https://github.com/moby/go-archive/pull/17

I'm not sure what to do about that; that package looks abandoned.

Note that, for solaris/illumos, this also requires: https://github.com/moby/go-archive/pull/17 I'm not sure what to do about that; that package looks abandoned.
Owner

When you're confident that this builds, I don't mind merging it. 👍

But I'm sure you'll understand that without any CI support in this repo, regressions of this will occur in the future and it won't be known. Support will be at a "I hope it works and I'm happy to review and merge PRs to fix things" level.

When you're confident that this builds, I don't mind merging it. 👍 But I'm sure you'll understand that without any CI support in this repo, regressions of this will occur in the future and it won't be known. Support will be at a "I hope it works and I'm happy to review and merge PRs to fix things" level.
Author
Contributor

When you're confident that this builds, I don't mind merging it. 👍

I know it builds for openbsd and dragonfly. I just don't know what to do about solaris/illumos since that go-archive dependency appears unmaintained. I could use some advice on how to move forward on that front.

But I'm sure you'll understand that without any CI support in this repo, regressions of this will occur in the future and it won't be known. Support will be at a "I hope it works and I'm happy to review and merge PRs to fix things" level.

That's fine.

I'll note that it's straightforward to cross-compile the runner for a bunch of different targets by just setting GOARCH and GOOS when invoking go build - that's what I did downstream. So even if you don't run the test suite, you could verify that it at least builds. But it's also fine if you'd rather not do it that way; we'll discover and fix any build issues when we upgrade our runners anyway.

> When you're confident that this builds, I don't mind merging it. :+1: I know it builds for openbsd and dragonfly. I just don't know what to do about solaris/illumos since that go-archive dependency appears unmaintained. I could use some advice on how to move forward on that front. > But I'm sure you'll understand that without any CI support in this repo, regressions of this will occur in the future and it won't be known. Support will be at a "I hope it works and I'm happy to review and merge PRs to fix things" level. That's fine. I'll note that it's straightforward to cross-compile the runner for a bunch of different targets by just setting `GOARCH` and `GOOS` when invoking `go build` - that's what I did [downstream](https://codeberg.org/ziglang/runner/releases/tag/v11.3.1). So even if you don't run the test suite, you *could* verify that it at least builds. But it's also fine if you'd rather not do it that way; we'll discover and fix any build issues when we upgrade our runners anyway.
Owner

Ah, I see, sorry I missed that comment about go-archive. My first thought is to replace it with https://github.com/mholt/archives, which is used by Forgejo and seems to be well maintained. I don't know off hand if it has any issues compiling for these platforms though. Since go-archive isn't used anywhere other than docker_build.go, it probably isn't a difficult replacement.

I'd guess that your usage of these additional platforms will be using the host executor? Another approach might be to invert the logic in these build checks and don't include Docker support for these platforms... then go-archive won't be referenced since it's only touched in docker_build.go.

Regarding cross-compiling, that's an interesting idea. If there are any non-Free tools required for building Illumos it might be a no-go for that platform, but I assume that wouldn't be the case for the others.

Ah, I see, sorry I missed that comment about go-archive. My first thought is to replace it with https://github.com/mholt/archives, which is used by Forgejo and seems to be well maintained. I don't know off hand if it has any issues compiling for these platforms though. Since go-archive isn't used anywhere other than `docker_build.go`, it probably isn't a difficult replacement. I'd guess that your usage of these additional platforms will be using the host executor? Another approach might be to invert the logic in these build checks and don't include Docker support for these platforms... then `go-archive` won't be referenced since it's only touched in `docker_build.go`. Regarding cross-compiling, that's an interesting idea. If there are any non-Free tools required for building Illumos it might be a no-go for that platform, but I assume that wouldn't be the case for the others.
Author
Contributor

Ah, I see, sorry I missed that comment about go-archive. My first thought is to replace it with https://github.com/mholt/archives, which is used by Forgejo and seems to be well maintained. I don't know off hand if it has any issues compiling for these platforms though. Since go-archive isn't used anywhere other than docker_build.go, it probably isn't a difficult replacement.

Well... maybe not, but I've never actually written a line of Go in my life. 😅

I'd guess that your usage of these additional platforms will be using the host executor?

Right.

Another approach might be to invert the logic in these build checks and don't include Docker support for these platforms... then go-archive won't be referenced since it's only touched in docker_build.go.

Now that I look a bit closer, it seems like Docker for Solaris isn't even a thing... or for NetBSD for that matter. DragonFly is a bit unclear, but I would guess no.

So this seems like a reasonable thing to do in any case.

Regarding cross-compiling, that's an interesting idea. If there are any non-Free tools required for building Illumos it might be a no-go for that platform, but I assume that wouldn't be the case for the others.

illumos is fully open source to my knowledge; it was forked from OpenSolaris before Oracle took over Solaris and effectively sentenced it to death by making the source code unavailable and subsequently laying off most of the development team.

> Ah, I see, sorry I missed that comment about go-archive. My first thought is to replace it with https://github.com/mholt/archives, which is used by Forgejo and seems to be well maintained. I don't know off hand if it has any issues compiling for these platforms though. Since go-archive isn't used anywhere other than `docker_build.go`, it probably isn't a difficult replacement. Well... maybe not, but I've never actually written a line of Go in my life. 😅 > I'd guess that your usage of these additional platforms will be using the host executor? Right. > Another approach might be to invert the logic in these build checks and don't include Docker support for these platforms... then `go-archive` won't be referenced since it's only touched in `docker_build.go`. Now that I look a bit closer, it seems like Docker for Solaris isn't even a thing... or for NetBSD for that matter. DragonFly is a bit unclear, but I would guess no. So this seems like a reasonable thing to do in any case. > Regarding cross-compiling, that's an interesting idea. If there are any non-Free tools required for building Illumos it might be a no-go for that platform, but I assume that wouldn't be the case for the others. illumos is fully open source to my knowledge; it was forked from OpenSolaris before Oracle took over Solaris and effectively sentenced it to death by making the source code unavailable and subsequently laying off most of the development team.
alexrp force-pushed main from 5b4b2d01ab
All checks were successful
issue-labels / release-notes (pull_request_target) Successful in 6s
checks / validate pre-commit-hooks file (pull_request) Successful in 30s
checks / validate mocks (pull_request) Successful in 38s
checks / build and test (pull_request) Successful in 49s
checks / runner exec tests (pull_request) Successful in 30s
checks / runner integration tests (pull_request) Successful in 5m1s
checks / integration tests (pull_request) Successful in 11m18s
to 9c1cf35e07
All checks were successful
checks / validate pre-commit-hooks file (pull_request) Successful in 38s
checks / validate mocks (pull_request) Successful in 47s
checks / build and test (pull_request) Successful in 58s
checks / runner exec tests (pull_request) Successful in 30s
checks / runner integration tests (pull_request) Successful in 6m11s
checks / integration tests (pull_request) Successful in 14m13s
cascade / forgejo (pull_request_target) Has been skipped
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 9s
2025-11-10 20:42:53 +00:00
Compare
Author
Contributor

Should be ready for review. The runner now builds for every 'desktop' OS that Go supports except aix, hurd, plan9, and zos. Of those, only aix and plan9 have cross-compilation support. I don't personally care about aix or zos.

❯ GOARCH=ppc64 GOOS=aix go build -v -tags 'netgo osusergo'
github.com/go-git/go-billy/v5/osfs
# github.com/go-git/go-billy/v5/osfs
../../go/pkg/mod/github.com/go-git/go-billy/v5@v5.6.2/osfs/os_posix.go:17:14: undefined: unix.Flock
../../go/pkg/mod/github.com/go-git/go-billy/v5@v5.6.2/osfs/os_posix.go:24:14: undefined: unix.Flock
❯ GOARCH=amd64 GOOS=plan9 go build -v -tags 'netgo osusergo'
github.com/cyphar/filepath-securejoin
go.etcd.io/bbolt
# github.com/cyphar/filepath-securejoin
../../go/pkg/mod/github.com/cyphar/filepath-securejoin@v0.6.0/join.go:145:114: undefined: syscall.ELOOP
github.com/docker/go-connections/sockets
# github.com/docker/go-connections/sockets
../../go/pkg/mod/github.com/docker/go-connections@v0.6.0/sockets/sockets.go:16:38: undefined: syscall.RawSockaddrUnix
../../go/pkg/mod/github.com/docker/go-connections@v0.6.0/sockets/unix_socket.go:67:20: undefined: syscall.Unlink
../../go/pkg/mod/github.com/docker/go-connections@v0.6.0/sockets/unix_socket_unix.go:50:23: undefined: syscall.Umask
../../go/pkg/mod/github.com/docker/go-connections@v0.6.0/sockets/unix_socket_unix.go:52:10: undefined: syscall.Umask
# go.etcd.io/bbolt
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:248:11: undefined: flock
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:492:11: undefined: mmap
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:546:12: undefined: munmap
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:659:12: undefined: fdatasync
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:706:14: undefined: funlock
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:1093:9: undefined: fdatasync
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/mlock_unix.go:14:17: undefined: unix.Mlock
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/mlock_unix.go:32:17: undefined: unix.Munlock
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/tx.go:566:13: undefined: fdatasync
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/tx.go:613:13: undefined: fdatasync
../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/tx.go:613:13: too many errors
❯ GOARCH=amd64 GOOS=hurd go build -v -tags 'netgo osusergo'
go: unsupported GOOS/GOARCH pair hurd/amd64
❯ GOARCH=s390x GOOS=zos go build -v -tags 'netgo osusergo'
go: unsupported GOOS/GOARCH pair zos/s390x
Should be ready for review. The runner now builds for every 'desktop' OS that Go supports except aix, hurd, plan9, and zos. Of those, only aix and plan9 have cross-compilation support. I don't personally care about aix or zos. ``` ❯ GOARCH=ppc64 GOOS=aix go build -v -tags 'netgo osusergo' github.com/go-git/go-billy/v5/osfs # github.com/go-git/go-billy/v5/osfs ../../go/pkg/mod/github.com/go-git/go-billy/v5@v5.6.2/osfs/os_posix.go:17:14: undefined: unix.Flock ../../go/pkg/mod/github.com/go-git/go-billy/v5@v5.6.2/osfs/os_posix.go:24:14: undefined: unix.Flock ❯ GOARCH=amd64 GOOS=plan9 go build -v -tags 'netgo osusergo' github.com/cyphar/filepath-securejoin go.etcd.io/bbolt # github.com/cyphar/filepath-securejoin ../../go/pkg/mod/github.com/cyphar/filepath-securejoin@v0.6.0/join.go:145:114: undefined: syscall.ELOOP github.com/docker/go-connections/sockets # github.com/docker/go-connections/sockets ../../go/pkg/mod/github.com/docker/go-connections@v0.6.0/sockets/sockets.go:16:38: undefined: syscall.RawSockaddrUnix ../../go/pkg/mod/github.com/docker/go-connections@v0.6.0/sockets/unix_socket.go:67:20: undefined: syscall.Unlink ../../go/pkg/mod/github.com/docker/go-connections@v0.6.0/sockets/unix_socket_unix.go:50:23: undefined: syscall.Umask ../../go/pkg/mod/github.com/docker/go-connections@v0.6.0/sockets/unix_socket_unix.go:52:10: undefined: syscall.Umask # go.etcd.io/bbolt ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:248:11: undefined: flock ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:492:11: undefined: mmap ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:546:12: undefined: munmap ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:659:12: undefined: fdatasync ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:706:14: undefined: funlock ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/db.go:1093:9: undefined: fdatasync ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/mlock_unix.go:14:17: undefined: unix.Mlock ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/mlock_unix.go:32:17: undefined: unix.Munlock ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/tx.go:566:13: undefined: fdatasync ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/tx.go:613:13: undefined: fdatasync ../../go/pkg/mod/go.etcd.io/bbolt@v1.4.3/tx.go:613:13: too many errors ❯ GOARCH=amd64 GOOS=hurd go build -v -tags 'netgo osusergo' go: unsupported GOOS/GOARCH pair hurd/amd64 ❯ GOARCH=s390x GOOS=zos go build -v -tags 'netgo osusergo' go: unsupported GOOS/GOARCH pair zos/s390x ```
mfenniak approved these changes 2025-11-11 01:32:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner!1135
No description provided.