Bug 2299798 - python3-botan2: pure Python module installed in %python3_sitearch
Summary: python3-botan2: pure Python module installed in %python3_sitearch
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: botan2
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Frantisek Sumsal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-07-25 03:07 UTC by Carl George 🤠
Modified: 2024-08-11 04:48 UTC (History)
4 users (show)

Fixed In Version: botan2-2.19.5-4.fc41 botan2-2.19.5-3.fc39 botan2-2.19.5-3.fc40
Clone Of:
Environment:
Last Closed: 2024-08-01 09:51:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Carl George 🤠 2024-07-25 03:07:24 UTC
The python3-botan2 package installs a pure Python module into %python3_sitearch, a directory reserved for natively compiled Python extension modules.

root@f41-container:~# dnf -q repoquery --list python3-botan2 | grep site
/usr/lib64/python3.13/site-packages/__pycache__/botan2.cpython-313.opt-1.pyc
/usr/lib64/python3.13/site-packages/__pycache__/botan2.cpython-313.pyc
/usr/lib64/python3.13/site-packages/botan2.py

Per the Python Packaging Guidelines, these files should be in %python3_sitelib (/usr/lib/python3.13/site-packages/) instead.

https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_mandatory_macros

I took a look at the spec file and didn't see an obvious way to fix this.  I tried changing the value passed to the --libdir flag for the configure.py script, however that also changes the directory that the compiled C++ shared object is installed to.  I'm thinking there are two possible solutions.

Option 1: Manually move botan2.py from %python3_sitearch to %python3_sitelib during %install.  We only have to move that one file, because the .pyc files are automatically generated later in the build process.

Option 2: Patch the sources to allow passing an explicit py_lib_path that can be different from libdir.  A little more complicated, but something that can perhaps be sent upstream and could benefit other distributions.

https://github.com/randombit/botan/blob/2.19.5/src/scripts/install.py#L222

Reproducible: Always

Comment 1 Yaakov Selkowitz 2024-07-25 03:17:55 UTC
While botan2.py is pure python and therefore *technically* noarch, it is a subpackage of an archful package (botan2 itself).  I'm not sure this is even an issue that is worth any time to "fix", but perhaps Python SIG would have something to say about this.

Comment 2 Carl George 🤠 2024-07-25 04:04:43 UTC
https://src.fedoraproject.org/rpms/botan2/pull-request/6

Comment 3 Carl George 🤠 2024-07-25 04:07:21 UTC
I hit submit too early.  That linked PR in my last comment is a proposed implementation of option 1.  If you'd prefer to go for option 2, feel free to close it.

Yaakov, I'm a member of the Python SIG, and I think it's worth following the guidelines here.  I'm checking with the other SIG members to see if it makes sense to mark the python3-botan2 subpackage as noarch as well.

Comment 4 Miro Hrončok 2024-07-25 09:30:50 UTC
https://src.fedoraproject.org/rpms/botan2/pull-request/5 and https://src.fedoraproject.org/rpms/botan2/pull-request/6 can be safely combined if the %{?_isa} part is dropped.


There might be a mishmash if you only have i686 botan2 installed on x86_64, but that's unlikely.

I believe the files indeed belong to /usr/lib/python3.13/site-packages/ -- but OTOH maybe it's not worth the trouble?

Comment 5 Carl George 🤠 2024-07-25 20:31:17 UTC
I updated https://src.fedoraproject.org/rpms/botan2/pull-request/6 to include the missing dependency, but without the %{?_isa}.

Regarding i686, certainly unlikely, but perhaps we could eliminate the possibility by adding `ExcludeArch: %{ix86}` in this package and librnp (the only package with i686 not disabled that requires this package).

https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval

I don't think it's any trouble at all, the changes are rather small.  Absent some kind of drawback I can't justify not following the guidelines.

Comment 6 Fedora Update System 2024-08-01 09:48:15 UTC
FEDORA-2024-a8a61149a8 (botan2-2.19.5-4.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-a8a61149a8

Comment 7 Fedora Update System 2024-08-01 09:51:03 UTC
FEDORA-2024-a8a61149a8 (botan2-2.19.5-4.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2024-08-01 11:05:54 UTC
FEDORA-2024-05fe1542a3 (botan2-2.19.5-3.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-05fe1542a3

Comment 9 Fedora Update System 2024-08-01 11:23:29 UTC
FEDORA-2024-924ed18058 (botan2-2.19.5-3.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-924ed18058

Comment 10 Fedora Update System 2024-08-02 03:35:32 UTC
FEDORA-2024-924ed18058 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-924ed18058`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-924ed18058

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2024-08-02 03:40:05 UTC
FEDORA-2024-05fe1542a3 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-05fe1542a3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-05fe1542a3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2024-08-11 03:29:32 UTC
FEDORA-2024-924ed18058 (botan2-2.19.5-3.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2024-08-11 04:48:15 UTC
FEDORA-2024-05fe1542a3 (botan2-2.19.5-3.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.