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 doesn't update rocks.toml entries of out-of-sync rocks that didn't get updated #380

Closed
champignoom opened this issue Jun 14, 2024 · 3 comments · Fixed by #382

Comments

@champignoom
Copy link

champignoom commented Jun 14, 2024

A week ago, I installed rocks.nvim (then 2.30.0), which had some serious bug.

Today, I removed ~/.local/share/nvim/rocks/, re-installed rocks.nvim, but with ~/.config/nvim/rocks.toml unchanged, which has obsolete version info "rocks.nvim" = "2.30.0" in it.

Then I did :Rocks update. But "rocks.nvim" = "2.30.0" stayed there unchanged.

Then I did :Rocks sync as suggested by rocks.nvim, and rocks.nvim got reverted back to 2.30.0, and the bug reappeared.

I would expected that the version info in rocks.toml gets updated by :Rocks update.

@mrcjkb
Copy link
Member

mrcjkb commented Jun 14, 2024

Hey 👋

Are you able to reproduce this reliably? If so, could you please provide a :Rocks log?

I was not able to reproduce it on my end.
Edit: Nor in CI: #381

@champignoom
Copy link
Author

  • rm -rf ~/.local/share/nvim/rocks
  • cat ~/.config/nvim/rocks.toml
# ~/.config/nvim/rocks.toml
[rocks]
[plugins]
"rocks.nvim" = "2.30.0"
[plugins.nvim-treesitter]
git = "nvim-treesitter/nvim-treesitter"
  • nvim -u NORC -c "source https://raw.githubusercontent.com/nvim-neorocks/rocks.nvim/master/installer.lua"
  • nvim, then :Rocks update, it says "Nothing to update! (100%)"
  • cat ~/.local/share/nvim/rocks/rocks.log, showing nothing
  • cat ~/.config/nvim/rocks.toml, unchanged

@mrcjkb
Copy link
Member

mrcjkb commented Jun 14, 2024

🤔 I think I know what your issue is.

:Rocks update only updates rocks.toml entries for rocks that it actually updated.
Since you did a fresh install, but kept your existing rocks.toml, rocks.nvim was already up-to-date, so :Rocks update didn't update rocks.nvim, and therefore didn't update the rocks.toml entry.

To fix this, Rocks update should update every rocks.toml entry's version to the currently installed version, regardless of whether or not it actually updated the rock.

@mrcjkb mrcjkb changed the title :Rocks update doesn't update rocks.toml :Rocks update doesn't update rocks.toml entries of out-of-sync rocks that didn't get updated Jun 14, 2024
mrcjkb added a commit that referenced this issue Jun 14, 2024
Fixes #380.
If a rocks.toml entry was set to an older version than a rock
that is already up-to-date, then `:Rocks update` wouldn't update
it and the next `:Rocks sync` would downgrade the rock.
vhyrro pushed a commit that referenced this issue Jun 19, 2024
Fixes #380.
If a rocks.toml entry was set to an older version than a rock
that is already up-to-date, then `:Rocks update` wouldn't update
it and the next `:Rocks sync` would downgrade the rock.
vhyrro pushed a commit that referenced this issue Jun 19, 2024
Fixes #380.
If a rocks.toml entry was set to an older version than a rock
that is already up-to-date, then `:Rocks update` wouldn't update
it and the next `:Rocks sync` would downgrade the rock.
@mrcjkb mrcjkb closed this as completed in 56460c8 Jun 19, 2024
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

Successfully merging a pull request may close this issue.

2 participants