From b939a730a269e4b28289f5481f2e8cb1ef68a4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 16:12:37 +0200 Subject: [PATCH 01/15] GHA: need to run aarch64 Linux build in a container --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5cb9bc5..0521181 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -135,6 +135,7 @@ jobs: linux-build-aarch64: if: ${{ github.event.inputs.inplinuxaarch64 == '' || github.event.inputs.inplinuxaarch64 == 'yes' }} runs-on: [linux-arm64] + container: ubuntu:24.04 name: Linux build aaarch env: RUST_BACKTRACE: 1 From 37af76255f112302494cb004fbfc7ac5a0de845e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 16:17:25 +0200 Subject: [PATCH 02/15] GHA: need to install tools for aarch64 Linux build --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0521181..b5fa72f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -147,6 +147,10 @@ jobs: with: fetch-depth: 10 + - name: Install build tools + run: | + apt-get update && apt-get install -y docker.io make + - name: Build rig run: | make linux-in-docker From 8434b654d157e465d26d57b721366e1a87c00e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 16:21:14 +0200 Subject: [PATCH 03/15] GHA aarch64 build: need docker compose as well --- .github/workflows/test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b5fa72f..5169a9e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -149,7 +149,8 @@ jobs: - name: Install build tools run: | - apt-get update && apt-get install -y docker.io make + apt-get update && apt-get install -y \ + make docker.io docker-compose-v2 - name: Build rig run: | From 3b453ece0d51257d85307720a315ce7f18aaee6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 16:29:06 +0200 Subject: [PATCH 04/15] GHA: maybe I need to mount the workspace --- .github/workflows/test.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5169a9e..7f08577 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -135,7 +135,10 @@ jobs: linux-build-aarch64: if: ${{ github.event.inputs.inplinuxaarch64 == '' || github.event.inputs.inplinuxaarch64 == 'yes' }} runs-on: [linux-arm64] - container: ubuntu:24.04 + container: + image: "ubuntu:24.04" + volumes: + - ${{ github.workspace }}:/${{ github.workspace }} name: Linux build aaarch env: RUST_BACKTRACE: 1 @@ -154,6 +157,7 @@ jobs: - name: Build rig run: | + cd ${{ github.workspace }} make linux-in-docker - name: Upload build as artifact From 97d6b9f53e2930c9b2a65eca4d4222be911bd7e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 16:39:17 +0200 Subject: [PATCH 05/15] Trying to fix containerized Linux build I forgot how this worked.... :( [ci skip] --- tools/entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/entrypoint.sh b/tools/entrypoint.sh index 4d9a0cc..b3ffbca 100755 --- a/tools/entrypoint.sh +++ b/tools/entrypoint.sh @@ -24,7 +24,8 @@ fi rm -rf /home/$user mv /home/rigbuild /home/$user -chown $user:$group /home/rig -chown $user:$group /home/rig/.cargo +chown $user:$group /home/$user +chown $user:$group /home/$user/.cargo +export PATH=/home/$user/.cargo/bin:$PATH exec su -s /bin/sh $user sh -l -c "cd /work && $*" From 99e15116f48fb5a2d7cc6bf04e99580c2a343f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 16:55:30 +0200 Subject: [PATCH 06/15] GHA: simplify aarch64 build No need for another Docker layer, GHA already runs a container. --- .github/workflows/test.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7f08577..fb9e882 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -137,8 +137,6 @@ jobs: runs-on: [linux-arm64] container: image: "ubuntu:24.04" - volumes: - - ${{ github.workspace }}:/${{ github.workspace }} name: Linux build aaarch env: RUST_BACKTRACE: 1 @@ -152,13 +150,12 @@ jobs: - name: Install build tools run: | - apt-get update && apt-get install -y \ - make docker.io docker-compose-v2 + apt-get update && apt-get install -y make curl + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y - name: Build rig run: | - cd ${{ github.workspace }} - make linux-in-docker + make linux - name: Upload build as artifact uses: actions/upload-artifact@v4 From 7b3ec546266fd8bda1d6e18fdc7618dc64a5fb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 17:04:41 +0200 Subject: [PATCH 07/15] GHA aarch64: need more tools to build and package [ci skip] --- .github/workflows/test.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fb9e882..dbbbfda 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -150,11 +150,15 @@ jobs: - name: Install build tools run: | - apt-get update && apt-get install -y make curl + apt-get update && apt-get install -y make curl gcc curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y + curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.40.0/nfpm_2.40.0_arm64.deb && \ + dpkg -i nfpm*.deb && \ + rm nfpm*.deb - name: Build rig run: | + . "$HOME/.cargo/env" make linux - name: Upload build as artifact From d247dbc6096b9478ca07812fa11375b05476c794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 17:15:05 +0200 Subject: [PATCH 08/15] GHA aarch64: build on Alpine To get a self-contained binary. [ci skip] --- .github/workflows/test.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dbbbfda..d45924d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -136,7 +136,7 @@ jobs: if: ${{ github.event.inputs.inplinuxaarch64 == '' || github.event.inputs.inplinuxaarch64 == 'yes' }} runs-on: [linux-arm64] container: - image: "ubuntu:24.04" + image: "alpine:3.15" name: Linux build aaarch env: RUST_BACKTRACE: 1 @@ -150,11 +150,11 @@ jobs: - name: Install build tools run: | - apt-get update && apt-get install -y make curl gcc - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y - curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.40.0/nfpm_2.40.0_arm64.deb && \ - dpkg -i nfpm*.deb && \ - rm nfpm*.deb + apk add curl linux-headers bash gcc musl-dev g++ pkgconf make file + cd && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y + curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.32.0/nfpm_2.32.0_$(arch).apk + apk add --allow-untrusted nfpm*.apk + rm nfpm*.apk - name: Build rig run: | From a52c2b72d305a4d450aed5d86b9856298a7b32e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 17:35:29 +0200 Subject: [PATCH 09/15] GHA aarch64: try newer 3.18, preinstall node 20 Maybe node.js actions work with this.... [ci skip] --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d45924d..d7ca014 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -136,7 +136,7 @@ jobs: if: ${{ github.event.inputs.inplinuxaarch64 == '' || github.event.inputs.inplinuxaarch64 == 'yes' }} runs-on: [linux-arm64] container: - image: "alpine:3.15" + image: "alpine:3.18" name: Linux build aaarch env: RUST_BACKTRACE: 1 @@ -150,7 +150,7 @@ jobs: - name: Install build tools run: | - apk add curl linux-headers bash gcc musl-dev g++ pkgconf make file + apk add curl nodejs-current linux-headers bash gcc musl-dev g++ pkgconf make file cd && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.32.0/nfpm_2.32.0_$(arch).apk apk add --allow-untrusted nfpm*.apk From c09c1ef940ae658efb94fe29c41e45897042c870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 17:37:20 +0200 Subject: [PATCH 10/15] GHA aarch64: checkout after installing node.js [ci skip] --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d7ca014..f357918 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -143,11 +143,6 @@ jobs: steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 10 - - name: Install build tools run: | apk add curl nodejs-current linux-headers bash gcc musl-dev g++ pkgconf make file @@ -156,6 +151,11 @@ jobs: apk add --allow-untrusted nfpm*.apk rm nfpm*.apk + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 10 + - name: Build rig run: | . "$HOME/.cargo/env" From d88452b6a974bcaad18345756cab98ab7b6caf32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 17:40:53 +0200 Subject: [PATCH 11/15] GHA aarch64: this IS a container job! Why does GH think that it is not??? [ci skip] --- .github/workflows/test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f357918..c292343 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -135,8 +135,7 @@ jobs: linux-build-aarch64: if: ${{ github.event.inputs.inplinuxaarch64 == '' || github.event.inputs.inplinuxaarch64 == 'yes' }} runs-on: [linux-arm64] - container: - image: "alpine:3.18" + container: "alpine:3.18" name: Linux build aaarch env: RUST_BACKTRACE: 1 From 4610f1c950737c265298d0b5e45849c1d6c888ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 17:45:39 +0200 Subject: [PATCH 12/15] GHA aarch64: try to fool GH to support Alpine --- .github/workflows/test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c292343..8ecd8e7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -150,6 +150,11 @@ jobs: apk add --allow-untrusted nfpm*.apk rm nfpm*.apk + - name: Fool distro detection to run aarch64 Alpine + run: | + apk add gcompat + sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release + - name: Checkout uses: actions/checkout@v4 with: From fef89b8694634943923c8d2f39c496da863b14a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 21:27:43 +0200 Subject: [PATCH 13/15] GHA aarch64: try with the cynkra image --- .github/workflows/test.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8ecd8e7..c7f1f3e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -135,7 +135,7 @@ jobs: linux-build-aarch64: if: ${{ github.event.inputs.inplinuxaarch64 == '' || github.event.inputs.inplinuxaarch64 == 'yes' }} runs-on: [linux-arm64] - container: "alpine:3.18" + container: "cynkra/actions-runner:2-alpine-rootful" name: Linux build aaarch env: RUST_BACKTRACE: 1 @@ -150,11 +150,6 @@ jobs: apk add --allow-untrusted nfpm*.apk rm nfpm*.apk - - name: Fool distro detection to run aarch64 Alpine - run: | - apk add gcompat - sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release - - name: Checkout uses: actions/checkout@v4 with: From 505cbef5a8ed11bca8d15d94eccbf0bb87f3af53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 21:29:50 +0200 Subject: [PATCH 14/15] Need sudo with new image [ci skip] --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c7f1f3e..0bc031a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -144,10 +144,10 @@ jobs: - name: Install build tools run: | - apk add curl nodejs-current linux-headers bash gcc musl-dev g++ pkgconf make file + sudo apk add curl nodejs-current linux-headers bash gcc musl-dev g++ pkgconf make file cd && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.32.0/nfpm_2.32.0_$(arch).apk - apk add --allow-untrusted nfpm*.apk + sudo apk add --allow-untrusted nfpm*.apk rm nfpm*.apk - name: Checkout From ccd81394189b7093ce2c48d6bb65e5e41d563bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Mon, 23 Sep 2024 21:35:07 +0200 Subject: [PATCH 15/15] GHA debug permissions [ci skip] --- .github/workflows/test.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0bc031a..45a5fb8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -144,10 +144,14 @@ jobs: - name: Install build tools run: | - sudo apk add curl nodejs-current linux-headers bash gcc musl-dev g++ pkgconf make file - cd && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y - curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.32.0/nfpm_2.32.0_$(arch).apk - sudo apk add --allow-untrusted nfpm*.apk + id + pwd + ls -l + ls -ld + sudo apk add curl nodejs-current linux-headers bash gcc musl-dev g++ pkgconf make file && + cd && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y && + curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.32.0/nfpm_2.32.0_$(arch).apk && + sudo apk add --allow-untrusted nfpm*.apk && rm nfpm*.apk - name: Checkout