Skip to content

File extension inconsistency #62

@mkroman

Description

@mkroman

Currently, as per the docs, on Windows, the default behavior for Library::open(…) is to automatically concatenate the platform-specific .dll extension when no extension is provided (or just omit it when a . suffix is given.)

This behavior is inconsistent across platforms, for example:

use libloading::Library;

fn main() {
    let library = Library::new("libzeta_core").unwrap();
}

On Windows, this will, as expected, try to load libzeta_core.dll - however, on Linux, this will try to load libzeta_core which is not the expected shared library filename - it's expected to be libzeta_core.so.

I'd suggest that libloading provides a platform-specific load sequence:

  • If no extension is given, it should try to load the library with a platform-specific extension
    • On Linux, *BSD and macOS, this should be .so
    • On Windows, this should be .dll

In all cases, when a . suffix is given, it should just try to load the filename without any extension.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions