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: input is updated on upgrade if repo owner capitalization is changed #10726

Open
nmattia opened this issue May 16, 2024 · 4 comments
Open
Labels

Comments

@nmattia
Copy link
Contributor

nmattia commented May 16, 2024

Describe the bug

I made a change to a flake input that should have no incidence on the build:

-  inputs.nixpkgs.url = "github:nixos/nixpkgs";
+  inputs.nixpkgs.url = "github:NixOS/nixpkgs";

However when running a nix upgrade, the input was updated:

$ nix profile upgrade 0
warning: updating lock file 'foo/flake.lock':
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/977a49df312d89b7dfbb3579bf13b7dfe23e7878' (2024-05-16)
  → 'github:NixOS/nixpkgs/4ff362e7100ea0003ec1c7e683f7c6d863fb286b' (2024-05-16)

Expected behavior

I did not expect nix profile upgrade to update inputs

nix-env --version output

nix-env (Nix) 2.18.2
@nmattia nmattia added the bug label May 16, 2024
@edolstra
Copy link
Member

The revision changed as well, right? So upgrading the lock file would be correct behaviour regardless of the change in capitalization.

However, even if there was no new revision, I'm not convinced the change in capitalization shouldn't be reflected in the lock file.

@nmattia
Copy link
Contributor Author

nmattia commented May 16, 2024

The revision changed as well, right?

The latest revision on that branch had changed, yes; that being said, I did not manually change the revision anywhere.

In general, is it normal for nix profile upgrade to bump the revision?

@fricklerhandwerk
Copy link
Contributor

Triaged in Nix maintainers meeting:

  • @tomberek: if the URL changes, regardless how, an update is run. at this point Nix doesn't know that the revision changed, but the subsequent fetch gets you the newest one
    • this may be a quirk but not necessarily a bug.
  • @roberth: changing the notion of equivalence would have to be per URL scheme
  • decision: low priority, may be a good first-time contribution

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/2024-05-22-nix-team-meeting-minutes-147/45835/1

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

4 participants