-
-
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theg: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 affectvim
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 openingneovim
whileneovim
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 inpkgs/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.
@felschr, correct 🙂. I will clean up this PR and ask for this to be merged once #72506 gets merged.