Opened 5 weeks ago

Closed 5 weeks ago

#71085 closed defect (invalid)

port -dv selfupdate fails for Macports 2.10.2, Sonoma 14.7, xcode 16

Reported by: kcap-tha Owned by:
Priority: Normal Milestone:
Component: base Version: 2.10.2
Keywords: Cc:
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

A port selfupdate is failing when trying to move from Macports 2.10.1 to 2.10.2
MacOS Sonoma: 14.7
CPU: 8-Core Intel Core i9
XCode: 16

I have tried various things to resolve my issue.
I can't even run a sudo port clean --all, or even clean a single port.
I started with the base MacPorts 2.10.1 for Sonoma 14.7. I migrated from a previous MacPorts version that was on a previous Sonoma minor version.
I have tried the hot list item: ProblemHotlist#clts16 with no help.

Lines near the error where the selfupdate dies.

In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/exception_types.h:192:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach_debug/ipc_info.h:99:2: error: unknown type name 'mach_port_urefs_t'
   99 |         mach_port_urefs_t iin_urefs;    /* user-references */
      |         ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach_debug/ipc_info.h:110:2: error: unknown type name 'mach_port_name_t'; did you mean 'mach_port_t'?
  110 |         mach_port_name_t iitn_lchild;   /* name of left child */
      |         ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/_types/_mach_port_t.h:50:30: note: 'mach_port_t' declared here
   50 | typedef __darwin_mach_port_t mach_port_t;
      |                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
/usr/bin/cc -c -I"." -I/opt/local/var/macports/sources/selfupdate/base/vendor/tcl/unix -I/opt/local/var/macports/sources/selfupdate/base/vendor/tcl/generic -I/opt/local/var/macports/sources/selfupdate/base/vendor/tcl/libtommath -O2 -pipe    -Wall -Wpointer-arith -fno-common -DBUILD_tcl -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.6\" -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DHAVE_ZLIB=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_HIDDEN=1 -DMAC_OSX_TCL=1 -DHAVE_CAST_TO_UNION=1 -DHAVE_VFORK=1 -DHAVE_POSIX_SPAWNP=1 -DHAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 -DHAVE_POSIX_SPAWNATTR_SETFLAGS=1 -DTCL_SHLIB_EXT=\".dylib\" -DNDEBUG=1 -DTCL_CFG_OPTIMIZED=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_MKSTEMP=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GETADDRINFO=1 -DHAVE_FREEADDRINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_STRUCT_ADDRINFO=1 -DHAVE_STRUCT_IN6_ADDR=1 -DHAVE_STRUCT_SOCKADDR_IN6=1 -DHAVE_STRUCT_SOCKADDR_STORAGE=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_CHFLAGS=1 -DHAVE_MKSTEMPS=1 -DHAVE_GETATTRLIST=1 -DHAVE_COPYFILE_H=1 -DHAVE_COPYFILE=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DTCL_WIDE_CLICKS=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_WEAK_IMPORT=1 -D_DARWIN_C_SOURCE=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -DTCL_UNLOAD_DLLS=1 -DHAVE_CPUID=1      -DMP_FIXED_CUTOFFS -DMP_NO_STDINT /opt/local/var/macports/sources/selfupdate/base/vendor/tcl/generic/tclOOInfo.c
20 errors generated.
make[2]: *** [tclUnixTime.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cp src/usr.bin/signify/signify.1 .
install -d /opt/local/var/macports/sources/selfupdate/base/vendor/vendor-destroot/opt/local/libexec/macports/bin /opt/local/var/macports/sources/selfupdate/base/vendor/vendor-destroot/opt/local/libexec/macports/share/man/man1
install -S -m 755 signify /opt/local/var/macports/sources/selfupdate/base/vendor/vendor-destroot/opt/local/libexec/macports/bin
install -S -m 644 signify.1 /opt/local/var/macports/sources/selfupdate/base/vendor/vendor-destroot/opt/local/libexec/macports/share/man/man1
make[1]: *** [all-tcl] Error 2
make: *** [all] Error 1
Command failed: CC=/usr/bin/cc SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk ./configure --prefix=/opt/local --with-install-user=root --with-install-group=wheel --with-directory-mode=0755 --enable-readline && SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk make -j16 SELFUPDATING=1 && make install SELFUPDATING=1
Exit code: 2
Error: Error installing new MacPorts base: command execution failed
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed

I thought it might be an issue with:
/opt/local/etc/macports/macports.conf
but I have the universal_archs and build_arch lines commented out as described here:
wiki:Migration

Thanks for any insight here.

Attachments (1)

port-error.log (270.4 KB) - added by kcap-tha 5 weeks ago.
Full debug log form selfupdate

Download all attachments as: .zip

Change History (10)

comment:1 Changed 5 weeks ago by jmroot (Joshua Root)

Can you attach the full debug output? The first error is usually most relevant. Most likely culprit at this point is some conflicting header in /usr/local.

Changed 5 weeks ago by kcap-tha

Attachment: port-error.log added

Full debug log form selfupdate

comment:2 Changed 5 weeks ago by kcap-tha

First issues are, what I assume is this benign make issue:

configure: === configuring in vendor/tclx (/opt/local/var/macports/sources/selfupdate/base/vendor/tclx)
make: *** No rule to make target `distclean'.  Stop.

Next hiccup comes from what might be a renaming in the XCode headers related to a typedef struct.

IMPORT=1 -D_DARWIN_C_SOURCE=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -DTCL_UNLOAD_DLLS=1 -DHAVE_CPUID=1      -DMP_FIXED_CUTOFFS -DMP_NO_STDINT /opt/local/var/macports/sources/selfupdate/base/vendor/tcl/unix/tclUnixCompat.c
In file included from /opt/local/var/macports/sources/selfupdate/base/vendor/tcl/unix/tclUnixTime.c:16:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/mach_time.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/mach_types.h:80:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/host_info.h:66:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/message.h:369:2: error: unknown type name 'mach_port_name_t'; did you mean 'mach_port_t'?
  369 |         mach_port_name_t              name;
      |         ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/_types/_mach_port_t.h:50:30: note: 'mach_port_t' declared here
   50 | typedef __darwin_mach_port_t mach_port_t;
      |                              ^
In file included from /opt/local/var/macports/sources/selfupdate/base/vendor/tcl/unix/tclUnixTime.c:16:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/mach_time.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/mach_types.h:80:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/host_info.h:66:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/message.h:380:2: error: unknown type name 'mach_port_name_t'; did you mean 'mach_port_t'?
  380 |         mach_port_name_t              name;
      |         ^

comment:3 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: selfupdate failure removed

comment:4 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)

Version: 2.10.12.10.2

MacPorts 2.10.2 was released on October 1 and nobody else has reported this problem. It builds fine on our automated build machines running every version of macOS. So there is not a general problem, and there is no change in the SDK headers. This is caused by something unique to your machine. Do you have anything in /usr/local, as Joshua asked? If so, remove it and try again.

comment:5 Changed 5 weeks ago by kcap-tha

Ok, thanks Ryan. There is a docker dir in /usr/local/lib. There are some things in /usr/local/bin I need i.e. composer, docker stuff. There is no /usr/local/include. I guess I can try to re-install the port pkg for Sonoma from the .dmg again. Just have to lookup how to keep my current ports and then rebuild them after the install (do you know that link off the top?). I'll let you know what happens.

Version 0, edited 5 weeks ago by kcap-tha (next)

comment:6 Changed 5 weeks ago by jmroot (Joshua Root)

In my SDK, mach_port_name_t is defined on line 106 of /usr/include/mach/port.h, and /usr/include/mach/message.h has #include <mach/port.h> on line 76. Is that the case for you?

comment:7 in reply to:  5 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)

Replying to kcap-tha:

There is a docker dir in /usr/local/lib. There are some things in /usr/local/bin I need i.e. composer, docker stuff. There is no /usr/local/include.

Indeed it doesn't sound like you have anything there that would cause this…

I guess I can try to re-install the port pkg for Sonoma from the .pkg again.

That would certainly avoid the need to compile it yourself via selfupdate.

Just have to lookup how to keep my current ports and then rebuild them after the install (do you know that link off the top?).

If you're not changing major OS versions or architectures, there's nothing to do; your installed ports are not affected by installing MacPorts and you don't need to reinstall or rebuild them after doing so.

comment:8 Changed 5 weeks ago by kcap-tha

My SDK, based on where the errors are coming from, is pointing here:

/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/

When I look at the usr/include/mach/port.h it's actually empty, that screams "problem" to me. Check this out:

ls -l /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/port.h

-r--r--r--  1 root  wheel  0 Apr 24 23:38 /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/mach/port.h

So I verified:

xcode-select --install
xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates

So I removed the CommandLineTools (rm -rf /Library/Developer/CommandLineTools/) and re-installed (xcode-select --install) them.

I tried the port -dv selfupdate command again and the build completed this time. So, to your point, it was specific to my machine. The real mystery is how did port.h become empty?

Thanks for helping me find the right places to poke around and get this issue resolved. Appreciate all you guys do for the MacPorts project.

comment:9 in reply to:  8 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)

Resolution: invalid
Status: newclosed

Replying to kcap-tha:

When I look at the usr/include/mach/port.h it's actually empty, that screams "problem" to me.

Definitely! Glad you found the cause and that you got it working.

Note: See TracTickets for help on using tickets.