Bug #61845
openreef build fails on debian bookworm (and bullseye)
0%
Description
From the reef rc build:
==> CMakeFiles/CMakeError.log <== Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: g++-11 Build flags: -g;-O2;-ffile-prefix-map=/build/ceph-18.1.0=.;-fstack-protector-strong;-Wformat;-Werror=format-security;-Wdate-time;-D_FORTIFY_SOURCE=2 Id flags: The output was: No such file or directory
Updated by Casey Bodley 10 months ago
dh_auto_configure --buildsystem=cmake -- -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 ...
CMake Error at CMakeLists.txt:3 (project): The CMAKE_CXX_COMPILER: g++-11 is not a full path and was not found in the PATH.
in https://github.com/ceph/ceph/commit/79d7ae7195c5086bdff49aa0f25318d7ce51472d (part of "enable c++20" https://github.com/ceph/ceph/pull/45133), i pinned the compiler version to gcc 11. i'm sorry, i know that was a terrible hack. you can find some discussion about it at https://github.com/ceph/ceph/pull/45133/files#r844458718
ubuntu trusty and xenial require the 'toolchain ppa' for access to a new enough compiler version, and this change was necessary to select gcc-11 over its default gcc version. we tried using update-alternatives
instead to change the compiler version globally, but that started breaking CI builds on other ceph release branches that were expecting the default compiler version
Updated by Laura Flores 10 months ago
We discussed in the CLT call the idea of building on bookworm.
https://packages.debian.org/bookworm/gcc
Updated by Casey Bodley 9 months ago
- Status changed from New to Fix Under Review
- Pull request ID set to 52658
Casey Bodley wrote:
ubuntu trusty and xenial require the 'toolchain ppa' for access to a new enough compiler version, and this change was necessary to select gcc-11 over its default gcc version. we tried using
update-alternatives
instead to change the compiler version globally, but that started breaking CI builds on other ceph release branches that were expecting the default compiler version
it turns out that update-alternatives
isn't necessary for PR 'make check' because we're overriding the compiler to use clang instead. i verified in https://github.com/ceph/ceph/pull/52658 that 'make check' passes with this pin removed from debian/rules
the ceph-build repo for shaman builds already uses update-alternatives
to choose the right compiler version
Updated by Dan Mick 9 months ago
Testing the results of sorting through ceph-build etc. to remove the gcc-11 pin for all Debian releases and select gcc-12 either explicitly or implicitly for bookworm, I've now run into https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030129 which is blocking the pbuilder dependent package installation. We end up with the Java stacktrace in that bug, and package installation fails.
Vexingly, I can't reproduce the failure in a bookworm container, either by running install-deps.sh or manually installing/removing the two packages in question. I'm not sure if there's some precondition I could try to ensure before running the pbuilder build step that would work around the issue, but I'm subscribed to the bug above for any updates. Failing any divine inspiration, I'm hoping that the fix will get backported to 'stable' (bookworm) soon.
Current plan is to document this failure in the reef release notes and add a link to those notes to the Debian bug as another motivation for backport.
Updated by Zac Dover 9 months ago
Dan Mick wrote:
Testing the results of sorting through ceph-build etc. to remove the gcc-11 pin for all Debian releases and select gcc-12 either explicitly or implicitly for bookworm, I've now run into https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030129 which is blocking the pbuilder dependent package installation. We end up with the Java stacktrace in that bug, and package installation fails.
Vexingly, I can't reproduce the failure in a bookworm container, either by running install-deps.sh or manually installing/removing the two packages in question. I'm not sure if there's some precondition I could try to ensure before running the pbuilder build step that would work around the issue, but I'm subscribed to the bug above for any updates. Failing any divine inspiration, I'm hoping that the fix will get backported to 'stable' (bookworm) soon.
Current plan is to document this failure in the reef release notes and add a link to those notes to the Debian bug as another motivation for backport.
The difficulty of building Ceph on bookworm has been added to the release notes, and the addition of such a note to the release notes is recorded here: https://github.com/ceph/ceph/pull/52490#issuecomment-1662962293
Updated by Matthew Vernon 8 months ago
I think this particular build failure is fixed by the latest bookworm point release; in a clean chroot I can get most of the way through building Ceph (I think the compilation all succeeds); I had to slightly patch debian/control
and debian/rules
, though - either to force a Build-Dependency on g++-11 (not the default g++ in bookworm), or to remove the hard-coding of -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11
in debian/rules
. I also added nasm [amd64]
to the Build-Dependencies. Would you like a PR with either of those changes? I'd be inclined to go with removing the gcc-11 hard-coding (and instead add versioning to the Build-Depends on g++)...
After all that, though, the build fails thus:
CMake Error at src/pybind/mgr/dashboard/cmake_install.cmake:66 (file): file INSTALL cannot find "/<<PKGBUILDDIR>>/src/pybind/mgr/dashboard/frontend/dist": No such file or directory.
which does fit with my source tree, which lacks the directory
/src/pybind/mgr/dashboard/frontend/dist
Can I have a pointer to fix this, please? It feels like I'm nearly at getting v18.2.0 to build on bookworm...
In case I mis-identified the build failure, the entire build log is https://people.wikimedia.org/~mvernon/ceph_18.2.0-1_amd64-2023-09-07T08:04:29Z.build (it's 6M, which is too big to upload here as an attachment)
Updated by Matthew Vernon 8 months ago
Sorry, I meant to say - this was an attempted build of the v18.2.0 tag
Updated by Matthew Vernon 8 months ago
OK, I've built Debian packages of 18.2.0 from the tarball, and submitted a MR to make the changes to debian/{rules,control}
that make the build work. https://github.com/ceph/ceph/pull/53342
I think this approach is neater than trying to hard-code a particular version in debian/rules
by itself, since the Build-Depends field in debian/control
is designed for this approach (and then tools like sbuild
will just do the right thing).
Updated by Backport Bot 7 months ago
- Copied to Backport #62970: reef: reef build fails on debian bookworm (and bullseye) added
Updated by Laura Flores 6 months ago
- Related to Bug #62634: CMake error when building Pacific v16.2.14 on Bullseye added