-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
vimPlugins.LeaderF: init at 2019-10-15 #71972
Conversation
I've tried to do as much due diligence as possible. However, I would appreciate it if anyone can answer these questions for me:
|
pkgs/misc/vim-plugins/overrides.nix
Outdated
LeaderF = super.LeaderF.overrideAttrs(old: { | ||
buildInputs = [ | ||
python3 | ||
stdenv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stdenv shouldn't be necessary
stdenv | |
stdenv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonringer, is there a different way to get gcc? The plugin compiles a C extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh hmmm. I think for the vimplugins they do a { stdenv = stdenvNoCC }
.... I'm not actually sure how to get gcc in there again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, it compiled fine for me when I used stdenv 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I just tried it without stdenv and it works fine. I'll remove the dependency. Thanks, @jonringer!
# $HOME, which during the build points to the non-existent | ||
# /homeless-shelter. lfMru.vim tries to create the directory but lacks | ||
# sufficient permissions, so this code forces g:Lf_CacheDirectory to point | ||
# to $TMPDIR only when $HOME == /homeless-shelter, i.e., only during builds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand this. When and why is $HOME
accessed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timokau, $HOME
is accessed here when trying to get the g:Lf_CacheDirectory
setting in vim: https://github.com/Yggdroot/LeaderF/blob/v1.21/autoload/lfMru.vim#L10. The default for that setting is $HOME
, which is set to /homeless-shelter
during the build.
A few lines later, the script attempts to create the directory pointed to by g:Lf_CacheDirectory
if it doesn't already exist: https://github.com/Yggdroot/LeaderF/blob/v1.21/autoload/lfMru.vim#L13. This action sometimes fails during the build because the user often doesn't have permission to create /homeless-shelter
. I assume that it would work if running as root, but we need to account for non-root users.
Besides, in this case, there isn't really a need to ensure that the cache directory exists. The error occurs when attempting to build neovim
(and would probably affect vim
builds, I assume, but I haven't checked) and the plugin is installed. The error doesn't occur when trying to build this plugin. That's because the the invalid access occurs in the autoload script for the plugin. The plugin is simply being loaded during the course of opening neovim
while neovim
is being built, which triggers the autoload script, which in turn triggers the mkdir that results in a permission error (when building as a non-privileged user). Therefore, we don't actually need the cache dir because the error is being triggered when the plugin isn't really being used for anything; it serves no purpose in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that sounds like the remote manifest generation is the issue. Neovim is launched with a minimal vimrc (that just includes the plugins) during build to generate the remote plugin manifest.
If that is the case, other plugins are likely to have similar issues. Maybe it would be better to create a home directory for the manifest generation. Could you try adding export HOME="$(mktemp -d)"
before the manifest generation in pkgs/applications/editors/neovim/wrapper.nix
? Please also add a short comment that explains why it is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fyi, the export HOME
fix was used in #72506 which appears to be close to being merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any updates on this? |
I marked this as stale due to inactivity. → More info |
seems like LeaderF is packaged already. |
Motivation for this change
Adds
vimPlugins.LeaderF
so that we can use the wonderful LeaderF plugin for vim.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)