Skip to content

Commit d5e5e84

Browse files
committed
FreeBSD CI: cross-compile binaries
Sometimes, vagrant provisioning fails on build step. This may be mitigated by factoring the build step out of the vagrant box and cross-compiling FreeBSD binaries instead. This change - Adds steps to setup go, and compile binaries on the host machine - Adjusts vagrant provisioners accordingly Signed-off-by: Artem Khramov <[email protected]>
1 parent 8c7b417 commit d5e5e84

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

.github/workflows/test-os.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,25 @@ jobs:
9494
runs-on: macos-12
9595
env:
9696
VAGRANT_VAGRANTFILE: hack/Vagrantfile.freebsd13
97+
GOOS: freebsd
9798
steps:
9899
-
99100
name: Checkout
100101
uses: actions/checkout@v3
102+
-
103+
name: Set up Go
104+
uses: actions/setup-go@v3
105+
with:
106+
go-version: "${{ env.GO_VERSION }}"
107+
cache: true
108+
109+
- name: Build buildkitd binary
110+
run: |
111+
go build ./cmd/buildkitd
112+
113+
- name: Build buildctl binary
114+
run: |
115+
go build ./cmd/buildctl
101116
-
102117
name: Cache Vagrant boxes
103118
uses: actions/cache@v3

hack/Vagrantfile.freebsd13

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Vagrant.configure("2") do |config|
1313
#!/usr/bin/env bash
1414
set -eux -o pipefail
1515
kldload nullfs
16-
pkg install -y go git containerd runj
16+
pkg install -y git containerd runj
1717
mkdir -p /vagrant/coverage /vagrant/.tmp/logs
1818
SHELL
1919
end
@@ -23,8 +23,8 @@ Vagrant.configure("2") do |config|
2323
#!/usr/bin/env bash
2424
set -eux -o pipefail
2525
cd /vagrant
26-
go build -o /usr/bin/buildkitd ./cmd/buildkitd
27-
type /usr/bin/buildkitd
26+
install -m 755 buildkitd /usr/local/bin/buildkitd
27+
type /usr/local/bin/buildkitd
2828
buildkitd --version
2929
SHELL
3030
end
@@ -34,8 +34,8 @@ Vagrant.configure("2") do |config|
3434
#!/usr/bin/env bash
3535
set -eux -o pipefail
3636
cd /vagrant
37-
go build -o /usr/bin/buildctl ./cmd/buildctl
38-
type /usr/bin/buildctl
37+
install -m 755 buildctl /usr/local/bin/buildctl
38+
type /usr/local/bin/buildctl
3939
SHELL
4040
end
4141

@@ -53,7 +53,7 @@ Vagrant.configure("2") do |config|
5353
#!/usr/bin/env bash
5454
set -eux -o pipefail
5555
mkdir -p /run/buildkit
56-
daemon -o /vagrant/.tmp/logs/buildkitd /usr/bin/buildkitd --addr=unix:///run/buildkit/buildkitd.sock
56+
daemon -o /vagrant/.tmp/logs/buildkitd /usr/local/bin/buildkitd --addr=unix:///run/buildkit/buildkitd.sock
5757
sleep 3
5858
SHELL
5959
end

0 commit comments

Comments
 (0)