Skip to content

add an environment variable for dynamic linking #77

@happysalada

Description

@happysalada

Hi, could we add an environment variable for dynamic linking?
Something that like CARGO_MIMALLOC_DYNAMIC_LINKING
that would do something akin to https://github.com/fede1024/rust-rdkafka/blob/master/rdkafka-sys/build.rs#L41
(finding the lib with pkg-config).
There might be a version mismatch, but there are several advantages.

  • you don't need to do the static build everytime for project in development (if your rust version changes or if you cargo clean).
  • some OS have a hard time with static compilation (in my case NixOS) because it has strict rules for dependencies. Since it can be found as a dependency already built in the OS, dynamic compilation would be best.

to give you a bit more context, I've tried to package something recently in rust that had a dependency on mimalloc_rust and had to give up (because compiling mimalloc has some dependencies not included when compiling for darwin).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions