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

neovim 0.5.0 fails to build #137829

Closed
peperunas opened this issue Sep 14, 2021 · 12 comments
Closed

neovim 0.5.0 fails to build #137829

peperunas opened this issue Sep 14, 2021 · 12 comments
Labels
0.kind: bug Something is broken 6.topic: vim

Comments

@peperunas
Copy link
Contributor

Describe the bug

Neovim 0.5.0 fails to build due to incorrect permissions.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install neovim from unstable

Additional context

substituteStream(): WARNING: pattern 'Name=Neovim' doesn't match anything in file '/nix/store/0a1ybbq252b46dzi5g644rfmmkbbblz8-neovim-0.5.0/share/applications/nvim.desktop'
/nix/store/7xdjqpzv0w4pkz8z2hbv8sj98zhy6g7n-hook/nix-support/setup-hook: line 40: /nix/store/s50aclcycg186nigchin5mnlsdfr3lzl-neovim-0.5.0/bin/nvim-python3: Permission denied

Notify maintainers

@Ma27 @manveru @rvolosatovs

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.62, NixOS, 21.05.20210906.fd6dba4 (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.4pre20210802_47e96bb`
 - channels(root): `"nixos-21.11pre309670.253aecf69ed, home-manager"`
 - channels(giulio): `""`
 - nixpkgs: `/nix/store/gk0xwmhhxb48i2kxlyrsm0vrczjjf6ja-source`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@peperunas peperunas added the 0.kind: bug Something is broken label Sep 14, 2021
@rvolosatovs
Copy link
Member

rvolosatovs commented Sep 14, 2021

substituteStream(): WARNING: pattern 'Name=Neovim' doesn't match anything in file '/nix/store/0a1ybbq252b46dzi5g644rfmmkbbblz8-neovim-0.5.0/share/applications/nvim.desktop'

Is very concerning, I don't see how it can fail

substitute ${neovim}/share/applications/nvim.desktop $out/share/applications/nvim.desktop \
--replace 'Name=Neovim' 'Name=WrappedNeovim'

I cannot reproduce this on 253aecf corresponding to your root channel:

$ git checkout 253aecf69ed && nix run -f . neovim -c nvim -u NONE -c :checkhealth

Also not on latest nixos-unstable:

$ git checkout upstream/nixpkgs-unstable && git rev-parse HEAD && nix run -f . neovim -c nvim -u NONE -c :checkhealth
HEAD is now at 071317d5432 Merge pull request #137754 from r-ryantm/auto-update/duckdb
071317d543205ee5f5611d391a37582f9b282240 

My initial feeling was to blame #136429, but it does not look like it changed anything that could cause the error and I cannot reproduce the error even with the PR in the tree

So it looks like something is wrong in your environment? Perhaps you have an overlay active?

Did it work before? Is it feasible for you to bisect and figure out which commit broke it?

@peperunas
Copy link
Contributor Author

I am using neovim unstable from the home-manager module. Could this be the breaker?

@rvolosatovs
Copy link
Member

rvolosatovs commented Sep 14, 2021

I would start with trying nix run nixpkgs.neovim -c nvim -u NONE -c :checkhealth (assuming you are on "legacy" nix)

If it works - then the culprit is home-manager indeed, if it does not - then likely something is wrong in your environment

@rvolosatovs
Copy link
Member

Could it be that you specified a custom neovim package in home-manager? If so, the package is probably invalid.

It looks like something other than unwrapped neovim is passed to the wrapper

@teto
Copy link
Member

teto commented Sep 14, 2021

nix build -f channel:nixos-unstable neovim neovim-unwrapped work fine so it's probably sthg wrong in your config

@figsoda
Copy link
Member

figsoda commented Sep 15, 2021

error message looks like it is trying to wrap a wrapped neovim, what is your config?

@peperunas
Copy link
Contributor Author

I am using neovim from home-manager, this might be the culprit.

I am modifying the neovim package by using the following snippet, nothing more:

programs.neovim = {
  enable      = true;
  package = pkgs.unstable.neovim;
}

@figsoda
Copy link
Member

figsoda commented Sep 30, 2021

what is pkgs.unstable?
if it is nixpkgs, it should probably be pkgs.unstable.neovim-unwrapped instead
https://github.com/nix-community/home-manager/blob/959217e51dbd07d0de6dcbddfbfcb4f2efdc0c1e/modules/programs/neovim.nix#L146
setting it to a wrapped neovim will cause double wrapping

@peperunas
Copy link
Contributor Author

Absolutely, that was the issue!

I solved it by setting package = neovim-unwrapped.

As a side note, why does neovim need wrapping?

@figsoda
Copy link
Member

figsoda commented Oct 1, 2021

the wrapper allows you to set your init file, adds support for python, node and other languages, and some other stuff
see https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/neovim/wrapper.nix

@peperunas
Copy link
Contributor Author

peperunas commented Oct 1, 2021 via email

@teto
Copy link
Member

teto commented Oct 2, 2021

I would prefer if we adopted neovim / neovim-wrapped rather neovim-unwrapped / neovim to avoid that (but unlikely to happen due to backwards compatibility and all). Also the module could check whether package is wrapped or not.

@stepbrobd stepbrobd mentioned this issue Apr 7, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: vim
Projects
None yet
Development

No branches or pull requests

4 participants