[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cross compilation: dev packages depending on rustc



On Tue, Feb 13, 2024 at 07:42:41PM +0100, Johannes Schauer Marin Rodrigues wrote:
> The following packages have unmet dependencies:
>  librust-gdk4-dev:amd64 : Depends: rustc:amd64 (>= 1.70) but it is not installable
>  librust-gtk4-macros-dev:amd64 : Depends: rustc:amd64 (>= 1.70) but it is not installable
>  librust-gtk4-dev:amd64 : Depends: rustc:amd64 (>= 1.70) but it is not installable
>  librust-glib-dev:amd64 : Depends: rustc:amd64 (>= 1.70) but it is not installable
>  librust-libadwaita-dev:amd64 : Depends: rustc:amd64 (>= 1.70) but it is not installable
>  librust-cairo-rs-dev:amd64 : Depends: rustc:amd64 (>= 1.70) but it is not installable
>  librust-graphene-rs-dev:amd64 : Depends: rustc:amd64 (>= 1.70) but it is not installable
>  librust-gsk4-dev:amd64 : Depends: rustc:amd64 (>= 1.70) but it is not installable
> 
> Taking librust-gtk4-dev as an example, it appears that some rust dev-packages
> have a dependency on rustc added to them. This cannot work for cross
> compilation as this will pull in the host-architecture rust package and we need
> the build-architecture rustc. This is also why source packages like rust-gtk4
> have a build dependency on rustc:native. The :native qualifier ensures that the
> build architecture is selected for rustc. But :native does only work with
> build-dependencies and not for binary package dependencies.
> 
> I was wondering what this dependency on rustc is for and why it is necessary.
> If packages shipping C header files would depend on gcc, the same thing would
> happen.
> 
> Can you shed some light on the situation?

This is because the crate states that its minimum rust version is 1.70.

https://sources.debian.org/src/rust-gdk4/0.7.3-1/Cargo.toml/#L14

Rust is in sort of a weird spot here.  The library crates exist solely
to build actual binary crates.  The package being built may not have a
minimum required Rust version, but the library crates that it
(transitively) Build-Depends on do, and that's what this is trying to
express.

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB


Reply to: