#1086702 - llvm-toolchain-19: FTBFS: Could not find wasi-libc on the system - Debian Bug report logs

Debian Bug report logs - #1086702
llvm-toolchain-19: FTBFS: Could not find wasi-libc on the system

version graph

Package: src:llvm-toolchain-19; Maintainer for src:llvm-toolchain-19 is LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>;

Reported by: "Duetsch, Thomas" <thomas.duetsch@siemens.com>

Date: Mon, 4 Nov 2024 12:33:01 UTC

Severity: normal

Tags: ftbfs

Found in version llvm-toolchain-19/19.1.2-2

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>:
Bug#1086702; Package src:llvm-toolchain-19. (Mon, 04 Nov 2024 12:33:02 GMT) (full text, mbox, link).


Acknowledgement sent to "Duetsch, Thomas" <thomas.duetsch@siemens.com>:
New Bug report received and forwarded. Copy sent to LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>.

Your message tried to set a usertag, but didn't have a valid user set ('"Duetsch' isn't valid)

(Mon, 04 Nov 2024 12:33:02 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: "Duetsch, Thomas" <thomas.duetsch@siemens.com>
To: "submit@bugs.debian.org" <submit@bugs.debian.org>
Subject: llvm-toolchain-19: FTBFS: Could not find wasi-libc on the system
Date: Mon, 4 Nov 2024 12:28:31 +0000
Source: llvm-toolchain-19
Version: 19.1.2-2
Tags: ftbfs

Dear Maintainer,

The source package llvm-toolchain-19 FTBFS on a current Trixie system running on ARM64.
Log output:
---
# llvm-spirv was found, so we can enable *.spv files. Debian
# buster and Ubuntu 18.04 don't have llvm-spirv to create the
# *.spv files.
if test "no" = "yes"; then \
	sed -i -e "s|#spv\ ||g" debian/libclc-19.install; \
fi
# disable libc++-X.Y-dev-wasm32.install.in on old distro
if test "yes" = "no"; then \
	echo "" > debian/libc++-19-dev-wasm32.install; \
	echo "" > debian/libc++abi-19-dev-wasm32.install; \
else \
	if ! dpkg -l|grep -q wasi-libc; then \
		echo "Could not find wasi-libc on the system"; \
		echo "Please check that the package is available on the system"; \
		echo "it might be that the 'hello' package is installed by another constraint"; \
		exit 1; \
	fi; \
fi
Could not find wasi-libc on the system
Please check that the package is available on the system
it might be that the 'hello' package is installed by another constraint
make[1]: *** [debian/rules:699: stamps/preconfigure] Error 1
make[1]: Leaving directory '/work/tmp/llvm-toolchain-19_19.1.2-2/llvm-toolchain-19-19.1.2'
make: *** [debian/rules:646: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1184:
dpkg-buildpackage -us -uc -ui -j6 -F failed
---

Digging into the control file, we found this patch:
https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/b13a5e5005bcc0da6bde1a2331d82c14e79fd9d1

This seems to break the build-dependencies for an ARM based build. The patch ignores the warning described a few lines below regarding the constraints of the alternatives.
Below is a small patch which fixes the issue for us.

---
diff -ru debian/control debian.new/control
--- debian/control      2024-10-26 07:14:42.000000000 +0000
+++ debian.new/control  2024-11-04 11:43:58.460681442 +0000
@@ -16,7 +16,7 @@
     libipt-dev [amd64 i386],
     lcov, procps, help2man,
     zlib1g-dev, libzstd-dev,
-    g++-multilib [amd64 i386 mips64 mips64el mipsel powerpc ppc64 s390x sparc sparc64 x32] | hello,
+    g++-multilib [amd64 i386 mips64 mips64el mipsel powerpc ppc64 s390x sparc sparc64 x32] | hello [amd64 i386 mips64 mips64el mipsel powerpc ppc64 s390x sparc sparc64 x32],
     libjs-mathjax, python3-myst-parser | python3-recommonmark, python3-pexpect,
     doxygen, time,
     ocaml-base [amd64 arm64 ppc64el riscv64 s390x] | ocaml-nox [amd64 arm64 ppc64el riscv64 s390x],
diff -ru debian/control.in debian.new/control.in
--- debian/control.in   2024-10-26 07:14:42.000000000 +0000
+++ debian.new/control.in       2024-11-04 11:44:15.650681247 +0000
@@ -16,7 +16,7 @@
     libipt-dev [amd64 i386],
     lcov, procps, help2man,
     zlib1g-dev, libzstd-dev,
-    g++-multilib [@MULTILIB_ARCHS@] | hello,
+    g++-multilib [@MULTILIB_ARCHS@] | hello [@MULTILIB_ARCHS@],
     libjs-mathjax, python3-myst-parser | python3-recommonmark, python3-pexpect,
     doxygen,@USAGE_BUILD_DEP@
     ocaml-base [@OCAML_ARCHS@] | ocaml-nox [@OCAML_ARCHS@],---

With best regards,
Thomas Duetsch

Information forwarded to debian-bugs-dist@lists.debian.org, LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>:
Bug#1086702; Package src:llvm-toolchain-19. (Tue, 05 Nov 2024 09:09:01 GMT) (full text, mbox, link).


Acknowledgement sent to Sylvestre Ledru <sylvestre@debian.org>:
Extra info received and forwarded to list. Copy sent to LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>. (Tue, 05 Nov 2024 09:09:02 GMT) (full text, mbox, link).


Message #10 received at 1086702@bugs.debian.org (full text, mbox, reply):

From: Sylvestre Ledru <sylvestre@debian.org>
To: "Duetsch, Thomas" <thomas.duetsch@siemens.com>, 1086702@bugs.debian.org
Subject: Re: Bug#1086702: llvm-toolchain-19: FTBFS: Could not find wasi-libc on the system
Date: Tue, 5 Nov 2024 10:07:08 +0100
Le 04/11/2024 à 13:28, Duetsch, Thomas a écrit :
> Source: llvm-toolchain-19
> Version: 19.1.2-2
> Tags: ftbfs
>
> Dear Maintainer,
>
> The source package llvm-toolchain-19 FTBFS on a current Trixie system running on ARM64.

Do you have more details about the context?

https://buildd.debian.org/status/logs.php?pkg=llvm-toolchain-19&arch=arm64

it has been ok here for a while :)

Cheers

S





Information forwarded to debian-bugs-dist@lists.debian.org, LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>:
Bug#1086702; Package src:llvm-toolchain-19. (Tue, 05 Nov 2024 13:30:02 GMT) (full text, mbox, link).


Acknowledgement sent to "Duetsch, Thomas" <thomas.duetsch@siemens.com>:
Extra info received and forwarded to list. Copy sent to LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>. (Tue, 05 Nov 2024 13:30:02 GMT) (full text, mbox, link).


Message #15 received at 1086702@bugs.debian.org (full text, mbox, reply):

From: "Duetsch, Thomas" <thomas.duetsch@siemens.com>
To: Sylvestre Ledru <sylvestre@debian.org>, "1086702@bugs.debian.org" <1086702@bugs.debian.org>
Subject: RE: Bug#1086702: llvm-toolchain-19: FTBFS: Could not find wasi-libc on the system
Date: Tue, 5 Nov 2024 13:26:19 +0000
> Do you have more details about the context?
>
> https://buildd.debian.org/status/logs.php?pkg=llvm-toolchain-19&arch=arm64
>
> it has been ok here for a while :)
>
> Cheers
>
> S

I've seen that as well. I can't really explain why, but what we do when recompiling is the following:
We run the latest debian:trixie container and execute these commands.
---

# add deb-src
sed -i  "s/Types: deb/Types: deb deb-src/g"  /etc/apt/sources.list.d/debian.sources
apt-get update
apt-get upgrade -y
apt-get install -y --no-install-recommends devscripts equivs
apt-get source llvm-toolchain-19
cd llvm-toolchain-19-19.1.2/
mk-build-deps --install --remove
---

That leaves you with this list of dependencies to be installed:
---
The following NEW packages will be installed:
  binutils-dev build-essential chrpath cmake cmake-data dh-exec dh-ocaml diffstat docutils-common doxygen fonts-mathjax g++ g++-14 g++-14-aarch64-linux-gnu g++-aarch64-linux-gnu hello help2man
  icu-devtools lcov libabsl-dev libabsl20230802 libalgorithm-c3-perl libarchive13t64 libb-hooks-endofscope-perl libbigarray-compat-ocaml libbigarray-compat-ocaml-dev libbrotli-dev libbrotli1
  libbsd-dev libc-ares-dev libcapture-tiny-perl libcares2 libclang-cpp19 libclang1-19 libclass-c3-perl libclass-data-inheritable-perl libclass-inspector-perl libclass-singleton-perl
  libcompiler-libs-ocaml-dev libconfig-tiny-perl libctypes-ocaml libctypes-ocaml-dev libcurl4-openssl-dev libcurl4t64 libdata-optlist-perl libdatetime-locale-perl libdatetime-perl
  libdatetime-timezone-perl libdevel-stacktrace-perl libedit-dev libedit2 libelf-dev libeval-closure-perl libevent-2.1-7t64 libexception-class-perl libexpat1-dev libffi-dev libfile-sharedir-perl
  libfindlib-ocaml libfmt9 libgmp-dev libgmpxx4ldbl libgnutls-dane0t64 libgnutls-openssl27t64 libgnutls28-dev libgrpc++-dev libgrpc++1.51t64 libgrpc-dev libgrpc29t64 libicu-dev libidn2-dev
  libintegers-ocaml libintegers-ocaml-dev libjs-jquery libjs-mathjax libjs-sphinxdoc libjs-underscore libjson-perl libjsoncpp-dev libjsoncpp26 libllvm19 liblocale-gettext-perl libmd-dev
  libmodule-implementation-perl libmro-compat-perl libnamespace-autoclean-perl libnamespace-clean-perl libncurses-dev libncurses6 libnghttp2-14 libnghttp2-dev libp11-kit-dev
  libpackage-stash-perl libparams-util-perl libparams-validationcompiler-perl libperlio-gzip-perl libpfm4 libpfm4-dev libpkgconf3 libproc2-0 libprotobuf-dev libprotobuf-lite32t64
  libprotobuf32t64 libprotoc32t64 libpsl-dev libpsl5t64 libpython3-dev libpython3.12-dev libpython3.12t64 libre2-11 libre2-dev librhash1 librtmp-dev librtmp1 libspecio-perl libssh2-1-dev
  libssh2-1t64 libssl-dev libstdc++-14-dev libstdlib-ocaml libstdlib-ocaml-dev libsub-exporter-perl libsub-exporter-progressive-perl libsub-identify-perl libsub-install-perl libsub-name-perl
  libtasn1-6-dev libtext-unidecode-perl libunbound8 libuv1t64 libvariable-magic-perl libxapian30 libxml-libxml-perl libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-perl libxml2-dev
  libxstring-perl libyaml-0-2 libz3-4 libz3-dev libzstd-dev lsb-release nettle-dev ninja-build ocaml ocaml-base ocaml-findlib ocaml-interp pkg-config pkgconf pkgconf-bin procps protobuf-compiler
  protobuf-compiler-grpc python-babel-localedata python3-alabaster python3-autocommand python3-babel python3-certifi python3-chardet python3-charset-normalizer python3-defusedxml python3-dev
  python3-docutils python3-idna python3-imagesize python3-inflect python3-jaraco.context python3-jaraco.functools python3-jinja2 python3-markdown-it python3-markupsafe python3-mdit-py-plugins
  python3-mdurl python3-more-itertools python3-myst-parser python3-packaging python3-pexpect python3-pkg-resources python3-ptyprocess python3-pygments python3-requests python3-roman
  python3-setuptools python3-snowballstemmer python3-sphinx python3-typeguard python3-typing-extensions python3-urllib3 python3-yaml python3-zipp python3.12-dev sgml-base sharutils sphinx-common
  swig tex-common texinfo texinfo-lib time ucf xml-core zlib1g-dev
---

Notably it installs "hello", but not "wasi-libc" (same goes for the spirv packages). Somehow the resolution seems to be different than on the official build server in that it installs hello because of the g++-multilib line and then does not install any of the other packages, because hello satisfies the build-dep already, as described in the comment, I think.
The command "apt-get build-dep --only-source llvm-toolchain-19" yields the same result.

After that, the build fails with the mentioned error message.

Cheers,
Thomas


Information forwarded to debian-bugs-dist@lists.debian.org, LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>:
Bug#1086702; Package src:llvm-toolchain-19. (Wed, 13 Nov 2024 09:51:02 GMT) (full text, mbox, link).


Acknowledgement sent to Matthias Klose <doko@debian.org>:
Extra info received and forwarded to list. Copy sent to LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>. (Wed, 13 Nov 2024 09:51:02 GMT) (full text, mbox, link).


Message #20 received at 1086702@bugs.debian.org (full text, mbox, reply):

From: Matthias Klose <doko@debian.org>
To: 1086702@bugs.debian.org, 1086702-submitter@bugs.debian.org
Subject: alternative hello build dependencies
Date: Wed, 13 Nov 2024 10:50:14 +0100
From my point of view, these alternative hello dependencies are a hack.

My understanding is that Sylvestre wants to use the very same control 
file for Debian builds, and for his uploads to apt.llvm.org, for 
multiple releases of Debian and Ubuntu.  I don't think that's 
reasonable, but I seem to be in disagreement with Sylvestre.

My proposed fix for that issue is to remove these alternative build 
dependencies, and regenerate the control file before building the 
package. This way, you can get exactly the needed build dependency.

This would be a no-change for the Debian builds, but would require 
changes in the CI how packages are built for apt.llvm.org.  It's fine to 
build such packages out of the Debian repository, but that should not 
become a burden for the Debian packages itself.

The changed CI for apt.llvm.org should do instead of a simple sbuild an 
unpack of the sources, running debian/rules stamps/preconfigure, 
debian/rules clean, and then calling sbuild to get the proper build 
dependencies for each specific build.

Matthias




Message sent on to "Duetsch, Thomas" <thomas.duetsch@siemens.com>:
Bug#1086702. (Wed, 13 Nov 2024 09:51:02 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Nov 24 09:36:44 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.