Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 846680

Summary: sys-auth/polkit-0.120_p20220221 Permission denied: '/usr/local/lib/libduktape.so'
Product: Gentoo Linux Reporter: Steven Davies <gentoo-bugzilla2>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Steven Davies 2022-05-21 09:18:30 UTC
When emerging polkit with USE=duktape: 
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/libduktape.so'

$ emerge -pqv =sys-auth/polkit-0.120_p20220221::gentoo
[ebuild     U ] sys-auth/polkit-0.120_p20220221 [0.120-r3] USE="duktape%* introspection pam systemd -examples -gtk -kde (-selinux) -test"


Reproducible: Always

Steps to Reproduce:
1. emerge -u polkit
Actual Results:  
Build log:

 * Package:    sys-auth/polkit-0.120_p20220221
 * Repository: gentoo
 * Maintainer: freedesktop-bugs@gentoo.org
 * USE:        abi_x86_64 amd64 duktape elibc_glibc introspection kernel_linux pam systemd userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking polkit-0.120_p20220221.tar.bz2 to /var/tmp/portage/sys-auth/polkit-0.120_p20220221/work
>>> Source unpacked in /var/tmp/portage/sys-auth/polkit-0.120_p20220221/work
>>> Preparing source in /var/tmp/portage/sys-auth/polkit-0.120_p20220221/work/polkit-b10a1bdb697045db40774f2a9a8c58ae5c7189c3 ...
 * Applying polkit-0.118-make-netgroup-support-optional.patch ...
patching file configure.ac
Hunk #1 succeeded at 117 with fuzz 2 (offset 17 lines).
patching file src/polkit/polkitidentity.c
patching file src/polkit/polkitunixnetgroup.c
patching file src/polkitbackend/polkitbackendinteractiveauthority.c
patching file src/polkitbackend/polkitbackendjsauthority.cpp
Hunk #1 succeeded at 1296 (offset -223 lines).
Hunk #2 succeeded at 1311 (offset -223 lines).
patching file test/polkit/polkitidentitytest.c
patching file test/polkit/polkitunixnetgrouptest.c
patching file test/polkitbackend/test-polkitbackendjsauthority.c
patching file src/polkitbackend/polkitbackendduktapeauthority.c
 [ ok ]
 * Applying polkit-0.120-meson.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-auth/polkit-0.120_p20220221/work/polkit-b10a1bdb697045db40774f2a9a8c58ae5c7189c3 ...
meson setup --libdir lib64 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig --pkg-co
nfig-path /usr/share/pkgconfig --native-file /var/tmp/portage/sys-auth/polkit-0.120_p20220221/temp/meson.x86_64-pc-linux-gnu.amd64.ini -Db_pch=false -Dwerror=fa
lse --buildtype plain --localstatedir=/var -Dauthfw=pam -Dexamples=false -Dgtk_doc=false -Dman=true -Dos_type=gentoo -Dsession_tracking=libsystemd-login -Dsyste
mdsystemunitdir=/lib/systemd/system -Djs_engine=duktape -Dintrospection=true -Dtests=false -Dpam_module_dir=/lib64/security /var/tmp/portage/sys-auth/polkit-0.1
20_p20220221/work/polkit-b10a1bdb697045db40774f2a9a8c58ae5c7189c3 /var/tmp/portage/sys-auth/polkit-0.120_p20220221/work/polkit-0.120_p20220221-build
The Meson build system
Version: 0.61.4
Source dir: /var/tmp/portage/sys-auth/polkit-0.120_p20220221/work/polkit-b10a1bdb697045db40774f2a9a8c58ae5c7189c3
Build dir: /var/tmp/portage/sys-auth/polkit-0.120_p20220221/work/polkit-0.120_p20220221-build
Build type: native build
Project name: polkit
Project version: 0.120
C compiler for the host machine: x86_64-pc-linux-gnu-gcc (gcc 11.2.1 "x86_64-pc-linux-gnu-gcc (Gentoo 11.2.1_p20220115 p4) 11.2.1 20220115")
C linker for the host machine: x86_64-pc-linux-gnu-gcc ld.bfd 2.37
C++ compiler for the host machine: x86_64-pc-linux-gnu-g++ (gcc 11.2.1 "x86_64-pc-linux-gnu-g++ (Gentoo 11.2.1_p20220115 p4) 11.2.1 20220115")
C++ linker for the host machine: x86_64-pc-linux-gnu-g++ ld.bfd 2.37
Host machine cpu family: x86_64
Host machine cpu: x86_64
Checking for function "clearenv" : YES
Checking for function "fdatasync" : YES
meson.build:123: WARNING: Consider using the built-in option for language standard version instead of using "-std=c99".
Found pkg-config: /usr/bin/x86_64-pc-linux-gnu-pkg-config (1.8.0)
Run-time dependency gio-2.0 found: YES 2.70.4
Run-time dependency gio-unix-2.0 found: YES 2.70.4
Run-time dependency glib-2.0 found: YES 2.70.4
Run-time dependency gobject-2.0 found: YES 2.70.4
Run-time dependency expat found: YES 2.4.7
Has header "expat.h" with dependency expat: YES
Checking for function "XML_ParserCreate" with dependency expat: YES
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 146, in run
    return options.run_func(options)
  File "/usr/lib/python3.9/site-packages/mesonbuild/msetup.py", line 294, in run
    app.generate()
  File "/usr/lib/python3.9/site-packages/mesonbuild/msetup.py", line 185, in generate
    self._generate(env)
  File "/usr/lib/python3.9/site-packages/mesonbuild/msetup.py", line 229, in _generate
    intr.run()
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreter/interpreter.py", line 2549, in run
    super().run()
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 148, in run
    self.evaluate_codeblock(self.ast, start=1)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 173, in evaluate_codeblock
    raise e
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 166, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 189, in evaluate_statement
    return self.evaluate_if(cur)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 272, in evaluate_if
    self.evaluate_codeblock(i.block)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 173, in evaluate_codeblock
    raise e
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 166, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 181, in evaluate_statement
    self.assignment(cur)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 566, in assignment
    value = self.evaluate_statement(node.value)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 179, in evaluate_statement
    return self.function_call(cur)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/interpreterbase.py", line 454, in function_call
    res = func(node, func_args, kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 768, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 768, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 768, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  [Previous line repeated 5 more times]
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 96, in wrapped
    ret = f(*wrapped_args, **wrapped_kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 115, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreterbase/decorators.py", line 276, in wrapper
    return f(*nargs, **wrapped_kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreter/interpreter.py", line 1572, in func_dependency
    d = df.lookup(kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreter/dependencyfallbacks.py", line 347, in lookup
    dep = func(kwargs, func_args, func_kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/interpreter/dependencyfallbacks.py", line 90, in _do_dependency
    dep = dependencies.find_external_dependency(name, self.environment, kwargs)
  File "/usr/lib/python3.9/site-packages/mesonbuild/dependencies/detect.py", line 114, in find_external_dependency
    d = c()
  File "/usr/lib/python3.9/site-packages/mesonbuild/dependencies/pkgconfig.py", line 96, in __init__
    self._set_libs()
  File "/usr/lib/python3.9/site-packages/mesonbuild/dependencies/pkgconfig.py", line 381, in _set_libs
    self.link_args, self.raw_link_args = self._search_libs(out, out_raw)
  File "/usr/lib/python3.9/site-packages/mesonbuild/dependencies/pkgconfig.py", line 307, in _search_libs
    args = self.clib_compiler.find_library(lib[2:], self.env,
  File "/usr/lib/python3.9/site-packages/mesonbuild/compilers/mixins/clike.py", line 1118, in find_library
    return self._find_library_impl(libname, env, extra_dirs, code, libtype)
  File "/usr/lib/python3.9/site-packages/mesonbuild/compilers/mixins/clike.py", line 1107, in _find_library_impl
    value = self._find_library_real(libname, env, extra_dirs, code, libtype)
  File "/usr/lib/python3.9/site-packages/mesonbuild/compilers/mixins/clike.py", line 1092, in _find_library_real
    trial = self._get_file_from_list(env, trials)
  File "/usr/lib/python3.9/site-packages/mesonbuild/compilers/mixins/clike.py", line 1036, in _get_file_from_list
    if p.is_file():
  File "/usr/lib/python3.9/pathlib.py", line 1456, in is_file
    return S_ISREG(self.stat().st_mode)
  File "/usr/lib/python3.9/pathlib.py", line 1232, in stat
    return self._accessor.stat(self)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/libduktape.so'
 * ERROR: sys-auth/polkit-0.120_p20220221::gentoo failed (configure phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line  127:  Called src_configure
 *   environment, line 3038:  Called meson_src_configure
 *   environment, line 2246:  Called die
 * The specific snippet of code:
 *       "${mesonargs[@]}" ) || die
 *
 * If you need support, post the output of `emerge --info '=sys-auth/polkit-0.120_p20220221::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-auth/polkit-0.120_p20220221::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-auth/polkit-0.120_p20220221/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-auth/polkit-0.120_p20220221/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-auth/polkit-0.120_p20220221/work/polkit-b10a1bdb697045db40774f2a9a8c58ae5c7189c3'
 * S: '/var/tmp/portage/sys-auth/polkit-0.120_p20220221/work/polkit-b10a1bdb697045db40774f2a9a8c58ae5c7189c3'
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-21 14:03:16 UTC
This seems a lot like you've got a library in /usr/local which you need to remove.
Comment 2 Steven Davies 2022-05-21 14:40:00 UTC
Nope, nothing unusual in /usr/local:

$ /bin/ls -laR /usr/local/lib
/usr/local/lib:
total 0
drwxr-x--- 1 root root  0 Jun 22  2019 .
drwxr-xr-x 1 root root 44 Jun 22  2019 ..

$ /bin/ls -laR /usr/local/lib64/
/usr/local/lib64/:
total 0
drwxr-xr-x 1 root root  0 Oct 30  2018 .
drwxr-xr-x 1 root root 44 Jun 22  2019 ..

$ /bin/ls -laR /usr/local/bin/
/usr/local/bin/:
total 8
drwxr-xr-x 1 root root  42 Nov 11  2018 .
drwxr-xr-x 1 root root  44 Jun 22  2019 ..
lrwxrwxrwx 1 root root  45 Nov 11  2018 exa -> /home/steven/code/rust/exa/target/release/exa
-rw-r--r-- 1 root root   0 Oct 30  2018 .keep
-rwxr-xr-x 1 root root 283 Nov  5  2018 systemd-email
Comment 3 Tee KOBAYASHI 2022-05-21 16:15:32 UTC
The direct cause seems to be that the permission (file mode) of your /usr/local/lib is set to 0750. I guess this can be worked around by:

# chmod 0755 /usr/local/lib
Comment 4 Steven Davies 2022-05-21 17:31:06 UTC
Yup, that solved it. No idea how that happened or why it's only causing a problem now. Thanks.