Skip to content

Main branch doesn't update hash with --flake #535

@katrinafyi

Description

@katrinafyi

This looks like a regression in main since the last release version. Idk if you're aware of it yet, but just reporting to be safe.

Updating with nix-update increments the version but does not change the revision. Importantly, this only seems to happen when the existing old hash is not AAAAAAA.

As a demo repo, I'm using a fork of nix-update with an extra package added exposed through its top-level flake.nix and changing the current hash to its proper value.

git clone git@github.com:rina-forks/nix-update.git
cd nix-update
git checkout f7d45565827fad8ddef235fa776682922daa0253

# this commits a proper update:
nix run github:mic92/nix-update/v1.14.0#nix-update -- --flake -f . --commit  github      

git reset --hard f7d45565827fad8ddef235fa776682922daa0253

# this commits a version increment but no hash change:
nix run github:mic92/nix-update/3ea1cb1a92b801dea7419505c918116b5ef0fd49#nix-update -- --flake -f . --commit  github

old committed diff (good):

diff --git a/tests/testpkgs/github.nix b/tests/testpkgs/github.nix
index 9f1d65c..21581a4 100644
--- a/tests/testpkgs/github.nix
+++ b/tests/testpkgs/github.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   pname = "fd";
-  version = "8.0.0";
+  version = "10.3.0";
 
   src = fetchFromGitHub {
     owner = "sharkdp";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-xwLrg6V/4JhKjUwa/dMY/QrsAYA34xZu8ywlObfqKFA=";
+    sha256 = "sha256-rUoR8LHtzwGQBwJGEsWpMYKG6HcGKcktcyF7TxTDJs8=";
   };
 }

new committed diff (bad):

diff --git a/tests/testpkgs/github.nix b/tests/testpkgs/github.nix
index 9f1d65c..793e5f8 100644
--- a/tests/testpkgs/github.nix
+++ b/tests/testpkgs/github.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   pname = "fd";
-  version = "8.0.0";
+  version = "10.3.0";
 
   src = fetchFromGitHub {
     owner = "sharkdp";

This was also mentioned in a comment to the PR: #522 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions