vimPlugins.vim-colorschemes: add overlay to address hash issue - #157622
Conversation
|
Result of 1 package built:
|
|
Result of 1 package built:
|
d4b39d7 to
1346094
Compare
|
Result of 1 package built:
|
|
Result of 1 package built:
|
jonringer
left a comment
There was a problem hiding this comment.
I think the hash would need to be recomputed as well
There was a problem hiding this comment.
| postFetch = srcOld.postFetch + lib.optionalString (!stdenv.isDarwin) '' | |
| postFetch = (srcOld.postFetch or "") + lib.optionalString (!stdenv.isDarwin) '' |
There was a problem hiding this comment.
@jonringer, I updated the PR with the change you suggested.
I initially thought the same thing about the hash, however, the current hash in nixpkgs is based off the source being downloaded on a darwin system. Given the override does nothing on darwin systems, the hash is the same. When I was testing this to ensure the hashes were the same on both systems I set the sha265 hash for the vim-colorschemes source to "" in generated.nix, to see what hashes Nix expected on each system.
On my Mac:
error: hash mismatch in fixed-output derivation '/nix/store/6yy77dsf8j3dmsia15w1xmbmxh2w1742-source.drv':
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
got: sha256-5Y29LUC1cddrX/mwLQoMTWxRcvXHYrgRo+s5IKRx+k4=
On my NixOS machine:
error: hash mismatch in fixed-output derivation '/nix/store/7hzr62y9l08j1c37flskx890p0h489dk-source.drv':
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
got: sha256-5Y29LUC1cddrX/mwLQoMTWxRcvXHYrgRo+s5IKRx+k4=
The expected hash is the same as the current hash in generated.nix:
❯ nix hash to-sri --type sha256 0kpsf6j20fgblc8vhqn7ymr52v2d1h52vc7rbxmxfwdm80nvv3g5
sha256-5Y29LUC1cddrX/mwLQoMTWxRcvXHYrgRo+s5IKRx+k4=There was a problem hiding this comment.
The or "" is only added to prevent evaluation errors if the overwriten Derivation for some reason no longer contain postFetch.
There was a problem hiding this comment.
That's what I assumed yeah.
1346094 to
b348e05
Compare
b348e05 to
c332788
Compare
Motivation for this change
As discussed in #157609, the source for
vim-colorschemescontains two files with who's name only differ by the case:colors/darkBlue.vimcolors/darkblue.vimThis results in
update.pygenerating a different hash for the plugin depending on whether the file system of the system it's run on is case-sensitive or not. This mainly comes up on Darwin systems.There's an issue on the upstream repo (flazz/vim-colorschemes#186) as well as a PR to fix the issue (flazz/vim-colorschemes#181).
Unfortunately the owner of the repo hasn't been active for over a year, so waiting for the PR to land probably isn't a viable solution :(
This PR is a proposed hack to address the issue.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes