Public bug reported:

Hi!

According to file debian/README.source
(https://git.launchpad.net/ubuntu/+source/rustc-1.80/tree/debian/README.source?h=applied/ubuntu/devel#n45),
profile `pkg.rustc.dlstage0` is intended to build rust-1.80 using
"official"stage0 compiler for the version being built from rust-
lang.org. So it is obvious, that system rustc from OS is not necessary
in such scenario. But actually it is impossible to build rustc-1.80 from
sources in Ubuntu using `pkg.rustc.dlstage0`.

Howto reproduce problem.

Run docker container with Ubuntu Plucky:
```
$ docker run --rm -it ubuntu:devel bash
```

Version of image in my case:
```
$ docker images
<...>
ubuntu                                                           devel      
aaaffc146c5b   5 weeks ago    82.1MB
<...>
```

And this is version of OS in container:
```
root@004fd5c54689:~# lsb_release -rd
Description:    Ubuntu Plucky Puffin (development branch)
Release:        25.04
root@004fd5c54689:~#
```

Update apt cache:
```
root@004fd5c54689:~# apt update
```

Install vim:
```
root@004fd5c54689:~# apt install vim
```

Edit /etc/apt/sources.list.d/ubuntu.sources:
```
root@004fd5c54689:~# vi /etc/apt/sources.list.d/ubuntu.sources
```

Append in vim `deb-src` to all lines starting with `Types: deb`.

Update apt cache again:
```
root@004fd5c54689:~# apt update

```

Get sources of rustc-1.80:
```
root@004fd5c54689:~# apt source rustc-1.80
```

Version 1.80.1+dfsg0ubuntu1-0ubuntu2 received. This is expected version
according to https://packages.ubuntu.com/source/plucky/rustc-1.80.

Install dpkg-dev package:
```
root@004fd5c54689:~# apt install dpkg-dev
```

Extract sources of rustc-1.80:
```
root@004fd5c54689:~# dpkg-source -x *.dsc
```

Goto into dir with extracted sources.

Let's try to install build deps according to debian/README.source (see 
"Building from source") with profile `pkg.rustc.dlstage0`:
```
root@004fd5c54689:~/rustc-1.80-1.80.1+dfsg0ubuntu1# apt-get build-dep -P 
pkg.rustc.dlstage0 ./ 
Note, using directory './' to get the build dependencies 
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: 
builddeps:./ : Depends: cargo-1.79 but it is not installable 
               Depends: rustc-1.79 but it is not installable 
E: Unable to correct problems, you have held broken packages. 
root@004fd5c54689:~/rustc-1.80-1.80.1+dfsg0ubuntu1#
```

Binary packages rustc-1.79 and cargo-1.79 are absent in Ubuntu Plucky:
```
root@004fd5c54689:~# apt install rustc-1.79 cargo-1.79
Error: Unable to locate package rustc-1.79
Error: Couldn't find any package by glob 'rustc-1.79'
Error: Unable to locate package cargo-1.79
Error: Couldn't find any package by glob 'cargo-1.79'
```

We can verify this using page 
https://packages.ubuntu.com/source/noble-updates/rustc-1.79.
There is no info about plucky on this page.

But why source rustc-1.80 has build deps on absent rustc-1.79?
Why rustc-1.80 need system rustc-1.79 when profile `pkg.rustc.dlstage0` was 
specified?
This contradicts debian/README.source, "Building from source" with 
`pkg.rustc.dlstage0`.

The problem is happening because of this line in debian/control 
(https://git.launchpad.net/ubuntu/+source/rustc-1.80/tree/debian/control?h=applied/ubuntu/devel#n18):
```
Build-Depends:
<...>
 cargo-1.79 | cargo-1.80 <!pkg.rustc.dlstage0>,
 rustc-1.79 | rustc-1.80 <!pkg.rustc.dlstage0>,
<...>
```
We can make expirement and comment these dependencies using vim and try to 
build package without these deps:
```
root@004fd5c54689:~/rustc-1.80-1.80.1+dfsg0ubuntu1# apt-get build-dep -P 
pkg.rustc.dlstage0 ./ 
Note, using directory './' to get the build dependencies 
Reading package lists... Done 
Building dependency tree... Done 
Reading state information... Done 
The following NEW packages will be installed: 
 autoconf automake autopoint autotools-dev bash-completion bsdextrautils 
ca-certificates cargo cargo-1.80 clang-18 cmake cmake-data comerr-dev curl 
 debhelper debugedit dh-autoreconf dh-cargo dh-cargo-tools 
dh-strip-nondeterminism dwz file fonts-font-awesome fonts-mathjax 
fonts-open-sans gdb gettext 
 gettext-base git git-man groff-base intltool-debian krb5-multidev lib32gcc-s1 
lib32stdc++6 libarchive-zip-perl libarchive13t64 libbabeltrace1 
 libbrotli-dev libbrotli1 libc6-i386 libclang-common-18-dev libclang-cpp18 
libclang-rt-18-dev libclang1-18 libcurl3t64-gnutls libcurl4-gnutls-dev 
 libcurl4t64 libdebhelper-perl libdebuginfod-common libdebuginfod1t64 libdw1t64 
libedit2 libelf1t64 liberror-perl libevent-2.1-7t64 libffi-dev 
 libfile-stripnondeterminism-perl libgc1 libgit2-1.8 libgit2-dev 
libglib2.0-0t64 libgmp-dev libgmpxx4ldbl libgnutls-dane0t64 
libgnutls-openssl27t64 
 libgnutls28-dev libgssrpc4t64 libhttp-parser-dev libhttp-parser2.9 libidn2-dev 
libipt2 libjs-highlight.js libjs-jquery libjs-mathjax libjson-c5 
 libjsoncpp26 libkadm5clnt-mit12 libkadm5srv-mit12 libkdb5-10t64 libkrb5-dev 
libldap-dev libllvm18 liblzma-dev libmagic-mgc libmagic1t64 libncurses-dev 
 libncurses6 libnghttp2-14 libnghttp2-dev libobjc-14-dev libobjc4 
libp11-kit-dev libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpfm4 
 libpipeline1 libpkgconf3 libpsl-dev libpsl5t64 libpython3-stdlib librhash1 
librtmp-dev librtmp1 libsource-highlight-common libsource-highlight4t64 
 libsqlite3-dev libssh2-1-dev libssh2-1t64 libssl-dev libstd-rust-1.80 
libstd-rust-1.80-dev libtasn1-6-dev libtool libuchardet0 libunbound8 libuv1t64 
 libxml2 libxml2-dev libyaml-0-2 libz3-4 libz3-dev libzstd-dev llvm-18 
llvm-18-dev llvm-18-linker-tools llvm-18-runtime llvm-18-tools m4 man-db 
nettle-dev 
 openssl pkgconf pkgconf-bin po-debconf python3 python3-minimal 
python3-pygments python3-yaml python3.12 python3.12-minimal rustc rustc-1.80 
ucf 
 zlib1g-dev 
The following packages will be upgraded: 
 libzstd1 
1 upgraded, 147 newly installed, 0 to remove and 10 not upgraded. 
Need to get 281 MB of archives. 
After this operation, 1361 MB of additional disk space will be used. 
Do you want to continue? [Y/n]
```

As you can see, apt wants to install rustc-1.80 and cargo-1.80 even in that 
case. This contradicts debian/README.source ("Building from source" with 
`pkg.rustc.dlstage0`) again. Profile `pkg.rustc.dlstage0` is intended to build 
rustc-1.80 from source using "official"
stage0 compiler for the version being built from rust-lang.org, so rustc-1.80 
from OS is not necessary but actually apt tries to install it.

A similar problem exists in previous Ubuntu "24.04.1 LTS (Noble Numbat)" with 
version 1.80.1+dfsg0ubuntu1-0ubuntu0.24.04 of rustc-1.80. But difference is 
that in Ubuntu Noble rustc-1.79 and cargo-1.79 are available so build 
dependencies installation for rustc-1.80 version 
1.80.1+dfsg0ubuntu1-0ubuntu0.24.04 in Ubuntu Noble works successfully but 
question remains: why apt installed system ustc-1.79 and cargo-1.79 when 
profile `pkg.rustc.dlstage0` was used? It is interesing that if we comment 
dependencies on rustc and cargo in debian/control of rustc-1.80 in Ubuntu 
Noble, we can install build-deps without system rustc and cargo:
```
root@4adefb1b185c:~/rustc-1.80-1.80.1+dfsg0ubuntu1# apt-get build-dep -P 
pkg.rustc.dlstage0 ./ 
Note, using directory './' to get the build dependencies 
Reading package lists... Done 
Building dependency tree... Done 
Reading state information... Done 
The following NEW packages will be installed: 
 autoconf automake autopoint autotools-dev bash-completion bsdextrautils 
ca-certificates cargo clang-18 cmake cmake-data curl debhelper debugedit 
 dh-autoreconf dh-cargo dh-cargo-tools dh-strip-nondeterminism dwz file 
fonts-font-awesome fonts-mathjax fonts-open-sans gdb gettext gettext-base git 
 git-man groff-base icu-devtools intltool-debian lib32gcc-s1 lib32stdc++6 
libarchive-zip-perl libarchive13t64 libbabeltrace1 libc6-i386 
 libclang-common-18-dev libclang-cpp18 libclang-rt-18-dev libclang1-18 
libcurl3t64-gnutls libcurl4-gnutls-dev libcurl4t64 libdebhelper-perl 
 libdebuginfod-common libdebuginfod1t64 libdw1t64 libedit2 libelf1t64 
liberror-perl libffi-dev libfile-stripnondeterminism-perl libgc1 libgit2-1.7 
 libgit2-dev libglib2.0-0t64 libgssapi-krb5-2 libhttp-parser-dev 
libhttp-parser2.9 libicu-dev libicu74 libipt2 libjs-highlight.js libjs-jquery 
 libjs-mathjax libjsoncpp25 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 
libllvm17t64 libllvm18 liblzma-dev libmagic-mgc libmagic1t64 
 libncurses-dev libncurses6 libnghttp2-14 libobjc-13-dev libobjc4 libpcre2-16-0 
libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpfm4 libpipeline1 
 libpkgconf3 libpsl5t64 libpython3-stdlib librhash0 librtmp1 
libsource-highlight-common libsource-highlight4t64 libsqlite3-dev libssh-4 
libssh2-1-dev 
 libssh2-1t64 libssl-dev libstd-rust-1.75 libstd-rust-dev libsub-override-perl 
libtool libuchardet0 libuv1t64 libxml2 libxml2-dev libyaml-0-2 libz3-4 
 libz3-dev llvm-18 llvm-18-dev llvm-18-linker-tools llvm-18-runtime 
llvm-18-tools m4 man-db openssl pkgconf pkgconf-bin po-debconf python3 
python3-minimal 
 python3-pkg-resources python3-pygments python3-yaml python3.12 
python3.12-minimal rustc ucf zlib1g-dev 
0 upgraded, 131 newly installed, 0 to remove and 0 not upgraded. 
Need to get 315 MB of archives. 
After this operation, 1532 MB of additional disk space will be used. 
Do you want to continue? [Y/n]
```

But then when we try to build we will get an error:
```
root@4adefb1b185c:~/rustc-1.80-1.80.1+dfsg0ubuntu1# export 
DEB_BUILD_OPTIONS="nocheck" 
root@4adefb1b185c:~/rustc-1.80-1.80.1+dfsg0ubuntu1# export 
DEB_BUILD_PROFILES="pkg.rustc.dlstage0 nocheck"
root@4adefb1b185c:~/rustc-1.80-1.80.1+dfsg0ubuntu1# dpkg-buildpackage -b 
--no-sign 
dpkg-buildpackage: info: source package rustc-1.80 
dpkg-buildpackage: info: source version 1.80.1+dfsg0ubuntu1-0ubuntu0.24.04 
dpkg-buildpackage: info: source distribution noble 
dpkg-buildpackage: info: source changed by Zixing Liu 
<[email protected]> 
dpkg-buildpackage: info: host architecture amd64 
 dpkg-source --before-build . 
dpkg-source: info: using options from 
rustc-1.80-1.80.1+dfsg0ubuntu1/debian/source/options: --include-removal 
 debian/rules clean 
debian/rules:244: *** No suitable Rust toolchain found to bootstrap Rust 1.80.  
Stop. 
dpkg-buildpackage: error: debian/rules clean subprocess returned exit status 2
```

This also contradicts debian/README.source (see "Building from source"
with `pkg.rustc.dlstage0`
https://git.launchpad.net/ubuntu/+source/rustc-1.80/tree/debian/README.source?h=applied/ubuntu/noble-
updates#n46).

It's time to summarize. Building rustc-1.80 from sources in at least
Ubuntu Noble, Plucky and Focal (I also checked Focal) does not work as
expected with profile `pkg.rustc.dlstage0`. Can you fix it, please?

** Affects: rustc-1.80 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2095397

Title:
  FTBFS with profile pkg.rustc.dlstage0

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rustc-1.80/+bug/2095397/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to