commit:     267b62c63fde02f09c2707bc47cc0d12b5cd9cdf
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Tue Jan 20 15:38:59 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 25 06:45:36 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=267b62c6

sys-cluster/ceph: fix issue under parallel builds

fix build failures caused by legacy-option-headers not being available
during parallel builds

Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/45459
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-cluster/ceph/ceph-19.2.2-r6.ebuild             |  1 +
 sys-cluster/ceph/ceph-19.2.3.ebuild                |  1 +
 sys-cluster/ceph/ceph-20.1.0-r2.ebuild             |  1 +
 sys-cluster/ceph/ceph-20.1.1.ebuild                |  1 +
 ...n-add-dependency-on-legacy-option-headers.patch | 59 ++++++++++++++++++++++
 5 files changed, 63 insertions(+)

diff --git a/sys-cluster/ceph/ceph-19.2.2-r6.ebuild 
b/sys-cluster/ceph/ceph-19.2.2-r6.ebuild
index cebcb429c8bc..4b4aa8bcc476 100644
--- a/sys-cluster/ceph/ceph-19.2.2-r6.ebuild
+++ b/sys-cluster/ceph/ceph-19.2.2-r6.ebuild
@@ -243,6 +243,7 @@ PATCHES=(
        "${FILESDIR}/ceph-19.2.2-ipv6.patch"
        "${FILESDIR}/ceph-19.2.2-QATAPP-Fix-clang-16-compiling-issue.patch"
        
"${FILESDIR}/ceph-19.2.2-add-option-to-build-agains-system-opentelemetry.patch"
+       
"${FILESDIR}/ceph-19.2.2-common-add-dependency-on-legacy-option-headers.patch"
        "${FILESDIR}/ceph-19.2.2-rbd-make-enums-statically-castable.patch"
        
"${FILESDIR}/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch"
        "${FILESDIR}/ceph-19.2.2-rgw-update-to-latest-zpp_bits.h.patch"

diff --git a/sys-cluster/ceph/ceph-19.2.3.ebuild 
b/sys-cluster/ceph/ceph-19.2.3.ebuild
index 00d9bc791b5c..872d6c1c8f8e 100644
--- a/sys-cluster/ceph/ceph-19.2.3.ebuild
+++ b/sys-cluster/ceph/ceph-19.2.3.ebuild
@@ -242,6 +242,7 @@ PATCHES=(
        "${FILESDIR}/ceph-19.2.2-gcc15.patch"
        "${FILESDIR}/ceph-19.2.2-QATAPP-Fix-clang-16-compiling-issue.patch"
        
"${FILESDIR}/ceph-19.2.2-add-option-to-build-agains-system-opentelemetry.patch"
+       
"${FILESDIR}/ceph-19.2.2-common-add-dependency-on-legacy-option-headers.patch"
        "${FILESDIR}/ceph-19.2.2-rbd-make-enums-statically-castable.patch"
        
"${FILESDIR}/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch"
        "${FILESDIR}/ceph-19.2.2-rgw-update-to-latest-zpp_bits.h.patch"

diff --git a/sys-cluster/ceph/ceph-20.1.0-r2.ebuild 
b/sys-cluster/ceph/ceph-20.1.0-r2.ebuild
index 4ecc68c722cd..96ff1a86d46e 100644
--- a/sys-cluster/ceph/ceph-20.1.0-r2.ebuild
+++ b/sys-cluster/ceph/ceph-20.1.0-r2.ebuild
@@ -220,6 +220,7 @@ PATCHES=(
        "${FILESDIR}/ceph-19.2.1-isa-l.patch"
        "${FILESDIR}/ceph-19.2.2-QATAPP-Fix-clang-16-compiling-issue.patch"
        
"${FILESDIR}/ceph-19.2.2-add-option-to-build-agains-system-opentelemetry.patch"
+       
"${FILESDIR}/ceph-19.2.2-common-add-dependency-on-legacy-option-headers.patch"
        "${FILESDIR}/ceph-19.2.2-rbd-make-enums-statically-castable.patch"
        
"${FILESDIR}/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch"
        # https://bugs.gentoo.org/960812

diff --git a/sys-cluster/ceph/ceph-20.1.1.ebuild 
b/sys-cluster/ceph/ceph-20.1.1.ebuild
index 4ecc68c722cd..96ff1a86d46e 100644
--- a/sys-cluster/ceph/ceph-20.1.1.ebuild
+++ b/sys-cluster/ceph/ceph-20.1.1.ebuild
@@ -220,6 +220,7 @@ PATCHES=(
        "${FILESDIR}/ceph-19.2.1-isa-l.patch"
        "${FILESDIR}/ceph-19.2.2-QATAPP-Fix-clang-16-compiling-issue.patch"
        
"${FILESDIR}/ceph-19.2.2-add-option-to-build-agains-system-opentelemetry.patch"
+       
"${FILESDIR}/ceph-19.2.2-common-add-dependency-on-legacy-option-headers.patch"
        "${FILESDIR}/ceph-19.2.2-rbd-make-enums-statically-castable.patch"
        
"${FILESDIR}/ceph-19.2.2-rgw-remove-FMT_STRING-to-fix-clang-20-build-failure.patch"
        # https://bugs.gentoo.org/960812

diff --git 
a/sys-cluster/ceph/files/ceph-19.2.2-common-add-dependency-on-legacy-option-headers.patch
 
b/sys-cluster/ceph/files/ceph-19.2.2-common-add-dependency-on-legacy-option-headers.patch
new file mode 100644
index 000000000000..f1bd71377df7
--- /dev/null
+++ 
b/sys-cluster/ceph/files/ceph-19.2.2-common-add-dependency-on-legacy-option-headers.patch
@@ -0,0 +1,59 @@
+https://github.com/ceph/ceph/pull/66924
+
+The patch is adjusted so that it can be applied to all ebuilds in the tree.
+
+From d5a8eaeb862d1840de8d82f6e958c1f609693ed8 Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <[email protected]>
+Date: Sat, 17 Jan 2026 20:59:09 +0800
+Subject: [PATCH] common: add dependency on legacy-option-headers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+A heap_profiler build failure was initially observed due to parallel
+build ordering. During parallel builds, src/perfglue/heap_profiler.cc
+may fail to compile because it depends on legacy-option-headers and the
+generated header global_legacy_options.h may not be available yet. This
+results in incomplete definitions in included headers, leading to
+compilation errors such as missing members in ConfigValues.
+
+For example, the following error is observed when building with "-j64":
+
+FAILED: [code=1] src/perfglue/CMakeFiles/heap_profiler.dir/heap_profiler.cc.o
+/var/tmp/portage/sys-cluster/ceph-20.1.0-r2/work/ceph-20.1.0/src/perfglue/heap_profiler.cc:
 In function ‘void get_profile_name(char*, int)’:
+src/perfglue/heap_profiler.cc:102:48: error: ‘class ConfigValues’ has no 
member named ‘log_file’
+  snprintf(path, sizeof(path), "%s", g_conf()->log_file.c_str());
+                                               ^~~~~~~~
+
+The dependency chain is as follows:
+
+src/perfglue/heap_profiler.cc
+ -> src/perfglue/heap_profiler.h
+ -> src/common/config.h
+ -> src/common/config_values.h
+ -> src/common/options/legacy_config_opts.h
+ -> global_legacy_options.h (generated by y2c.py)
+
+The issue can be reliably reproduced by adding time.sleep(3600) at the
+beginning of y2c.py.
+
+Further testing showed that heap_profiler is not the only affected
+consumer. Additional analysis indicates that common is a shared
+dependency of all affected components. Therefore, it is appropriate to
+add legacy-option-headers as a dependency of common to ensure correct
+build ordering under parallel builds.
+
+Signed-off-by: Z. Liu <[email protected]>
+
+diff --git a/src/common/options/CMakeLists.txt 
b/src/common/options/CMakeLists.txt
+index 60cdbc3f224..4879c10d813 100644
+--- a/src/common/options/CMakeLists.txt
++++ b/src/common/options/CMakeLists.txt
+@@ -112,3 +112,7 @@ target_sources(legacy-option-headers
+ include(AddCephTest)
+ add_ceph_test(validate-options
+   ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/validate-options.py 
${options_yamls})
++
++add_dependencies(common-options-objs
++  legacy-option-headers
++)

Reply via email to