[MacPorts] #67104: If qt5-qtwebengine fails to build on MacOS 10.15 (and possibly older) with a "too new" Xcode installed, try this
MacPorts
noreply at macports.org
Wed Mar 15 15:55:46 UTC 2023
#67104: If qt5-qtwebengine fails to build on MacOS 10.15 (and possibly older) with
a "too new" Xcode installed, try this
----------------------+-----------------------------
Reporter: Gandoon | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.8.1
Keywords: catalina | Port: qt5-qtwebengine
----------------------+-----------------------------
Good afternoon,
This is mainly for information, as I have found a solution to the problem,
and I am not aware if there is anything that can be done from MacPorts
side to remedy this issue.
I am for various backwards compatibility reasons stuck at MacOS 10.15.7 on
one machine. And I need to keep an as up-to-date version as possible of
MacPorts on it. And once again the ever problematic qt5-qtwebengine gave
me a headache.
If you for whatever reason use the newer Xcode 12 (latest version for my
system is 12.4), you will probably have the 11.1 SDK installed as well as
the 10.14 and 10.15 ones. This means that there are potential issues due
to the command `xcrun` that is used to dig out paths during the
qt5-qtwebengine build not pointing to a valid copy of the SDK you need.
During the process the command `xcrun --sdk macosx --show-sdk-path` is
invoked and it will result in a path that probably will look like
`/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk`.
However, if you like me have the "latest and greatest" Xcode installed, it
is very likely that this path unfortunately will not contain that SDK but
probably look something like:
{{{
drwxr-xr-x - youruser 30 Nov 2020 DriverKit20.2.sdk
drwxr-xr-x - youruser 30 Nov 2020 MacOSX.sdk
lrwxr-xr-x 10 youruser 28 Apr 2021 MacOSX11.1.sdk -> MacOSX.sdk
}}}
This will cause the qt5-qtwebengine build to fail with an error:
`:info:configure Project ERROR: Could not resolve SDK Path for
'macosx10.15' using --show-sdk-path` early on. And unfortunately, it is
not enough to just make a softlink, `MacOSX10.15.sdk -> MacOSX.sdk`, as
this will also fail. But there is a fairly simple solution that I used to
solve it in the end, that might work for you as well. There is a
repository of SDKs at `/Library/Developer/CommandLineTools/SDKs`,
including the one needed (10.15). So the (possibly slightly dirty)
solution I used to solve this issue is to instead make a softlink to that
repository thus:
{{{
$ ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
$ ls -l
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
drwxr-xr-x - youruser 30 Nov 2020 DriverKit20.2.sdk
drwxr-xr-x - youruser 30 Nov 2020 MacOSX.sdk
lrwxr-xr-x 56 youruser 15 Mar 12:51 MacOSX10.15.sdk ->
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
lrwxr-xr-x 10 youruser 28 Apr 2021 MacOSX11.1.sdk -> MacOSX.sdk
}}}
This allows the build scripts use of `xcrun` to find what it needs. If you
have similar problems on earlier systems, adjust paths accordingly. First
test the `xcrun --sdk macosx --show-sdk-path` to see what it says, and
check that path if is valid, and if not, you can try to follow this
recipe. YMMV!
As this by now is a quite old OS release, I do not expect everything to be
working flawlessly in perpetuity, but if I can help someone with some
patchwork here and there to keep things going for as long as possible, I
am happy.
--
Ticket URL: <https://trac.macports.org/ticket/67104>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list