Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cachix-daemon-.../post-build-hook.sh': No such file or directory #169

Open
srid opened this issue Jan 27, 2024 · 6 comments
Open

cachix-daemon-.../post-build-hook.sh': No such file or directory #169

srid opened this issue Jan 27, 2024 · 6 comments

Comments

@srid
Copy link

srid commented Jan 27, 2024

Cachix is unable to push from inside nixos-container for whatever reason:

running post-build-hook '/run/github-runner/emanote/_temp/cachix-daemon-vy7DOb/post-build-hook.sh'...
treefmt-check (post)> error: executing '/run/github-runner/emanote/_temp/cachix-daemon-vy7DOb/post-build-hook.sh': No such file or directory

https://github.com/srid/emanote/actions/runs/7678233028/job/20928039851

(This was on a self-hosted runner)

Is there anything else I do here?

@sandydoo
Copy link
Member

@srid, would you be able to test whether it works with useDaemon: false?

Your self-hosted runner is running inside a nixos-container, correct?

@domenkozar
Copy link
Member

Unless we can reproduce the issue we can't really help there, I'm closing this for now.

If you hit an issue, schedule a call at https://cal.com/domenkozar and we can go deeper.

@srid
Copy link
Author

srid commented Feb 14, 2024

@srid, would you be able to test whether it works with useDaemon: false?

What's this setting?

Your self-hosted runner is running inside a nixos-container, correct?

Yes

@sandydoo
Copy link
Member

What's this setting?

It disables the daemon+post-build-hook push method.

- uses: cachix/cachix-action@v14
  with:
    useDaemon: false

I've been chipping away at setting up a similar runner in a nixos-container. I think what's happening is that the post-build-hook is being executed outside of the container by the Nix daemon, but the post-build-hook script the action creates is inside the container. That's why you're seeing the "no such file" error. I'm not sure what to do about this.

@sandydoo
Copy link
Member

Basic repro:

  1. Create /etc/script.sh on the server (not in the container):
#!/bin/sh
echo "oh hi there"
chmod +x /etc/script.sh
  1. In a GitHub actions workflow:
run: |
  NIX_CONFIG="post-build-hook = /etc/script.sh" nix build --rebuild nixpkgs#hello

@domenkozar domenkozar reopened this Feb 16, 2024
@domenkozar
Copy link
Member

Sounds like another use case for build hook to run on the client side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants