lua detection can fail when --bindings="lua" is provided

Bug #702726 reported by Mike Auty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libbls
Fix Released
Undecided
Unassigned

Bug Description

Currently (revision 64) of libbls checks for lua using pkg-config as both lua5.1 and then also lua using the code below.

 opt_pkgs = [('lua5.1', 'lua')]
 for pkg, uselib in opt_pkgs:
  conf.check_cfg(package = pkg, uselib_store = uselib, args = '--cflags --libs',
    mandatory = 'lua' in Options.options.bindings)

When --bindings="lua" is *not* specified this works fine, however, when lua is in Options.options.bindings, it will require that both lua and lua5.1 be found by check_cfg since both are now mandatory, rather than either (as appears to be the case when the lua bindings are not requested). As such on a system with pkg-config lua, the search for lua5.1 will fail and because it is mandatory, the configure phase will fail even though lua is installed. I'm not sure how best to correct this. If you need any further information please let me know...

Related branches

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Hi Mike,

I am not sure I understand this. The code above just checks for the pkg-config package 'lua5.1' and stores its flags in the uselib variables *_lua. It doesn't check for both 'lua5.1' and 'lua'.

If you mean, however, that in some distributions the pkg-config file is lua.pc (instead of lua5.1.pc) then of course I need to find a way to support both of them.

Revision history for this message
Mike Auty (mike-auty) wrote :

Yep, sorry. Re-reading this, I'd thought that the tuple was iterated over, and so both lua5.1 and lua would be checked.

However, in at least one distribution (Gentoo), the pkg-config file is installed as lua.pc rather than lua5.1.pc, so this does still need fixing unfortunately.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Hi Mike,

the attached patch tries to detect all known pkg-config files for lua 5.1.

Can you please check if this patch solves the issue on your system?

Revision history for this message
Mike Auty (mike-auty) wrote :

It applies (to revision 70, not 71), but it fails to detect lua properly due to a typo. Currently the lua option has:

args = ['lua >= 5.1 lua <= 5.1.99', '--cflags --libs']

which causes pkg-config to think that "--cflags --libs" is a single option which it doesn't recognize.

args = ['lua >= 5.1 lua <= 5.1.99', '--cflags', '--libs']

appears to work fine, but I don't know the waf build system all that well to say that's the best way of solving the problem.

Changed in libbls:
status: New → Fix Committed
Changed in libbls:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.