Bug 2097158

Summary: %pyproject_build_lib uses the dotted python version which is not the case for setuptools 62.4.0
Product: [Fedora] Fedora Reporter: Charalampos Stratakis <cstratak>
Component: pyproject-rpm-macrosAssignee: Python Maintainers <python-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, lbalhar, mhroncok, pviktori, python-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pyproject-rpm-macros-1.3.2-1.fc37 pyproject-rpm-macros-1.3.2-1.fc35 pyproject-rpm-macros-1.3.2-1.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-20 13:45:55 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:    
Bug Blocks: 2064842, 2097085, 2097103, 2097109    

Description Charalampos Stratakis 2022-06-15 02:16:35 UTC
Before this [0] commit in setuptools, building a C extension would create the lib.linux-x86_64-3.9 build directory.

That's not the case now, as with the latest version, the directory would be lib.linux-x86_64-cpython39

This currently makes a number of packages to fail, e.g. bug 2097107

[0] https://github.com/pypa/setuptools/pull/3258/commits/1c23f5e1e4b18b50081cbabb2dea22bf345f5894

Comment 1 Miro HronĨok 2022-06-15 08:42:47 UTC
Awesome! 

This is the current iplmentation:

%pyproject_build_lib %{expand:\\\
$(
pyproject_build_lib=()
if [ -d build/lib.%{python3_platform}-%{python3_version} ]; then
  pyproject_build_lib+=( "${PWD}/build/lib.%{python3_platform}-%{python3_version}" )
fi
if [ -d build/lib ]; then
  pyproject_build_lib+=( "${PWD}/build/lib" )
fi
for directory in $(find "%{_pyproject_builddir}" -type d -wholename "%{_pyproject_builddir}/pip-req-build-*/build/lib.%{python3_platform}-%{python3_version}" 2>/dev/null); do
  pyproject_build_lib+=( "${directory}" )
done
for directory in $(find "%{_pyproject_builddir}" -type d -wholename "%{_pyproject_builddir}/pip-req-build-*/build/lib" 2>/dev/null); do
  pyproject_build_lib+=( "${directory}" )
done
echo $(IFS=:; echo "${pyproject_build_lib[*]}")
)}


I believe this can be solved by adding more ifs and fors.

Due to the ongoing Python 3.11 rebuild, I won't be looking into this soon. I would be able to review a PR.

-------

Note that there are many packages that make this assumption in their spec file manually without pyproject-rpm-macros

Comment 3 Fedora Update System 2022-06-20 13:43:07 UTC
FEDORA-2022-d857c5b521 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-d857c5b521

Comment 4 Fedora Update System 2022-06-20 13:45:55 UTC
FEDORA-2022-d857c5b521 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Fedora Update System 2022-06-20 14:09:11 UTC
FEDORA-2022-49880f29f9 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-49880f29f9

Comment 6 Fedora Update System 2022-06-20 14:09:12 UTC
FEDORA-2022-de6aa089a7 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-de6aa089a7

Comment 7 Fedora Update System 2022-06-21 01:29:55 UTC
FEDORA-2022-49880f29f9 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 --advisory=FEDORA-2022-49880f29f9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-49880f29f9

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

Comment 8 Fedora Update System 2022-06-21 01:58:36 UTC
FEDORA-2022-de6aa089a7 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 --advisory=FEDORA-2022-de6aa089a7`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-de6aa089a7

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

Comment 9 Fedora Update System 2022-06-29 01:50:41 UTC
FEDORA-2022-de6aa089a7 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2022-06-29 02:06:54 UTC
FEDORA-2022-49880f29f9 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.