Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion interpreter/cling/lib/Interpreter/CIFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,17 @@ namespace {
/*AllowModulemapOverride=*/ false);
#elif __APPLE__
if (Triple.isMacOSX()) {
if (CI.getTarget().getSDKVersion() < VersionTuple(14, 4)) {
// The following is needed to support MacOS13 with LLVM 18, but does not
// make sense in a conda build where the the SDK version is much older
// (typically 11) but the modulemap is shipped separately by conda-forge.
const bool isCondaBuild = []() {
if (const auto en = std::getenv("CONDA_BUILD")) {
return std::strcmp(en, "1") == 0;
}
return false;
}();
Comment on lines +735 to +740
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this hack should definitely not become part of the generic Cling. I know we discussed in the past, I forgot the details, but if the SDK version is not correctly found it means that some flags are not correct. I don't know where is the proper place to fix it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it's more subtle than that. The SDK is properly found by the build, thanks to the now fixed and well-defined CMAKE_OSX_SYSROOT variable https://github.com/root-project/root/blob/dd9c2d39dda88e817002130bbebb752f7fa94eec/cmake/modules/SetOSX_SDK.cmake . That works now.

These lines in CIFactory.cpp though are actively going against the already-found and correct MacOS SDK path. That's because on conda-forge the MacOS SDK used is version 11.0. These lines in CIFactory.cpp are triggered because of the condition <14.2, but the patched modulemap provided in this case is simply wrong. If these lines were not present, the correct CMake workflow would run.

if (CI.getTarget().getSDKVersion() < VersionTuple(14, 4) &&
!isCondaBuild) {
maybeAppendOverlayEntry(stdIncLoc.str(),
"std_darwin.MacOSX14.2.sdk.modulemap",
clingIncLoc.str().str(), MOverlay,
Expand Down
Loading