-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fix lua configure detection #71
Conversation
We introduce a new configure switch called --with-lua-impl=, which is used to store user defined and yet supported lua implementation to use. If the parameter is not specified, lua support is not built in. For package maintainers this is a breaking fix, as it changes the previous --with-lua-suffix, so watch out. The previous implementation did not work on my system, no matter what I tried, thus the detection and configuration is now handled via PKG_HAVE_DEFINE_WITH_MODULES, which seems to work fine for the various implementations, tested with luajit, lua5.1 and lua5.4.
My ubuntu 20.04 system chokes when I run autogen.sh
This is with pkg.m4 provided by |
Also, is there a way we can do this without the "breaking fix"? Edit: actually, maybe a good thing to do here would be for you to open an issue first, and dump in your relevant info. |
Here is the problem, we do not use pkg-config in this project, we already depend on pkgconf, see: It's in the readme ;-) I've compiled this project just fine on Ubuntu 20 using pkgconf, as per the readme. To make this a non-breaking change, we can rename --with-lua-impl to --with-lua-suffix, as long as the current --with-lua-suffix can be one of: |
I think it will actually work with either, prior to this PR, which is sort of nice since you actually have to replace the default |
pkgconf has become the default tool for various distributions in the last few years, GNU/Gentoo Linux including. Unfortunately, the macro from this PR relies on the version of pkg.m4 that is only shipped with pkgconf and does not exist in the one from pkg-config... |
If PKG_HAVE_DEFINE_WITH_MODULES is not defined, fail early and print more user friendly message. Introduce dependency on pkgconf instead of pkg-config package.
Hello Jim, If the previous lua check (--with-lua-suffix) accepts the same set of parameters as the new --with-lua-impl, we can rename it to what it used to be to preserve the switch name. Also, I've added 'set -e' at the start of autogen.sh so that it fails when a command exits abnormally, instead of running the rest when it actually should not. |
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.
Could you try going back to master and updating config/ax_lua.m4 to the latest version from savannah:
http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_lua.m4
Docs are here:
https://www.gnu.org/software/autoconf-archive/ax_lua.html
Then apply this diff to configure.ac
diff --git a/configure.ac b/configure.ac
index 1cb8579..ca27393 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,8 +68,8 @@ X_AC_CURSES
X_AC_CHECK_COND_LIB(munge, munge_ctx_create)
X_AC_CHECK_COND_LIB(cap, cap_get_proc)
X_AC_TCMALLOC
+AX_PROG_LUA([5.1],[5.5])
AX_LUA_HEADERS
-AX_LUA_HEADERS(501)
AX_LUA_LIBS
X_AC_RDMATRANS
If you just run configure with no options, does it find your lua package?
I found we had a very old one that no longer works on modern distros. Other projects I work on had had updated around 2017(!) but diod just silently disables config file support (and tests for it) when lua is not available so we didn't notice in CI (a matter for another pr).
If this works, I prefer it because on most systems it just works without options. If not, let's spend a bit of time trying to figure out why.
If no lua implementation is provided, my change will disable lua support, and I consider it as designed. I believe lua should be included only if the user has explicitly decided to include it by providing the required implementation, jit|5.1|5.4 etc. I understand your view point regarding backwards compatibility, but I'd rather not go back to including updated ax_lua.m4 in the project. Most likely, if you do that, you will end up in the same situation in a few years from now. Switching to pkgconf in 'master' is the way to go, if you ask me. In this way you remove the dependency of maintaining automake scripts in your project, but let pkgconf do it for you. I do not believe pkg-config comes in by default on a new deployment of any distribution and master is all about up-to-date code. On top of my head, Redhat 8, Fedora, Arch and Gentoo Linux have all switched to pkgconf years ago so this change should not be causing any problems on any of those. People running outdated releases of non-rolling-update distros could manually install pkgconf which will replace their pkg-config or just use diod release that has not yet switched to pkgconf. Feel free to close this PR without merging it if you insist on sticking to pkg-config for the project in the future. |
I want to go with the other solution, but let's make sure it fixes your specific problem. |
Closing this one. Sorry we didn't argree. |
We introduce a new configure switch called --with-lua-impl=,
which is used to store user defined and yet supported lua
implementation to use. If the parameter is not specified,
lua support is not built in.
For package maintainers this is a breaking fix, as it
changes the previous --with-lua-suffix, so watch out.
The previous implementation did not work on my system, no
matter what I tried, thus the detection and configuration
is now handled via PKG_HAVE_DEFINE_WITH_MODULES, which
seems to work fine for the various implementations, tested
with luajit, lua5.1 and lua5.4.