Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 737894 - sys-kernel/genkernel-4.1.0-r1 fails to build bcache-tools when using dev-util/pkgconfig
Summary: sys-kernel/genkernel-4.1.0-r1 fails to build bcache-tools when using dev-util...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-18 13:48 UTC by Reed Riley
Modified: 2020-08-19 10:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,6.13 KB, text/plain)
2020-08-18 14:12 UTC, Reed Riley
Details
/var/log/genkernel.log (genkernel.log,685.77 KB, text/plain)
2020-08-18 14:12 UTC, Reed Riley
Details
genkernel.log (working) (genkernel.log,264.21 KB, text/plain)
2020-08-18 15:45 UTC, Thomas Deutschmann (RETIRED)
Details
genkernel.log (broken, no ccache) (genkernel.log,685.32 KB, text/plain)
2020-08-18 22:39 UTC, Reed Riley
Details
tree (tree.txt,2.99 KB, text/plain)
2020-08-18 23:47 UTC, Reed Riley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Reed Riley 2020-08-18 13:48:40 UTC
When I try to use genkernel to build linux-5.8.1-gentoo with BCACHE="yes" in genkernel.conf, genkernel fails to build the initramfs.

I suspect that util-linux isn't being correctly included by genkernel when building bcache-tools.

Relevant part of the build log:

=================================================================
*         >> Appending bcache cpio data ...
* Checking for binpkg(s) required for bcache-tools-1.0.8_p20141204 (L0) ...
* > util-linux-2.36 has no dependencies. (L1)
* > GKBUILD '/usr/share/genkernel/gkbuilds/util-linux-2.36.gkbuild' does NOT exist; Skipping ...
* > Existing util-linux-2.36 binpkg is newer than '/usr/share/genkernel/gkbuilds/util-linux.gkbuild'; Skipping ...
* > Can keep using existing util-linux-2.36 binpkg from '/var/cache/genkernel/4.1.0/util-linux-2.36-x86_64.tar.xz'!
* > Binpkg of util-linux-2.36 is ready; Adding to list 'CHECK_L0_REQUIRED_BINPKGS' ...
* > Checking for binpkg(s) required for eudev-3.2.9 (L1) ...
* >> util-linux-2.36 has no dependencies. (L2)
* >> GKBUILD '/usr/share/genkernel/gkbuilds/util-linux-2.36.gkbuild' does NOT exist; Skipping ...
* >> Existing util-linux-2.36 binpkg is newer than '/usr/share/genkernel/gkbuilds/util-linux.gkbuild'; Skipping ...
* >> Can keep using existing util-linux-2.36 binpkg from '/var/cache/genkernel/4.1.0/util-linux-2.36-x86_64.tar.xz'!
* >> Binpkg of util-linux-2.36 is ready; Adding to list 'CHECK_L1_REQUIRED_BINPKGS' ...
* > GKBUILD '/usr/share/genkernel/gkbuilds/eudev-3.2.9.gkbuild' does NOT exist; Skipping ...
* > Existing eudev-3.2.9 binpkg is newer than '/usr/share/genkernel/gkbuilds/eudev.gkbuild'; Skipping ...
* > Existing eudev-3.2.9 binpkg is newer than 'util-linux-2.36-x86_64.tar.xz'; Skipping ...
* > Existing eudev-3.2.9 binpkg is newer than '/usr/share/genkernel/patches/eudev/3.2.9/eudev-3.2.9-static.patch'; Skipping ...
* > Can keep using existing eudev-3.2.9 binpkg from '/var/cache/genkernel/4.1.0/eudev-3.2.9-x86_64.tar.xz'!
* > Binpkg of eudev-3.2.9 is ready; Adding to list 'CHECK_L0_REQUIRED_BINPKGS' ...
* Binpkg '/var/cache/genkernel/4.1.0/bcache-tools-1.0.8_p20141204-x86_64.tar.xz' does NOT exist; Need to build bcache-tools-1.0.8_p20141204 ...
* Trying to determine gkbuild for bcache-tools-1.0.8_p20141204 ...
* '/usr/share/genkernel/gkbuilds/bcache-tools-1.0.8_p20141204.gkbuild' not found; Skipping ...
* Will use '/usr/share/genkernel/gkbuilds/bcache-tools.gkbuild' to build bcache-tools-1.0.8_p20141204 ...
* SYSROOT set to '/'!
*                 bcache-tools-1.0.8_p20141204: >> Unpacking required binpkg '/var/cache/genkernel/4.1.0/util-linux-2.36-x86_64.tar.xz' ...
*                 bcache-tools-1.0.8_p20141204: >> Unpacking required binpkg '/var/cache/genkernel/4.1.0/eudev-3.2.9-x86_64.tar.xz' ...
*                 bcache-tools-1.0.8_p20141204: >> Unpacking source ...
*                 bcache-tools-1.0.8_p20141204: >> Preparing source ...
*                 bcache-tools-1.0.8_p20141204: >> Applying patches ...
patching file Makefile
*                          - bcache-tools-1.0.8_p20141204-build.patch
patching file bcache.c
patching file bcache.h
*                          - bcache-tools-1.0.8_p20141204-crc64.patch
patching file 69-bcache.rules
*                          - bcache-tools-1.0.8_p20141204-modprobe.patch
COMMAND: ELT_LOGDIR='/var/tmp/genkernel/gk_kKRtcPFC/bcache-tools/temp' LD='x86_64-pc-linux-gnu-ld' eltpatch
*                 bcache-tools-1.0.8_p20141204: >> Configuring source ...
*                 bcache-tools-1.0.8_p20141204: >> Compiling source ...
COMMAND: nice -n10 make -j3 V=1
/usr/lib/ccache/bin/gcc -c -Os -pipe -fomit-frame-pointer -I/var/tmp/genkernel/gk_kKRtcPFC/bcache-tools/buildroot/usr/include bcache.c -o bcache.o
Unknown option -static
/usr/lib/ccache/bin/gcc -c -Os -pipe -fomit-frame-pointer -I/var/tmp/genkernel/gk_kKRtcPFC/bcache-tools/buildroot/usr/include  make-bcache.c -o make-bcache.o
Unknown option -static
/usr/lib/ccache/bin/gcc -c -Os -pipe -fomit-frame-pointer -I/var/tmp/genkernel/gk_kKRtcPFC/bcache-tools/buildroot/usr/include  probe-bcache.c -o probe-bcache.o
make-bcache.c:11:10: fatal error: blkid.h: No such file or directory
   11 | #include <blkid.h>
      |          ^~~~~~~~~
compilation terminated.
Unknown option -static
make: *** [Makefile:45: make-bcache.o] Error 1
make: *** Waiting for unfinished jobs....
probe-bcache.c:11:10: fatal error: blkid.h: No such file or directory
   11 | #include <blkid.h>
      |          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:51: probe-bcache.o] Error 1
* ERROR: Command 'nice -n10 make -j3 V=1' failed!
* ERROR: create_initramfs(): append_data(): append_bcache(): populate_binpkg(): gkbuild(): Failed to create binpkg of bcache-tools-1.0.8_p20141204!
* 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!
*
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-08-18 13:53:36 UTC
Can we have the full build.log please and emerge --info?
Comment 2 Reed Riley 2020-08-18 14:12:02 UTC
Created attachment 655340 [details]
emerge --info

Output from emerge --info.
Comment 3 Reed Riley 2020-08-18 14:12:33 UTC
Created attachment 655342 [details]
/var/log/genkernel.log

Copy of /var/log/genkernel.log.
Comment 4 Reed Riley 2020-08-18 14:13:13 UTC
I'm assuming you mean /var/log/genkernel.log, instead of build.log?  If not - let me know where to find the log file you're interested in and I'll grab it.
Comment 5 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-18 15:45:28 UTC
Created attachment 655358 [details]
genkernel.log (working)

I cannot reproduce, see my attached log.

I see you are using ccache. Please try without ccache to rule out any issue caused by ccache.
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-18 16:02:17 UTC
And please tell us used virtual/pkgconfig provider.
Comment 7 Reed Riley 2020-08-18 22:39:05 UTC
Created attachment 655430 [details]
genkernel.log (broken, no ccache)
Comment 8 Reed Riley 2020-08-18 22:41:37 UTC
I re-ran again with ccache disabled; and got the same error.  genkernel.log is attached.

> And please tell us used virtual/pkgconfig provider.

I don't understand - how do I look this up?  (Also happy to try any other suggestions any of you might have for debugging.)

I just realized this is on `sys-kernel/genkernel-4.1.0-r1` in case that's relevant; I have been looking at `genkernel --version`.  I'll update the bug title if I can figure out how.
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-18 23:10:01 UTC
$ qfile $(which pkg-config)

You could run genkernel with --no-cleanup. After the failure, call "tree" (app-text/tree) on bcache-tools' buildroot (which is mentioned in genkernel.log, something like /var/tmp/genkernel/gk_*/bcache-tools/buildroot).
Comment 10 Reed Riley 2020-08-18 23:47:49 UTC
Created attachment 655432 [details]
tree
Comment 11 Reed Riley 2020-08-19 00:06:16 UTC
(In reply to Thomas Deutschmann from comment #9)
> $ qfile $(which pkg-config)
> 
> You could run genkernel with --no-cleanup. After the failure, call "tree"
> (app-text/tree) on bcache-tools' buildroot (which is mentioned in
> genkernel.log, something like
> /var/tmp/genkernel/gk_*/bcache-tools/buildroot).

❯ qfile $(which pkg-config)
dev-util/pkgconfig: /usr/bin/pkg-config

❯ pkg-config --cflags uuid blkid
-I/usr/include/uuid -I/usr/include/blkid

I've attached the output from tree in the buildroot.

When I try to run the same command that fails from the build directory as root, I get the same failure.  When I add `-I/var/tmp/genkernel/gk_6dgUS7cU/bcache-tools/buildroot/usr/include/blkid` to the gcc command line it works.

Does genkernel use some kind of chroot environment with some kind of custom pkg-config?  Because the Makefile uses `$(shell $(PKG_CONFIG) --cflags uuid blkid)` to look up the arguments to gcc; and when I run make from the build directory it succeeds.
Comment 12 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-19 00:59:43 UTC
It's a dev-util/pkgconfig issue again -- dev-util/pkgconf works.

Note that your manual test with pkg-config doesn't help because it's using real system, not genkernel's build environment.
Comment 13 Larry the Git Cow gentoo-dev 2020-08-19 01:14:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d1f25b7d50dffbff5ddbf63fba6294309a5a19b5

commit d1f25b7d50dffbff5ddbf63fba6294309a5a19b5
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-08-19 01:13:19 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-08-19 01:13:19 +0000

    bcache: Fix pkg-config call
    
    Bug: https://bugs.gentoo.org/737894
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 gkbuilds/bcache-tools.gkbuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 14 Larry the Git Cow gentoo-dev 2020-08-19 01:18:25 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=739d9c4c3635ed4536ef385dc4475a3f15d9f6ab

commit 739d9c4c3635ed4536ef385dc4475a3f15d9f6ab
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-08-19 01:17:23 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-08-19 01:18:21 +0000

    sys-kernel/genkernel: fix --bcache option
    
    Closes: https://bugs.gentoo.org/737894
    Package-Manager: Portage-3.0.3, Repoman-3.0.0
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 ...itramfs.patch => genkernel-4.1.0-post-release-fixes.patch} | 11 +++++++++++
 .../{genkernel-4.1.0-r1.ebuild => genkernel-4.1.0-r2.ebuild}  |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
Comment 15 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-19 01:19:00 UTC
Thank you for the report!
Comment 16 Reed Riley 2020-08-19 10:55:10 UTC
Thank you for the fix!  (I have confirmed that `sys-kernel/genkernel-4.1.0-r2` resolves this issue for me.)