-
Notifications
You must be signed in to change notification settings - Fork 45
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
Allow to link dynamically against system-provided mimalloc (use pkgconf) #73
Comments
This is tricky since mimalloc isn't fully ABI stable, so updating just the allocator and leaving everything else isn't actually viable. |
If you're concerned about ABI stability, would you consider an option that allowed linking with a "system" static Currently we (Nix) need to do Funny Tricks if we need to patch the included |
That doesn't really help, unless the bindings take into account each version. |
That said, you can always use a build script override for this. It's what it's for. https://doc.rust-lang.org/cargo/reference/build-scripts.html#overriding-build-scripts |
The bindings would only have to take into account API changes though, which are far less frequent and usually more intentional than ABI changes. |
They've probably slowed down now, but it's still concerning. Anyway, is there a reason a build script override doesn't work for your case? It's more or less designed for that use case. |
It's actually easier and using our own tooling, but it's still more verbose and fragile compared to e.g. |
Why do you consider it more fragile? I'd consider an environment variable more fragile, especially since it still runs the build script and can get it wrong (I maintain rusqlite which I believe, sadly, has this issue still in some edge cases, and haven't had the time to really dig in to figure it out). I suppose more verbose is true, though. |
Fragile from our point of view. It's fair for us to assume that a flag like |
Sure, but supporting build script overrides greatly reduces the amount of configuations we'd need to support in the build.rs, which are exponential otherwise, and very hard to test. You're right that we don't have test coverage in this repo for build script overrides, though. It would be nice to add. |
I wanted to package difftastic for Alpine Linux, but find out that it’s using bundled mimalloc library from this crate. Memory allocator is very security sensitive piece of software, using a bundled statically-linked alternative memory allocator is unacceptable for Alpine Linux, as well as for most other Linux distributions that care about security.
Can you please add support for building this crate against a system-provided mimalloc library (discovered via pkgconf) and fallback to the bundled copy of mimalloc only if not available?
The text was updated successfully, but these errors were encountered: