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

nix flakes is too aggressive with caching when using things like nix run github:... #4007

Open
colemickens opened this issue Sep 13, 2020 · 8 comments
Labels

Comments

@colemickens
Copy link
Member

colemickens commented Sep 13, 2020

Describe the bug

I need to be able to tell users that they can run the listed command.

But I really can't have much faith in which version they're getting because of the type of caching that's going on. I'm making fixes, pushing, and the command just spits out the same error. I don't see an intuitive way to bust the cast. I think it ought to be checking much more aggressively when given external references like github:.

# install nix from nixos.org/download
nix-env -iA nixpkgs.nixUnstable
nix build \
  --experimental-features 'nix-command flakes' \
  'github:colemickens/nixcfg#hosts.testipfsvm'

Expected behavior

A clear and concise description of what you expected to happen.

nix-env --version output
nix-env (Nix) 3.0pre20200829_f156513
nix (Nix) 3.0pre20200829_f156513

Additional context

Add any other context about the problem here.

@zimbatm
Copy link
Member

zimbatm commented Sep 13, 2020

as a workaround, add /<commit_id> to the github URL. Eg: github:colemickens/nixcfg/a00c2b2e40f8c0a483883370c44fb45c7802ca20#hosts.testipfsvm

@edolstra
Copy link
Member

edolstra commented Sep 14, 2020

You can pass --refresh to force a redownload.

@stale
Copy link

stale bot commented Mar 16, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Mar 16, 2021
@stale
Copy link

stale bot commented Apr 19, 2022

I closed this issue due to inactivity. → More info

@elikoga
Copy link
Contributor

elikoga commented Sep 8, 2023

We probably want to check the current git commit for all the git sources (github, git+https, git+ssh, git+file), right?

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/deployment-tools-evaluating-nixops-deploy-rs-and-vanilla-nix-rebuild/36388/27

@LuNeder
Copy link

LuNeder commented May 25, 2024

You can pass --refresh to force a redownload.

Is there any equivalent for that on nixos-rebuild? Even if I add --refresh, nix doesn't seem to notice that the repo I'm importing in my flake changed so it just rebuilds from cache

@dasj19
Copy link

dasj19 commented Sep 1, 2024

@LuNeder maybe the following will help: --option eval-cache false

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

No branches or pull requests

8 participants