From 71e221d8de22de4e7df5b824ef1386281de83544 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Fri, 24 May 2024 00:12:23 -0300 Subject: [PATCH 1/5] Test the installer on aarch64-darwin runner --- .github/workflows/ci.yml | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa27826e4..d735d0afa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,9 @@ jobs: build-x86_64-darwin: uses: ./.github/workflows/build-x86_64-darwin.yml + + build-aarch64-darwin: + uses: ./.github/workflows/build-aarch64-darwin.yml lints: name: Lints @@ -351,3 +354,86 @@ jobs: NIX_INSTALLER_LOGGER: pretty NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug RUST_BACKTRACE: full + + run-aarch64-darwin: + name: Run aarch64 Darwin + runs-on: macos-latest-xlarge + needs: [lints, build-aarch64-darwin] + permissions: + id-token: "write" + contents: "read" + steps: + - uses: actions/checkout@v3 + - name: Restore Github cache artifacts + uses: actions/cache/restore@v3 + with: + path: nix-installer + key: aarch64-darwin-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-darwin + chmod +x install-root/nix-installer-aarch64-darwin install-root/nix-installer.sh + - run: brew install fish coreutils + - 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 }} + extra-conf: | + trusted-users = root runner + - 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: 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 }} + extra-conf: trusted-users = root runner + - 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 From c24f470ab2782d0b60d3a9c430c338aed9810b54 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Fri, 24 May 2024 12:39:19 -0300 Subject: [PATCH 2/5] Merge in changes from main --- .github/workflows/ci.yml | 111 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d735d0afa..7ea75ef72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,9 @@ permissions: jobs: build-x86_64-linux: uses: ./.github/workflows/build-x86_64-linux.yml + + build-aarch64-linux: + uses: ./.github/workflows/build-aarch64-linux.yml build-x86_64-darwin: uses: ./.github/workflows/build-x86_64-darwin.yml @@ -437,3 +440,111 @@ jobs: NIX_INSTALLER_LOGGER: pretty NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug RUST_BACKTRACE: full + + run-aarch64-linux: + name: Run aarch64 Linux + runs-on: namespace-profile-default-arm64 + needs: [lints, build-aarch64-linux] + permissions: + id-token: "write" + contents: "read" + steps: + - uses: actions/checkout@v3 + - name: Restore Github cache 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 -y 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 bd9065b392d0cf31fe6d12609761c891a0dbd135 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Fri, 24 May 2024 12:40:35 -0300 Subject: [PATCH 3/5] Adjust ordering of blocks --- .github/workflows/ci.yml | 100 +++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ea75ef72..827ca4466 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,11 @@ jobs: build-x86_64-linux: uses: ./.github/workflows/build-x86_64-linux.yml - build-aarch64-linux: - uses: ./.github/workflows/build-aarch64-linux.yml - build-x86_64-darwin: uses: ./.github/workflows/build-x86_64-darwin.yml + + build-aarch64-linux: + uses: ./.github/workflows/build-aarch64-linux.yml build-aarch64-darwin: uses: ./.github/workflows/build-aarch64-darwin.yml @@ -358,10 +358,10 @@ jobs: NIX_INSTALLER_LOG_DIRECTIVES: nix_installer=debug RUST_BACKTRACE: full - run-aarch64-darwin: - name: Run aarch64 Darwin - runs-on: macos-latest-xlarge - needs: [lints, build-aarch64-darwin] + run-aarch64-linux: + name: Run aarch64 Linux + runs-on: namespace-profile-default-arm64 + needs: [lints, build-aarch64-linux] permissions: id-token: "write" contents: "read" @@ -371,14 +371,14 @@ jobs: uses: actions/cache/restore@v3 with: path: nix-installer - key: aarch64-darwin-artifacts-${{ github.sha }} + 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-darwin - chmod +x install-root/nix-installer-aarch64-darwin install-root/nix-installer.sh - - run: brew install fish coreutils + 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 - name: Initial install uses: DeterminateSystems/nix-installer-action@main with: @@ -388,8 +388,6 @@ jobs: log-directives: nix_installer=debug backtrace: full github-token: ${{ secrets.GITHUB_TOKEN }} - extra-conf: | - trusted-users = root runner - name: Initial uninstall (without a `nix run` first) run: sudo -E /nix/nix-installer uninstall env: @@ -397,6 +395,20 @@ jobs: 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: @@ -406,7 +418,6 @@ jobs: log-directives: nix_installer=debug backtrace: full github-token: ${{ secrets.GITHUB_TOKEN }} - extra-conf: trusted-users = root runner - name: echo $PATH run: echo $PATH - name: Test `nix` with `$GITHUB_PATH` @@ -440,11 +451,25 @@ jobs: 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 - run-aarch64-linux: - name: Run aarch64 Linux - runs-on: namespace-profile-default-arm64 - needs: [lints, build-aarch64-linux] + run-aarch64-darwin: + name: Run aarch64 Darwin + runs-on: macos-latest-xlarge + needs: [lints, build-aarch64-darwin] permissions: id-token: "write" contents: "read" @@ -454,14 +479,14 @@ jobs: uses: actions/cache/restore@v3 with: path: nix-installer - key: aarch64-linux-artifacts-${{ github.sha }} + key: aarch64-darwin-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 -y fish zsh + mv ./nix-installer install-root/nix-installer-aarch64-darwin + chmod +x install-root/nix-installer-aarch64-darwin install-root/nix-installer.sh + - run: brew install fish coreutils - name: Initial install uses: DeterminateSystems/nix-installer-action@main with: @@ -471,6 +496,8 @@ jobs: log-directives: nix_installer=debug backtrace: full github-token: ${{ secrets.GITHUB_TOKEN }} + extra-conf: | + trusted-users = root runner - name: Initial uninstall (without a `nix run` first) run: sudo -E /nix/nix-installer uninstall env: @@ -478,20 +505,6 @@ jobs: 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: @@ -501,6 +514,7 @@ jobs: log-directives: nix_installer=debug backtrace: full github-token: ${{ secrets.GITHUB_TOKEN }} + extra-conf: trusted-users = root runner - name: echo $PATH run: echo $PATH - name: Test `nix` with `$GITHUB_PATH` @@ -534,17 +548,3 @@ jobs: 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 e3a3aaa7fa6bd667cbdafb1dd2e3a9ee7f9cc28d Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 24 May 2024 15:38:07 -0700 Subject: [PATCH 4/5] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c63f7fc4..8ec26dec4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ permissions: jobs: build-x86_64-linux: uses: ./.github/workflows/build-x86_64-linux.yml - build-x86_64-darwin: uses: ./.github/workflows/build-x86_64-darwin.yml From 509beb8b5719d3842a5b804af509edd97cab0540 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 24 May 2024 15:38:50 -0700 Subject: [PATCH 5/5] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ec26dec4..989df6756 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ permissions: jobs: build-x86_64-linux: uses: ./.github/workflows/build-x86_64-linux.yml + build-x86_64-darwin: uses: ./.github/workflows/build-x86_64-darwin.yml