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

flakes support #47

Open
domenkozar opened this issue Jun 15, 2020 · 10 comments
Open

flakes support #47

domenkozar opened this issue Jun 15, 2020 · 10 comments

Comments

@domenkozar
Copy link
Member

domenkozar commented Jun 15, 2020

https://docs.cachix.org/pushing#flakes

@mpscholten
Copy link

Any updates on this one here since 2020? We're migrating IHP to devenv via nix flakes and there's a lot of reports from people using latest IHP master that their IHP is building from scratch instead of fetching from cachix (digitallyinduced/ihp#1740 digitallyinduced/ihp#1728)

If flakes are not supported with the cachix-action, this would explain the problem

@sandydoo
Copy link
Member

sandydoo commented Jul 14, 2023

@mpscholten, AFAIK this is a feature request for automatically building and caching the inputs/outputs of a flake.

The action should pick up any paths built during the run, whether it's through nix build or nix develop.
I've been digging through the IHP actions logs and the only suspicious thing I see is this build of nodejs that doesn't get uploaded to the cache. But it seems to be available in the next run, so perhaps some concurrent job got to it first?

@mpscholten
Copy link

Thanks for taking a look! :)

The action should pick up any paths built during the run, whether it's through nix build or nix develop.

Thanks for clarifying 👍 Re nodejs: unlikely to be a concurrent job, more likely that it's already stored in cachix (we don't have any custom nix code related to nodejs, so it should come right from within nixpkgs)

Then the cache misses of IHP need to be caused by something else. Could this be the use of --impure or something related to that? I would expect all binaries to get served from cachix as long as the flake.lock stays the same (nix-build was working perfectly before)

@domenkozar
Copy link
Member Author

@mpscholten --impure just implies that Nix can access some otherwise restrictive operations.

What paths do you see that are built on CI but not substituted?

@mpscholten
Copy link

--impure just implies that Nix can access some otherwise restrictive operations.

Thanks for confirming 👍

What paths do you see that are built on CI but not substituted?

Since the changes I did on friday on our github actions, I cannot reproduce the issue anymore. And it seems to be fixed for other people that reported the problem as well. So right now I cannot pinpoint it to a specific path.

One possible explanation: We've added a call to git add . to the github action on friday. A script in our pipeline patches the flake.nix to add a ?ref=CURRENT_GH_ACTION_COMMIT to the ihp flake input url. As I understand without the git add ., nix develop didn't pick up the latest flake.nix but instead used the one without the ?ref=.. url parameter. Thus evaulating an older version of IHP and not the current one which we want to build.

@domenkozar
Copy link
Member Author

As far as I know, flakes use git only to check what paths are tracked by git, but they do use the latest version.

@mpscholten
Copy link

Ok, then I'm out of ideas what could have caused this. I'll post here if we eventually figure out the root cause. So far no one has reported the problem anymore.

(btw: thanks again for making devenv :) it's now used across nearly all our projects (even in non IHP projects))

@skykanin
Copy link

skykanin commented Sep 25, 2023

I have a flake which exports two devShells, but even when using cachix/cachix-action@v12 I get this error in the post setup:

Post job cleanup.
Stopping SSH agent
The "file" argument must be of type string. Received undefined
Error stopping the SSH agent, proceeding anyway

I'm using Nix version 2.17.0 for this.

@domenkozar
Copy link
Member Author

Could you give us a link to the job?

@skykanin
Copy link

Could you give us a link to the job?

Unfortunately I cannot as this is for work purposes. I might try to make a repro.

jakobkukla added a commit to jakobkukla/nixos-config that referenced this issue Mar 19, 2024
The cachix action doesn't support flakes yet
See cachix/cachix-action#47
jakobkukla added a commit to jakobkukla/nixos-config that referenced this issue Mar 19, 2024
FIXME: this doesn't work yet since the cachix action doesn't support
flakes yet. See cachix/cachix-action#47
jakobkukla added a commit to jakobkukla/nixos-config that referenced this issue Mar 19, 2024
FIXME: this doesn't work yet since the cachix action doesn't support
flakes yet. See cachix/cachix-action#47
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

4 participants