Bug 73491

Summary: configure.ac searches for Python 3 version of libxml2 when /usr/bin/python is python3
Product: ITS Tool Reporter: Michael Catanzaro <mcatanzaro>
Component: generalAssignee: Shaun McCance <shaunm>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: bugs, dmacks, jjardon, marc.planolesay, mcatanzaro
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Use $PYTHON instead of python in configure.ac

Description Michael Catanzaro 2014-01-11 06:09:01 UTC
Created attachment 91848 [details]
Use $PYTHON instead of python in configure.ac

I can't build itstool on Arch Linux because configure.ac is using python3 to search for libxml2 (on line 17; /usr/bin/python is a symlink to /usr/bin/python3 on Arch Linux). I think it should instead use $PYTHON, which is set by AM_PATH_PYTHON a couple lines above. Arch and Gentoo users can then build by setting $PYTHON=/usr/bin/python2 when calling configure.

This is basically a follow-up to https://gitorious.org/itstool/itstool/commit/1cce05f8c3d2b52f030b3e253d37ae5a6eee8003
Comment 1 Kerrick Staley 2014-01-16 03:32:59 UTC
This is fixed by https://gitorious.org/itstool/itstool/merge_requests/6

None of the itstool maintainers have acted on that merge request yet.
Comment 2 Michael Catanzaro 2014-01-16 05:16:22 UTC
(In reply to comment #1)
> This is fixed by https://gitorious.org/itstool/itstool/merge_requests/6
> 
> None of the itstool maintainers have acted on that merge request yet.

OK. That merge request is clearly superior to my patch, since it fixes the tests as well.
Comment 3 Daniel Macks 2014-02-17 15:10:34 UTC
That fix appears to hardcode "python2", which means using its first occurrence in $PATH. But darwin doesn't appear to have python2 (just more specific python2.X). And it still doesn't respect the $PYTHON autoconf result (I may not want the "first in $PATH" and I may have some arbitrary other specially named interp to use).
Comment 4 Daniel Macks 2014-02-17 15:12:29 UTC
My "that fix" in Comment #3 is talking about the upstream https://gitorious.org/itstool/itstool/merge_requests/6/diffs whereas the patch proposed my Michael here correctly uses $PYTHON at least in the autoconf test for the libxml2 python module.
Comment 5 Michael Catanzaro 2014-07-25 01:48:00 UTC
*** Bug 58223 has been marked as a duplicate of this bug. ***
Comment 6 Michael Catanzaro 2014-07-25 02:44:28 UTC
FYI, I've added this patch to GNOME jhbuild.
Comment 7 Kerrick Staley 2014-07-29 16:00:12 UTC
It seems that itstool doesn't run autoconf during the build, so the fix in 
"configure.ac" never actually makes it into "configure". Michael, could you update your patch to also fix "configure"?
Comment 8 Michael Catanzaro 2014-08-03 15:00:32 UTC
(In reply to comment #7)
> It seems that itstool doesn't run autoconf during the build, so the fix in 
> "configure.ac" never actually makes it into "configure". Michael, could you
> update your patch to also fix "configure"?

I've fixed this in GNOME jhbuild (please do test). It's not relevant to upstream since the configure script is correctly unversioned.
Comment 9 Kerrick Staley 2014-08-03 19:26:04 UTC
It worked! Now, when I Ctrl+C the itstool build and choose '[6] Go to phase "wipe directory and start over"', it runs autoreconf -fi after patching, and builds successfully.

Going to leave this open since I think it should be patched upstream. But thanks for the jhbuild fix :)
Comment 10 tingping 2015-05-18 15:14:59 UTC
@(In reply to Michael Catanzaro from comment #8)
> (In reply to comment #7)
> > It seems that itstool doesn't run autoconf during the build, so the fix in 
> > "configure.ac" never actually makes it into "configure". Michael, could you
> > update your patch to also fix "configure"?
> 
> I've fixed this in GNOME jhbuild (please do test). It's not relevant to
> upstream since the configure script is correctly unversioned.

It still only runs ./configure which means the patch is never used.. I am not sure what comment 9 is talking about as that doesn't work here, but that should not be necessary anyway.
Comment 11 Michael Catanzaro 2015-05-18 15:42:52 UTC
(In reply to tingping from comment #10)
> It still only runs ./configure which means the patch is never used.. I am
> not sure what comment 9 is talking about as that doesn't work here, but that
> should not be necessary anyway.

Unless there has been some regression in jhbuild, it should still work. I have forced it to run autoreconf before configure the first time the code is checked out:

<autotools id="itstool" autogen-sh="autoreconf">
Comment 12 Damien Grassart 2015-10-17 10:00:36 UTC
I'm running jhbuild on Arch Linux as well but since the argument passed to AM_PATH_PYTHON only specifies a minimum version, it's returning Python 3.5 on my system.

While jhbuild configures itstool, I see:

checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 3.5
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.5/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.5/site-packages
checking for python module libxml2... not found
configure: error: Python module libxml2 is needed to run this package


I can get around it by dropping to the shell and passing PYTHON=/usr/bin/python2 to configure but it seems you got it working without needing to do that?

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.