3 ms·
The symbol mangling ABI isn't considered stable yet. And even if it was stable, rust's struct packing is still compiler-defined. Rust libraries can be dynamica
by josephg 4y ago
The symbol mangling ABI isn't considered stable yet. And even if it was stable, rust's struct packing is still compiler-defined.
Rust libraries can be dynamically linked if they look like a C library, or get wrapped by abi_stable[1] or something. But this isn't the standard. Probably less than 5% of the crate ecosystem is packaged like this.
And a 5% solution is nowhere near good enough. Right now, I can build any rust package on any system, no matter what dependencies it has by just running cargo build. For apt to be competitive, it'd need to pull the ~100k cargo packages into apt's repository, wrap all of them in abi_stable or some equivalent and parse Cargo.toml files into the equivalent dpkg config.
Ideally it should also work across every OS (though starting with ubuntu, debian and mint would be a start).
This is possible. But for all the hand wringing about how modern packages should use apt, nobody seems to actually care enough to make any of this happen.
[1] https://crates.io/crates/abi_stable https://crates.io/crates/abi_stable
- pabs3 4y agoI got the impression from that issue that the v0 ABI is frozen and is only not the default yet because they are working on getting support for it in external tools and writing up the documentation. https://github.com/rust-lang/rust/issues/60705 https://github.com/rust-lang/rust/issues/60705 https://github.com/rust-lang/rfcs/pull/2603 https://github.com/rust-lang/rfcs/pull/2603
- camgunz 4y agoWell, there are significant differences between apt and cargo though right? Apt by and large installs pre-built binaries and ancillary stuff for projects written in... every language. Cargo fetches and builds Rust projects. If you wanted Cargo to do what Apt does, what it currently does would be a small percentage of its new total functionality. It might be cool if we "united" all the build apps (npm, pip, cargo, go, etc) under a similar interface, but that also sounds like a lot of work, which is why I think these package managers stick with binaries.