Re:Swift Static Linux SDK
by umanwizard on Wednesday June 12, 2024 @06:16AM
(#40656438)
> Rust supports compiling each crate as a separate .so and then linking all of them?
Yes, by passing crate-type=dylib to the compiler.
Re:Swift Static Linux SDK
by whytevuhuni on Wednesday June 12, 2024 @03:18PM
(#40661874)
Due to the lack of ABI stability, the resulting dynamic library is tied to the exact binary hash of the Rust compiler (which includes the dependencies rustc was built from).
Those dynamic libraries will also not remain ABI stable if their code changes (because Rust's semver specifically applies to the public API, but the public API is free to pass around structs with private fields, which may alter the layout drastically even for minor semver-compatible changes).
So this helps with some aspects (such as libraries being reused between binaries, reducing disk usage).
But it does not help with the issue most discussed in this thread: that of security updates (all libraries have to be rebuilt whenever rustc changes or a dependency changes, all programs (potentially the entire operating system) have to be redownloaded by all users, etc).
That's not at all how debian packages written in rust are linked. So the person I replied to is incorrect.
I suspect you're incorrect as well and what you claim doesn't exist at all, but you're claiming a different thing.