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

[Feature] git dependencies #329

Open
mrcjkb opened this issue Jan 12, 2025 · 3 comments
Open

[Feature] git dependencies #329

mrcjkb opened this issue Jan 12, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@mrcjkb
Copy link
Member

mrcjkb commented Jan 12, 2025

This would likely require us to create a luarocks build backend that is capable of handling it.

  • Should this be its own git_dependencies table?
  • Or a [dependencies].<foo>.git = github:owner/repo
  • Or something that allows to embed a rockspec:
dependency_rockspecs = {
[==[
package = "foo",
version = "1.0.0",
source.url = "bla",
build = {
  type = "builtin",
},
]==],
}

Even though it's more verbose, I'm leaning towards the third option, because it's very flexible (not limited to git dependencies) and we can already encode rockspecs in the lockfile.

@mrcjkb mrcjkb added the enhancement New feature or request label Jan 12, 2025
@vhyrro
Copy link
Contributor

vhyrro commented Jan 13, 2025

I guess my only gripe with all of these approaches is that they aren't compatible with the rockspec format. I see two possible approaches here:

  1. We disallow a rockspec with git dependencies to be uploaded to luarocks.org (cargo does this for crates.io)
  2. We instead opt for an adapter architecture (luarocks-build-git-adapter), which allows you to specify git dependencies in the build step, all while being able to specify a different build step that runs as a subcommand of sorts (e.g. build.type = "git-adapter" and build.subtype = "builtin").

@mrcjkb
Copy link
Member Author

mrcjkb commented Jan 13, 2025

Ah crap, luarocks doesn't support any off-spec fields. That means we'd have to change it to

build = {
  dependency_rockspecs = {
[==[
package = "foo",
version = "1.0.0",
source.url = "bla",
build = {
  type = "builtin",
},
]==],
  }
}

which is kind of ugly.
But with that, luarocks won't complain (even if the rockspec uses the builtin build backend).
It'll just ignore the off-spec fields.
So I don't think it would be strictly necessary to disallow uploading rockspecs with off-spec fields to luarocks.org.

@vhyrro
Copy link
Contributor

vhyrro commented Jan 14, 2025

I'm of the opinion that a given rock should provide the same output no matter what plugin manager consumes it. Doing off-spec fields is dangerous in this way because it becomes an anarchy of "this package manager can build this rockspec but this one can't". I think disallowing is safer (while still making the functionality cool).

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

No branches or pull requests

2 participants