Check duplicate issues.
Description
When ROOT_PLUGIN_PATH has been prepended by an entry, ROOT cannot find its own plugins.
Reproducer
Default behavior:
[ROOT/latest] ~ %> echo $ROOT_PLUGIN_PATH
[ROOT/latest] ~ %> root -l
root [0] new TBrowser
ROOT comes with a web-based browser, which is now being started.
Revert to TBrowser by setting "Browser.Name: TRootBrowser" in rootrc file or
by starting "root --web=off"
Find more info on https://root.cern/for_developers/root7/#rbrowser
Info in <THttpEngine::Create>: Starting HTTP server on port 127.0.0.1:9216
(TBrowser *) 0x785483e220
root [1] %
With modified ROOT_PLUGIN_PATH
[O2Physics/latest] ~ %> echo $ROOT_PLUGIN_PATH
/Users/aalkin/O2/sw/osx_arm64/JAliEn-ROOT/0.7.22-local7/etc/plugins
[O2Physics/latest] ~ %> root -l
root [0] new TBrowser
Error in <TGuiFactory::CreateBrowserImp>: Fail to create ROOT::RWebBrowserImp, please provide missing libraries or run 'root --web=off'
(TBrowser *) 0x78f6009ea0
Exactly the same happens if one alters the ROOT_PLUGIN_PATH in the same session, none of ROOT's own libraries can be found. Unsetting ROOT_PLUGIN_PATH restores normal behavior.
The actual problem is in core/base/src/TPluginManager.cxx, TPluginManager::LoadHandlersFromPluginDirs, around line 531:
if (sbase != "") {
const char *p = gSystem->PrependPathName(d, sbase);
LoadHandlerMacros(p);
}
Since PrependPathName modifies the string in place, sbase now contains the first path and for the next entry its path will be wrong.
Solution is to create a temporary string:
if (sbase != "") {
TString p = sbase;
gSystem->PrependPathName(d, p);
LoadHandlerMacros(p);
}
ROOT version
ROOT 6.40.04
Built for macosxarm64 from tags/6-40-04@6-40-04
With Apple clang version 21.0.0 (clang-2100.3.34.2) std202002
Installation method
build from source
Operating system
MacOS 27
Additional context
No response
Check duplicate issues.
Description
When ROOT_PLUGIN_PATH has been prepended by an entry, ROOT cannot find its own plugins.
Reproducer
Default behavior:
With modified ROOT_PLUGIN_PATH
Exactly the same happens if one alters the ROOT_PLUGIN_PATH in the same session, none of ROOT's own libraries can be found. Unsetting ROOT_PLUGIN_PATH restores normal behavior.
The actual problem is in core/base/src/TPluginManager.cxx,
TPluginManager::LoadHandlersFromPluginDirs, around line 531:Since
PrependPathNamemodifies the string in place,sbasenow contains the first path and for the next entry its path will be wrong.Solution is to create a temporary string:
ROOT version
ROOT 6.40.04
Built for macosxarm64 from tags/6-40-04@6-40-04
With Apple clang version 21.0.0 (clang-2100.3.34.2) std202002
Installation method
build from source
Operating system
MacOS 27
Additional context
No response