buildtools/wafadmin/Tools/python.py currently calls the detected pythonX.Y-config through the detected $PYTHON interpreter. This assumes that pythonX.Y-config is actually a Python script, but it should just be called as an executable. Our Python maintainer, Matthias Klose, recently changed pythonX.Y-config to be a shell script to better support cross-building; he said that he will push for this to land in upstream Python as well. As a result of that, configuring fails with: --------------------- 8< ----------------- Checking for Python version >= 2.4.2 : ok 2.7.3 Checking for library python2.7 : yes Checking for program python2.7-config : "/usr/bin/python2.7-config" File "/usr/bin/python2.7-config", line 5 echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--configdir" ^ SyntaxError: invalid syntax Traceback (most recent call last): File "./buildtools/bin/waf", line 76, in <module> Scripting.prepare(t, cwd, VERSION, wafdir) File "/build/buildd/samba4-4.0.0~rc5+dfsg1/buildtools/wafadmin/Scripting.py", line 145, in prepare prepare_impl(t, cwd, ver, wafdir) File "/build/buildd/samba4-4.0.0~rc5+dfsg1/buildtools/wafadmin/Scripting.py", line 135, in prepare_impl main() File "/build/buildd/samba4-4.0.0~rc5+dfsg1/wscript", line 281, in main wildcard_main(wildcard_cmd) File "./buildtools/wafsamba/samba_wildcard.py", line 110, in wildcard_main fun(ctx) File "/build/buildd/samba4-4.0.0~rc5+dfsg1/buildtools/wafadmin/Scripting.py", line 241, in configure conf.sub_config(['']) File "/build/buildd/samba4-4.0.0~rc5+dfsg1/buildtools/wafadmin/Configure.py", line 237, in sub_config self.recurse(k, name='configure') File "/build/buildd/samba4-4.0.0~rc5+dfsg1/buildtools/wafadmin/Utils.py", line 634, in recurse f(self) File "/build/buildd/samba4-4.0.0~rc5+dfsg1/wscript", line 92, in configure conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True) File "./buildtools/wafsamba/samba_python.py", line 11, in SAMBA_CHECK_PYTHON_HEADERS conf.check_python_headers(mandatory) File "/build/buildd/samba4-4.0.0~rc5+dfsg1/buildtools/wafadmin/Tools/python.py", line 262, in check_python_headers for incstr in Utils.cmd_output("%s %s --includes" % (python, python_config)).strip().split(): File "/build/buildd/samba4-4.0.0~rc5+dfsg1/buildtools/wafadmin/Utils.py", line 455, in cmd_output raise ValueError(msg) ValueError: command execution failed: /usr/bin/python2.7 "/usr/bin/python2.7-config" --includes -> '' --------------------- 8< -----------------
Created attachment 8346 [details] Do not assume that python*-config is a Python script; just call it as an executable This patch drops the assumption of the -config script being a Python script, and just calls it as an executable. This should be more robust, and works: https://launchpad.net/ubuntu/+source/samba4/4.0.0~rc5+dfsg1-1ubuntu2 built on all architectures (you can click through the build logs if you are interested). Thanks for considering!
This change appears to be in master. Should we backport it to 4.0?
Created attachment 8500 [details] Patch for v4-0-test
Pushed to autobuild-v4-0-test.
Pushed to v4-0-test. Closing out bug report. Thanks!