PyROOT tries to import `.so` instead of `.dylib` on macos

This impacts 6.32.10, 6.34.10, 6.36.04, and 6.36.06 (so I think it’s pretty independent of root but maybe configuration related). For ROOT experts, what is triggering the loading of a shared library (as in what determines how to load the shared library). The corresponding GitHub issue is here: OSX builds are broken · Issue #6 · conda-forge/roounfold-feedstock · GitHub .

On mac osx, I import RooUnfold like so:

Lord Stark:~/roounfold-feedstock (debug/variants)$ pixi run python
Python 3.13.11 | packaged by conda-forge | (main, Dec  6 2025, 11:37:04) [Clang 19.1.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import RooUnfold
Error in <TMacOSXSystem::FindDynamicLibrary>: libRooUnfold.so does not exist in /usr/local/cuda/lib:::.:/Users/kratsg/roounfold-feedstock/.pixi/envs/default/lib:/usr/local/lib:/usr/X11R6/lib:/usr/lib:/lib:/lib/x86_64-linux-gnu:/usr/local/lib64:/usr/lib64:/lib64::/Users/kratsg/roounfold-feedstock/.pixi/envs/default/lib:/Users/kratsg/roounfold-feedstock/.pixi/envs/default/lib
In file included from libRooUnfold dictionary payload:11:
In file included from /Users/kratsg/roounfold-feedstock/.pixi/envs/default/include/RooFitUnfold.h:19:
In file included from /Users/kratsg/roounfold-feedstock/.pixi/envs/default/include/RooUnfold.h:29:
In file included from /Users/kratsg/roounfold-feedstock/.pixi/envs/default/include/RooUnfoldResponse.h:27:
In file included from /Users/kratsg/roounfold-feedstock/.pixi/envs/default/include/RooUnfoldFitHelpers.h:19:
/Users/kratsg/roounfold-feedstock/.pixi/envs/default/include/RooUnfoldHelpers.h:259:10: fatal error: 'RooUnfoldHelpers.tpp' file not found
#include "RooUnfoldHelpers.tpp"
         ^~~~~~~~~~~~~~~~~~~~~~
Error in <TInterpreter::AutoParse>: Error parsing payload code for class RooUnfoldResponse with content:

but this is weird, as it seems to be triggered by the following call with an explicit libRooUnfold.so and things just go bad:

>>> ROOT.gSystem.DynamicPathName("libRooUnfold.so")
Error in <TMacOSXSystem::FindDynamicLibrary>: libRooUnfold.so does not exist in /usr/local/cuda/lib:::.:/Users/kratsg/roounfold-feedstock/.pixi/envs/default/lib:/usr/local/lib:/usr/X11R6/lib:/usr/lib:/lib:/lib/x86_64-linux-gnu:/usr/local/lib64:/usr/lib64:/lib64::/Users/kratsg/roounfold-feedstock/.pixi/envs/default/lib:/Users/kratsg/roounfold-feedstock/.pixi/envs/default/lib
''
>>> ROOT.gSystem.DynamicPathName("libRooUnfold")
'/Users/kratsg/roounfold-feedstock/.pixi/envs/default/lib/libRooUnfold.dylib'
>>> ROOT.gSystem.DynamicPathName("libRooUnfold.dylib")
'/Users/kratsg/roounfold-feedstock/.pixi/envs/default/lib/libRooUnfold.dylib'

So what’s not clear to me is why the following works

>>> ROOT.gSystem.Load("libRooUnfold")
0
>>> import RooUnfold
>>>

but the importlib is somehow causing the wrong extension to be searched for / loaded? It seems ROOT is aware we’re on OSX, but something triggers the .so to be added? I don’t know what happens here if an expert could point out what calls the gSystem→Load.

Found it, sorry for the noise. The underlying package explicitly uses ROOT.gSystem.Load(“libRooUnfold.so”) which breaks things.