Skip to content

[ci] strip pcms from wheels builds - #23071

Open
siliataider wants to merge 19 commits into
root-project:test_macos_wheel_v2from
siliataider:silia/test_macos_wheel_v2_cibw_2
Open

[ci] strip pcms from wheels builds#23071
siliataider wants to merge 19 commits into
root-project:test_macos_wheel_v2from
siliataider:silia/test_macos_wheel_v2_cibw_2

Conversation

@siliataider

Copy link
Copy Markdown
Contributor

Test a new strategy: ship ROOT wheels without pre-built C++ module .pcm files, and rebuild them once on the target machine instead.

.pcm files are frozen against the system headers of the build machine creating portability issues to other machines with different versions. This PR strips them out at CI build time and adds a one-time warm-up script that rebuilds them locally on first import ROOT against whatever headers actually exist on the user's machine.

siliataider and others added 18 commits July 22, 2026 14:39
`TSystem::CompileMacro`, aka `ACLiC`, can generate a shared library from a ROOT macro. While doing so, it links the target library against all loaded libraries at time of calling.

When running from Python e.g. via `ProcessLine(".L macro.C+")`, the loaded libraries include those dynamically loaded by the Python interpreter.

When run on a MacOS system, these may also include so-called "private" Apple libraries. These libraries cannot be linked against by third-party code: the linker will fail with an error saying "product being built is not an allowed client of it".

One such situation has surfaced in a bug report to the homebrew distribution of ROOT Homebrew/homebrew-core#272324 related to the `libffi` library, but the issue is actually generic.

Unfortunately, Apple does not provide an authoritative list of "private" libraries and there is no direct way to ask a library whether linking against it will produce a linker error or not.

Aside from manually checking the list of allowed clients of each of the loaded libraries before linking, manually vetoing known "private" libraries seems the next-best thing. This commit proposes to remove the `libffi` library from the list of libraries `ACLiC` will link against when run on MacOS.
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Test Results

     4 files       4 suites   6h 33m 4s ⏱️
 3 761 tests  3 352 ✅ 15 💤 394 ❌
12 368 runs  11 558 ✅ 30 💤 780 ❌

For more details on these failures, see this check.

Results for commit 4c69dca.

♻️ This comment has been updated with latest results.

@pcanal

pcanal commented Aug 12, 2026

Copy link
Copy Markdown
Member

What is the time taken by the rebuild of the pcms?

Comment thread core/base/src/TSystem.cxx
if (index >= 0) {
TString s = libs2(index, end);
if (s.Index(dynload) == kNPOS) {
if (s.Index(dynload) == kNPOS && s.Index(libffiMatch) == kNPOS) {

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.

This seems to (also) be introduced in #22963.
However, the location of this code is somewhat surprising and I wonder if it should be not be with the other vetoing in TCling::RegisterLoadedSharedLibrary. (Or at the very least to code comment why this one is here and the other there).

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed this was merged in master but not in the branch root-project:test_macos_wheel_v2 so I just cherry picked it for the tests to work

The PRs I have open on this branch (#22886 and #23071) are just experimenting with the macos wheels, not going into production as they are of course

Comment thread .github/workflows/cibuildwheel-impl/action.yml
@siliataider

Copy link
Copy Markdown
Contributor Author

@pcanal Around 20s for the first import ROOT on my machine, I wonder if the modules could be rebuilt in parallel to speed this up a bit

for i, name in enumerate(names, 1):
_print_progress(i, len(names), name)
try:
declare(f"#pragma clang module import {name}")

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.

Is this out the pcms are being rebuild? If so, I am not sure this is the same as the pcms produced by rootcling. The pcms produced by rootcling contains not only the 'real' pcm but also have an additional payload which was previously the rootpcm files which contains shortcuts to the class information (in the form of TProtoClass stored in a ROOT file) which allows to be able to do I/O without actually loading any interpreter information (i.e. the real pcm content) which improve run-time and drastically reduce the memory needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants