Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 931839 - sys-apps/keyutils - Makefile inherits LIBDIR from user environment
Summary: sys-apps/keyutils - Makefile inherits LIBDIR from user environment
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-12 22:45 UTC by Matías Blasi
Modified: 2024-05-19 21:49 UTC (History)
3 users (show)

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


Attachments
build log (build.log,699 bytes, text/x-log)
2024-05-12 22:45 UTC, Matías Blasi
Details
emerge info (emerge.info,7.07 KB, text/plain)
2024-05-12 22:45 UTC, Matías Blasi
Details
environment (environment,110.67 KB, text/plain)
2024-05-12 22:46 UTC, Matías Blasi
Details
keyutils build log (sys-apps:keyutils-1.6.3-r1:20240514-180914.log,17.79 KB, text/x-log)
2024-05-14 18:11 UTC, Matías Blasi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matías Blasi 2024-05-12 22:45:13 UTC
Created attachment 892842 [details]
build log

When trying to upgrade to libblockdev-3.0.4, I get following compilation message:


libtool: link:  x86_64-pc-linux-gnu-gcc -shared  -fPIC -DPIC  .libs/libbd_crypto_la-crypto.o   -Wl,-rpath -Wl,/var/tmp/portage/sys-libs/libblockdev-3.0.4/work/libblockdev-3.0.4/src/utils/.libs -L./../utils/ -Wl,--as-needed ./../utils/.libs/libbd_utils.so -lm -ludev -lkmod -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcryptsetup -lblkid -lkeyutils  -O2 -march=znver3 -Wl,--no-undefined -Wl,-O1   -pthread -Wl,-soname -Wl,libbd_crypto.so.3 -Wl,-version-script -Wl,.libs/libbd_crypto.ver -o .libs/libbd_crypto.so.3.0.0
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lkeyutils: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:834: libbd_crypto.la] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-libs/libblockdev-3.0.4/work/libblockdev-3.0.4/src/plugins'
make[2]: *** [Makefile:1150: all-recursive] Error 1
make[1]: *** [Makefile:431: all-recursive] Error 1
make: *** [Makefile:508: all-recursive] Error 1


Build failure:

collect2: error: ld returned 1 exit status

Emerge failure:

 * ERROR: sys-libs/libblockdev-3.0.4::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-libs/libblockdev-3.0.4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/libblockdev-3.0.4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/libblockdev-3.0.4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/libblockdev-3.0.4/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/libblockdev-3.0.4/work/libblockdev-3.0.4'
 * S: '/var/tmp/portage/sys-libs/libblockdev-3.0.4/work/libblockdev-3.0.4'
Comment 1 Matías Blasi 2024-05-12 22:45:39 UTC
Created attachment 892843 [details]
emerge info
Comment 2 Matías Blasi 2024-05-12 22:46:11 UTC
Created attachment 892844 [details]
environment
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-12 22:58:55 UTC
You have USE=cryptsetup so this in the ebuild should be effective:
```
	cryptsetup? (
		escrow? (
			>=dev-libs/nss-3.18.0
			dev-libs/volume_key
		)
		>=sys-apps/keyutils-1.5.0:=
		>=sys-fs/cryptsetup-2.3.0:=
	)
```

Is keyutils installed?
Comment 4 Matías Blasi 2024-05-14 11:43:39 UTC
Yes, I have:

```
# eix sys-apps/keyutils                  
[I] sys-apps/keyutils
     Available versions:  1.6.3-r1(0/1.9)^t {static static-libs test ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  1.6.3-r1(0/1.9)^t(20:22:22 12/05/24)(-static -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git
     Description:         Linux Key Management Utilities
# eix sys-fs/cryptsetup                  
[I] sys-fs/cryptsetup
     Available versions:  2.6.1(0/12)^t {+argon2 fips gcrypt kernel nettle nls +openssl pwquality ssh static static-libs test +udev urandom}
     Installed versions:  2.6.1(0/12)^t(12:13:23 23/06/23)(argon2 nls openssl udev -fips -gcrypt -kernel -nettle -pwquality -ssh -static -static-libs -test -urandom)
     Homepage:            https://gitlab.com/cryptsetup/cryptsetup
     Description:         Tool to setup encrypted devices with dm-crypt
#
```
Comment 5 Mike Gilbert gentoo-dev 2024-05-14 15:58:51 UTC
Does /usr/lib64/libkeyutils.so exist as a valid symlink?
Comment 6 Matías Blasi 2024-05-14 17:30:11 UTC
First of all, thank all of you!

No, it doesn't exist:

```
# ll /usr/lib64/libkeyutils.so
ls: no se puede acceder a '/usr/lib64/libkeyutils.so': No existe el fichero o el directorio
```

I also reinstalled keyutils without any change.
Comment 7 Mike Gilbert gentoo-dev 2024-05-14 18:06:25 UTC
Please attach a build log for sys-apps/keyutils.

You can tell Portage to save the build log for a successful build by adding this to make.conf:

PORT_LOGDIR="/var/log/portage"
Comment 8 Matías Blasi 2024-05-14 18:11:37 UTC
Created attachment 892926 [details]
keyutils build log
Comment 9 Mike Gilbert gentoo-dev 2024-05-14 18:20:31 UTC
It seems to be installing libkeyutils.so as /usr/lib64/xorg/modules/drivers/libkeyutils.so. That makes no sense.

Do you have LIBDIR or LIBDIR_amd64 defined in the environment or make.conf?

Are you somehow overriding the get_libdir ebuild function?
Comment 10 Matías Blasi 2024-05-14 18:52:12 UTC
I didn't override anything... I'm just a basic user.
I have nvidia-drivers installed... and as far I see, I don't have any definition for LIBDIR.* in make.conf, but environment has a lot of lines with this var. This file is uploaded.

Any other clue?
Comment 11 Mike Gilbert gentoo-dev 2024-05-14 19:42:40 UTC
Let's have a look the environment and Makefile.

1. From the /var/db/repos/gentoo/sys-apps/keyutils, run this:

> ebuild keyutils-1.6.3-r1.ebuild clean compile

2. Attach the following files:

> /var/tmp/portage/sys-apps/keyutils-1.6.3-r1/temp/environment
> /var/tmp/portage/sys-apps/keyutils-1.6.3-r1/work/keyutils-1.6.3-abi_x86_64.amd64/Makefile
Comment 12 Mike Gilbert gentoo-dev 2024-05-14 19:47:21 UTC
(In reply to Matías Blasi from comment #10)
> but environment has a lot of lines with this var. This file is uploaded.

Sorry I overlooked this.

Yeah, the issue is definitely caused by that LIBDIR="/usr/lib64/xorg/modules/drivers" in the environment.

Try grepping for that path in /etc and your home directory.
Comment 13 Matías Blasi 2024-05-14 20:09:49 UTC
Interesting... lots of them... in /etc:

```
# grep -r "/usr/lib64/xorg/modules/drivers" /etc
/etc/bumblebee/bumblebee.conf:XorgModulePath=/usr/lib64/opengl/nvidia/lib,/usr/lib64/opengl/nvidia/extensions,/usr/lib64/xorg/modules/drivers,/usr/lib64/xorg/modules
/etc/csh.env:setenv LIBDIR '/usr/lib64/xorg/modules/drivers'
/etc/environment.d/10-gentoo-env.conf:LIBDIR=/usr/lib64/xorg/modules/drivers
/etc/profile.env:export LIBDIR='/usr/lib64/xorg/modules/drivers'
/etc/env.d/99libtool:LIBDIR=/usr/lib64/xorg/modules/drivers
```

In my home, its only logs:

```
# grep -r "/usr/lib64/xorg/modules/drivers" /home/matias 
/home/matias/.local/share/xorg/Xorg.1.log:[    72.782] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
/home/matias/.local/share/xorg/Xorg.1.log.old:[   113.459] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
/home/matias/.local/share/xorg/Xorg.0.log:[    97.010] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
```
Comment 14 Mike Gilbert gentoo-dev 2024-05-14 20:28:50 UTC
I suspect /etc/env.d/99libtool is the source of the problem. Most of the other files in /etc are generated from this.

Is /etc/env.d/99libtool owned by some package, or did you create that?
Comment 15 Matías Blasi 2024-05-14 20:32:46 UTC
I really don't remember to create this file. It could be some try to make something work, by googling.... but really don't remember...

```
# equery belongs /etc/env.d/99libtool
 * Searching for /etc/env.d/99libtool ... 
#
```

Anyway, I removed the file, and the problem continues...
Comment 16 Mike Gilbert gentoo-dev 2024-05-14 20:34:21 UTC
You need to run env-update after removing the file, followed by a log out / log in to clear your environment.
Comment 17 Matías Blasi 2024-05-14 21:30:54 UTC
Thank you Mike.

I run env-update, logout & login, and run emerge again, with same result.
Comment 18 Matías Blasi 2024-05-14 23:20:16 UTC
This is my only result now:

```
# grep -r "/usr/lib64/xorg/modules/drivers" /etc
/etc/bumblebee/bumblebee.conf:XorgModulePath=/usr/lib64/opengl/nvidia/lib,/usr/lib64/opengl/nvidia/extensions,/usr/lib64/xorg/modules/drivers,/usr/lib64/xorg/modules
# 
```

Regards,
Matías.
Comment 19 Mike Gilbert gentoo-dev 2024-05-14 23:30:06 UTC
(In reply to Matías Blasi from comment #17)
> I run env-update, logout & login, and run emerge again, with same result.

Is LIBDIR still set in the environment?
Comment 20 Larry the Git Cow gentoo-dev 2024-05-15 00:12:10 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3cc0a9fd571f057ca3a2eae1c7f49f7048364e2c

commit 3cc0a9fd571f057ca3a2eae1c7f49f7048364e2c
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-05-15 00:10:59 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-05-15 00:10:59 +0000

    sys-apps/keyutils: pass parameters to make
    
    ... instead of abusing sed.
    
    Closes: https://bugs.gentoo.org/931839
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/keyutils/keyutils-1.6.3-r1.ebuild | 57 +++++++++++++++++-------------
 1 file changed, 32 insertions(+), 25 deletions(-)
Comment 21 Matías Blasi 2024-05-19 21:49:42 UTC
Thank you very much! It worked like a charm after upgrading!

Regards,
Matías.