From 7909924e6296937b67680674ed6a7aa5642a0b5c Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Thu, 23 May 2024 19:45:16 -0300 Subject: [PATCH 1/6] Test the installer on aarch64-linux runners --- .github/workflows/ci.yml | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa27826e4..9e260a510 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,9 @@ jobs: build-x86_64-darwin: uses: ./.github/workflows/build-x86_64-darwin.yml + build-aarch64-linux: + uses: ./.github/workflows/build-aarch64-darwin.yml + lints: name: Lints runs-on: ubuntu-latest @@ -351,3 +354,116 @@ jobs: NIX_INSTALLER_LOGGER: pretty NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug RUST_BACKTRACE: full + + run-aarch64-linux: + name: Run aarch64 Linux + runs-on: ${{ matrix.system }} + strategy: + matrix: + system: + - namespace-profile-default-arm64 + - nscloud-ubuntu-22.04-amd64-4x16 + needs: [lints, build-aarch64-linux] + permissions: + id-token: "write" + contents: "read" + steps: + - uses: actions/checkout@v3 + - name: Restore Github cache of Buildkite artifacts + uses: actions/cache/restore@v3 + with: + path: nix-installer + key: aarch64-linux-artifacts-${{ github.sha }} + - name: Move & set executable + run: | + mkdir install-root + cp nix-installer.sh install-root/nix-installer.sh + mv ./nix-installer install-root/nix-installer-aarch64-linux + chmod +x install-root/nix-installer-aarch64-linux install-root/nix-installer.sh + - run: sudo apt install fish zsh + - name: Initial install + uses: DeterminateSystems/nix-installer-action@main + with: + flakehub: true + local-root: install-root/ + logger: pretty + log-directives: nix_installer=debug + backtrace: full + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Initial uninstall (without a `nix run` first) + run: sudo -E /nix/nix-installer uninstall + env: + NIX_INSTALLER_NO_CONFIRM: true + NIX_INSTALLER_LOGGER: pretty + NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug + RUST_BACKTRACE: full + - name: Ensure `nix` is removed + run: | + if systemctl is-active nix-daemon.socket; then + echo "nix-daemon.socket was still running" + exit 1 + fi + if systemctl is-active nix-daemon.service; then + echo "nix-daemon.service was still running" + exit 1 + fi + if [ -e /nix ]; then + echo "/nix exists" + exit 1 + fi + - name: Repeated install + uses: DeterminateSystems/nix-installer-action@main + with: + flakehub: true + local-root: install-root/ + logger: pretty + log-directives: nix_installer=debug + backtrace: full + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: echo $PATH + run: echo $PATH + - name: Test `nix` with `$GITHUB_PATH` + if: success() || failure() + run: | + nix run nixpkgs#hello + nix profile install nixpkgs#hello + hello + nix store gc + nix run nixpkgs#hello + - name: Test bash + run: nix-instantiate -E 'builtins.currentTime' --eval + if: success() || failure() + shell: bash --login {0} + - name: Test sh + run: nix-instantiate -E 'builtins.currentTime' --eval + if: success() || failure() + shell: sh -l {0} + - name: Test zsh + run: nix-instantiate -E 'builtins.currentTime' --eval + if: success() || failure() + shell: zsh --login --interactive {0} + - name: Test fish + run: nix-instantiate -E 'builtins.currentTime' --eval + if: success() || failure() + shell: fish --login {0} + - name: Repeated uninstall + run: sudo -E /nix/nix-installer uninstall + env: + NIX_INSTALLER_NO_CONFIRM: true + NIX_INSTALLER_LOGGER: pretty + NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug + RUST_BACKTRACE: full + - name: Ensure `nix` is removed + run: | + if systemctl is-active nix-daemon.socket; then + echo "nix-daemon.socket was still running" + exit 1 + fi + if systemctl is-active nix-daemon.service; then + echo "nix-daemon.service was still running" + exit 1 + fi + if [ -e /nix ]; then + echo "/nix exists" + exit 1 + fi From fb8e5cbec1d246e8c17815d7508ac269f12945ca Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Thu, 23 May 2024 20:46:27 -0300 Subject: [PATCH 2/6] Remove buildkite reference in step names --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e260a510..38be2d80b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: contents: "read" steps: - uses: actions/checkout@v3 - - name: Restore Github cache of Buildkite artifacts + - name: Restore Github cache artifacts uses: actions/cache/restore@v3 with: path: nix-installer @@ -167,7 +167,7 @@ jobs: contents: "read" steps: - uses: actions/checkout@v3 - - name: Restore Github cache of Buildkite artifacts + - name: Restore Github cache artifacts uses: actions/cache/restore@v3 with: path: nix-installer @@ -281,7 +281,7 @@ jobs: contents: "read" steps: - uses: actions/checkout@v3 - - name: Restore Github cache of Buildkite artifacts + - name: Restore Github cache artifacts uses: actions/cache/restore@v3 with: path: nix-installer @@ -369,7 +369,7 @@ jobs: contents: "read" steps: - uses: actions/checkout@v3 - - name: Restore Github cache of Buildkite artifacts + - name: Restore Github cache artifacts uses: actions/cache/restore@v3 with: path: nix-installer From f322feb07bed06461846e76d7e573371e312259e Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Thu, 23 May 2024 23:40:17 -0300 Subject: [PATCH 3/6] Fix build job YAML file path --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38be2d80b..38a9abb1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: uses: ./.github/workflows/build-x86_64-darwin.yml build-aarch64-linux: - uses: ./.github/workflows/build-aarch64-darwin.yml + uses: ./.github/workflows/build-aarch64-linux.yml lints: name: Lints From 565db4bcf693e15e3b31dd8ad86839783f9c3474 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Thu, 23 May 2024 23:46:48 -0300 Subject: [PATCH 4/6] Use apt install -y --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38a9abb1c..943024218 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -380,7 +380,7 @@ jobs: cp nix-installer.sh install-root/nix-installer.sh mv ./nix-installer install-root/nix-installer-aarch64-linux chmod +x install-root/nix-installer-aarch64-linux install-root/nix-installer.sh - - run: sudo apt install fish zsh + - run: sudo apt install -y fish zsh - name: Initial install uses: DeterminateSystems/nix-installer-action@main with: From 71424af3e37349f771f91ce3a95f4f4424a9a153 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Thu, 23 May 2024 23:55:32 -0300 Subject: [PATCH 5/6] Run only on ARM system --- .github/workflows/ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 943024218..c557e0736 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -357,12 +357,7 @@ jobs: run-aarch64-linux: name: Run aarch64 Linux - runs-on: ${{ matrix.system }} - strategy: - matrix: - system: - - namespace-profile-default-arm64 - - nscloud-ubuntu-22.04-amd64-4x16 + runs-on: namespace-profile-default-arm64 needs: [lints, build-aarch64-linux] permissions: id-token: "write" @@ -380,7 +375,7 @@ jobs: cp nix-installer.sh install-root/nix-installer.sh mv ./nix-installer install-root/nix-installer-aarch64-linux chmod +x install-root/nix-installer-aarch64-linux install-root/nix-installer.sh - - run: sudo apt install -y fish zsh + - run: sudo apt install fish zsh - name: Initial install uses: DeterminateSystems/nix-installer-action@main with: From 4e678414daca5d824b41ba99c0a356a494e27251 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Thu, 23 May 2024 23:59:16 -0300 Subject: [PATCH 6/6] Use apt install -y on ARM machine --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c557e0736..5e968531e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -375,7 +375,7 @@ jobs: cp nix-installer.sh install-root/nix-installer.sh mv ./nix-installer install-root/nix-installer-aarch64-linux chmod +x install-root/nix-installer-aarch64-linux install-root/nix-installer.sh - - run: sudo apt install fish zsh + - run: sudo apt install -y fish zsh - name: Initial install uses: DeterminateSystems/nix-installer-action@main with: