Skip to content

Commit e2d52a8

Browse files
authored
Merge pull request #2901 from crazy-max/netbsd
build and test netbsd
2 parents 48a591b + af2d8fe commit e2d52a8

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ jobs:
258258
matrix:
259259
os:
260260
- freebsd
261+
- netbsd
261262
- openbsd
262263
steps:
263264
-

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ COPY --link --from=buildx-build /usr/bin/docker-buildx /buildx
105105
FROM binaries-unix AS binaries-darwin
106106
FROM binaries-unix AS binaries-freebsd
107107
FROM binaries-unix AS binaries-linux
108+
FROM binaries-unix AS binaries-netbsd
108109
FROM binaries-unix AS binaries-openbsd
109110

110111
FROM scratch AS binaries-windows

docker-bake.hcl

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ target "lint" {
4848
"linux/s390x",
4949
"linux/ppc64le",
5050
"linux/riscv64",
51+
"netbsd/amd64",
52+
"netbsd/arm64",
5153
"openbsd/amd64",
5254
"openbsd/arm64",
5355
"windows/amd64",
@@ -167,6 +169,8 @@ target "binaries-cross" {
167169
"linux/ppc64le",
168170
"linux/riscv64",
169171
"linux/s390x",
172+
"netbsd/amd64",
173+
"netbsd/arm64",
170174
"openbsd/amd64",
171175
"openbsd/arm64",
172176
"windows/amd64",

hack/Vagrantfile.netbsd

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
Vagrant.configure("2") do |config|
5+
config.vm.box = "generic/netbsd9"
6+
config.vm.boot_timeout = 900
7+
config.vm.synced_folder ".", "/vagrant", type: "rsync"
8+
config.ssh.keep_alive = true
9+
10+
config.vm.provision "init", type: "shell", run: "once" do |sh|
11+
sh.inline = <<~SHELL
12+
set -x
13+
mkdir -p /var/tmp
14+
chmod 1777 /var/tmp
15+
16+
pkgin -y install git mozilla-rootcerts
17+
mozilla-rootcerts install
18+
19+
ftp https://go.dev/dl/go#{ENV['GO_VERSION']}.netbsd-amd64.tar.gz
20+
tar -C /var/tmp -xzf go#{ENV['GO_VERSION']}.netbsd-amd64.tar.gz
21+
22+
cat << 'EOF' > /usr/bin/go-wrapper
23+
#!/bin/sh
24+
export TMPDIR="/var/tmp"
25+
exec /var/tmp/go/bin/go "$@"
26+
EOF
27+
chmod +x /usr/bin/go-wrapper
28+
29+
ln -s /usr/bin/go-wrapper /usr/bin/go
30+
SHELL
31+
end
32+
end

0 commit comments

Comments
 (0)