-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Avoid using patched MacOS modulemap on conda-forge builds #22448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
| }(); | ||
| if (CI.getTarget().getSDKVersion() < VersionTuple(14, 4) && | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the value of If the SDK version is not correctly found, I think this value is empty. Then maybe a simpler solution would be to default to EDIT: Just read the comment above. The value is 11, I take back my comment.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, to be explicit, the following line added in CIFactory.cpp: Gives during the conda build: |
||
| !isCondaBuild) { | ||
| maybeAppendOverlayEntry(stdIncLoc.str(), | ||
| "std_darwin.MacOSX14.2.sdk.modulemap", | ||
| clingIncLoc.str().str(), MOverlay, | ||
|
|
||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_SYSROOTvariable https://github.com/root-project/root/blob/dd9c2d39dda88e817002130bbebb752f7fa94eec/cmake/modules/SetOSX_SDK.cmake . That works now.These lines in
CIFactory.cppthough are actively going against the already-found and correct MacOS SDK path. That's because on conda-forge the MacOS SDK used is version11.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.