-
Notifications
You must be signed in to change notification settings - Fork 2
Delay loading libraries until required #2
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It would be nice to be able to delay loading the libraries until they're needed. We can do this by prepending 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request