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

Rocks update result in ENONET error after removing rocks-git plugin #37

Closed
austinliuigi opened this issue Jul 8, 2024 · 10 comments
Closed

Comments

@austinliuigi
Copy link

austinliuigi commented Jul 8, 2024

When I run :Rocks update, I get the following error:

image

It worked when I ran it earlier today, but after attempting to lazy-load my plugins with rocks-lazy.nvim I noticed that converting my rocks-git plugins to use opt = true wasn't working; they were staying in ~/.local/share/nvim/site/pack/rocks/start. When I tried uninstalling the plugin and reinstalling, it wouldn't install. I tried reinstalling rocks.nvim by deleting ~/.local/share/nvim/rocks/ and ~/.local/share/nvim/site/pack/ and re-triggering the bootstrap. However, after reinstallation, I still get the error shown in the image when I run :Rocks update.

Update: I figured that this only occurs after removing a rocks-git plugin. So after doing a fresh install of rocks.nvim, this is the sequence I followed:

- run :Rocks sync
- run :Rocks update <= works
- comment out a rocks-git plugin from rocks.toml
- run :Rocks sync
- run Rocks update <= errors
@austinliuigi austinliuigi changed the title Rocks update result in ENONET error Rocks update result in ENONET error after remove rocks-git plugin Jul 8, 2024
@austinliuigi austinliuigi changed the title Rocks update result in ENONET error after remove rocks-git plugin Rocks update result in ENONET error after removing rocks-git plugin Jul 8, 2024
@mrcjkb mrcjkb transferred this issue from nvim-neorocks/rocks.nvim Jul 9, 2024
@mrcjkb
Copy link
Member

mrcjkb commented Jul 9, 2024

Hey 👋

Thanks for reporting. I'll try to reproduce later today.

@mrcjkb
Copy link
Member

mrcjkb commented Jul 9, 2024

Also, This looks suspicious in your config:

local rocks_config = {
    rocks_path = vim.fs.normalize(install_location),
    luarocks_binary = vim.fs.joinpath(install_location, "bin", "luarocks"),
}

That comes from a bug in the readme's old bootstrap snippet.
Can you please try unsetting luarocks_binary?

So that it's

local rocks_config = {
    rocks_path = vim.fs.normalize(install_location),
}

@austinliuigi
Copy link
Author

Thanks for taking the time to help track down the issue. I just updated the bootstrap code with the one in the current readme. I reinstalled rocks.nvim, but the same issue occurs. My rocks.nvim config is the following now:

image

@austinliuigi
Copy link
Author

Another issue that may be related and could possibly provide more context : after following these steps after reinstallation that I mentioned above,

- run :Rocks sync
- run :Rocks update <= works
- comment out a rocks-git plugin from rocks.toml
- run :Rocks sync
- run Rocks update <= errors

I also cannot re-install the plugin that I commented out. When I uncomment it and run :Rocks sync, it doesn't install. Note that the sync doesn't show any signs of failing, it just processes for a little while with no progress messages then shows "Completed" when done. It is only when I run :Rocks update that I get the ENONET error.

@mrcjkb
Copy link
Member

mrcjkb commented Jul 9, 2024

I haven't been able to reproduce the behaviour you're describing.
But I've also noticed your rocks.nvim installation and its modules (rocks-git, etc.) are quite out of date.

Could you please update to the latest versions and then see if the issue still persists?

You should be able to update them individually with :Rocks install {rock} (e.g. Rocks install rocks.nvim).

@austinliuigi
Copy link
Author

I've been running the latest versions, but I just haven't pushed my updated config to github yet. Nevertheless, I tried running :Rocks install rocks.nvim and :Rocks install rocks-git.nvim with a :Rocks sync, but still no luck. Maybe I'll just wait for a few updates and see if the issue fixes itself. Thanks for your help :)

@mrcjkb
Copy link
Member

mrcjkb commented Jul 9, 2024

If you push your updated config to another branch and link it for me, I can try and reproduce again 😄

@austinliuigi
Copy link
Author

So I was probing the source code of rocks.nvim and rocks-git.nvim to see if I could get more information and I found out why rocks-git wasn't installing plugins. I fixed the issue in this PR. Interestingly, I currently can't reproduce the ENONET error when I :Rocks update, even when I revert the fix for rocks-git not installing plugins. Maybe it's some kind of race condition?

I also mentioned in the PR that rocks-git seems to install plugins fine on the first run of :Rocks sync after a fresh install of rocks.nvim. I'm curious to know f you have any ideas why.

@mrcjkb
Copy link
Member

mrcjkb commented Jul 9, 2024

Thanks for digging and for the fix 🙏

I also mentioned in the PR that rocks-git seems to install plugins fine on the first run of :Rocks sync after a fresh install of rocks.nvim. I'm curious to know f you have any ideas why.

I think it could be if rocks-git isn't installed yet. To make sure sync works when you first run it (before extensions like rocks-git are installed), rocks.nvim collects all the rocks it couldn't handle itself, loads external handlers after installing them, and then retries to install the rocks it couldn't install previously.

@austinliuigi
Copy link
Author

I see, thanks for the explanation. Since I can't reproduce the ENONET error, this issue could probably be closed but I'll leave that up to you. Thanks for all the help and the great package manager :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants