feat: lockfile support
Closes #34.
The documentation says luarocks will use a lockfile if there is one in the cwd. But I haven't confirmed this yet.
This needs some vigorous testing.
How it works
Adding/updating/removing rocks:
- We add a
--pinflag to theinstallcommand - luarocks creates a luarocks.lock file in the rock's install tree (for all transitive dependencies of the installed rock)
- We add the path to the rtp
- We load the lockfile and use it to update our rocks-lock.toml
Syncing rocks:
- We get the locked dependencies from our rocks-lock.toml
- We use those to create a luarocks.lock in a temp directory
- We set the
cwdto the location of the lock file for anyinstallcommands
Review Checklist
Does this PR follow the Contribution Guidelines? Following is a partial checklist:
Proper conventional commit scoping:
-
For example, fix(installer): some installer bugfix
-
[x] Pull request title has the appropriate conventional commit prefix.
If applicable:
- [x] Tested
- [x] Tests have been added.
- [x] Tested manually (steps in PR description).
- [x] Updated documentation.
:thinking: maybe we should just call the file rocks.lock instead of rocks-lock.toml.
I just can't get the test cases to succeed (╯°□°)╯︵ ┻━┻
It looks like it could be something to do with the neovim scheduler? Not sure how to get busted working with that.
~This PR is pretty much ready. But I would like to merge #245 first.~
Todo:
- [x] Update the new
sync_spec.luato install a package that has a locked dependency, and confirm that the locked dependency is indeed installed.
Looks like luarocks is ignoring the luarocks.lock file in the install cwd.
Blocked by https://github.com/luarocks/luarocks/issues/1662
Looks like https://github.com/luarocks/luarocks/issues/1662 has been fixed, so this is now unblocked
Looks like luarocks/luarocks#1662 has been fixed, so this is now unblocked
We're going to have to wait for luarocks 3.11.1 to land in nixpkgs.
Well... it looks like luarocks 3.11.1 is still not picking up the lockfile when installing :disappointed:
- https://github.com/luarocks/luarocks/pull/1693