[MacPorts] #18090: python25 broken after [37817]
#18090: python25 broken after [37817] ---------------------------------------------------------------------------+ Reporter: rasmus@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python, python25, python2.5, dlopen, environ, patch, portfile | Port: ---------------------------------------------------------------------------+ The merge [37817] broke python25 in the way that the patchfile patch-Misc- setuid-prog.c.diff was no longer used. This patch is critical since it provides the notorious environ-fix. This patch essentially defines environ, which is not present on OS X. Without this patch, machine-native extensions referring to environ will not load. I.e. you will get this: {{{ #!python import _nativemodule Traceback... ... ImportError: dlopen(/opt/local...): Symbol not found: _environ }}} The required patch is here: [browser:trunk/dports/lang/python25/files /patch-Misc-setuid-prog.c.diff@45618] -- Ticket URL: <http://trac.macports.org/ticket/18090> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] ---------------------------------------------------------------------------+ Reporter: rasmus@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python, python25, python2.5, dlopen, environ, patch, portfile | Port: ---------------------------------------------------------------------------+ Comment(by rasmus@…): I have also tested this with latest python26 – same problem here. The machine I've tested this and the problem mentioned in the ticket itself:[[BR]] {{{Darwin hostname 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386}}} -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] ---------------------------------------------------------------------------+ Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python, python25, python2.5, dlopen, environ, patch, portfile | Port: ---------------------------------------------------------------------------+ Changes (by ram@…): * cc: rasmus@… (removed) * cc: ram@… (added) * owner: macports-tickets@… => mww@… Comment: Assigning to maintainer, reporter is automatically CC'd -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Changes (by blb@…): * cc: blb@… (added) * keywords: python, python25, python2.5, dlopen, environ, patch, portfile => python dlopen environ patch portfile * port: => python25 python26 Comment: Where is this _nativemodule supposed to come from? I don't see any reference to it at all in the python 2.5.4 source tree. -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Comment(by rasmus@…): It's a fictive scenario. The real case is that I try to import smisk (http://trac.hunch.se/smisk) which is linked against libfcgi. libfcgi uses environ, but Python 2.5.4 (current in macports) does not provide environ (because of the missing patch), thus I receive the error in the aforementioned fictive scenario. I have tested different modules using environ and having 2:nd level libraries using environ and have deduced the error as the missing patch through trail and error. Loading these libraries works with the Python 2.5.2 from ports (built with the environ- patch). -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Comment(by rasmus@…): Clarification: The libfci triggering the error is a clean macport (port: www/fcgi) -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Changes (by blb@…): * cc: mcalhoun@… (added) Comment: Did you try it with that patch reinstated? I still get the same failure with it (not to mention it appears that Misc/setuid-prog.c isn't actually used by python). However, in Modules/posicmodule.c, environ is declared static, but when I remove the static portion, smisk appears to work fine. -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Comment(by rasmus@…): I did not try to apply the patch manually. Only to build the previous port ([browser:trunk/dports/lang/python25/@45618]) Sounds weird that environ was declared static in Modules/posixmodule.c – what Python does here is creating a temporary solution for that object file. Now the question is: Should Python provide the environ symbol or should any library needing it do as python-2.5.4/Modules/posixmodule.c and provide their own solution? I guess the latter would be the prettiest, but dunno how many ports will need to be patched. (www/fcgi will definitely be one of them) Will investigate further later today. -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Comment(by rasmus@…): BTW, seems like someone called afb@ (is this Anders F. Björklund?!) have been working with the Portfile. Maybe he/she could be CCed as well? -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Comment(by ram@…): Replying to [comment:7 blb@…]:
However, in Modules/posicmodule.c, environ is declared static, but when I remove the static portion, smisk appears to work fine.
I can also confirm that the attached patch enables me to import native modules, in this case the python bindings to the globus toolkit. Without this patch I get errors regarding the `_environ` symbol missing, with the patch applied they import without error. Looks like this is a solution, whether it is the correct solution is a different matter.... -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Comment(by ram@…): It appears that there is another patch in the files directory [http://trac.macports.org/browser/trunk/dports/lang/python25/files/patch- Modules-posixmodule.c.diff patch-Modules-posixmodile.c.diff] that also patches `Modules/posixmodule.c`, however it is not applied to the python source, this is a different patch and applying this has no effect for this issue, i.e. the errors are still received regarding the missing `_environ` symbol. In fact there are several patches in the files directory that are not applied. -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------------------------+------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Keywords: python dlopen environ patch portfile | Port: python25 python26 --------------------------------------------------+------------------------- Comment(by rasmus@…): Replying to [comment:10 ram@…]:
Replying to [comment:7 blb@…]:
However, in Modules/posicmodule.c, environ is declared static, but when I remove the static portion, smisk appears to work fine.
I can also confirm that the attached patch enables me to import native modules, in this case the python bindings to the globus toolkit. Without this patch I get errors regarding the `_environ` symbol missing, with the patch applied they import without error.
Looks like this is a solution, whether it is the correct solution is a different matter....
I think the patching should be done in the binary which uses environ rather than Python exposing it like a normal libc would. I.e. patching lang/python is not the way, but rather patching libfcgi which is in my case the binary using environ. (python itself has it's own solution to accessing environ on Mac OS X). I have by email submitted patches to the libfcgi port, effectively solving the problem. I now realize that this issue/change (environ no longer exported by python) probably breaks alot of native python modules. A simple grep for environ in all .c-files in all python-modules would shed some light on the situation. -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#18090: python25 broken after [37817] --------------------------------+------------------------------------------- Reporter: rasmus@… | Owner: mww@… Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.7.0 Resolution: fixed | Keywords: python dlopen environ patch portfile Port: python25 python26 | --------------------------------+------------------------------------------- Changes (by rasmus@…): * status: new => closed * resolution: => fixed Comment: Fixed by [46147] -- Ticket URL: <http://trac.macports.org/ticket/18090#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts