cachix/cachix-action

support for pushing while building?

colemickens opened this issue · 11 comments

Hi, I know that you added support for this in cachix, both via the new mode and the previously existing store watching mode.

How can I mostly easily make use of that here? I'm running out of space on the GHA free builders and if cachix were pushing in the background, it's likely that I would eventually succeed (since I'm using nix-build-uncached, it would be able to keep poking through the builds, in some cases at least)

(and I'm not sure, it seems like maybe cachix action will upload by default, even if steps fail, but in my case, the entire Workflow gets into a bad state because the runner failure looks like an internal failure...)

You should be able to do that by running cachix watch-store $CACHE_NAME after cachix-action.

Thinking of making this the default implementation 🤔

I agree this would be a nice default

This is now in beta, help us test:

- uses: cachix/cachix-action@d150e67a68baa578596bcdbdf830657b4a173df4
  with:
    useDaemon: true
terlar commented

I tried this commit, but seems the install step is not executing the correct command:

Run cachix/cachix-action@d150e67a68baa578596bcdbdf830657b4a173df4
  with:
    name: terlar
    authToken: ***
    extraPullNames: nix-community
    useDaemon: true
Cachix: installing
  /usr/bin/bash -c 
Cachix: checking version
  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.

@terlar, thanks for the feedback! Should be fixed in cachix/cachix-action@5fc8ed76f6a97fdf54319a5f6846f67b60c9ed5d

terlar commented

Thank you, that worked, however, when running that commit with useDaemon enabled it seems my cache was not used. I did not look into why, but it has been working before:
https://github.com/terlar/emacs-config/actions/runs/6432508165

I'll investigate it when I have time to see if the nix.conf was updated correctly or what the deal is...

@terlar, thanks for the logs! The post-build-hook was completely overriding the existing nix configuration. We now tell nix to load and merge any existing user nix.confs.

terlar commented

Tested this and now everything seems to be working as expected. Will do some more tests, especially having something that needs to cache many things, to see how it performs.