-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the hash would need to be recomputed as well
# https://github.com/NixOS/nixpkgs/issues/157609 | ||
vim-colorschemes = super.vim-colorschemes.overrideAttrs (old: { | ||
src = old.src.overrideAttrs (srcOld: { | ||
postFetch = srcOld.postFetch + lib.optionalString (!stdenv.isDarwin) '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postFetch = srcOld.postFetch + lib.optionalString (!stdenv.isDarwin) '' | |
postFetch = (srcOld.postFetch or "") + lib.optionalString (!stdenv.isDarwin) '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I assumed yeah.
1346094
to
b348e05
Compare
b348e05
to
c332788
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Result of nixpkgs-review pr 157622 run on x86_64-linux 1
2 packages built:
- spacevim
- tests.vim.test_vim_with_vim_nix
Motivation for this change
As discussed in #157609, the source for
vim-colorschemes
contains two files with who's name only differ by the case:colors/darkBlue.vim
colors/darkblue.vim
This results in
update.py
generating 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 = true
set 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.sh
to update generated release notes