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

Platform version overrides #148

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

whoopdedo
Copy link

Platform names can include version information. The platform string is treated as a dependency string.

Internally, LuaRocks maintains a list of generic platform types, and an additional canonical name for the current system. The function luarocks.cfg.is_platform will compare a string with the generic types regardless of system version. The function luarocks.deps.match_platform compares a string to the generic and canonical names with version numbers.

The version of a system is determined with uname -r on Unix-like platforms, and VER on Windows. It is set as the variable LUAROCKS_UNAME_R in the site config upon installation.

TODO: Possible use an external program to read the WIndows version because VER may not be reliable. The Windows build should set a variable WINVER that can be optionally used by rockspecs to set a compiler macro.

Platform strings used in override tables or the supported_platform list
is a dependency string. The deps.match_platform function will compare
this string to the detected platform and system name. The old
cfg.is_platform function matches only plain strings against built-in
platform names (like it always has).
@hishamhm
Copy link
Member

This looks good, but creates an incompatibility in the rockspec format. But it definitely sounds like something to be added in the next major version of LuaRocks. So let's keep this patch on hold for a while and add it later.

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

Successfully merging this pull request may close these issues.

None yet

4 participants