After kernel compilation, when creating an initramfs with genkernel-4.3.16-r5, it is failing with errors. Had to downgrade to cmake-3.31.7-r1 in order to successfully create the initramfs. Also tried downgrading genkernel to v4.3.16-r4 and the failures persisted. Two machines tested with same results. Reproducible: Always Steps to Reproduce: 1.Compile kernel 2.Create initramfs with genkernel and cmake-4.0.2-r1 3.Downgrade cmake to 3.31.7-r1, create initramfs successfully.
Created attachment 930391 [details] genkernel log with error msg
Here is the screen output in then event of easy diagnosis: ----- * ERROR: Command 'cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_APPS=OFF -DDISABLE_EXTRA_LIBS=ON -DDISABLE_WERROR=ON -DENABLE_RDRAND=no -DENABLE_THREADING=no -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_LIBDIR=lib ../json-c-0.17' failed! * ERROR: create_initramfs(): append_data(): append_luks(): populate_binpkg(): populate_binpkg(): gkbuild(): Failed to create binpkg of json-c-0.17! * Please consult '/var/log/genkernel.log' for more information and any * errors that were reported above. * * Report any genkernel bugs to bugs.gentoo.org and * assign your bug to genkernel@gentoo.org. Please include * as much information as you can in your bug report; attaching * '/var/log/genkernel.log' so that your issue can be dealt with effectively. * * Please do *not* report kernel compilation failures as genkernel bugs! -----
made a patch which adds -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to the json-c gkbuild file as the failing genkernel output suggests. this fixes the error for me with genkernel 4.3.16-r5 and cmake-4.0.2-r1
Created attachment 930406 [details, diff] fix json-c build in genkernel with cmake 4
(In reply to Chris Pfuhl from comment #3) > made a patch which adds -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to the json-c > gkbuild file as the failing genkernel output suggests. this fixes the error > for me with genkernel 4.3.16-r5 and cmake-4.0.2-r1 this could also be fixed but upgrading json-c to 0.18 or above. this change would take place in the ebuild. im not sure of an automated way to do this though because the json-c gkbuid needs to be updated too (copying son-c-0.17.gkbuild to json-c-0.18.gkbuild works fine). that change needs to take place in the genkernel git repository though or maybe we could do a copy operation at the very end of the ebuild. im not sure. i just made the changes locally for the time being. the location of these file son the file system would be /usr/share/genkernel/gkbuilds
(In reply to Chris Pfuhl from comment #4) > Created attachment 930406 [details, diff] [details, diff] > fix json-c build in genkernel with cmake 4 i also tried your patch. for some reason it wouldnt apply. seems like its possibly an issue with spaces vs tabs. i recreated the patch locally with git diff and that applied properly. the only difference between the 2 was spaces vs tabs for indentation. the original file in git uses tabbed indentation.
Created attachment 930937 [details, diff] fixed json-c-0.17_cmake4 patch using tabbed indentation this patch is identical to the one already posted. the only change is tabbed indentation. this one works for me the previous one did not.
Tested both patches and had the same issue with the first. The second one did apply successfully for me. Was able to build an initramfs using cmake-4 with the patch applied.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=30744c2709ef988a58b89c8988ca0bc2872c0f98 commit 30744c2709ef988a58b89c8988ca0bc2872c0f98 Author: Ben Kohler <bkohler@gentoo.org> AuthorDate: 2025-06-10 15:06:03 +0000 Commit: Ben Kohler <bkohler@gentoo.org> CommitDate: 2025-06-10 15:06:03 +0000 gkbuilds: add json-c-0.18 Same as 0.17 but still separate from the unversioned one for now. Bug: https://bugs.gentoo.org/957178 Signed-off-by: Ben Kohler <bkohler@gentoo.org> gkbuilds/json-c-0.18.gkbuild | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a84760409cc3b31a2fa15db5ba7d7bb03135d2d4 commit a84760409cc3b31a2fa15db5ba7d7bb03135d2d4 Author: Ben Kohler <bkohler@gentoo.org> AuthorDate: 2025-06-10 16:27:27 +0000 Commit: Ben Kohler <bkohler@gentoo.org> CommitDate: 2025-06-10 16:28:47 +0000 sys-kernel/genkernel: bump to 4.3.17 Adds new json-c-0.18 & includes backported fixes Bug: https://bugs.gentoo.org/957178 Signed-off-by: Ben Kohler <bkohler@gentoo.org> sys-kernel/genkernel/Manifest | 2 + sys-kernel/genkernel/genkernel-4.3.17.ebuild | 288 +++++++++++++++++++++++++++ sys-kernel/genkernel/genkernel-9999.ebuild | 31 +-- 3 files changed, 308 insertions(+), 13 deletions(-)
Apart from the awful practice of manually calling cmake in the first place, it also fails to declare it as BDEPEND.
Tested genkernel-4.3.17 with cmake-4.0.2-r1 and successfully created initramfs. I could close this as "Resolved", "Fixed for me" or "Fixed", but not sure if I should? Still listed as unconfirmed and work seems to be continuing... Will leave open for now, but if an admin or maintainer wants to close it, feel free. Simply not sure of the protocol here.