ganto / copr-lxc3

RPM spec files for building lxc-3 on Fedora COPR
MIT License
8 stars 2 forks source link

lua-lxc fails to build on EPEL 7 with "possibly undefined macro: PKG_CHECK_VAR" #2

Closed ganto closed 6 years ago

ganto commented 6 years ago

The spec file for lua-lxc-3.0.0-0.1 from this repository fails to build in an EPEL 7 build root with the following message:

ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/lua-lxc.spec'], chrootPath='/var/lib/mock/742680-epel-7-x86_64-1524077113.699223/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'}shell=Falselogger=<mockbuild.trace_decorator.getLog object at 0x7f48a1197b70>timeout=0uid=1001gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=True)
Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '345a1a3fdf0241b99e3ac0905b04012c', '-D', '/var/lib/mock/742680-epel-7-x86_64-1524077113.699223/root', '-a', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;<mock-chroot>\\007"', '--setenv=PS1=<mock-chroot> \\s-\\v\\$ ', '--setenv=LANG=en_US.UTF-8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/lua-lxc.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'} and shell False
Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.S4OtUy
+ umask 022
+ cd /builddir/build/BUILD
+ cd /builddir/build/BUILD
+ rm -rf lua-lxc-3.0.0
+ /usr/bin/gzip -dc /builddir/build/SOURCES/lua-lxc-3.0.0.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd lua-lxc-3.0.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.iNusCj
+ umask 022
+ cd /builddir/build/BUILD
+ cd lua-lxc-3.0.0
+ ./autogen.sh
+ test -d autom4te.cache
+ libtoolize
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
+ aclocal -I config
+ autoheader
+ autoconf
BUILDSTDERR: configure.ac:61: error: possibly undefined macro: PKG_CHECK_VAR
BUILDSTDERR:       If this token and others are legitimate, please use m4_pattern_allow.
BUILDSTDERR:       See the Autoconf documentation.
+ exit 1
BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.iNusCj (%build)
RPM build errors:
BUILDSTDERR:     Bad exit status from /var/tmp/rpm-tmp.iNusCj (%build)
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/util.py", line 626, in do
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed: 
 # /usr/bin/systemd-nspawn -q -M 345a1a3fdf0241b99e3ac0905b04012c -D /var/lib/mock/742680-epel-7-x86_64-1524077113.699223/root -a --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=en_US.UTF-8 -u mockbuild bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/lua-lxc.spec

Still have to investigate if there is something missing or if this is a version issue.

ganto commented 6 years ago

On a Fedora system this macro is defined in /usr/share/aclocal/pkg.m4 which belongs to pkgconf-m4 (currently 1.3.12-2). On a CentOS 7 system, this file is owned by pkgconfig (currently 0.27.1-4.el7). The pkgconf source package on Fedora also builds the pkgconf-pkg-config RPM which provides pkgconfig-0.29.1-3.

A nice comment in the pkg.m4 file hints that PKG_CHECK_VAR was added to pkg-config in 0.28. This means the pkg-config version in CentOS 7 is too old for the current code.

When trying to skip the ./autogen.sh then ./configure would fail with a similar error:

[...]
checking for LUA... yes
checking Lua version... ./configure: line 12933: syntax error near unexpected token `LUA_VERSION,'
./configure: line 12933: `PKG_CHECK_VAR(LUA_VERSION, $LUAPKGCONFIG, V,,'
ganto commented 6 years ago

Issue is fixed with cd613abdde9efd19c8fe590607697a79759f5cd1 (patch submitted upstream, see lxc/lua-lxc#2).

lua-lxc-3.0.0-0.2 now available for CentOS 7.