Bug 2134832

Summary: _pcbnew.so misplaced on x64
Product: [Fedora] Fedora Reporter: Sergey <sergey>
Component: kicadAssignee: Steven A. Falco <stevenfalco>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: aimylios, alain.vigne.14, kiarakovalevsky, stevenfalco, thibault
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kicad-6.0.8-4.fc36 kicad-6.0.8-4.fc35 kicad-6.0.9-1.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-29 19:32:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sergey 2022-10-14 13:34:17 UTC
Description of problem:
A 64-bit ELF _pcbnew.so installed into /usr/lib/python3.10/site-packages/

Version-Release number of selected component (if applicable):
FC36, FC37, FC38

How reproducible:
always

Steps to Reproduce:
dnf install kicad

Actual results:
$ rpm -qf /usr/lib/python3.10/site-packages/_pcbnew.so
kicad-6.0.8-1.fc36.x86_64


Expected results:
A 64-bit ELF_pcbnew.so installed into /usr/lib64/python3.10/site-packages/

Comment 1 Steven A. Falco 2022-10-14 21:33:21 UTC
I'll start a dialog with the upstream developers.  I'm not sure what the best way to fix this would be.

Comment 2 Sergey 2022-10-15 08:06:06 UTC
(In reply to Steven A. Falco from comment #1)
> I'll start a dialog with the upstream developers.  I'm not sure what the
> best way to fix this would be.

Steven,

Looking at `pcbnew/CMakeLists.txt` I would suggest to add `-DPYTHON_DEST=${python3_sitearch}` or even `-DPYTHON_DEST=%{buildroot}%{python3_sitearch}` to cmake invocation (I am not sure would cmake add the `%{buildroot}` on its own to `PYTHON_DEST` in `install section`. However, `rpmlint` would complain if you use `%{buildroot}` in `build section`)

Also, you could replace `%{buildroot}%{_prefix}/lib/python%{python3_version}/site-packages/` with %{buildroot}%{python3_sitearch} in further references to `_pcbnew.so` 

Sergey

Comment 3 Steven A. Falco 2022-10-15 14:48:12 UTC
Sergey,

Thanks very much for the suggestion.  I see that PYTHON_DEST is set from PYTHON_SITE_PACKAGE_PATH.  PYTHON_SITE_PACKAGE_PATH comes from the top level CMakeLists.txt:

execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig;print(\"%s\"%distutils.sysconfig.get_python_lib(plat_specific=0, standard_lib=0, prefix=''))"

But distutils.sysconfig is deprecated, so it may be that the top level CMakeLists.txt should be changed to something like:

execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from sysconfig import get_path; print(get_path(\"stdlib\"))"

That would set the PYTHON_SITE_PACKAGE_PATH to /usr/lib64/python3.10, which might fix the problem.

But I'm not at all a python expert, and that's why I want to get upstream to look at it.  I think they are currently traveling, so it will take a few days to get an answer from them.

Comment 4 Fedora Update System 2022-10-16 00:02:19 UTC
FEDORA-2022-4f27b4267e has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-4f27b4267e

Comment 5 Fedora Update System 2022-10-16 00:02:52 UTC
FEDORA-2022-f140db8af1 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f140db8af1

Comment 6 Fedora Update System 2022-10-16 00:03:33 UTC
FEDORA-2022-6051239c6d has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-6051239c6d

Comment 7 Steven A. Falco 2022-10-16 00:07:13 UTC
I created a patch for this and made the builds.  Please test.  I'll leave the bug open for now.

Comment 8 Sergey 2022-10-16 00:26:36 UTC
(In reply to Steven A. Falco from comment #7)
> I created a patch for this and made the builds.  Please test.  I'll leave
> the bug open for now.

Yes, this solves the problem. However, this works just fine as well (tested):

     -DKICAD_VERSION_EXTRA=%{release} \
     -DKICAD_SHOW_GTK_MESSAGES=ON \
-    -DCMAKE_BUILD_TYPE=RelWithDebInfo
+    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+    -DPYTHON_SITE_PACKAGE_PATH=%{python3_sitearch}
 %cmake_build
 

Regards,
Sergey

Comment 9 Steven A. Falco 2022-10-16 14:11:02 UTC
Thanks.  We'll see what upstream wants to do.  If they don't like my patch I can always revert it and make the change you suggested.

Comment 10 Fedora Update System 2022-10-16 21:13:21 UTC
FEDORA-2022-6051239c6d has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-6051239c6d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-6051239c6d

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

Comment 11 Fedora Update System 2022-10-16 22:33:32 UTC
FEDORA-2022-4f27b4267e has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-4f27b4267e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-4f27b4267e

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

Comment 12 Fedora Update System 2022-10-16 23:00:15 UTC
FEDORA-2022-f140db8af1 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-f140db8af1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-f140db8af1

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

Comment 13 Steven A. Falco 2022-10-20 15:22:43 UTC
Given the fact that distutils.sysconfig is deprecated and will be removed from python 3.12, it makes sense to drop my approach and go with the one Sergey came up with.

Builds are in progress.

Thanks Sergey!

Comment 14 Fedora Update System 2022-10-21 12:38:43 UTC
FEDORA-2022-fc8c504abe has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-fc8c504abe

Comment 15 Fedora Update System 2022-10-21 12:39:17 UTC
FEDORA-2022-f231ce034c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f231ce034c

Comment 16 Fedora Update System 2022-10-21 12:39:43 UTC
FEDORA-2022-54e7ae3712 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-54e7ae3712

Comment 17 Fedora Update System 2022-10-22 13:11:57 UTC
FEDORA-2022-54e7ae3712 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-54e7ae3712`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-54e7ae3712

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

Comment 18 Fedora Update System 2022-10-22 14:33:54 UTC
FEDORA-2022-f231ce034c has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-f231ce034c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-f231ce034c

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

Comment 19 Fedora Update System 2022-10-22 14:55:31 UTC
FEDORA-2022-fc8c504abe has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-fc8c504abe`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-fc8c504abe

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

Comment 20 Fedora Update System 2022-10-29 19:32:24 UTC
FEDORA-2022-f231ce034c has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2022-10-29 19:41:45 UTC
FEDORA-2022-fc8c504abe has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 22 Fedora Update System 2022-11-10 22:28:04 UTC
FEDORA-2022-5d8d131a29 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.