I build my kernels using the out-of-source-tree build method, where the source tree and the build results tree do not comingle. e.g. (simplified here) # plumbing mkdir /usr/src/local_kernel ln -s /usr/src/local_kernel /usr/src/linux # install sources emerge =sys-kernel/gentoo-sources-5.1.8 # configure and build cd /usr/src/linux-5.1.8-gentoo-sources make O=/usr/src/local_kernel menuconfig make O=/usr/src/local_kernel all # etc ASIDE: I do this so that I can swap out local_kernel directories or btrfs subvolumes, and so that emerge can clean up the source directories and blah and blah and blah. 8-) So far every other package that searches for the kernel sources and binaries works with this flawlessly, having no trouble finding the makefiles and whatont. eudev says "could not detect kernel version" and exits. I suspect eudev is ignoring the "source" (q.v. simply resolving "/usr/src/linux/source") when looking for particular distribution files and/or not doing the make business. Note that if I cobble an overlayfs at /usr/src/linux that is a stack of the relevant source and local_kernel directory trees I can build the package without modifying either directory. Also Note: This has been noted with several different kernel versions, not just 5.1.8, so it's not related to the kernel version or some quirk of the build method.
Please attach the build log.
(In reply to Robert White from comment #0) > > eudev says "could not detect kernel version" and exits. > I'm confused here. At what point is eudev throwing this error? Can you give steps to reproduce.
This is happening to me now. I too have separate kernel source and kernel object directories. localhost /usr/src/rezk # emerge eudev -1 Calculating dependencies... done! >>> Verifying ebuild manifests >>> Running pre-merge checks for sys-fs/eudev-3.2.9 * * As of 2013-01-29, eudev-3.2.9 provides the new interface renaming functionality, * as described in the URL below: * https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames * * This functionality is enabled BY DEFAULT because eudev has no means of synchronizing * between the default or user-modified choice of sys-fs/udev. If you wish to disable * this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules * exists: touch /etc/udev/rules.d/80-net-name-slot.rules * >>> Emerging (1 of 1) sys-fs/eudev-3.2.9::gentoo >>> Failed to emerge sys-fs/eudev-3.2.9, Log file: >>> '/var/tmp/portage/sys-fs/eudev-3.2.9/temp/build.log' >>> Jobs: 0 of 1 complete, 1 failed Load avg: 2.35, 4.58, 6.20 * Package: sys-fs/eudev-3.2.9 * Repository: gentoo * Maintainer: eudev@gentoo.org * USE: abi_x86_32 abi_x86_64 amd64 elibc_glibc hwdb kernel_linux kmod userland_GNU * FEATURES: network-sandbox preserve-libs sandbox userpriv usersandbox * /etc/portage/package.cflags/ltoworkarounds.conf -> sys-fs/eudev: *FLAGS-="-mtls-dialect=gnu2" * FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync' * CFLAGS='-O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -O3 -pipe -march=native -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed' * CXXFLAGS='-O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -O3 -pipe -march=native -fomit-frame-pointer -fPIC -Wl,-O1 -Wl,--as-needed' * FFLAGS='-O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -O3 -pipe -march=native -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed' * FCFLAGS='-O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -O3 -pipe -march=native -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed' * F77FLAGS='-O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -O3 -pipe -march=native -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed' * LDFLAGS='-Wl,-O1 -Wl,--as-needed -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -march=native -fomit-frame-pointer -fPIC' * MAKEOPTS='-j24' * gcc (Gentoo 9.2.0-r2 p3) 9.2.0 * Linux localhost 5.3.10-gentoo #10 SMP Mon Nov 11 21:12:10 PST 2019 x86_64 AMD Ryzen 9 3900X 12-Core Processor AuthenticAMD GNU/Linux * Determining the location of the kernel source code * Found kernel source directory: * /usr/src/linux * Found kernel object directory: * /usr/src/rezk * Found sources for kernel version: * 5.3.11-gentoo * Checking for suitable kernel configuration options... [ ok ] * Determining the location of the kernel source code * Found kernel source directory: * /usr/src/rezk * Could not detect kernel version. * Please ensure that /usr/src/rezk points to a complete set of Linux sources. * Unable to calculate Linux Kernel version for build, attempting to use running version * ERROR: sys-fs/eudev-3.2.9::gentoo failed (setup phase): * Unable to determine any Linux Kernel version, please report a bug
(In reply to Dylan from comment #3) > * Determining the location of the kernel source code > * Found kernel source directory: > * /usr/src/linux > * Found kernel object directory: > * /usr/src/rezk > * Found sources for kernel version: > * 5.3.11-gentoo > * Checking for suitable kernel configuration options... > [ ok ] > * Determining the location of the kernel source code > * Found kernel source directory: > * /usr/src/rezk > * Could not detect kernel version. > * Please ensure that /usr/src/rezk points to a complete set of Linux > sources. > * Unable to calculate Linux Kernel version for build, attempting to use > running version > * ERROR: sys-fs/eudev-3.2.9::gentoo failed (setup phase): > * Unable to determine any Linux Kernel version, please report a bug This error message is thrown by linux-info.eclass. There is nothing for eudev to do here, ie its nothing in the eudev build systems that's causing this. If this is a bug (and it may not be as there may be a problem with the source tree at rezk), it has to be fixed in the eclass. Any ebuild which inherits linux-info.eclass would throw the same error. The maintainer of the eclass is kernel@gentoo.org. I'm going to switch this to INVALID. What I recommend you do is talk to the folk at #gentoo-kernel and determine whether or not this is a bug and not a problem with the source tree.
I suspect it has something to do with calling linux-info_pkg_setup followed by get_running_version. Most ebuilds do not do this. There's probably also something weird going on with KERNEL_DIR and KBUILD_OUTPUT on the systems where the problem occurs. Insufficient information has been provided to really debug that.
Solved. I poked around some more and discovered... I was running kernel 5.3.10, but /usr/src/linux contained source for 5.3.11, I had removed source for 5.3.10.
Solved. I poked around some more and discovered... I was running kernel 5.3.10, but /usr/src/linux contained source for 5.3.11, I had removed source for 5.3.10. After rebooting into the 5.3.11 kernel, eudev installs just fine. So, maybe a more descriptive error message would help?