Opened 5 weeks ago

Last modified 3 weeks ago

#68095 assigned defect

yorick: Outdated embedded SDK path in macOS 11 binaries causes build failure of dependents

Reported by: ryandesign (Ryan Schmidt) Owned by: paumard
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: bigsur Cc:
Port: yorick


Ports depending on yorick fail to build on macOS 11, e.g. yorick-optimpack:

/usr/bin/clang  -O2 -pipe -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64 -DOP_INTEGER=long  -DPLUG_IN -I. -I/opt/local/lib/yorick/include -o op_lnsrch.o -c ../op_lnsrch.c
/usr/bin/clang  -O2 -pipe -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64 -DOP_INTEGER=long  -DPLUG_IN -I. -I/opt/local/lib/yorick/include -o op_utils.o -c ../op_utils.c
/usr/bin/clang  -O2 -pipe -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64 -DOP_INTEGER=long  -DPLUG_IN -I. -I/opt/local/lib/yorick/include -o op_vmlmb.o -c ../op_vmlmb.c
/opt/local/lib/yorick/lib/codger w OptimPack1   OptimPack1.i
found OptimPack1.i in current directory
/usr/bin/clang -O2 -pipe -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64 -DOP_INTEGER=long  -DPLUG_IN -I. -I/opt/local/lib/yorick/include   -c -o ywrap.o ywrap.c
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk' [-Wmissing-sysroot]
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk' [-Wmissing-sysroot]
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk' [-Wmissing-sysroot]
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk' [-Wmissing-sysroot]
../op_lnsrch.c:38:10: fatal error: 'math.h' file not found
../op_utils.c:35:../op_vmlmb.c:#include <math.h>
42:10:10:  fatal error: fatal error: 'math.h' file not found'math.h' file not found

#include <math.h>
#include <math.h>
1 error generated.
1 error generated.
1 error generated.
make: *** [op_utils.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [op_lnsrch.o] Error 1
make: *** [op_vmlmb.o] Error 1

This happens because /opt/local/lib/yorick/Make.cfg contains:

Y_CFLAGS=-pipe -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch arm64
Y_LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch arm64

Specifically, the reference to MacOSX11.0.sdk is the problem because there is no such SDK anymore in current versions of Xcode for macOS 11. There is a MacOSX11.3.sdk directory and a MacOSX11.sdk symlink pointing to it.

The yorick 2.2.04 binaries for Big Sur were built in January 2021 at which time MacPorts 2.6.4 was in use, which was not fully compatible with the changes in version numbering Apple made in macOS 11. At the time, we did not yet know how Apple would number future macOS and SDK versions. Corrected version handling was implemented in MacPorts 2.7.0 released in May 2021 (#61866).

The immediate solution for the build failures on macOS 11 is to increase the revision of the yorick port which will rebuild it with a fixed version of MacPorts base so that a usable SDK path is used, and then to schedule new builds on the macOS 11 buildbot workers for the ports that depend on yorick.

However, baking the SDK path into Make.cfg is probably wrong; it should probably be removed entirely e.g. with reinplace.

Change History (1)

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

Really, the whole design of the yorick module build system is wrong. Building any yorick modules causes yorick's Make.cfg to be included and all of the environment variables MacPorts sets to be ignored. Removing the SDK path from Make.cfg won't fix that. The module ports need to be fixed so they use MacPorts environment variables. There are several yorick modules in MacPorts and they're all standalone ports, not using a common portgroup, so they all need individual fixes, or a common fix could be put into a new yorick portgroup that they all include. Or, since yorick was declared obsolete by its developers years ago, perhaps it's not worth investing any time in it and it should be removed from MacPorts?

Note: See TracTickets for help on using tickets.