Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Packer - Failed to install - git timeout, and no post install hook #69

Closed
bmulholland opened this issue Oct 25, 2021 · 15 comments · Fixed by #70
Closed

Packer - Failed to install - git timeout, and no post install hook #69

bmulholland opened this issue Oct 25, 2021 · 15 comments · Fixed by #70
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bmulholland
Copy link

bmulholland commented Oct 25, 2021

Installing with packer with use({ 'mrjones2014/dash.nvim', requires = { 'nvim-telescope/telescope.nvim' }, run = 'make install' }), I get a "Failed to install" when running a PackerSync. Thereafter, I get "module "libdash_nvim" not found, did you set up Dash.nvim with make install as a post-install hook?"

Debugging a bit, I found two things:

  1. Git times out frequently: ...m/site/pack/packer/start/packer.nvim/lua/packer/jobs.lua:87: Killing git due to timeout!. Now, the connection I'm on is a little weak, but it still downloaded from github at ~500kb/s. I worked around this for now by increasing timeout to 120s (from 60s). None of my other plugins needed this, though...
  2. Having worked around that, the post install hook doesn't seem to run? After the packer sync, I guess it tries to load the module, because the debug log shows "Vim(lua):module "libdash_nvim" not found, did you set up Dash.nvim with make install as a post-install hook? See :h dash-install". So maybe that failing is preventing the hook from executing?

I solved the problem for now by cding to the dash dir and running make install manually.

@bmulholland bmulholland changed the title Failed to install - git timeout Packer - Failed to install - git timeout, and no post insall hook Oct 25, 2021
@bmulholland bmulholland changed the title Packer - Failed to install - git timeout, and no post insall hook Packer - Failed to install - git timeout, and no post install hook Oct 25, 2021
@mrjones2014
Copy link
Owner

Hmm, I wonder if this is because I'm including binaries in the repo. Might have a pretty fat .git directory. I can maybe try pruning the .git directory, or installing the binaries another way.

@bmulholland
Copy link
Author

bmulholland commented Oct 25, 2021

Yeah that might help with the first part. I imagine it's pretty easy to do a fresh git clone and see how long it takes?

@knpwrs
Copy link
Contributor

knpwrs commented Oct 27, 2021

I'm currently seeing the "Failed to install" error and subsequent "module libdash_nvim not found" error. Running make install in the cloned directory works. I can't see what's actually failing in the packer output though.

@mrjones2014
Copy link
Owner

Hmm, I'm really curious if it has to do with the download size. Maybe we can make it so the binaries aren't stored in the repo, but are instead downloaded from Github Releases as part of make install. I'd need to update my GitHub Actions CI to publish the binaries with each release.

I wonder if there's a better way.

@mrjones2014
Copy link
Owner

Frustrating that I can't reproduce this on my machine. It's difficult to diagnose the issue.

@knpwrs
Copy link
Contributor

knpwrs commented Oct 27, 2021

I don't think it's a repo size thing for me. It's not timing out or anything over here. Is there a way to get more verbose output from make install so we can take a peek at what's happening? make install doesn't have any output for me whether it's run from packer or from the shell.

@mrjones2014
Copy link
Owner

make install just runs ./scripts/install-for-architecture.bash which has the following contents:

#!/usr/bin/env bash

rm -rf ./lua/libdash_nvim.so ./lua/deps/

if [[ "$(uname -m)" == "arm64" ]]; then
  cp ./bin/arm/libdash_nvim.so ./lua/
  mkdir -p ./lua/deps/
  cp -r ./bin/arm/deps/ ./lua/deps/
else
  cp ./bin/x86/libdash_nvim.so ./lua/
  mkdir -p ./lua/deps/
  cp -r ./bin/x86/deps/ ./lua/deps/
fi

I wonder if this line is the issue since these won't exist on initial install: rm -rf ./lua/libdash_nvim.so ./lua/deps/

but that doesn't explain why it would work when run manually.

@mrjones2014 mrjones2014 added bug Something isn't working help wanted Extra attention is needed labels Oct 27, 2021
@mrjones2014 mrjones2014 pinned this issue Oct 27, 2021
@knpwrs
Copy link
Contributor

knpwrs commented Oct 27, 2021

I wonder if this line is the issue since these won't exist on initial install: rm -rf ./lua/libdash_nvim.so ./lua/deps/

but that doesn't explain why it would work when run manually.

Yeah, I wouldn't expect that to be a problem unless you put set -e at the top of the script.

Maybe another option would be for the Lua plugin to decide where to look for the binary rather than copy a specific binary to a known location?

@mrjones2014
Copy link
Owner

Yeah, @knpwrs that was another option I had in mind when coming up with the install flow. I can try doing that instead of the make install probably this week or weekend.

@mrjones2014
Copy link
Owner

@knpwrs @bmulholland Is this the error you were getting?

[packer.nvim] [ERROR 16:28:11] async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(lua):module "libdash_nvim" not found, did you set up Dash.nvim with make install as a post-install hook? See :h dash-install

If so, that's my own check, and I probably just need to tweak that and how it's run.

@knpwrs
Copy link
Contributor

knpwrs commented Oct 27, 2021

That's the error I get when starting Neovim, but I'm also getting a "failed to install" from Packer (when it runs make install).

@mrjones2014
Copy link
Owner

Right @knpwrs I think you're getting "Failed to install" from packer because it's running my startup check before make install has been run, which calls vim.api.nvim_err_writeln if make install hasn't been run yet 🤦

I need to figure out how to not error if it's during a packer install, or maybe move the error checking to happen the first time you try to load the module, or something like that.

@mrjones2014
Copy link
Owner

Simply using print instead of vim.api.nvim_err_writeln should fix it.

@mrjones2014
Copy link
Owner

@knpwrs @bmulholland it should be fixed now.

@mrjones2014 mrjones2014 unpinned this issue Oct 27, 2021
@knpwrs
Copy link
Contributor

knpwrs commented Oct 27, 2021

Nice, that fixed it! Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants