** Description changed:

+ [Original Description/Impact]
+ 
  dh-python in Noble, on architectures other than amd64, renames libdnf
  binary modules and breaks them:
  
  I: dh_python3 fs:418: renaming _module.so to
  _.cpython-312-aarch64-linux-gnu.so
  
  https://launchpadlibrarian.net/722671993/buildlog_ubuntu-noble-
  arm64.libdnf_0.69.0-2.3build3_BUILDING.txt.gz
  
  https://packages.ubuntu.com/noble/arm64/python3-libdnf/filelist
  
  /usr/lib/python3/dist-packages/libdnf/_.cpython-312-aarch64-linux-gnu.so
  
  On amd64 it ships the module named as intended:
  
  https://packages.ubuntu.com/noble/amd64/python3-libdnf/filelist
  
  /usr/lib/python3/dist-packages/libdnf/_module.cpython-312-x86_64-linux-
  gnu.so
  
- 
  This causes dnf to break on arm64:
  
  Traceback (most recent call last):
-   File "/usr/bin/dnf", line 61, in <module>
-     from dnf.cli import main
-   File "/usr/lib/python3/dist-packages/dnf/__init__.py", line 30, in <module>
-     import dnf.base
-   File "/usr/lib/python3/dist-packages/dnf/base.py", line 29, in <module>
-     import libdnf.transaction
-   File "/usr/lib/python3/dist-packages/libdnf/__init__.py", line 13, in 
<module>
-     from . import module
-   File "/usr/lib/python3/dist-packages/libdnf/module.py", line 10, in <module>
-     from . import _module
+   File "/usr/bin/dnf", line 61, in <module>
+     from dnf.cli import main
+   File "/usr/lib/python3/dist-packages/dnf/__init__.py", line 30, in <module>
+     import dnf.base
+   File "/usr/lib/python3/dist-packages/dnf/base.py", line 29, in <module>
+     import libdnf.transaction
+   File "/usr/lib/python3/dist-packages/libdnf/__init__.py", line 13, in 
<module>
+     from . import module
+   File "/usr/lib/python3/dist-packages/libdnf/module.py", line 10, in <module>
+     from . import _module
  ImportError: cannot import name '_module' from partially initialized module 
'libdnf' (most likely due to a circular import) 
(/usr/lib/python3/dist-packages/libdnf/__init__.py)
  
- 
- Github Actions enable arm64 using Ubuntu 24.04 images yesterday, so this 
issue is starting to show up when building rpm-based images (fedora/centos) on 
Ubuntu 24.04 arm64 on Github as part of CI systems.
+ Github Actions enable arm64 using Ubuntu 24.04 images yesterday, so this
+ issue is starting to show up when building rpm-based images
+ (fedora/centos) on Ubuntu 24.04 arm64 on Github as part of CI systems.
  
  The issue was already fixed in Debian, but didn't make it in Noble:
  
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068255
  
  https://salsa.debian.org/python-team/tools/dh-
  python/-/commit/5406e503c4428ae3b019f2078146a1ea2dfc2fa5
  
  It would be great to update dh-python in Noble, and do a binary rebuild
  of libdnf to fix this issue.
+ 
+ [Test Plan]
+ 
+ * On a non-amd64 host running Ubuntu 24.04, install and run dnf:
+ 
+ $ dpkg --print-architecture
+ $ apt install -y dnf
+ $ dnf
+ 
+ * Without the bug, the help output should be displayed. With the bug, an
+ ImportError will be thrown.
+ 
+ * For good measure, the package contents should be listed to confirm
+ naming is correct:
+ 
+ $ dpkg -L python3-libdnf
+ 
+ [Other information]
+ 
+ The root cause of this bug is in dh-python, and is fixed in oracular and
+ newer. While the *best* fix would be to fix dh-python directly, and
+ rebuild affected packages, it seems that libdnf is the only affected
+ package. Hence, to simplify the fix, the workaround approach is
+ preferred.
+ 
+ In order for a package to be affected, it would have had to be built in
+ noble after dh-python 6.20240401 was uploaded, *AND* ship a file named
+ _module.cpython-312-*.so. On an amd64 host running noble, I see only
+ libdnf meeting this criteria:
+ 
+ nr@six:~$ apt-file search /_module.cpython
+ python3-libdnf: 
/usr/lib/python3/dist-packages/libdnf/_module.cpython-312-x86_64-linux-gnu.so
+ 
+ [Where problems could occur]
+ 
+ The patch is in d/rules, and copies the incorrectly named _.cpython-*.so
+ to _module.cpython-*.so instead. I.e., manually fixing the incorrect
+ renaming. An error in this logic would result in either (a) the build
+ failing, or (b) the bug not being fixed at all.

** Changed in: libdnf (Ubuntu)
       Status: New => Fix Released

** Changed in: dh-python (Ubuntu)
       Status: New => Fix Released

** Changed in: libdnf (Ubuntu Noble)
       Status: Confirmed => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to dh-python in Ubuntu.
https://bugs.launchpad.net/bugs/2095168

Title:
  dh-python: dh_python3 loses cpython module name when renaming shared
  object

Status in dh-python package in Ubuntu:
  Fix Released
Status in libdnf package in Ubuntu:
  Fix Released
Status in dh-python source package in Noble:
  Confirmed
Status in libdnf source package in Noble:
  In Progress
Status in dh-python source package in Oracular:
  Fix Released
Status in libdnf source package in Oracular:
  Fix Released
Status in dh-python package in Debian:
  Fix Released

Bug description:
  [Original Description/Impact]

  dh-python in Noble, on architectures other than amd64, renames libdnf
  binary modules and breaks them:

  I: dh_python3 fs:418: renaming _module.so to
  _.cpython-312-aarch64-linux-gnu.so

  https://launchpadlibrarian.net/722671993/buildlog_ubuntu-noble-
  arm64.libdnf_0.69.0-2.3build3_BUILDING.txt.gz

  https://packages.ubuntu.com/noble/arm64/python3-libdnf/filelist

  /usr/lib/python3/dist-packages/libdnf/_.cpython-312-aarch64-linux-
  gnu.so

  On amd64 it ships the module named as intended:

  https://packages.ubuntu.com/noble/amd64/python3-libdnf/filelist

  /usr/lib/python3/dist-
  packages/libdnf/_module.cpython-312-x86_64-linux-gnu.so

  This causes dnf to break on arm64:

  Traceback (most recent call last):
    File "/usr/bin/dnf", line 61, in <module>
      from dnf.cli import main
    File "/usr/lib/python3/dist-packages/dnf/__init__.py", line 30, in <module>
      import dnf.base
    File "/usr/lib/python3/dist-packages/dnf/base.py", line 29, in <module>
      import libdnf.transaction
    File "/usr/lib/python3/dist-packages/libdnf/__init__.py", line 13, in 
<module>
      from . import module
    File "/usr/lib/python3/dist-packages/libdnf/module.py", line 10, in <module>
      from . import _module
  ImportError: cannot import name '_module' from partially initialized module 
'libdnf' (most likely due to a circular import) 
(/usr/lib/python3/dist-packages/libdnf/__init__.py)

  Github Actions enable arm64 using Ubuntu 24.04 images yesterday, so
  this issue is starting to show up when building rpm-based images
  (fedora/centos) on Ubuntu 24.04 arm64 on Github as part of CI systems.

  The issue was already fixed in Debian, but didn't make it in Noble:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068255

  https://salsa.debian.org/python-team/tools/dh-
  python/-/commit/5406e503c4428ae3b019f2078146a1ea2dfc2fa5

  It would be great to update dh-python in Noble, and do a binary
  rebuild of libdnf to fix this issue.

  [Test Plan]

  * On a non-amd64 host running Ubuntu 24.04, install and run dnf:

  $ dpkg --print-architecture
  $ apt install -y dnf
  $ dnf

  * Without the bug, the help output should be displayed. With the bug,
  an ImportError will be thrown.

  * For good measure, the package contents should be listed to confirm
  naming is correct:

  $ dpkg -L python3-libdnf

  [Other information]

  The root cause of this bug is in dh-python, and is fixed in oracular
  and newer. While the *best* fix would be to fix dh-python directly,
  and rebuild affected packages, it seems that libdnf is the only
  affected package. Hence, to simplify the fix, the workaround approach
  is preferred.

  In order for a package to be affected, it would have had to be built
  in noble after dh-python 6.20240401 was uploaded, *AND* ship a file
  named _module.cpython-312-*.so. On an amd64 host running noble, I see
  only libdnf meeting this criteria:

  nr@six:~$ apt-file search /_module.cpython
  python3-libdnf: 
/usr/lib/python3/dist-packages/libdnf/_module.cpython-312-x86_64-linux-gnu.so

  [Where problems could occur]

  The patch is in d/rules, and copies the incorrectly named
  _.cpython-*.so to _module.cpython-*.so instead. I.e., manually fixing
  the incorrect renaming. An error in this logic would result in either
  (a) the build failing, or (b) the bug not being fixed at all.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dh-python/+bug/2095168/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to