3 ms·
But they do. They do let you choose. Debian's build of rust packages are linked dynanically, for instance. It's a build setting, you can turn it on.
by tux3 2y ago
But they do. They do let you choose.
Debian's build of rust packages are linked dynanically, for instance. It's a build setting, you can turn it on.
- LtWorf 2y agoNo, crates will be statically linked anyway in general.
- kibwen 2y agoRust supports dynamic linking, it's just not the default, so you need to configure a given crate to use it at build time.
- LtWorf 2y agoRust supports compiling each crate as a separate .so and then linking all of them? 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.
- School-Cotton 2y ago> Rust supports compiling each crate as a separate .so and then linking all of them? Yes, by passing crate-type=dylib to the compiler.
- whytevuhuni 2y agoDue 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).