Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915379 - dev-python/pyside2-5.15.10-r2: ImportError: /usr/lib64/libudev.so.1: invalid ELF header
Summary: dev-python/pyside2-5.15.10-r2: ImportError: /usr/lib64/libudev.so.1: invalid ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Nowa Ammerlaan
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-08 13:38 UTC by Sergey 'L29Ah' Alirzaev
Modified: 2024-03-09 07:41 UTC (History)
4 users (show)

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


Attachments
emerge --info (emerge.info,22.14 KB, text/plain)
2023-10-08 13:38 UTC, Sergey 'L29Ah' Alirzaev
Details
build log (build.log.xz,37.23 KB, application/x-xz)
2023-10-08 13:40 UTC, Sergey 'L29Ah' Alirzaev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 'L29Ah' Alirzaev 2023-10-08 13:38:00 UTC
FAILED: PySide2/QtSerialPort/CMakeFiles/QtSerialPort_pyi /var/tmp/portage/dev-python/pyside2-5.15.10-r2/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtSerialPort/CMakeFiles/QtSerialPort_pyi
cd /var/tmp/portage/dev-python/pyside2-5.15.10-r2/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtSerialPort && /usr/bin/cmake -E env LD_LIBRARY_PATH=/var/tmp/portage/dev-python/pyside2-5.15.10-r2/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/libpyside:/usr/lib64 /usr/bin/python3.11 /var/tmp/portage/dev-python/pyside2-5.15.10-r2/work/pyside-setup-opensource-src-5.15.10/sources/pyside2/PySide2/QtSerialPort/../support/generate_pyi.py QtSerialPort --sys-path /var/tmp/portage/dev-python/pyside2-5.15.10-r2/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11 /usr/lib/python3.11/site-packages/shiboken2
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/pyside2-5.15.10-r2/work/pyside-setup-opensource-src-5.15.10/sources/pyside2/PySide2/QtSerialPort/../support/generate_pyi.py", line 322, in <module>
    generate_all_pyi(outpath, options=options)
  File "/var/tmp/portage/dev-python/pyside2-5.15.10-r2/work/pyside-setup-opensource-src-5.15.10/sources/pyside2/PySide2/QtSerialPort/../support/generate_pyi.py", line 299, in generate_all_pyi
    generate_pyi(import_name, outpath, options)
  File "/var/tmp/portage/dev-python/pyside2-5.15.10-r2/work/pyside-setup-opensource-src-5.15.10/sources/pyside2/PySide2/QtSerialPort/../support/generate_pyi.py", line 215, in generate_pyi
    top = __import__(import_name)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "shibokensupport/feature.py", line 139, in _import
ImportError: /usr/lib64/libudev.so.1: invalid ELF header
Comment 1 Sergey 'L29Ah' Alirzaev 2023-10-08 13:38:30 UTC
Created attachment 872326 [details]
emerge --info
Comment 2 Sergey 'L29Ah' Alirzaev 2023-10-08 13:40:48 UTC
Created attachment 872327 [details]
build log
Comment 3 Nowa Ammerlaan gentoo-dev 2023-10-12 04:41:17 UTC
> ImportError: /usr/lib64/libudev.so.1: invalid ELF header

This looks like a problem with your udev installation. Which package is providing udev here? Can you try recompiling it?
Comment 4 Sergey 'L29Ah' Alirzaev 2023-10-14 15:50:59 UTC
(In reply to Andrew Ammerlaan from comment #3)
> > ImportError: /usr/lib64/libudev.so.1: invalid ELF header
> 
> This looks like a problem with your udev installation. Which package is
> providing udev here? Can you try recompiling it?

sys-apps/systemd-utils
Compiled it yesterday, got the same error.
Comment 5 Sergey 'L29Ah' Alirzaev 2023-10-14 15:52:08 UTC
∞ cat /usr/lib64/libudev.so.1
/* GNU ld script
   Since Gentoo has critical dynamic libraries in /lib, and the static versions
   in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
   run into linking problems.  This "fake" dynamic lib is a linker script that
   redirects the linker to the real lib.  And yes, this works in the cross-
   compiling scenario as the sysroot-ed linker will prepend the real path.

   See bug https://bugs.gentoo.org/4411 for more info.
 */
OUTPUT_FORMAT ( elf64-x86-64 )
GROUP ( /lib64/libudev.so.1 )
Comment 6 Nowa Ammerlaan gentoo-dev 2023-10-14 16:50:12 UTC
@systemd team, do you have any idea what is happening here and what we can do about it? I cannot reproduce this on my system with sys-apps/systemd, it seems to be specific to sys-apps/systemd-utils.
Comment 7 Mike Gilbert gentoo-dev 2023-10-15 00:14:10 UTC
Can you force it to load /lib64/libudev.so.1 instead of /usr/lib64/libudev.so.1?
Comment 8 Mike Gilbert gentoo-dev 2023-10-15 00:37:00 UTC
I suspect this has nothing to do with systemd vs systemd-utils.

The difference is probably split-usr, where /usr/lib64/libudev.so.1 is a linker script instead of an ELF shared object.

I have no idea how PySide2 works, so I'm not sure how/why it would try to load libudev.so.1 without using the runtime linker (ld.so).
Comment 9 Mike Gilbert gentoo-dev 2023-10-15 01:00:42 UTC
Ah, I think the issue is the build system sets LD_LIBRARY_PATH=/usr/lib64. You can see that LD_LIBRARY_PATH setting in the command line from comment 0.

That causes ld.so to load libraries directly from /usr/lib64 instead of consulting /etc/ld.so.cache.
Comment 10 Mike Gilbert gentoo-dev 2023-10-15 01:04:58 UTC
I'm guessing the LD_LIBRARY_PATH setting comes from this cmake file.

https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside2/cmake/Macros/PySideModules.cmake?h=v5.15.10-lts-lgpl#n165
Comment 11 Nowa Ammerlaan gentoo-dev 2023-10-27 10:10:27 UTC
(In reply to Mike Gilbert from comment #10)
> I'm guessing the LD_LIBRARY_PATH setting comes from this cmake file.
> 
> https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside2/cmake/
> Macros/PySideModules.cmake?h=v5.15.10-lts-lgpl#n165

The /usr/lib64 part of LD_LIBRARY_PATH is coming from the env:

    else()
        # Handles both macOS and Linux.
        set(env_value "$ENV{${ld_prefix_var_name}}")
        if(env_value)
            string(APPEND ld_prefix ":${env_value}")
        endif()
    endif()

I can patch this code out, but maybe it makes more sense to find out what is putting this in the env in the first place.
Comment 12 Sergey 'L29Ah' Alirzaev 2023-11-23 23:32:15 UTC
Could you please put the previous, working version back in the tree? emerge fails to resolve the system upgrade (things like firefox and mpv) after failing to build pyside2 despite of --keep-going, and masking it just makes it refuse to update world altogether.
Comment 13 Nowa Ammerlaan gentoo-dev 2023-11-24 09:23:36 UTC
(In reply to Sergey 'L29Ah' Alirzaev from comment #12)
> Could you please put the previous, working version back in the tree? emerge
> fails to resolve the system upgrade (things like firefox and mpv) after
> failing to build pyside2 despite of --keep-going, and masking it just makes
> it refuse to update world altogether.

This is not feasible since this requires re-adding all of the old Qt5 packages as well. Are you sure it is still broken in 5.15.11? If I look at the log it seems the latest version doesn't set LD_LIBRARY_PATH as aggressively as the previous version.

If it is still broken you can try patching out this line in sources/pyside2/cmake/Macros/PySideModules.cmake:
"""
        set(env_value "$ENV{${ld_prefix_var_name}}")
"""

I want to get rid of pyside2 as soon as possible anyway, it is unmaintained upstream and we have only a few reverse dependencies that are all well on their way to port to pyside6.
Comment 14 Sergey 'L29Ah' Alirzaev 2023-11-24 12:08:18 UTC
(In reply to Andrew Ammerlaan from comment #13)
> This is not feasible since this requires re-adding all of the old Qt5
> packages as well. Are you sure it is still broken in 5.15.11? If I look at
> the log it seems the latest version doesn't set LD_LIBRARY_PATH as
> aggressively as the previous version.

What packages? The installed pyside2 version (5.15.10::gentoo) seems to work with the current qt5 packages (at least, freecad runs).

I upgrade world every night and it always fails.

https://github.com/FreeCAD/FreeCAD/issues/6992 doesn't seem like freecad will migrate in the next half a year.
Comment 15 Nowa Ammerlaan gentoo-dev 2023-11-24 12:11:13 UTC
(In reply to Sergey 'L29Ah' Alirzaev from comment #14)
> (In reply to Andrew Ammerlaan from comment #13)
> > This is not feasible since this requires re-adding all of the old Qt5
> > packages as well. Are you sure it is still broken in 5.15.11? If I look at
> > the log it seems the latest version doesn't set LD_LIBRARY_PATH as
> > aggressively as the previous version.
> 
> What packages? The installed pyside2 version (5.15.10::gentoo) seems to work
> with the current qt5 packages (at least, freecad runs).

This bug is reported against 5.15.10-r2, I think you'll have more luck with 5.15.11-r1. We don't have qt 5.15.10 in the tree any more at all.
Comment 16 Sergey 'L29Ah' Alirzaev 2023-11-24 12:22:38 UTC
(In reply to Andrew Ammerlaan from comment #15)
> (In reply to Sergey 'L29Ah' Alirzaev from comment #14)
> > (In reply to Andrew Ammerlaan from comment #13)
> > > This is not feasible since this requires re-adding all of the old Qt5
> > > packages as well. Are you sure it is still broken in 5.15.11? If I look at
> > > the log it seems the latest version doesn't set LD_LIBRARY_PATH as
> > > aggressively as the previous version.
> > 
> > What packages? The installed pyside2 version (5.15.10::gentoo) seems to work
> > with the current qt5 packages (at least, freecad runs).
> 
> This bug is reported against 5.15.10-r2, I think you'll have more luck with
> 5.15.11-r1. We don't have qt 5.15.10 in the tree any more at all.

I don't have qt 5.15.10 either, yet pyside2 5.15.10 works with the current qt5.
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-24 12:24:51 UTC
Can you try building 5.15.11-r1 as requested (unclear if you've tried it)?

If it fails, please try the patch Andrew suggests.
Comment 18 Larry the Git Cow gentoo-dev 2024-01-05 04:10:41 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/data/gentoo-news.git/commit/?id=114a15884faf88f202073de48812613b264f49e0

commit 114a15884faf88f202073de48812613b264f49e0
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: 2024-01-02 04:04:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-05 04:10:37 +0000

    2024-01-05-usr-initramfs: add news item
    
    Revival of commit a79dd69b0cca439bc0c483c9193c79e0554819d0.
    
    Bug: https://bugs.gentoo.org/868306#c10
    Bug: https://bugs.gentoo.org/902829
    Bug: https://bugs.gentoo.org/915379
    Bug: https://bugs.gentoo.org/825078
    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../2024-01-05-usr-initramfs.en.txt                | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
Comment 19 Larry the Git Cow gentoo-dev 2024-03-09 07:41:45 UTC
The bug has been referenced in the following commit(s):

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

commit b1e27ebcaab82dea490ab48f29c269240c0b74ba
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2024-03-09 07:40:02 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2024-03-09 07:40:48 +0000

    profiles/package.deprecated: deprecate pyside2 and friends
    
    Bug: https://bugs.gentoo.org/864391
    Bug: https://bugs.gentoo.org/920544
    Bug: https://bugs.gentoo.org/915379
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 profiles/package.deprecated | 8 ++++++++
 1 file changed, 8 insertions(+)