Bug 2097183

Summary: sysconfig results lead to broken Meson heuristics
Product: [Fedora] Fedora Reporter: Tristan Partin <tristan>
Component: python3.10Assignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: 36CC: cstratak, marcus, mhroncok, python-maint, python-sig, thrnciar, torsava, vstinner
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: python3.10-3.10.6-2.fc38 python3.10-3.10.7-1.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-23 01:20:30 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:
Bug Depends On: 2026979    
Bug Blocks:    

Description Tristan Partin 2022-06-15 05:22:03 UTC
Description of problem:

sysconfig is returning irregular values leading to broken Meson heuristics.

`python3 -c "import sysconfig; print(sysconfig.get_paths(vars={'base': '', 'platbase': '', 'installed_base': ''}))"`

This isn't the case in any Ubuntu I tested nor Fedora 35. Ideally Fedora either reverts this change or guides Meson on how to better handle this case. See upstream bug report further down.

Version-Release number of selected component (if applicable):


How reproducible: 100%


Steps to Reproduce:
1. Run the command listed in the description

Actual results:

```
{'stdlib': '/lib64/python3.10', 'platstdlib': '/lib64/python3.10', 'purelib': '/local/lib/python3.10/site-packages', 'platlib': '/local/lib64/python3.10/site-packages', 'include': '/include/python3.10', 'platinclude': '/usr/include/python3.10', 'scripts': '/local/bin', 'data': '/local'}
```

Expected results:

```
{'stdlib': '/lib64/python3.10', 'platstdlib': '/lib64/python3.10', 'purelib': '/lib/python3.10/site-packages', 'platlib': '/lib64/python3.10/site-packages', 'include': '/include/python3.10', 'platinclude': '/usr/include/python3.10', 'scripts': '/bin', 'data': '.'}
```

Additional info:

https://github.com/mesonbuild/meson/issues/10459

Comment 1 Tristan Partin 2022-06-15 05:27:08 UTC
Meson's default prefix on Linux is `/usr/local`. So when sysconfig reports this type of path, `/usr/local` gets prepended to the returned paths, you end up with the type of paths listed in the bug report, `/usr/local/local/...`. If you change Meson's prefix to `/opt`, the combined paths become `/opt/local/...`. Fedora 36 is the only system exhibiting this kind of behavior at the moment.

Comment 3 Marcus Müller 2022-08-07 18:01:40 UTC
Can confirm this breaks meson when used for python on Fedora 36; this is actively hurting GNU Radio 4.0 development on Fedora (needs to be done on a different distro, as this blocks the necessary installation into prefixes for testing). So, this is a blocker for shipping `gnuradio-4` at some point.

Comment 4 Miro Hrončok 2022-08-09 10:20:47 UTC
I've created a patch that I believe should mitigate this issue. Next steps: Verify and tested for regressions.

https://github.com/fedora-python/cpython/pull/48/
https://src.fedoraproject.org/rpms/python3.11/pull-request/74

=========================================

(In reply to Marcus Müller from comment #3)
> Can confirm this breaks meson when used for python on Fedora 36; this is
> actively hurting GNU Radio 4.0 development on Fedora (needs to be done on a
> different distro, as this blocks the necessary installation into prefixes
> for testing). So, this is a blocker for shipping `gnuradio-4` at some point.

I am sorry about that. As a workaround, you don't need to change a distro, set $RPM_BUILD_ROOT=/ (environment variable).

Comment 5 Fedora Update System 2022-08-18 12:50:33 UTC
FEDORA-2022-63c831ce92 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-63c831ce92

Comment 6 Fedora Update System 2022-08-18 12:50:40 UTC
FEDORA-2022-f4df41ffb4 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f4df41ffb4

Comment 7 Fedora Update System 2022-08-18 12:53:21 UTC
FEDORA-2022-63c831ce92 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2022-08-18 12:56:18 UTC
FEDORA-2022-f4df41ffb4 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Miro Hrončok 2022-08-18 13:05:17 UTC
This has been fixed in Fedora 37 Python 3.11. I plan to let it sink for a while before backporting to 3.10. Testing and feedback would be appreciated.

Comment 10 Fedora Update System 2022-08-18 16:53:28 UTC
FEDORA-2022-af60f7160a has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-af60f7160a

Comment 11 Fedora Update System 2022-08-18 16:53:29 UTC
FEDORA-2022-850a0a68d4 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-850a0a68d4

Comment 12 Fedora Update System 2022-08-19 01:13:02 UTC
FEDORA-2022-af60f7160a 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-af60f7160a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-af60f7160a

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

Comment 13 Fedora Update System 2022-08-19 02:33:37 UTC
FEDORA-2022-850a0a68d4 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-850a0a68d4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-850a0a68d4

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

Comment 14 Miro Hrončok 2022-08-24 10:22:14 UTC
Tristan, please go to https://src.fedoraproject.org/rpms/python3.10/pull-request/124, fetch the CI scratch build form https://koji.fedoraproject.org/koji/taskinfo?taskID=91129331 and let us know if this fixes the issue for you. Thank you.

Comment 15 Fedora Update System 2022-08-26 11:51:58 UTC
FEDORA-2022-af60f7160a has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2022-08-26 12:16:13 UTC
FEDORA-2022-850a0a68d4 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Tristan Partin 2022-08-26 18:23:15 UTC
I don't know how to test the RPM on my current Fedora 36 install without rpm complaining that I am about to destroy my system if I uninstall python-libs.

Comment 19 Fedora Update System 2022-09-06 14:32:11 UTC
FEDORA-2022-f0c3f99a57 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f0c3f99a57

Comment 20 Fedora Update System 2022-09-06 14:35:35 UTC
FEDORA-2022-f0c3f99a57 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2022-09-06 14:59:59 UTC
FEDORA-2022-a9cbedd528 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a9cbedd528

Comment 22 Fedora Update System 2022-09-06 20:30:41 UTC
FEDORA-2022-a9cbedd528 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-a9cbedd528`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-a9cbedd528

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

Comment 23 Fedora Update System 2022-09-08 11:13:32 UTC
FEDORA-2022-c072cdc3c8 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-c072cdc3c8

Comment 24 Miro Hrončok 2022-09-08 11:21:24 UTC
(In reply to Fedora Update System from comment #23)
> FEDORA-2022-c072cdc3c8 has been submitted as an update to Fedora 36.
> https://bodhi.fedoraproject.org/updates/FEDORA-2022-c072cdc3c8

This is the update you've been waiting for. Please test and provide karma.

Comment 25 Fedora Update System 2022-09-09 11:55:21 UTC
FEDORA-2022-c072cdc3c8 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-c072cdc3c8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-c072cdc3c8

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

Comment 26 Fedora Update System 2022-09-10 17:20:52 UTC
FEDORA-2022-f330bbfda2 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-f330bbfda2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-f330bbfda2

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

Comment 27 Fedora Update System 2022-09-10 19:43:56 UTC
FEDORA-2022-c072cdc3c8 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-c072cdc3c8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-c072cdc3c8

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

Comment 28 Fedora Update System 2022-09-14 00:22:18 UTC
FEDORA-2022-f330bbfda2 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 29 Fedora Update System 2022-09-23 01:20:30 UTC
FEDORA-2022-c072cdc3c8 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 30 Red Hat Bugzilla 2023-09-18 04:39:15 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days