DeterminateSystems / nix-installer-action

The Github Action for the Determinate Nix Installer
https://github.com/determinateSystems/nix-installer
GNU Lesser General Public License v2.1
158 stars 16 forks source link

source-url documentation is inconsistent on whether it is to the nix-installer binary or to a script that downloads it #107

Closed lf- closed 2 months ago

lf- commented 2 months ago

image

It seems that for whatever reason using https://install.lix.systems/lix as source-url on macOS returns permission denied like so: https://github.com/hazelweakly/nixos-configs/actions/runs/9877071030/job/27278362955

Further, @grahamc tweeted about using it with the binary package. So I think it actually is for the binary package. But then you have to inject the platform into that string, which is kind of ugly. https://x.com/grhmc/status/1787469491430989912

I am not sure why the permission denied error happened. The part that's especially confusing with that is that the lix-installer.sh does not include the string "nix-installer" anywhere which means that whatever broke here was actually in nix-installer-action as far as I can tell.

grahamc commented 2 months ago

Thanks for pointing out the inconsistency. It does need to be the executable, not the script. Our library for making github actions includes automatically caching the downloaded executable into the GitHub Actions Cache, which uses the name of the action as the final binary name: https://github.com/DeterminateSystems/nix-installer-action/blob/main/src/index.ts#L80

The permission denied error is a bit surprising... I'm taking a look...

grahamc commented 2 months ago

I sent a PR to fix the inconsistency (#108) -- thank you! I looked but ran out of time researching the permission denied error. I did verify that the cached artifact has an etag which matches the md5sum of the lix script:

##[debug]Checking the tool cache for https://install.lix.systems/lix at "37b484b605499fdebf3e1c88d2ec4336"

...

grahamchristensen@Grahams-MacBook-Pro ~ % md5 ~/Downloads/lix
MD5 (/Users/grahamchristensen/Downloads/lix) = 37b484b605499fdebf3e1c88d2ec4336

so that is good news. I would expect this to work correctly, and would be glad to know why it doesn't...

hazelweakly commented 2 months ago

Looks like things work when the source-url is set to a platform specific binary, interesting. Although I did have one spurious error that was a timeout issue (unrelated, just a network glitch. $WORK has been having this off and on as well in other places)

https://github.com/hazelweakly/nixos-configs/actions/runs/9879620636/job/27286337171

grahamc commented 2 months ago

Gotcha. Can you share a log where there was a timeout? We try pretty hard to have retries built in and enabled in all the relevant spots.

grahamc commented 2 months ago

I'm going to go ahead and close this. Feel free to re-open if you have more info!