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

vim_configurable: restore python derivation overriding #104077

Merged
merged 2 commits into from Jun 16, 2021

Conversation

dotkrnl
Copy link
Contributor

@dotkrnl dotkrnl commented Nov 17, 2020

Motivation for this change

In the current Vim, the Python support can be implemented by linking to the Python library, e.g., lib/libpython3.8.dylib on darwin. The previous workaround of wrapping Vim to prefix $PATH is not sufficient anymore. Since in the current Vim, the Python interpreter is no longer invoked, but instead, the dynamically linked library is used, in which only the original Python modules are loaded, causing plugins to fail to load their required Python modules.

Experiments show that, however, it is controlled by the $NIX_PYTHONPATH environment variable, as in development/interpreters/python/wrapper.nix. In this commit, we add the required environment variable to the wrapped Vim workaround as previously proposed. So that the Vim plugins can use Python modules in the specified Python derivation.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

In the current Vim, the Python support can be implemented by linking to
the Python library, e.g., lib/libpython3.8.dylib on darwin.  The
previous workaround of wrapping Vim to prefix $PATH is not sufficient
anymore.  Since in the current Vim, the Python interpreter is no longer
invoked, but instead, the dynamically linked library is used, in which
only the original Python modules are loaded, causing plugins to fail
to load their required Python modules.

Experiments show that, however, it is controlled by the $NIX_PYTHONPATH
environment variable.  In this commit, we add the required environment
variable to the wrapped Vim workaround as previously proposed.  So that
the Vim plugins can use Python modules in the specified Python derivation.
@dotkrnl
Copy link
Contributor Author

dotkrnl commented Nov 17, 2020

I guess I would need to notify maintainers since ofborg did not add any reviewers? Sorry for bothering if I am wrong.
@lovek323 @equirosa

Copy link
Contributor

@equirosa equirosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me 👍

@dotkrnl
Copy link
Contributor Author

dotkrnl commented Jun 14, 2021

@SuperSandro2000 Merge conflict resolved.

@SuperSandro2000 SuperSandro2000 merged commit 145195c into NixOS:master Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants