Opened 16 years ago

Closed 16 years ago

Last modified 9 years ago

#18066 closed defect (fixed)

pyrex hardcodes MACOSX_DEPLOYMENT_TARGET to 10.3

Reported by: harry@… Owned by: skymoo (Adam Mercer)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc:
Port: py-pyrex

Description (last modified by raimue (Rainer Müller))

In Mac/DarwinSystem.py there's a line that does this:

os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.3"

Which cases builds on Leopard to fail like this:

distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure

Change History (12)

comment:1 Changed 16 years ago by skymoo (Adam Mercer)

I maintain the py25-pyrex port and that builds fine for me on Leopard. Can you attach the complete build log i.e.:

$ sudo port -d install py-pyrex &> py-pyrex.log 

comment:2 Changed 16 years ago by harry@…

Oops, I meant to say that other ports using pyrex fail to build. I'm trying to install py-glewpy, which has a dependency on python2.4. The error is:

Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-glewpy/work/glewpy-0.7.4" && /opt/local/bin/python2.4 setup.py build " returned error 1
Command output: Traceback (most recent call last):
  File "setup.py", line 43, in ?
    cmdclass = {'build_ext': build_ext}
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/core.py", line 123, in setup
    dist.parse_config_files()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py", line 339, in parse_config_files
    filenames = self.find_config_files()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py", line 302, in find_config_files
    check_environ()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/util.py", line 209, in check_environ
    os.environ['PLAT'] = get_platform()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/util.py", line 78, in get_platform
    cfgvars = get_config_vars()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/sysconfig.py", line 488, in get_config_vars
    func()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/sysconfig.py", line 373, in _init_posix
    raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure

IIRC the import of pyrex sets MACOSX_DEPLOYMENT_TARGET to 10.3 regardless of the actual OS version.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 in reply to:  2 ; Changed 16 years ago by skymoo (Adam Mercer)

Replying to harry@…:

IIRC the import of pyrex sets MACOSX_DEPLOYMENT_TARGET to 10.3 regardless of the actual OS version.

It does although it appears that theres something deeper going on here. I changed line 22 of ${prefix}/lib/python2.4/site-packages/Pyrex/Mac/DarwinSystem.py to set the deployment target to 10.5, i.e.:

os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.5"

however doing that py-glewpy fails to build with:

pyrexc src/glew.pyx --> src/glew.c
/opt/local/var/macports/build/_Users_ram_opt_macports_python_py-glewpy/work/glewpy-0.7.4/src/glew.pyx:32:25: Cannot convert 'src.glew.GLbyte *' to Python object
/opt/local/var/macports/build/_Users_ram_opt_macports_python_py-glewpy/work/glewpy-0.7.4/src/glew.pyx:38:30: Cannot convert 'src.glew.GLbyte *' to Python object
building 'glew' extension
/usr/bin/gcc-4.0 -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -fno-common -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c src/glew.c -o build/temp.macosx-10.5-i386-2.4/src/glew.o
src/glew.c:1:2: error: #error Do not use this file, it is the result of a failed Pyrex compilation.
error: command '/usr/bin/gcc-4.0' failed with exit status 1

so it looks like theres something wrong with pyrex, what however I have no idea.

comment:4 Changed 16 years ago by skymoo (Adam Mercer)

I'm enquiring with upstream.

comment:5 Changed 16 years ago by skymoo (Adam Mercer)

Owner: changed from macports-tickets@… to ram@…
Status: newassigned

comment:6 in reply to:  3 Changed 16 years ago by harry@…

Replying to ram@…:

It does although it appears that theres something deeper going on here.

Yeah, that's what I saw too. The pyrex + glewpy problem has been reported by Linux users as well (http://bugs.gentoo.org/show_bug.cgi?id=198330) and I'm not sure if the bug ultimately lies with pyrex or glewpy. But this MACOSX_DEPLOYMENT_TARGET thing is the more immediate challenge. Baby steps... :)

comment:7 Changed 16 years ago by blb@…

Note that the python ports record the value of MACOSX_DEPLOYMENT_TARGET (${prefix}/Library/Frameworks/Python.framework/Versions/2.*/lib/python2.*/config/Makefile). Combine that with the fact that MacPorts 1.6 didn't set MDT but 1.7 explicitly does, and that could be the cause for the issue.

comment:8 in reply to:  4 ; Changed 16 years ago by skymoo (Adam Mercer)

Replying to ram@…:

I'm enquiring with upstream.

It appears that glewpy is no longer under development, it hasn;t been touched in nearly three years and the mailing lists have been shutdown, so I don't think this issue can be resolved with glewpy. I was advised to use PyOpenGL in place on glewpy on the Pyrex mailing list

I've updated py-pyrex to the latest version and I no longer get the deployment target issue.

comment:9 in reply to:  8 Changed 16 years ago by harry@…

Replying to ram@…:

It appears that glewpy is no longer under development, it hasn;t been touched in nearly three years and the mailing lists have been shutdown, so I don't think this issue can be resolved with glewpy. I was advised to use PyOpenGL in place on glewpy on the Pyrex mailing list

I've updated py-pyrex to the latest version and I no longer get the deployment target issue.

Too bad about glewpy... Thanks for looking into it and for updating py-pyrex.

comment:10 Changed 16 years ago by skymoo (Adam Mercer)

Resolution: fixed
Status: assignedclosed

Finally heard form upstream on this issue, as of 0.9.8.5 (which is the current version in MacPorts) the deployment target should not be set under normal circumstances. So I'm closing this ticket. If you experience similar problems again please reopen.

comment:11 Changed 16 years ago by raimue (Rainer Müller)

Description: modified (diff)

comment:12 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.