Your message dated Mon, 07 Apr 2025 20:13:35 +0200
with message-id <[email protected]>
and subject line Re: [Pkg-rust-maintainers] Bug#1102311: rust-src is missing
Cargo.lock
has caused the Debian Bug report #1102311,
regarding rust-src is missing Cargo.lock
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1102311: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1102311
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: src:rustc
Version: 1.63.0+dfsg1-2
Because various libstds aren't packaged (including ones which cannot be packaged for license reasons
like macOS targets), `-Zbuild-std` is an important feature for being able to build for various targets.
Sadly, by default builds fail because of a missing Cargo.lock for libstd in the rust-src package.
Simply having an empty file at /usr/lib/rustlib/src/rust/Cargo.lock makes builds continue, but
forces cargo to fetch the latest copies of crates like compiler-builtins, which no longer build with
the version of rustc shipped in stable/bookworm (compiler-builtins in general only supports a single
specific rust version which its intended to be built with). Working around this is theoretically
doable with a magic dance, manually removing things from $HOME/.cargo and the --offline flag, but
its a huge PITA. I believe the inclusion of a Cargo.lock would make cargo fetch the correct versions
when building std.
--- End Message ---
--- Begin Message ---
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
>
> Because various libstds aren't packaged (including ones which cannot be
> packaged for license reasons
> like macOS targets), `-Zbuild-std` is an important feature for being
> able to build for various targets.
>
> Sadly, by default builds fail because of a missing Cargo.lock for
> libstd in the rust-src package.
> Simply having an empty file at /usr/lib/rustlib/src/rust/Cargo.lock
> makes builds continue, but
> forces cargo to fetch the latest copies of crates like
> compiler-builtins, which no longer build with
> the version of rustc shipped in stable/bookworm (compiler-builtins in
> general only supports a single
> specific rust version which its intended to be built with). Working
> around this is theoretically
> doable with a magic dance, manually removing things from $HOME/.cargo
> and the --offline flag, but
> its a huge PITA. I believe the inclusion of a Cargo.lock would make
> cargo fetch the correct versions
> when building std.
rustc since the version mentioned above ships the original Cargo.lock
in rust-src. this enables calling
RUST_BOOTSTRAP=1 cargo build -Zbuild-std
depending on your desired target, you might need additional flags
and/or workarounds though.
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).
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.
--- End Message ---