-
-
Notifications
You must be signed in to change notification settings - Fork 13k
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
vim plugins built with vimUtils.buildVimPlugin
require a pname
attribute
#193903
Comments
I think the issue originates from this line specifically: cc @teto (I think this was your PR) |
@MangoIV all derivations should have a pname and pname != name . I am interested in how this broke your setup ? can't you add a pname ? |
I can add a nvim-agda = pkgs.vimUtils.buildVimPlugin rec {
name = "nvim-agda";
pname = name; # this is how I fixed the issue
src = pkgs.fetchFromGitHub {
owner = "ashinkarov";
repo = "nvim-agda";
rev = "4b347ab08157614e5acb2a9d5103115521ffa447";
sha256 = "idMSFkWoWO3GpK/sJsqChYu34EpMoTmnvuqQI9R8PWk=";
};
}; I'm also not the only one who declares their plugins like this; e.g. |
@teto also see this relevant nixpkgs manual section https://nixos.org/manual/nixpkgs/unstable/#managing-plugins-with-vim-packages |
and no, I can't specify Alternatively |
This is a mistake in the manual, look at the generated plugins they all pname: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix Using "name" instead of pname will break the install because the name has the prefix "vimplugin-". Do you want to update the manual xD ? |
so what should the workflow for |
I know this, but they're generated, you don't have to bother with the |
Yeah, this is definitely how it's supposed to work. the You either pass both I think your change has to account for a vimPlugin not having a |
another simple fix would be to have |
yeah, I think that would be the most simple fix |
It's the opposite throughout nixpkgs https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/build-vim-plugin.nix#L12 and if you look at the git log, you will notice a big effort to use pname everywhere. My question is how do you end up with a plugin that doesn't have a pname ? and why not add pname there ? |
|
if you change pname by |
As long as that doesn't force the user to specify the |
@teto because I don't quite understand what you're proposing to solve it, this is the definition of rec {
buildVimPlugin = attrs@{
name ? "${attrs.pname}-${attrs.version}",
namePrefix ? "vimplugin-",
src,
unpackPhase ? "",
configurePhase ? "",
buildPhase ? "",
preInstall ? "",
postInstall ? "",
path ? ".",
addonInfo ? null,
...
}:
let drv = stdenv.mkDerivation (attrs // {
name = namePrefix + name;
inherit unpackPhase configurePhase buildPhase addonInfo preInstall postInstall;
installPhase = ''
runHook preInstall
target=$out/${rtpPath}/${path}
mkdir -p $out/${rtpPath}
cp -r . $target
runHook postInstall
'';
});
in toVimPlugin(drv.overrideAttrs(oa: {
rtp = "${drv}";
})); If we don't allow for passing |
Given that the manual explicitly documents The fact that nixpkgs uses Using |
I 100% agree with this statement. I do however understand the idea to migrate to pname eventually. |
The easy way out is to replace |
This broke my setup as well. Tried to upgrade and the build failed, I'm not sure which plugin/plugins are the culprit yet. |
EDIT: Well I feel dumb. This issue was because of my local plugin definitions which were using |
Just to let you know, it broke my 18 private neovim plugins. |
As I encountered the same, I think it's a good idea to add it to the release notes so that everyone is not that much surprised when they will have errors. |
so what do we do about it? strict |
Seems like this upsetted more people than I anticipated so I'll just merge this quickfix #194483 so that we can find a solution in a less stressful context.
I was more thinking in terms of user then ^^ so I am curious how do you define these plugins ? do you use the manual recommendation with an out of tree vimPlugins overlay (I guess not since that uses pname) or flake inputs ? is this public somewhere ? |
I have a repo to provide neovim with my favourite plugins. The flake for plugins itself uses nixpkgs fork so it wasn't broken, but it was broken when referenced from other nixpkgs instance. |
I was also one of the people affected by this change. I didn't commented earlier as the discussion already seemed productive and the fix seemed easy. I now comment as you want to fix in a less stressful context and it looks like you wanna understand the situation of the people. I no longer know how I ended up in that setup, but I guess I followed the docs as mentioned in an earlier comment. Some Plugins are missing in nixpkgs (maybe I should contribute?). Others are pinned to an older version as I don't like newer changes. I hope this context helps a bit. |
Describe the bug
Vim plugins built with
vimUtils.buildVimPlugin
now require apname
attribute, because otherwise the evaluation ofvim-utils.nix
will fail withattribute 'pname' missing
Expected behavior
The
name
attribute should be enoughNotify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: