Opened 15 years ago

Closed 15 years ago

#19051 closed defect (fixed)

port selfupdate: error in installing new macports base 1.7.1

Reported by: senz@… Owned by: macports-tickets@…
Priority: High Milestone: MacPorts 1.8.0
Component: base Version: 1.7.1
Keywords: port selfupdate error Cc: michaelld (Michael Dickens), blb@…
Port:

Description

[Users/senz] > selfupdate

MacPorts base version 1.700 installed
Downloaded MacPorts base version 1.710

Installing new MacPorts release in /opt/local as root:admin - TCL-PACKAGE in /Library/Tcl; Permissions: 0755

Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: shell command "cd /opt/local/var/macports/sources/rsync.macports.org/release/base && ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 && make && make install" returned error 2
Command output: /System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:80: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:83: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:86: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:89: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:90: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:93: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:94: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:95: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:97: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:98: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:99: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:100: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:102: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:103: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURLHandle.h:104: error: expected ';' before '__attribute__'
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:88,
                 from tclobjc.m:42:
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:75: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:76: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:77: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:78: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:83: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:84: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:85: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:88: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:89: error: expected ';' before '__attribute__'
/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:91: error: expected ';' before '__attribute__'
make[2]: *** [tclobjc.o] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1

Attachments (1)

patches (877 bytes) - added by blb@… 15 years ago.
diff (in trunk/base)

Download all attachments as: .zip

Change History (10)

comment:1 Changed 15 years ago by blb@…

Cc: mlk@… added
Milestone: Port BugsMacPorts Future
Version: 1.7.01.7.1

Cc reporter of dup #19052.

comment:2 Changed 15 years ago by blb@…

Cc: blb@… added

The basic issue is that configure does set CC to compile, but it only sets it to 'gcc' instead of the full path; we need to either keep the modified PATH from configure during the build or to get the AC_PROG_CC to give us a full path.

comment:3 Changed 15 years ago by senz@…

mp-gcc43 was set as gcc link. Changing it to gcc40 (apple) via gcc_select solve compilation errors.

comment:4 Changed 15 years ago by michaelld (Michael Dickens)

Having the partial or full path to 'gcc' doesn't really matter; what does matter is making sure the found 'gcc' is an Apple-variant. I think configure is working as it should be; I think what needs to happen is to set "... && CC=/usr/bin/cc && ./configure ...". Here's my efforts and analysis into coming to that conclusion:

Actually (and, yes, I tested all of these out), the issue is that configure sets CC to be (in this case) the -first- version of GCC found in PATH. Let's assume that /opt/local/bin is before /usr/bin in PATH, as is typically the case in order to get the MacPorts-provided. With 'gcc_select' installed, 'sudo gcc_select gcc40' will set /opt/local/bin/gcc to symlink to /usr/bin/gcc, or Apple's GCC 4.0 variant. Now if you do 'sudo port selfupdate' it will work. OTOH, if I have the port gcc43 installed, 'sudo gcc_select mp-gcc43' will set /opt/local/bin/gcc to symlink to ./gcc-mp-4.3 . Doing 'sudo port selfupdate' not will not work. Further , even if I do 'export CC=/usr/bin/gcc-4.2' then 'sudo port selfupdate', my desired CC environment value is ignored (because the update is occurring -through- the 'port' command in a shell it is creating) .. this not the case if I do 'configure' manually from my shell (the CC value I specify is used).

What needs to happen, I think, is to manually "export CC=/usr/bin/cc" (or whatever, so long as CC is set to an Apple-provided compiler) before executing the 'configure' command; this is, I think, done at /Library/Tcl/macports1.0/macports.tcl:1908 . This won't work for the 1.7.1 or 1.7.2 release, but it could be incorporated into the 1.7.2 release into order to take effect starting with 1.7.3 (assuming those are the release numbers for future releases).

comment:5 Changed 15 years ago by blb@…

Note that PATH does not include MacPorts' directories when configure runs, as otherwise this could lead to issues where MacPorts depends on something installed by MacPorts...

All we need to do is use the same PATH that configure uses while building. Attaching a patch to base which does that.

Changed 15 years ago by blb@…

Attachment: patches added

diff (in trunk/base)

comment:6 in reply to:  5 Changed 15 years ago by michaelld (Michael Dickens)

Ah, yes, I think I understand the real issue now. I didn't know that configure removed ${prefix}/bin and ${prefix}/sbin from PATH before doing anything else, but reading through configure.ac and aclocal.m4 makes that clear. So, Yes, I also think the proposed solution should work. Assuming that these proposed changes are used, my question is then: Should 'configure' be changed, or 'configure.ac'? If I execute './regen.sh' then I end up with a new 'configure' which would override the proposed changes to that file; hence I think the latter is the appropriate place for those particular changes.

I think another way to do this would be to set the PATH before executing 'configure' in /Library/Tcl/macports1.0/macports.tcl:1908 ... since commands are chained within the same system call (cd ... && export PATH=... && configure ... && make && make install), the PATH would be properly carried over, and used just for that system call. This method would use a Tcl routine to modify the incoming PATH and pass that knowledge to the system command, as opposed to the proposed method that does it inside 'configure' and then passing the knowledge on to the top-level 'Makefile'.

comment:7 Changed 15 years ago by blb@…

Note that my patch updates both configure and aclocal.m4 (I really only updated the latter and used regen.sh to create a new configure).

Updating macports.tcl could also work, but that would only affect selfupdate, not if someone manually runs configure/make/make install to update their install. Doing it by stripping PATH in configure and remembering that for make works in both cases.

comment:8 Changed 15 years ago by michaelld (Michael Dickens)

Ah. Good points all around; I obviously hadn't thought through enough angles for how to accomplish this change. If your patches work as is, then I, for one, am all for them.

comment:9 Changed 15 years ago by blb@…

Milestone: MacPorts FutureMacPorts 1.8.0
Resolution: fixed
Status: newclosed

Should be fixed in r53374.

Note: See TracTickets for help on using tickets.