Page MenuHomeFreeBSD

Change version selection logic in Mk/Uses/lua.mk
ClosedPublic

Authored by andrew_tao173.riddles.org.uk on Apr 18 2020, 11:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 5 2024, 10:31 PM
Unknown Object (File)
Oct 2 2024, 11:42 PM
Unknown Object (File)
Oct 2 2024, 11:16 PM
Unknown Object (File)
Oct 2 2024, 6:08 PM
Unknown Object (File)
Oct 2 2024, 4:14 PM
Unknown Object (File)
Oct 2 2024, 11:07 AM
Unknown Object (File)
Oct 1 2024, 11:12 AM
Unknown Object (File)
Oct 1 2024, 1:10 AM

Details

Summary

Per discussion on D14709, this patch implements Antoine's suggested "closest version" logic in place of the previous "highest version" when the default version is not in the range allowed by the port.

Test Plan

Tested standalone using make -v '...' to display variables with a range of inputs for USES and DEFAULT_VERSIONS, all output correct.

Tested in-situ by testport'ing a sample of lua ports with varying default versions, all builds worked as expected.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Lua 5.4.0 is planned for release next week, it would be nice to have this resolved sometime reasonably soon.

Lua 5.4.0 is now released, so this is now a blocking issue for the lua54 port.

Mk/Uses/lua.mk
35 ↗(On Diff #70755)

Can you explain how a tie can happen?

Mk/Uses/lua.mk
35 ↗(On Diff #70755)

USES=lua:51,53 with 5.2 as the default version.

Mk/Uses/lua.mk
35 ↗(On Diff #70755)

Is this an actually existing case, or is this purely academic?

Mk/Uses/lua.mk
35 ↗(On Diff #70755)

I don't believe any existing port does it, but I do myself have some code (which I do eventually hope to make a port for) that works only with 5.1 or 5.3. This is because the 5.1 compatibility is there only to support luajit, whereas there is no good reason to support 5.2 if 5.3 is available.

Mk/Uses/lua.mk
35 ↗(On Diff #70755)

Ok, so, this is code to handle an edge case that does not exist in the ports tree. I don't really like to add code to support non existing cases.

I don't know Lua, but looking at their website, Lua 5.1 has been dead 8 years, Lua 5.2 has been dead 5, and Lua 5.3 has been dead 2, maybe it is time to remove 5.1 and 5.2... And plan to remove 5.3 in the next year or so.

adamw added inline comments.
Mk/Uses/lua.mk
35 ↗(On Diff #70755)

You can always put it in as a comment for if it does happen in the future.

Mk/Uses/lua.mk
35 ↗(On Diff #70755)

Why, though? It wouldn't change the code in any useful way.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 24 2020, 4:39 AM
This revision was automatically updated to reflect the committed changes.