Skip to content

ROOT_PLUGIN_PATH is handled incorrectly #23536

Description

@aalkin

Check duplicate issues.

  • Checked for duplicates

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

Activity

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

Metadata

Metadata

Assignees

Labels

bugexperimentAffects an experiment / reported by its software & computimng experts

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions