#1124769 rustc: FTBFS rustc in Debian Bookworm because of conflict in build deps

#1124769#5
Date:
2026-01-06 14:23:11 UTC
From:
To:
Dear Maintainer,
it is impossible to build rustc on Debian Bookworm because of conflict in build deps.

How to reproduce.

Lets start new docker container with Debian Bookworm environment:
```
sudo docker run -it --rm debian:bookworm bash
```

Update apt cache:
```
apt update
```

Install some text editor:
```
apt install nano
```

Make backup of `/etc/apt/sources.list.d/debian.sources`:
```
cp /etc/apt/sources.list.d/debian.sources{,.bak}
```

Edit `/etc/apt/sources.list.d/debian.sources` and add deb-src:
```
nano /etc/apt/sources.list.d/debian.sources
```

Difference with original file:
```
root@9925b7386ff9:/# diff /etc/apt/sources.list.d/debian.sources{.bak,}
1c1
< Types: deb
---
8c8
< Types: deb
---
root@9925b7386ff9:/#
```

Update apt cache again:
```
apt update
```

Let's try to simulate installation of rustc build deps:
```
apt -s build-dep rustc
```

And this is a problem:
```
root@9925b7386ff9:/# apt -s build-dep rustc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libstd-rust-web-dev : Conflicts: libstd-rust-dev
 rustc-web : Conflicts: rustc
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
root@9925b7386ff9:/#
```

Problem reproduced on amd64 and arm64.

#1124769#10
Date:
2026-01-06 15:20:17 UTC
From:
To:

#1124769#15
Date:
2026-01-06 16:38:08 UTC
From:
To:
because I cannot reproduce this at all, see my previous reply..
#1124769#24
Date:
2026-01-06 16:36:08 UTC
From:
To:
Control: tag -1 +moreinfo

the following works just fine for me (didn't test a full build, just the initial build-dep setup):

$ sbuild -d bookworm rustc

[..]

+------------------------------------------------------------------------------+
| Fetch source files                           Tue, 06 Jan 2026 16:32:10 +0000 |
+------------------------------------------------------------------------------+


Check APT
---------

There are no deb-src lines in your sources.list
Automatically adding to EXTRA_REPOSITORIES: deb-src http://deb.debian.org/debian/ bookworm main
Automatically adding to EXTRA_REPOSITORIES: deb-src http://deb.debian.org/debian/ bookworm-updates main
Automatically adding to EXTRA_REPOSITORIES: deb-src http://security.debian.org/debian-security/ bookworm-security main

+------------------------------------------------------------------------------+
| Update chroot                                Tue, 06 Jan 2026 16:32:10 +0000 |
+------------------------------------------------------------------------------+

Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://security.debian.org/debian-security bookworm-security InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Get:4 http://deb.debian.org/debian bookworm/main Sources [9494 kB]
Get:5 http://security.debian.org/debian-security bookworm-security/main Sources [196 kB]
Get:6 http://deb.debian.org/debian bookworm-updates/main Sources [3288 B]
Fetched 9693 kB in 2s (5163 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Checking available source versions...

Download source files with APT
------------------------------

Reading package lists...
NOTICE: 'rustc' packaging is maintained in the 'Git' version control system at:
https://salsa.debian.org/rust-team/rust.git
Please use:
git clone https://salsa.debian.org/rust-team/rust.git
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 32.6 MB of source archives.
Get:1 http://deb.debian.org/debian bookworm/main rustc 1.63.0+dfsg1-2 (dsc) [3535 B]
Get:2 http://deb.debian.org/debian bookworm/main rustc 1.63.0+dfsg1-2 (tar) [32.5 MB]
Get:3 http://deb.debian.org/debian bookworm/main rustc 1.63.0+dfsg1-2 (diff) [92.2 kB]
Fetched 32.6 MB in 3s (11.4 MB/s)
Download complete and in download only mode

+------------------------------------------------------------------------------+
| Install package build dependencies           Tue, 06 Jan 2026 16:32:16 +0000 |
+------------------------------------------------------------------------------+

[..]

 main build dependencies (apt-based resolver)
----------------------------------------------------

Installing build dependencies
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  autoconf automake autopoint autotools-dev binutils-mingw-w64-x86-64
  bsdextrautils cargo clang-14 cmake cmake-data debhelper dh-autoreconf
  dh-strip-nondeterminism dwz file gcc-mingw-w64-base
  gcc-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix-runtime gdb gettext
  gettext-base git git-man groff-base icu-devtools intltool-debian
  libarchive-zip-perl libarchive13 libbabeltrace1 libboost-regex1.74.0
  libbrotli1 libbsd0 libclang-common-14-dev libclang-cpp14 libclang1-14
  libcurl3-gnutls libcurl3-nss libcurl4 libdebhelper-perl libdebuginfod-common
  libdebuginfod1 libdw1 libedit2 libelf1 liberror-perl libexpat1 libffi-dev
  libfile-stripnondeterminism-perl libgc1 libgit2-1.5 libglib2.0-0
  libhttp-parser2.9 libicu-dev libicu72 libipt2 libjsoncpp25 libldap-2.5-0
  libllvm14 liblzma-dev libmagic-mgc libmagic1 libmbedcrypto7 libmbedtls14
  libmbedx509-1 libncurses-dev libncurses6 libncursesw6 libnghttp2-14 libnspr4
  libnss3 libobjc-12-dev libobjc4 libpfm4 libpipeline1 libpkgconf3 libproc2-0
  libpsl5 libpython3-stdlib libpython3.11 libpython3.11-minimal
  libpython3.11-stdlib libreadline8 librhash0 librtmp1 libsasl2-2
  libsasl2-modules-db libsource-highlight-common libsource-highlight4v5
  libsqlite3-0 libssh2-1 libstd-rust-1.63 libstd-rust-dev libsub-override-perl
  libtinfo-dev libtool libuchardet0 libuv1 libxml2 libxml2-dev libyaml-0-2
  libz3-4 libz3-dev llvm-14 llvm-14-dev llvm-14-linker-tools llvm-14-runtime
  llvm-14-tools m4 man-db media-types mingw-w64-common mingw-w64-x86-64-dev
  nss-plugin-pem pkg-config pkgconf pkgconf-bin po-debconf procps python3
  python3-minimal python3-pkg-resources python3-pygments python3-yaml
  python3.11 python3.11-minimal readline-common rustc sensible-utils ucf
  wasi-libc zlib1g-dev
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc cargo-doc clang-14-doc cmake-doc
  cmake-format elpa-cmake-mode ninja-build dh-make gcc-12-locales gdb-doc
  gdbserver gettext-doc libasprintf-dev libgettextpo-dev git-daemon-run
  | git-daemon-sysvinit git-doc git-email git-gui gitk gitweb git-cvs
  git-mediawiki git-svn groff lrzip low-memory-monitor icu-doc liblzma-doc
  ncurses-doc libtool-doc gfortran | fortran95-compiler gcj-jdk llvm-14-doc
  m4-doc apparmor less www-browser wine64 libmail-box-perl python3-doc
  python3-tk python3-venv python3-setuptools python-pygments-doc
  ttf-bitstream-vera python3.11-venv python3.11-doc binfmt-support
  readline-doc lld-14
Recommended packages:
  libc-dbg curl | wget | lynx ca-certificates less ssh-client
  libclang-rt-14-dev libarchive-cpio-perl libglib2.0-data shared-mime-info
  xdg-user-dirs libldap-common libgpm2 publicsuffix libsasl2-modules
  libltdl-dev binfmt-support | systemd libmail-sendmail-perl psmisc
The following NEW packages will be installed:
  autoconf automake autopoint autotools-dev binutils-mingw-w64-x86-64
  bsdextrautils cargo clang-14 cmake cmake-data debhelper dh-autoreconf
  dh-strip-nondeterminism dwz file gcc-mingw-w64-base
  gcc-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix-runtime gdb gettext
  gettext-base git git-man groff-base icu-devtools intltool-debian
  libarchive-zip-perl libarchive13 libbabeltrace1 libboost-regex1.74.0
  libbrotli1 libbsd0 libclang-common-14-dev libclang-cpp14 libclang1-14
  libcurl3-gnutls libcurl3-nss libcurl4 libdebhelper-perl libdebuginfod-common
  libdebuginfod1 libdw1 libedit2 libelf1 liberror-perl libexpat1 libffi-dev
  libfile-stripnondeterminism-perl libgc1 libgit2-1.5 libglib2.0-0
  libhttp-parser2.9 libicu-dev libicu72 libipt2 libjsoncpp25 libldap-2.5-0
  libllvm14 liblzma-dev libmagic-mgc libmagic1 libmbedcrypto7 libmbedtls14
  libmbedx509-1 libncurses-dev libncurses6 libncursesw6 libnghttp2-14 libnspr4
  libnss3 libobjc-12-dev libobjc4 libpfm4 libpipeline1 libpkgconf3 libproc2-0
  libpsl5 libpython3-stdlib libpython3.11 libpython3.11-minimal
  libpython3.11-stdlib libreadline8 librhash0 librtmp1 libsasl2-2
  libsasl2-modules-db libsource-highlight-common libsource-highlight4v5
  libsqlite3-0 libssh2-1 libstd-rust-1.63 libstd-rust-dev libsub-override-perl
  libtinfo-dev libtool libuchardet0 libuv1 libxml2 libxml2-dev libyaml-0-2
  libz3-4 libz3-dev llvm-14 llvm-14-dev llvm-14-linker-tools llvm-14-runtime
  llvm-14-tools m4 man-db media-types mingw-w64-common mingw-w64-x86-64-dev
  nss-plugin-pem pkg-config pkgconf pkgconf-bin po-debconf procps python3
  python3-minimal python3-pkg-resources python3-pygments python3-yaml
  python3.11 python3.11-minimal readline-common rustc
  sbuild-build-depends-main-dummy sensible-utils ucf wasi-libc zlib1g-dev
0 upgraded, 132 newly installed, 0 to remove and 0 not upgraded.
Need to get 286 MB of archives.

[..]

#1124769#31
Date:
2026-01-06 19:41:06 UTC
From:
To:
Fabian, hi!

Thank you for such quick answer!

You wrote:
forget to also add the corresponding main bookworm repository?

I think my repository setup is complete. As proof that main bookworm
repository added in my setup:
```
root@9925b7386ff9:/# apt policy rustc
rustc:
  Installed: (none)
  Candidate: 1.63.0+dfsg1-2
  Version table:
     1.63.0+dfsg1-2 500
        500 http://deb.debian.org/debian bookworm/main arm64 Packages
root@9925b7386ff9:/#
```

So, I can install binary rustc package. Binary rustc package is located
in main bookworm repository. So I think it's all ok with my repository
setup.

You wrote:
thread? I used only base tools like apt and nano (no advanced
complicated tools like sbuild), so, I think, there can be no mistakes
in described steps sequence to reproduce problem in Debian Bookworm
environment.
I use official Debian Bookworm image from these resource:
https://hub.docker.com/layers/library/debian/bookworm/images/sha256-409529ea1ed9728a9a5fb4960fdf9163e8b608c34db681a1273c617c056d325d

I event tried to pull image again, but it is up to date:
```

ubuntu@ubuntu:~$ sudo docker run --pull=always -it --rm debian:bookworm
bash
bookworm: Pulling from library/debian
Digest:
sha256:c66c66fac809bfb56a8001b12f08181a49b6db832d2c8ddabe22b6374264055f
Status: Image is up to date for debian:bookworm
root@7c98c710cd67:/#
```

I tried again steps described at beginning of this thread with new
fresh container. Even I removed local apt lists before final apt
update. Please look at repository configuration and output of `apt
update`:
```
root@7c98c710cd67:/# rm -rf /var/lib/apt/lists/*
root@7c98c710cd67:/# cat /etc/apt/sources.list.d/debian.sources
Types: deb deb-src
# http://snapshot.debian.org/archive/debian/20251229T000000Z
URIs: http://deb.debian.org/debian
Suites: bookworm bookworm-updates
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb deb-src
# http://snapshot.debian.org/archive/debian-security/20251229T000000Z
URIs: http://deb.debian.org/debian-security
Suites: bookworm-security
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
root@7c98c710cd67:/# apt update
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease
[48.0 kB]
Get:4 http://deb.debian.org/debian bookworm/main Sources [9494 kB]
Get:5 http://deb.debian.org/debian bookworm/main arm64 Packages [8693
kB]
Get:6 http://deb.debian.org/debian bookworm-updates/main Sources [3288
B]
Get:7 http://deb.debian.org/debian bookworm-updates/main arm64 Packages
[6936 B]
Get:8 http://deb.debian.org/debian-security bookworm-security/main
Sources [196 kB]
Get:9 http://deb.debian.org/debian-security bookworm-security/main
arm64 Packages [286 kB]
Fetched 18.9 MB in 15s (1260 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@7c98c710cd67:/#
```

I think it's all ok with main bookworm repository in this setup. Do you
agree?

And problem is still here:
```
root@7c98c710cd67:/# apt -s build-dep rustc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libstd-rust-web-dev : Conflicts: libstd-rust-dev
 rustc-web : Conflicts: rustc
E: Error, pkgProblemResolver::Resolve generated breaks, this may be
caused by held packages.
root@7c98c710cd67:/#
```

Described problem can be reproduced with described steps in Debian
Bookworm amd64 environment, I checked again.

And last info. I tried to reproduce described problem in Debian Trixie
docker image (arm64):
```
ubuntu@ubuntu:~$ sudo docker run --pull=always --rm -it debian:trixie
bash
trixie: Pulling from library/debian
5785abec2864: Pull complete
Digest:
sha256:c71b05eac0b20adb4cdcc9f7b052227efd7da381ad10bb92f972e8eae7c6cdc9
Status: Downloaded newer image for debian:trixie
root@eae19363f5e9:/#
```

And it's all ok in Debian Trixie. `apt -s build-dep rustc` successfully
works. In amd64 too. So, I think, that way to reproduce problem in
Debian Bookworm is correct, but some problem in build deps of rustc in
Debian Bookworm exists (at least in amd64, arm64 - maybe in other archs
too).

#1124769#36
Date:
2026-01-06 20:27:37 UTC
From:
To:
Control: reassign -1 src:rustc-web 1.85.0+dfsg3-1~deb12u3
But I can reproduce the issue in a plain bookworm chroot as well, it's
just that sbuild (the official way to build packages) uses a different
(build-)dependency resolver than `apt build-dep`.

The actual problem is that rustc-web and cargo-web both have a Provides:
for regular rustc and cargo, but cargo-web's one is unversioned, and thus
a versioned build-dependency on both rustc and cargo (which rustc has)
potentially only picks up rustc-web, but not cargo-web, which is an
invalid combination because of the Conflicts.

Reassigning accordingly, pochu/adilinger feel free to provide further
input, I think the correct solution here is to add a version to cargo-web's
Provides line as well, or drop the version from rustc-web's?

@Sergey: I think you can work around the issue by first installing rustc
and cargo, then running `apt build-dep` again - at least that works in my
reproducer environment.

Fabian

#1124769#47
Date:
2026-01-06 20:30:35 UTC
From:
To:
Fabian, if you don't like docker for some reasons, I can show way howto
reproduce problem with debootstap.

Just for information, I have RaspberryPI with Ubuntu 22.04.5 LTS and
debootstap 1.0.142 taken from Debian Forky
(https://packages.debian.org/forky/debootstrap)
```
ubuntu@ubuntu:~$ debootstrap --version
debootstrap 1.0.142
ubuntu@ubuntu:~$ apt list --installed | grep debootstrap

WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.

debootstrap/now 1.0.142 all [installed,local]
ubuntu@ubuntu:~$
```

Let's try to reproduce a problem.

Create Debian Bookworm chroot environment in minbase variant:
```
sudo debootstrap --no-check-sig --variant=minbase bookworm bookworm-
chroot-env http://deb.debian.org/debian/ |& tee debootstrap.log
```

debootstrap.log attached to letter just for information.

Only main bookworm repo exists in sources list at this moment:
```
ubuntu@ubuntu:~$ cat bookworm-chroot-env/etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main
ubuntu@ubuntu:~$ ls bookworm-chroot-env/etc/apt/sources.list.d/
ubuntu@ubuntu:~$
```

Add deb-src:
```
echo "deb-src http://deb.debian.org/debian bookworm main" | sudo tee -a
bookworm-chroot-env/etc/apt/sources.list
```

sources.list after this change looks like this:
```
ubuntu@ubuntu:~$ cat bookworm-chroot-env/etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main
deb-src http://deb.debian.org/debian bookworm main
ubuntu@ubuntu:~$
```

Chroot in created environment:
```
sudo chroot bookworm-chroot-env bash
```

Update apt cache:
```
apt update
```

Output in my case:
```
root@ubuntu:/# apt update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://deb.debian.org/debian bookworm/main Sources [9494 kB]
Get:3 http://deb.debian.org/debian bookworm/main Translation-en [6109
kB]
Fetched 15.6 MB in 8s (1918 kB/s)
Reading package lists... Done
Building dependency tree... Done
All packages are up to date.
root@ubuntu:/#
```

And now we can see problem just like in docker earlier in this thread:
```
root@ubuntu:/# apt -s build-dep rustc
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libstd-rust-web-dev : Conflicts: libstd-rust-dev
 rustc-web : Conflicts: rustc
E: Error, pkgProblemResolver::Resolve generated breaks, this may be
caused by held packages.
root@ubuntu:/#
```

I also checked Debian Bookworm chroot env created in described way in
amd64. I reprpoduced problem in described way.

P.S. We can try to reproduce problem in chroot environment with Trixie
created using debootstrap:
```
sudo debootstrap --no-check-sig --variant=minbase trixie trixie-chroot-
env http://deb.debian.org/debian/ |& tee debootstrap.log
```
But `apt -s build-dep rustc` works ok in Debian Trixie arm64 and amd64.

#1124769#52
Date:
2026-01-06 20:32:40 UTC
From:
To:
Oh, I just received your letter that you already reproduced problem
with debootstrap too. Thank you!

В Вт, 06/01/2026 в 21:27 +0100, Fabian Grünbichler пишет: