[MacPorts] #50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error?
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? -----------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: doxygen -----------------------------+-------------------------------- {{{ :info:build [ 27%] Generating ../generated_src/ce_parse.h :info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/generated_src && /opt/local/bin/bison -l -d -p ce_parsexpYY /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/src/constexp.y -o ce_parse.c :info:build [ 28%] Generating /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/generated_src/resources.cpp :info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/src && /opt/local/bin/python /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/src/res2cc_cmd.py /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/templates /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/generated_src/resources.cpp :info:build File "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/src/res2cc_cmd.py", line 40 :info:build print("static const unsigned char %s_data[] = " % self.bareName,file=outputFile) :info:build ^ :info:build SyntaxError: invalid syntax :info:build make[2]: *** [generated_src/resources.cpp] Error 1 :info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10' :info:build make[1]: *** [src/CMakeFiles/_doxygen.dir/all] Error 2 :info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10' :info:build make: *** [all] Error 2 :info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10' :info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10" && /usr/bin/make -w all VERBOSE=ON :info:build Exit code: 2 :error:build org.macports.build for port doxygen returned: command execution failed }}} -- Ticket URL: <https://trac.macports.org/ticket/50342> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by cal@…): Probably needs a newer Python version, but I'd rather not add a python build dependency for everyone. Can you figure out which version of Python added this? -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Replying to [comment:1 cal@…]:
Probably needs a newer Python version, but I'd rather not add a python build dependency for everyone.
I have installed, to satisfy dependencies: {{{ python27 @2.7.11_0+ucs4 (active) python34 @3.4.4_0 (active) }}}
Can you figure out which version of Python added this?
No. I am merely a Python illiterate. I have no idea what's causing the fault why. -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by cal@…): The file does `from __future__ import print_function`, which enables this usage of print but only works with Python >= 2.6. Additionally, it specifies a shebang of `/usr/bin/python`, which is probably too old on your system. Replacing the shebang of `src/res2cc_cmd.py` with `#!/usr/bin/env python` would probably fix this if you had python 2.7 installed. I'm not planning to do this for all users as some people link their python interpreter to python 3.x, which could lead to problems. -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Replying to [comment:3 cal@…]:
The file does `from __future__ import print_function`, which enables this usage of print but only works with Python >= 2.6. Additionally, it specifies a shebang of `/usr/bin/python`, which is probably too old on your system. Replacing the shebang of `src/res2cc_cmd.py` with `#!/usr/bin/env python` would probably fix this if you had python 2.7 installed.
Applying that patch leads to another error: {{{ make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10' [ 26%] Generating /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/generated_src/resources.cpp cd /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/src && /opt/local/bin/python /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/src/res2cc_cmd.py /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/templates /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/generated_src/resources.cpp File "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_textproc_doxygen/doxygen/work/doxygen-1.8.10/src/res2cc_cmd.py", line 40 print("static const unsigned char %s_data[] = " % self.bareName,file=outputFile) ^ SyntaxError: invalid syntax }}} What finally helped building doxygen is changing the setting of `python` from {{{ Name Selected Options ==== ======== ======= clang none mp-clang-3.4 none cython cython27 cython27 none db none db48 none gcc apple-gcc42 apple-gcc42 gcc33 gcc40 mp-gcc48 mp-gcc49 mp-gcc5 none llvm none mp-llvm-3.3 mp-llvm-3.4 none nosetests none nosetests27 none python python25 python23-apple python25 python27 python34 none python2 python27 python23-apple python27 none python3 python34 python34 none }}} to {{{ python python27 python23-apple python25 python27 python34 none }}} -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by cal@…): So the correct fix would be to add a dependency on Python 2.7 and patch the shebang of the file, but only on platforms where this is necessary. Can you provide a patch that does this? -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Replying to [comment:5 cal@…]:
So the correct fix would be to add a dependency on Python 2.7 and patch the shebang of the file, but only on platforms where this is necessary.
Can you provide a patch that does this?
To improve my earlier report: I re-started with clean sources, i.e., after invoking `port clean doxygen`. So the only patch necessary is that of the Portfile. IMO it already contains that dependancy, on line #44, doesn't it? It's somehow necessary to make port invoke `port select --set python python27` or such. -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by cal@…): Ports cannot depend on a certain selection state of `port select`, we would consider that a bug, because the selection mechanism is for users only. Consequently, we cannot rely on `/usr/bin/env python` being our python after declaring a dependency on python27, and for this reason, we need the patch to the shebang explicitly uses our python. -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:7> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by donniet@…): Replying to [comment:7 cal@…]:
Ports cannot depend on a certain selection state of `port select`, we would consider that a bug, because the selection mechanism is for users only.
Consequently, we cannot rely on `/usr/bin/env python` being our python after declaring a dependency on python27, and for this reason, we need the patch to the shebang explicitly uses our python.
The only problem is that the CMakeCache.txt file points to the wrong version of Python. Python 2.7 does get installed as part of the Doxygen dependency resolution, but the CMakeCache.txt file still points to "/usr/bin/python", which is at version 2.5. Anyway, I attached the corrected CMakeCache.txt file, which I've verified as working on two different G5 PowerMacs. You're welcome! -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:8> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+-------------------------------- Comment (by cal@…): We need a unified diff of a change in the Portfile that fixes this. Since the variable is `PYTHON_EXECUTABLE`, you could probably do something along the lines of {{{ configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 }}} However, python 2.7 is not in the transitive dependency tree of cmake on my machine: {{{ $ port rdeps --index cmake The following ports are dependencies of cmake @3.4.3_0: curl lbzip2 pkgconfig libiconv gperf zlib xz gettext expat ncurses openssl curl-ca-bundle perl5 perl5.22 gdbm bzip2 libarchive libxml2 lzo2 }}} I'd like to keep it that way for all platforms where `/usr/bin/python` is sufficient. So you'll have to do this conditionally in a block that checks the version number: {{{ platform darwin { if {${os.major} <= 9} { configure.args-append ... depends_build-append port:python27 } } }}} where the version number still needs to be determined. -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:9> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+------------------- Reporter: Peter_Dyballa@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+------------------- Changes (by mcalhoun@…): * cc: css@… (removed) * owner: macports-tickets@… => css@… -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:11> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+------------------- Reporter: Peter_Dyballa@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+------------------- Comment (by mcalhoun@…): Does r149412 fix the problem? -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:12> MacPorts <https://www.macports.org/> Ports system for OS X
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+------------------- Reporter: Peter_Dyballa@… | Owner: css@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: doxygen | ------------------------------+------------------- Comment (by Peter_Dyballa@…): Replying to [comment:12 mcalhoun@…]:
Does r149412 fix the problem?
Yes the problem is fixed, doxygen built fine. -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:13> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#50342: doxygen @1.8.10_2 does not build on PPC Tiger, Mac OS X 10.4.11, because of Python code error? ------------------------------+-------------------- Reporter: Peter_Dyballa@… | Owner: css@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: doxygen | ------------------------------+-------------------- Changes (by cal@…): * status: new => closed * resolution: => fixed -- Ticket URL: <https://trac.macports.org/ticket/50342#comment:14> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
participants (1)
-
MacPorts