Opened 16 years ago

Closed 15 years ago

Last modified 11 years ago

#13930 closed defect (fixed)

Intermittent failures building Python modules: unable to execute -DNDEBUG

Reported by: wiml@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.6.0
Keywords: Cc: mww@…, febeling (Florian Ebeling), blb@…, tolsen (Tim Olsen), pub1@…, brunogirin@…, macports@…, Ricardo.Cordeiro@…, lars@…, peter.arrenbrecht@…, vpribish@…, iacanay@…, sirpete@…, terry@…, fhwi93ne@…, ryandesign (Ryan Carsten Schmidt), dhelder@…, skymoo (Adam Mercer), jannis@…, cooljeanius (Eric Gallager)
Port:

Description

I'm not sure what's going on here. In all cases, quitting 'port' and restarting it and reissuing the 'install' command succeeds. But one time in five or so, building a Python-based port fails, apparently because it's set $CC to an empty string or something like that:

[var/root] > install py25-tkinter
--->  Building py25-tkinter with target build
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_py25-tkinter/work/Python-2.5.1/Modules" && /opt/local/bin/python2.5 setup.py build " returned error 1
Command output: running build
running build_ext
building '_tkinter' extension
-DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DWITH_APPINIT=1 -I/opt/local/include -I/opt/local/include/python2.5 -c _tkinter.c -o build/temp.macosx-10.3-i386-2.5/_tkinter.o
unable to execute -DNDEBUG: No such file or directory
error: command '-DNDEBUG' failed with exit status 1

Error: Status 1 encountered during processing.
[var/root] > ^D
Goodbye
root@slowpoke# /opt/local/bin/port                                                                                                                                                      ~
MacPorts 1.600
Entering interactive mode... ("help" for help, "quit" to quit)
[var/root] > install py25-tkinter
--->  Building py25-tkinter with target build
--->  Staging py25-tkinter into destroot
--->  Installing py25-tkinter 2.5.1_0
--->  Activating py25-tkinter 2.5.1_0
--->  Cleaning py25-tkinter
[var/root] > ^D

It's not the same port(s) each time, seems to be random.

Leopard 10.5.1/9B18, MacPorts 1.600, freshly installed and updated.

Change History (39)

comment:1 Changed 16 years ago by jmpp@…

Milestone: Port Bugs

comment:2 Changed 16 years ago by jmroot (Joshua Root)

Cc: mww@… added

Some sort of race in setuptools perhaps?

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

Has duplicate #14542.

comment:4 Changed 16 years ago by afb@…

It seems that those python ports are expecting $CC to be set in build as well as in configure, and fall back to random values such as "" or "cc" or "/usr/bin/gcc-4.0" when it isn't. This probably also explains why rerunning the build sometimes succeeds, if something else was adding a $CC to the environment that can be picked up as a lucky guess second time.

Supposedly base wants to be enhanced to support CC in non-configure builds ?

Workaround meanwhile is adding build.env="CC=gcc" while building the port.

comment:5 Changed 16 years ago by renatoc@…

I can also confirm this bug, while trying to install gtk2 and dependencies. I only noted this problem after uninstalling MacPorts (like stated in the !FAQ) and installing it again.

Anyway, I worked around this by setting

 extra_env       CC

in macports.conf

comment:6 Changed 16 years ago by febeling (Florian Ebeling)

This is really an annoying issue, and it persists in trunk. Has anybody looked into this already?

comment:7 Changed 16 years ago by febeling (Florian Ebeling)

Cc: florian.ebeling@… added

Cc Me!

comment:8 in reply to:  6 Changed 16 years ago by jmroot (Joshua Root)

Replying to florian.ebeling@gmail.com:

This is really an annoying issue, and it persists in trunk. Has anybody looked into this already?

See this ML thread. It appears to be a bug in the environment handling in Leopard's Tcl.

comment:9 Changed 16 years ago by spambox@…

I can confirm this attempting to build deluge.

--->  Building py25-hashlib with target build
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_py25-hashlib/work/Python-2.5.2/Modules" && /opt/local/bin/python2.5 setup.py build " returned error 1
Command output: running build
running build_ext
building '_hashlib' extension
creating build
creating build/temp.macosx-10.3-i386-2.5
-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include -I/opt/local/include/python2.5 -c _hashopenssl.c -o build/temp.macosx-10.3-i386-2.5/_hashopenssl.o
unable to execute -DNDEBUG: No such file or directory
error: command '-DNDEBUG' failed with exit status 1

Reissuing the port install deluge command built py25-hashlib fine the second time.

comment:10 Changed 16 years ago by afb@…

Workaround implemented in r36722

comment:11 Changed 16 years ago by macports@…

I'm still getting these errors (#15608 #15609 #15612), is r36722 in the current release (MacPorts 1.6 + port selfupdate)?

comment:12 in reply to:  11 Changed 16 years ago by jmroot (Joshua Root)

Replying to macports@henrik.synth.no:

is r36722 in the current release (MacPorts 1.6 + port selfupdate)?

No, that's why this ticket isn't closed.

comment:13 Changed 16 years ago by blb@…

Cc: blb@… added

Cc Me!

comment:14 Changed 16 years ago by tolsen (Tim Olsen)

Cc: tolsen@… added

Cc Me!

comment:15 Changed 16 years ago by pub1@…

Cc: pub1@… added

Cc Me!

comment:16 Changed 16 years ago by brunogirin@…

Cc: brunogirin@… added

Cc Me!

comment:17 Changed 16 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:18 Changed 16 years ago by Ricardo.Cordeiro@…

Cc: Ricardo.Cordeiro@… added

Cc Me!

comment:19 Changed 16 years ago by lars@…

Cc: lars@… added

Cc Me!

comment:20 in reply to:  description Changed 16 years ago by peter.arrenbrecht@…

Cc Me!

comment:21 Changed 16 years ago by peter.arrenbrecht@…

Cc: peter.arrenbrecht@… added

Cc Me!

comment:22 Changed 16 years ago by vpribish@…

Cc: vpribish@… added

Cc Me!

comment:23 Changed 16 years ago by iacanay@…

Cc: iacanay@… added

Cc Me!

comment:24 Changed 16 years ago by sirpete@…

Cc: sirpete@… added

Cc Me!

comment:25 Changed 15 years ago by jmroot (Joshua Root)

This is still not completely fixed in trunk @ r40402. I just ran port upgrade outdated, which upgraded two ports, first ImageMagick and then py25-numpy. The latter failed with a classic env bug error: sh: -fno-strict-aliasing: command not found, and succeeded after a clean.

comment:26 Changed 15 years ago by terry@…

Cc: terry@… added

Cc Me!

comment:27 Changed 15 years ago by fhwi93ne@…

Cc: fhwi93ne@… added

Cc Me!

comment:28 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Component: portsbase
Milestone: Port BugsMacPorts base bugs

comment:29 Changed 15 years ago by dhelder@…

Cc: dhelder@… added

Cc Me!

comment:30 Changed 15 years ago by blb@…

Milestone: MacPorts base bugsMacPorts 1.7.0

Since there's still at least one edge case (around python modules), placing in the 1.7.0 milestone so we can deal with it for that.

comment:31 Changed 15 years ago by skymoo (Adam Mercer)

Cc: ram@… added

Cc Me!

comment:32 Changed 15 years ago by blb@…

Resolution: fixed
Status: newclosed

This should now be finally fixed as of r41603, fortunately nethack and python modules were quite good at hitting this bug so gave good test cases; both now build quite smoothly in testing, but failed every time without the fix.

comment:33 in reply to:  32 ; Changed 15 years ago by afb@…

Replying to blb@…:

This should now be finally fixed as of r41603, fortunately nethack and python modules were quite good at hitting this bug so gave good test cases; both now build quite smoothly in testing, but failed every time without the fix.

Were you able to actually add it to the test case too ?

http://trac.macports.org/browser/trunk/base/src/pextlib1.0/tests/unsetenv.tcl

comment:34 in reply to:  33 Changed 15 years ago by blb@…

Replying to afb@…:

Were you able to actually add it to the test case too ?

Test case for this added in r41638.

The issue where info exists env(somevar) returned true even after unsetenv somevar fixed in r41639.

comment:35 Changed 15 years ago by jannis@…

Cc: jannis@… added

Cc Me!

comment:36 Changed 15 years ago by bretthoerner@…

I'm running 1.6 on Leopard and synced, just wanted to note that it doesn't seem to be fixed for everything.

--->  Building py25-libxml2 with target build
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py:248: UserWarning: 'licence' distribution option is deprecated; use 'license'
  warnings.warn(msg)
running build
running build_py
running build_ext
building 'libxml2mod' extension
-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_REENTRANT=1 -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c libxml2-py.c -o build/temp.macosx-10.3-i386-2.5/libxml2-py.o
unable to execute -DNDEBUG: No such file or directory
error: command '-DNDEBUG' failed with exit status 1
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_py25-libxml2/work/libxml2-python-2.6.21" && /opt/local/bin/python2.5 setup.py build " returned error 1
Command output: /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py:248: UserWarning: 'licence' distribution option is deprecated; use 'license'
  warnings.warn(msg)
running build
running build_py
running build_ext
building 'libxml2mod' extension
-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_REENTRANT=1 -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c libxml2-py.c -o build/temp.macosx-10.3-i386-2.5/libxml2-py.o
unable to execute -DNDEBUG: No such file or directory
error: command '-DNDEBUG' failed with exit status 1

Warning: the following items did not execute (for py25-libxml2): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Error: The following dependencies failed to build: gtk-doc gnome-doc-utils py25-libxml2 getopt
Error: Unable to upgrade port: 1

comment:37 in reply to:  36 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to bretthoerner@…:

I'm running 1.6 on Leopard and synced, just wanted to note that it doesn't seem to be fixed for everything.

That's correct. MacPorts 1.6 experiences the issue. It is fixed in MacPorts 1.7.0-rc1 which is available now, and of course it will stay fixed when MacPorts 1.7.0 final is released.

comment:38 Changed 15 years ago by blb@…

Other notable updates: r36719, r39016, r39017, r41650, r41651.

comment:39 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.