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

ctags: fix sha256 #101590

Closed
wants to merge 1 commit into from
Closed

ctags: fix sha256 #101590

wants to merge 1 commit into from

Conversation

quyse
Copy link
Contributor

@quyse quyse commented Oct 24, 2020

Motivation for this change

Apparently sha256 for ctags source is wrong, replace it with the one returned by nix-prefetch-svn https://svn.code.sf.net/p/ctags/code/trunk 816.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Oct 24, 2020

Something is really broken here:

Exported revision 816.
hash mismatch in fixed-output derivation '/nix/store/dvrx54bbzkjjrgb14gk6pq4g1j5xy6hw-code-r816':
  wanted: sha256:0g9pgnrawf10c26y0xn832skf2ff30scdk3gj12ky0lhg1sa9bfm
  got:    sha256:0jmbkrmscbl64j71qffcc39x005jrmphx8kirs1g2ws44wil39hf

@quyse
Copy link
Contributor Author

quyse commented Oct 24, 2020

Ok, building the derivation with nix-build and using nix-prefetch-svn actually return different hashes and store paths.
nix-build indeed calculates current (pre-PR) hash 0jmbkrmscbl64j71qffcc39x005jrmphx8kirs1g2ws44wil39hf and /nix/store/dvrx54bbzkjjrgb14gk6pq4g1j5xy6hw-code-r816.
nix-prefetch-svn returns hash 0g9pgnrawf10c26y0xn832skf2ff30scdk3gj12ky0lhg1sa9bfm and /nix/store/ix0i60ah9r07vf60l94cgbfd20lg728w-code-r816.

Diffing paths returns (excerpt):

diff -r -U3 /nix/store/dvrx54bbzkjjrgb14gk6pq4g1j5xy6hw-code-r816/Eiffel/external_addressing.e /nix/store/ix0i60ah9r07vf60l94cgbfd20lg728w-code-r816/Eiffel/external_addressing.e
--- /nix/store/dvrx54bbzkjjrgb14gk6pq4g1j5xy6hw-code-r816/Eiffel/external_addressing.e  1970-01-01 03:00:01.000000000 +0300
+++ /nix/store/ix0i60ah9r07vf60l94cgbfd20lg728w-code-r816/Eiffel/external_addressing.e  1970-01-01 03:00:01.000000000 +0300
@@ -2,7 +2,7 @@
 
        description: "Compiler-dependent external addressing of objects"
        revision: "$Revision: 189 $"
-       date: "$Date: 2002-08-26 03:16:52 +0000 (Mon, 26 Aug 2002) $"
+       date: "$Date: 2002-08-26 07:16:52 +0400 (Mon, 26 Aug 2002) $"
        copyright: "Copyright 2002 Darren Hiebert and others"
        license: "Eiffel Forum License, version 1"
 
diff -r -U3 /nix/store/dvrx54bbzkjjrgb14gk6pq4g1j5xy6hw-code-r816/Eiffel/tag_entry.e /nix/store/ix0i60ah9r07vf60l94cgbfd20lg728w-code-r816/Eiffel/tag_entry.e
--- /nix/store/dvrx54bbzkjjrgb14gk6pq4g1j5xy6hw-code-r816/Eiffel/tag_entry.e    1970-01-01 03:00:01.000000000 +0300
+++ /nix/store/ix0i60ah9r07vf60l94cgbfd20lg728w-code-r816/Eiffel/tag_entry.e    1970-01-01 03:00:01.000000000 +0300
@@ -2,7 +2,7 @@
 
        description: "Describes a single entry in a tag file."
        revision: "$Revision: 195 $"
-       date: "$Date: 2002-08-28 04:49:14 +0000 (Wed, 28 Aug 2002) $"
+       date: "$Date: 2002-08-28 08:49:14 +0400 (Wed, 28 Aug 2002) $"
        copyright: "Copyright 2002 Darren Hiebert and others"
        license: "Eiffel Forum License, version 1"
 
diff -r -U3 /nix/store/dvrx54bbzkjjrgb14gk6pq4g1j5xy6hw-code-r816/Eiffel/tag_extension_fields.e /nix/store/ix0i60ah9r07vf60l94cgbfd20lg728w-code-r816/Eiffel/tag_extension_fields.e
--- /nix/store/dvrx54bbzkjjrgb14gk6pq4g1j5xy6hw-code-r816/Eiffel/tag_extension_fields.e 1970-01-01 03:00:01.000000000 +0300
+++ /nix/store/ix0i60ah9r07vf60l94cgbfd20lg728w-code-r816/Eiffel/tag_extension_fields.e 1970-01-01 03:00:01.000000000 +0300
@@ -2,7 +2,7 @@
 
        description: "Variable extension fields for tag file entry."
        revision: "$Revision: 189 $"
-       date: "$Date: 2002-08-26 03:16:52 +0000 (Mon, 26 Aug 2002) $"
+       date: "$Date: 2002-08-26 07:16:52 +0400 (Mon, 26 Aug 2002) $"
        copyright: "Copyright 2002 Darren Hiebert and others"
        license: "Eiffel Forum License, version 1"

... 

So apparently the difference is due to Subversion's keyword substitution of $Date$: it uses UTC or local time zone, depending on the tool.

So my PR is invalid, sorry about that.

@quyse quyse closed this Oct 24, 2020
@SuperSandro2000
Copy link
Member

For me this sounds like a bug. If two tools meant to generate this hashes return different things it is complicated.

@quyse
Copy link
Contributor Author

quyse commented Oct 24, 2020

It looks to me nix-prefetch-svn should use UTC as well, to calculate the same hash as fetchsvn during normal Nix build. I will file another issue about it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants