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

What is the correct way to use luarocks? #406

Closed
wushu037 opened this issue Aug 5, 2023 · 2 comments
Closed

What is the correct way to use luarocks? #406

wushu037 opened this issue Aug 5, 2023 · 2 comments

Comments

@wushu037
Copy link

wushu037 commented Aug 5, 2023

I'm having two problems

  1. some modules are downloaded with names that don't match the names used by require. E.g. luarocks install luasocket -> require("socket")
  2. does luarocks offer the ability to manage multiple versions of a module? I didn't find a description.

This can be difficult when doing collaborative development and long term development. So:

  1. do I need to add a file to the project that describes which modules are used in the project?
  2. Since there is no version management, it is possible that everyone in the team installs a different version of the module at a different time, so should I put the module in the project directory?

I need to hear from the luarocks team.

@catwell
Copy link
Member

catwell commented Aug 6, 2023

I am unsure why you are opening this issue on luasocket, but:

  • Yes sometimes modules have a different name that the rock, this is often the case with other languages as well.
  • LuaRocks allows a single version of a module for a given project but you can have different sets of rocks in different projects. LuaRocks natively supports different rocks trees, but personally I use a completely separate environment with its own Lua and LuaRocks using this script I wrote.

To have a specific set of versions for a project across a team, you can create a rockspec and install with --only-deps

@alerque alerque closed this as completed Aug 12, 2023
@wushu037
Copy link
Author

@catwell Sorry, I asked in the wrong place. But thank you for your answer.

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

No branches or pull requests

3 participants