Skip to content

Delay loading libraries until required #2

Open
@FFY00

Description

@FFY00

It would be nice to be able to delay loading the libraries until they're needed. We can do this by pretending a path hook using a custom ExtensionFileLoader to sys.path_hooks. Our custom loader would load the library before executing the module in exec_module.

Since we don't know which extension links against the library from the entrypoints metadata, we need to load it on all extension imports. Alternatively, we can try to load the extension, and if it fails, load the library and try again. Other option could also be to read the ELF objects to see if they link against the library.

Anyway, even though this is the best default behavior, we should have an environment variable to force loading everything at startup, for quick troubleshooting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions