-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
lua 5.3.4, rename from lua@5.3 and lua@5.1: add unversioned pkg-config file #21300
Conversation
Formula/lua.rb
Outdated
resource "luarocks" do | ||
url "https://luarocks.github.io/luarocks/releases/luarocks-2.4.3.tar.gz" | ||
sha256 "4d414d32fed5bb121c72d3ff1280b7f2dc9027a9bc012e41dfbffd5b519b362e" | ||
url "https://keplerproject.github.io/luarocks/releases/luarocks-2.3.0.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't need downgrading if you keep the executable of the lua
formula as lua
and version the others.
Will look this over when I'm not cooking, but I'd be a little surprised if this doesn't break a small horde of formulae. Ecosystem support for 5.3 is somehow lagging behind a touch, despite 5.3 not being an especially new major release at this point. |
@DomT4 yeah, @fxcoudert asked why we hadn't done this yet so I figured I'd see where we stand. |
One question is how viable |
A pretty long temporary strategy I'd bet 🙈. To be honest one of my big reluctances on this is screwing Travis up for people who use You might get a "truer" CI result here with |
Yeah. This is in the brainless stage right now. |
maybe should go keg_only on the versioned ones … |
It has been discussed before. I pretty consistently argue against it, at least whilst things like |
You're aware |
Yeah, but then you end up with only one Lua linked at once still, and I'm not the heaviest user of |
@DomT4 PR refreshed. |
@DomT4 so one option available here is to build with compatibility |
Ditto LUA_COMPAT_5_1 which then also defines LUA_COMPAT_MODULE amongst other things. MacPorts is using this: https://github.com/macports/macports-ports/blob/master/lang/lua/files/patch-src-Makefile.diff#L8 So that explains why they're able to use 5.3 with things that would otherwise be 5.3 incompatible. |
Apologies, came back from the gym last night & was exhausted, so didn't reappear as planned.
Yeah. I don't have a huge problem with this other than having concerns about facilitating an ecosystem that is already slooooooooooooooooooow to move on feeling like there's even less importance to updating their codebases to support the latest & greatest major version of Lua, but if MacPorts is already doing it I guess we might as well concede that ship has sailed and see if we can use it as an avenue to update. |
|
||
resources.each do |r| | ||
r.stage do | ||
system "luarocks", "build", r.name, "--tree=#{luapath}" | ||
end | ||
end | ||
|
||
# Ensures it uses the intended Lua (5.2) rather than 5.1/5.3 or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this double checked locally on a system that has multiple versions of Lua installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(CMake being CMake has the tendency to do whatever the hell it likes, even when passed direct variables in some cases, because life is fun 🙃)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.
Formula/lua.rb
Outdated
|
||
# This resource must be handled after the main install, since there's a lua dep. | ||
# Keeping it in install rather than postinstall means we can bottle. | ||
if build.with? "luarocks" | ||
resource("luarocks").stage do | ||
ENV.prepend_path "PATH", bin | ||
lua_prefix = prefix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honestly not sure why I added this in the first place given it was only used once, as far as I can see 😓.
Formula/lua.rb
Outdated
(pkgshare/"5.2/luarocks").install_symlink Dir["#{libexec}/share/lua/5.2/luarocks/*"] | ||
bin.install_symlink libexec/"bin/luarocks-5.2" | ||
bin.install_symlink libexec/"bin/luarocks-admin-5.2" | ||
(share/"lua/5.3/luarocks").install_symlink Dir["#{libexec}/share/lua/5.3/luarocks/*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can go back to being pkgshare
.
Formula/lua.rb
Outdated
Requires: | ||
Libs: -L${libdir} -llua -lm | ||
Libs: -L${libdir} -llua.5.3 -lm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably fine remaining as -llua -lm
here.
Formula/lua.rb
Outdated
Cflags: -I${includedir} | ||
EOS | ||
end | ||
|
||
def caveats; <<~EOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caveat is still relevant but the same thing happens with python
and python3
and we don't warn about it so I don't have strong feelings 🤷♂️.
Formula/lua.rb
Outdated
test do | ||
system "#{bin}/lua", "-e", "print ('Ducks are cool')" | ||
system "#{bin}/lua-5.3", "-e", "print ('Ducks are cool')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, keep this as lua
since that's what the actual executable is called. We just install the symlink for compatibility mostly.
Formula/lua@5.2.rb
Outdated
system "make", "build" | ||
system "make", "install" | ||
|
||
(pkgshare/"5.2/luarocks").install_symlink Dir["#{libexec}/share/lua/5.2/luarocks/*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one will need to however be changed back to (share/"lua/5.2/luarocks")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does anything actually break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From memory, yes, but I can look into it properly at some point later probably.
Formula/lua@5.2.rb
Outdated
EOS | ||
end | ||
|
||
def caveats; <<~EOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably decide what to do with these caveats and then harmomise it across all the Lua versions.
I think MacPorts is the odd one out in terms of what other package managers have done here. |
One reason in favor of building with |
Will look this over again/etc after class today. Things are a bit hectic this week as there's an alarmingly large exam on Friday 🙈. |
I'm thinking maybe no 5.2 formula since presumably 5.3's 5.2 compat should cover that case regardless of whether we also build it with 5.1 compat. |
Agreed. If you're leaning towards having 5.2 compatibility on, at least for now, it would make sense to not have a |
Off-topic but there's a new |
and use upstream's vendored lua
@DomT4 PR refreshed. |
@BrewTestBot test this please |
Yes, given they can't always be expressed as renames that makes sense to me. |
@BrewAudit you're just going to have to learn to live with it. |
Thanks for pushing this through @ilovezfs. Appreciate the help on the |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?CC @DomT4