Skip to content
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

PODIO implicit plug-in mechanism is not robust enough #403

Open
tmadlener opened this issue Apr 4, 2023 · 0 comments
Open

PODIO implicit plug-in mechanism is not robust enough #403

tmadlener opened this issue Apr 4, 2023 · 0 comments

Comments

@tmadlener
Copy link
Collaborator

PODIO has an implicit plug-in mechanism that is necessary to load I/O functionality for EDMs that have been generated. There are several shared libraries that are loaded at runtime only, and for which different plug-in mechanisms exist within PODIO. All of them essentially search LD_LIBRARY_PATH which makes it very easy to end up in a "polluted" environment if one is not careful enough. This bites us regularly in e.g. CI, especially if breaking changes are introduced and the underlying environment has not yet caught up.

Currently the plug-in mechanisms are

  • ROOT dictionary loading where we have no real control, since this is all happening in ROOT
  • SIO Block library loading. Here we have all control via the SIOBlockLibraryLoader, where we currently explicitly search for libraries on LD_LIBRARY_PATH:

    podio/src/SIOBlock.cc

    Lines 163 to 178 in 09d17d4

    const auto ldLibPath = std::getenv("LD_LIBRARY_PATH");
    if (!ldLibPath) {
    return libs;
    }
    std::istringstream stream(ldLibPath);
    while (std::getline(stream, dir, ':')) {
    if (not fs::exists(dir)) {
    continue;
    }
    for (auto& lib : fs::directory_iterator(dir)) {
    const auto filename = lib.path().filename().string();
    if (filename.find("SioBlocks") != std::string::npos) {
    libs.emplace_back(std::move(filename), dir);
    }
    }
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

No branches or pull requests

1 participant