-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
vimUtils.buildVimPlugin: hard error if called without pname+version #194069
Conversation
Since NixOS#193323 this is required otherwise building the wrapper for vim/neovim fails with a very hard to debug error.
you didn't change the documentation accordingly, also this is apparently a duplicate of my PR |
I also don't agree with erring when calling without |
pname should always be used in combination with version. Only supplying pname is not something that is usually supported and mkDerivation would error inside of nix when done. |
Instead of requiring If you are intentionally trying to guard against that, we could just synthesize This could look something like let
version = attrs.version or (lib.getVersion name);
drv = stdenv.mkDerivation (attrs
# allow specifying name or pname alone
// (if attrs?name then { name = namePrefix + name; }
else if !attrs?version then { name = namePrefix + attrs.pname; }
else {})
// (lib.optionalAttrs (version != "") { inherit version; })
// {
# ensure the resulting derivation always has a pname
pname = namePrefix + attrs.pname or (lib.getName name);
# … This way the resulting derivation will include |
Having said all that, I'm still more in favor of just "always use buildVimPlugin {
name = "foo";
inherit src;
} would produce a derivation with {
name = "foo";
pname = "foo";
} Perhaps there's precedent for this, for derivations synthesizing a |
It occurs to me that probably the best solution is to just add a vim test that constructs a plugin with only |
Yes, this is intended. When you right now don't pass pname+version you get an error with no trace where the error is created.
This would need to be changed in packdir but for that I would like feedback from @teto which I can't get because he has blocked me which breaks collaboration.
The code example is way to complex and complicated for what we are doing here.
We have that, kinda. https://github.com/NixOS/nixpkgs/pull/193323/files#diff-ef18e443be3c1c6d3542cac9e3c5ed844ef3f3c4a6d16dbd17bd82f9dcc5e5caR76 Apparently this was already fixed in #194483 but no on cared to make me aware of that. |
Since #193323 this is required otherwise building the wrapper for vim/neovim fails with a very hard to debug error.
Description of changes
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