can't build lxml 3.0 with Python 3.3 on Mac OS X

Bug #1065139 reported by Colin McPhail
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Fix Released
Medium
scoder

Bug Description

Building lxml 3.0 using Python 3.3 (probably any Python 3 will fail) on Mac OS X 10.8 fails:

$ STATIC_DEPS=true pip install lxml==3.0
Downloading/unpacking lxml==3.0
  Running setup.py egg_info for package lxml
    Building lxml version 3.0.
    Latest version of libiconv is 1.14
    Using existing libiconv downloaded into libs/libiconv-1.14.tar.gz (delete this file if you want to re-download the package)
    Unpacking libiconv-1.14.tar.gz into build/tmp
    Latest version of libxml2 is 2.9.0
    Using existing libxml2 downloaded into libs/libxml2-2.9.0.tar.gz (delete this file if you want to re-download the package)
    Unpacking libxml2-2.9.0.tar.gz into build/tmp
    Latest version of libxslt is 1.1.27
    Using existing libxslt downloaded into libs/libxslt-1.1.27.tar.gz (delete this file if you want to re-download the package)
    Unpacking libxslt-1.1.27.tar.gz into build/tmp
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/var/folders/cl/7k35th017tn0v9t9rphhcskh0000gn/T/pip-build/lxml/setup.py", line 226, in <module>
        **setup_extra_options()
      File "/var/folders/cl/7k35th017tn0v9t9rphhcskh0000gn/T/pip-build/lxml/setup.py", line 139, in setup_extra_options
        STATIC_CFLAGS, STATIC_BINARIES)
      File "./setupinfo.py", line 57, in ext_modules
        multicore=OPTION_MULTICORE)
      File "./buildlibxml.py", line 298, in build_libxml2xslt
        if (xcode_version.startswith('Xcode') and
    TypeError: startswith first arg must be bytes or a tuple of bytes, not str

If I fix that problem and do a manual build I hit problem (2) described in bug#1056157.

Revision history for this message
scoder (scoder) wrote :

Could you send a pull request with your fix?

Revision history for this message
Colin McPhail (mcphail-colin) wrote :

Being a bit old-school I've not caught up with 'pull requests' yet. I've attached a patch file showing the two lines I added to buildlibxml.py.

Revision history for this message
scoder (scoder) wrote :

Thanks! I think we can just always decode it, even in Py2. I've pushed a fix.

https://github.com/lxml/lxml/commit/7827b0c10b0bf4722df84eb1c2d91c13a33565ff

Regarding pull requests, you can actually edit the file online on github (but you need an account for that).

Changed in lxml:
assignee: nobody → Stefan Behnel (scoder)
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
scoder (scoder) wrote :

Could you comment in ticket 1056157 ? Sadly, it describes two problems, so I can't tell which one you are referring two. The first one *should* be solved and the other one is trivial to work around.

Revision history for this message
Colin McPhail (mcphail-colin) wrote :

It was the problem in the libxml2-2.9.0 source that I was referring to. I worked around that but the build of libxml2-2.9.0 is still failing. Here is the end of the build log:

Making all in doc
Making all in .
make[3]: Nothing to be done for `all-am'.
Making all in devhelp
make[3]: *** No rule to make target `home.png', needed by `all-am'. Stop.
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 226, in <module>
    **setup_extra_options()
  File "setup.py", line 139, in setup_extra_options
    STATIC_CFLAGS, STATIC_BINARIES)
  File "/Users/colin/Python/lxml-3.0/setupinfo.py", line 57, in ext_modules
    multicore=OPTION_MULTICORE)
  File "/Users/colin/Python/lxml-3.0/buildlibxml.py", line 340, in build_libxml2xslt
    cmmi(libxml2_configure_cmd, libxml2_dir, multicore, **call_setup)
  File "/Users/colin/Python/lxml-3.0/buildlibxml.py", line 266, in cmmi
    cwd=build_dir, **call_setup)
  File "/Users/colin/Python/lxml-3.0/buildlibxml.py", line 249, in call_subprocess
    raise Exception('Command "%s" returned code %s' % (cmd_desc, returncode))
Exception: Command "make -j5" returned code 512

It looks like a file 'home.png' in the libxml2-2.9.0 documentation tree is missing.

This isn't lxml's problem so I am happy for this bug report to be marked fixed.

Revision history for this message
scoder (scoder) wrote :

Fix has been released in lxml 3.0.1.

Changed in lxml:
status: Fix Committed → Fix Released
scoder (scoder)
Changed in lxml:
milestone: none → 3.0
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.