Proposal: rockspec v4 specs #1729
Replies: 2 comments 2 replies
-
To add to this: It would be nice if luarocks supported something like this: git_dependencies = {
"github:<owner>/<repo>"
"gitlab:<owner>/<repo>?ref=<branch-or-tag-name>&rev=<commit-sha>"
} If there is a n scm-rockspec in the project root, that could be used to build. Otherwise, default to the This would allow luarocks projects to depend on lua libraries without uploading a rockspec to the root manifest (which some authors may be reluctant to do). |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
- 8053
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, hope you're doing well!
I've been working with luarocks for a while now and I must say that my overall experience has been very pleasant, thanks for taking on the project! However, I have found some discrepancies and other things I would like to see in the rockspec format.
Separate concerns
Currently, the
description
table mixes general metadata (likelicense
,homepage
andmaintainer
) with the actual description of the package. This can be confusing, and thus I propose either separating this information into a dedicatedmetadata
table or renaming the existing table tometadata
.Add additional metadata fields
Adding fields for
README
andCHANGELOG
paths would be extremely helpful for automated tooling and documentation generation. This could also benefit the luarocks site, allowing it to display more information about the rocks, for example a README file instead of a simple description.Add development dependencies
After a very long time programming, I miss dependencies that are exclusively for the purpose of being used during development. It's crucial to distinguish between runtime dependencies and dependencies needed only for development (linting, building, etc.), for example I don't want users of my libraries to have to install tools like luacheck if it's not really necessary for the library to work. Something like an extra table called
dev_dependencies
which follows exactly the same syntax asdependencies
could be ideal.Add opt-in dependencies support
This one is pretty much inspired by languages like Rust, where its package manager
cargo
has "features
" which enables certain capabilities in the libraries/binaries and thus decides which dependencies to download based on the specific functionalities desired by the users installing them. This could significantly reduce the overall size of the installed rocks as well.Here is a dummy example of what I'm looking for:
Users could then install the rock with a specific feature using a command like
luarocks install --with-features=json my-package
. If multiple features are desired, a comma could be used to separate them and make it easy to parse the command flag option.I believe these changes would greatly improve the rockspec format and the overall LuaRocks ecosystem. I'm open to feedback and further discussion.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions