The cargo version that we include in a Debian release needs to be buildable with the rustc also in that release. So if you want us to match the rustc/cargo pairing that you’re using for your pre-built bundles, then yes we’ll need it to be able to build with the paired stable rustc.
We take source tarballs (and then import them into our own git tree, but that’s mostly a coordination choice on our side). Currently we also repack the source tarballs to remove src/llvm/* (unneeded, and big) and src/etc/snapshot.pyc (shouldn’t be in the upstream tarball anyway).
Note that even when we kept the full src/llvm/ source, we still had to remove src/llvm/cmake/modules/LLVMParseArguments.cmake because CC-BY 2.5 isn’t DFSG-free. We also have to find/include the appropriate jquery source for the minified version shipped in upstream git - again due to Debian’s interpretation of “compiled” for javascript. It would be helpful if the latter was already included in upstream source, and perhaps you could work with LLVM to address the former? (but that’s just me being lazy
)
Yes, I think it would be fine to say that we need to hop through each stable rustc release - or re-bootstrap everything. We intend to upload every rustc stable release into Debian unstable, and have that trickle down into testing in the usual manner (~2 week delay); Debian stable is then a snapshot of whatever testing was at that point in time (so Debian oldstable->stable will almost certainly skip rustc releases).
A Debian (entire distro) testing/stable release needs to be able to rebuild whatever rustc version is included in it using only other packages also in that release (so using the same rustc version), and each new rustc release that we upload into unstable needs to be buildable with the immediately prior rustc release already in unstable (to avoid re-bootstrapping). I think this means we’ll need to improve the Debian build to detect version and jump straight into stage2 for the former case, since stage1 won’t build with its own release (until upstream moves away from using #[cfg(stage0)] as a versioning mechanism) - this doesn’t sound too bad, but I haven’t actually done it yet so I don’t know what traps await…
EDIT: once again, I’ve forgotten that jumping straight into stage2 isn’t possible because unstable Rust features won’t be available. Sigh, need to think of something else (perhaps package rustc twice with different --release-channel choices)
Reporting versions is the easy bit (and could be done manually, although tooling is always nice). By “want to expose dependencies” I meant “vendoring sources” is technically workable, but not a great solution.
In a hypothetical future Debian stable release that included rustc/cargo and (eg) rust-mozilla, the Debian security team might need to patch the (eg) rust-ssl library used by rust-mozilla. We need to be able to tell cargo to rebuild the same rust-mozilla source using the now-modified rust-ssl library (so can’t pull from network). We also want it to be easy to find and repeat this for every package that uses rust-ssl (so “vendoring” a new copy of rust-ssl source in every application that uses it is bad).
I sketched out a possible solution elsewhere, that follows what golang currently does in Debian. In this proposal, Debian Rust “library packages” are just source archives that get dumped somewhere centrally on disk. We then need some way to tell cargo to build using the libraries in this central location rather than going out to crates.io or wherever it would normally go. I think we can generate whatever version metadata/index cargo wants, if such a thing is required.
With this proposal, the rust-mozilla Debian package would have a regular Debian build-dependency on the rust-ssl-dev Debian package. The security fix would be as simple and routine as “release a patched rust-ssl-dev Debian package, and rebuild/release all Debian packages that build-depend on it”. rust-mozilla and any others would pick up the modified rust-ssl source from the central on-disk location and it would all just-work.
As a practical matter, we would only assemble and upload libraries into Debian that were actually required by Rust executables also in Debian - this isn’t attempting to be a viable alternative to cargo and crates.io for regular upstream software development.
The latter. If we want to have an executable built using cargo in Debian (this includes cargo itself), we need to be able to tell cargo to not use the network. As explained in the security example above, we’d also like to be able to point cargo at a central location so we can share those crates (source, not proposing rlibs/dylibs) across multiple cargo-using executables.
FYI: Luca’s excellent work on packaging cargo might give you some idea of the blunt tools required to get current cargo to not use the network.
Ah I see
It would be helpful to distinguish between “source” and “binary” packages, since I thought you were talking about splitting out the rustc and std source packaging (and I’ve had to resolve this ambiguity in some of the other discussion).
Well no, the link step isn’t specific to C. To make that more clear, in my example above I want to pass -C link-args="-Wl,-z,relro" to rustc. My other examples were about enabling/disabling cpu features and ABI details, which obviously need to influence the code that rustc compiler itself produces.
We can (and do) patch this for the rustc build system easily enough (since the rustc build system exposes these details quite openly), but this is harder for cargo and other Rust applications (built using cargo) since cargo intentionally doesn’t offer this flexibility (not saying whether that’s good or bad, just highlighting there’s a clash in use cases here).