cachix / install-nix-action

Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.
Apache License 2.0
498 stars 78 forks source link

Installer broken by Nix 2.14 #161

Closed l0b0 closed 1 year ago

l0b0 commented 1 year ago

Two separate repos with the same code:

  test-nix-shell:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3.3.0
      - uses: cachix/install-nix-action@v19
      - uses: cachix/cachix-action@v12
        with:
          name: some-name
          authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

are suddenly reporting the same issue during cachix/cachix-action@v12:

Error: Action failed with error: Error: Unable to locate executable file: cachix. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

JRMurr commented 1 year ago

Ran into this as well for not finding nix-env on path. Looks like its caused but nix 2.14 which was released today https://github.com/NixOS/nix/milestone/22

I would assume this pr is the cause but not sure on what the needed fix is yet https://github.com/NixOS/nix/pull/5226

Work around i found was to pin to 2.13.3

- uses: cachix/install-nix-action@v19
      with:
        install_url: https://releases.nixos.org/nix/nix-2.13.3/install
domenkozar commented 1 year ago

I've released v20 that fixes this critical bug.

I've asked here to release candidate Nix releases to make sure things go smoother: https://discourse.nixos.org/t/nix-2-14-0-released/25900/4

domenkozar commented 1 year ago

Going to leave it open for a while to make sure people find the fix.

steveej commented 1 year ago

@domenkozar i think it would be useful to pin the nix version in this action and have a test job gating the update.

domenkozar commented 1 year ago

@domenkozar i think it would be useful to pin the nix version in this action and have a test job gating the update.

I'm going to work on automation to test the unstable Nix installer before it's released to prevent such failures in the future.