[Pkg-rust-maintainers] Bug#1102311: Bug#1102311: rust-src is missing Cargo.lock
Fabian Grünbichler
debian at fabian.gruenbichler.email
Mon Apr 7 20:47:21 BST 2025
On April 7, 2025 8:57:56 PM GMT+02:00, Matt Corallo <rpmcitoo at bluematt.me> wrote:
>
>
>On 4/7/25 2:13 PM, Fabian Grünbichler wrote:
>> Version: 1.82.0+dfsg1-1
>>
>> On Mon, Apr 7, 2025, at 3:31 PM, Matt Corallo wrote:
>>> Package: src:rustc
>>> Version: 1.63.0+dfsg1-2
>>>
>> rustc since the version mentioned above ships the original Cargo.lock
>> in rust-src.
>
>https://packages.debian.org/bookworm/all/rust-src/filelist disagrees? There are various Cargo.lock files, but none at the path above and all for dependent crates of std, not for std itself.
That's bookworm, the version with the fix came later, Trixie/did ship the Cargo.lock file:
https://packages.debian.org/trixie/all/rust-src/filelist
>> this enables calling
>>
>> RUST_BOOTSTRAP=1 cargo build -Zbuild-std
>>
>> depending on your desired target, you might need additional flags
>> and/or workarounds though.
>
>Yes, I have to run `touch /usr/lib/rustlib/src/rust/Cargo.lock` first :).
You don't in Trixie ;)
>> note that this lock file includes a lot of things that we actually
>> remove when doing the package build, and versions might not line up
>> 100% as a result, so it is possible for this to fail still or be
>> buggy.
>>
>> shipping the actually used Cargo.lock file would require also shipping
>> a copy of all the vendored crates used for the build in their patched
>> form (since those would be referenced by that Cargo.lock file), and
>> configuring the build to use it (at least for building core and std and
>> friends).
>
>Specifically, my issue is that building with the above command results in failures because cargo pulls the latest `compiler-builtins` when building with -Zbuild-std which fails to build (as compiler-builtins is only supported for a specific version of rustc). A Cargo.lock should enable rustc to pin `compiler-builtins`, I imagine.
>
>> you can likely manually achieve such a setup by downloading the rustc
>> source package and modifying it to build a toolchain and libstd for
>> your desired target.
>
>If this is required maybe debian should be shipping for way more platforms?
That's not really possible/in scope for Debian..
More information about the Pkg-rust-maintainers
mailing list