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_configurable: restore ability to override python for modules #40920
Conversation
I'll run EDIT:
|
Success on x86_64-linux (full log) Attempted: vim_configurable Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: vim_configurable Partial log (click to expand)
|
In neovim this is done by |
It seems as the issue doesn't exist in neovim as it allows an extra property named
When you build the code for First of all the question is when do we want to use Python from the derivation and when the one from $PATH? Unfortunately I don't know too much about Vim's internals, so I'm not sure if there's an easy way to fix this 😅 |
Yeah, I'm not sure if creating the wrapper unconditionally is a good idea. Creating a wrapper yourself is pretty straightforward, while disabling it would be pretty tricky. |
I absolutely understand your point. The reason why I filed this patch was to retain the behavior with VIM 8.0 where the |
As I'm currently using an altered As I already said, I'm open for further discussion (we can even make this behavior optional, right?), I'm just not sure if we want to use the "new" behavior of VIM 8.1 or keep the behavior of VIM 8.0 where the |
ping @LnL7 |
Adding an option for the wrapper so it can be overridden sounds fine to me. Maybe we should keep it disabled by default since using PATH is now the default upstream, unless everybody thinks the wrapper makes more sense. |
It seems as Python will be fetched from $PATH in Vim 8.1: ``` stat("/home/ma27/bin/python", 0x7ffe57a317b0) = -1 ENOENT (No such file or directory) stat("/run/wrappers/bin/python", 0x7ffe57a317b0) = -1 ENOENT (No such file or directory) stat("/home/ma27/.nix-profile/bin/python", 0x7ffe57a317b0) = -1 ENOENT (No such file or directory) stat("/nix/var/nix/profiles/default/bin/python", 0x7ffe57a317b0) = -1 ENOENT (No such file or directory) stat("/run/current-system/sw/bin/python", {st_mode=S_IFREG|0555, st_size=291, ...}) = 0 readlink("/run/current-system/sw/bin/python", "/nix/store/ggjkqbvwnv7dflkmdgmmp"..., 4096) = 72 ``` This breaks in cases where you want to use a modified Python derivation for the VIM plugins you use in `vim_configurable`: ``` let vim_configurable' = vim_configurable.override { # python with modules for ensime python = python.withPackages (ps: with ps; [ sexpdata websocket_client ]); }; in vim_configurable'.customize { # ... } ``` With VIM 8.0 this worked perfectly fine, now it's necessary to install the modified `python` in $PATH to actually use it, otherwise an error like this arises: ``` [ensime] A dependency is missing, please `pip2 install sexpdata websocket-client` and restart Vim. Press ENTER or type command to continue ``` However it should be possible to pass the modified Python to the modules, the easiest workaround is to write a wrapper which prefixes $PATH to have the Python derivation available.
4a0395b
to
f43446c
Compare
@LnL7 you're right, the behavior is optional now %) |
Success on x86_64-linux (full log) Attempted: vim_configurable Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: vim_configurable Partial log (click to expand)
|
Motivation for this change
It seems as Python will be fetched from $PATH in Vim 8.1:
This breaks in cases where you want to use a modified Python derivation
for the VIM plugins you use in
vim_configurable
:With VIM 8.0 this worked perfectly fine, now it's necessary to install
the modified
python
in $PATH to actually use it, otherwise an errorlike this arises:
However it should be possible to pass the modified Python to the
modules, the easiest workaround is to write a wrapper which prefixes
$PATH to have the Python derivation available.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)