%pyproject_buildrequires: Support Package information on ELF objects

When extension modules are built in %pyproject_buildrequires,
we need to create the package note file.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2097535

This is tested via python-ldap -- %pyproject_buildrequires -w fails without the fix.

Neither python-markupsafe nor python-mistune can be used as a test
because they only warn when the extension module cannot be built
because they fallback to pure Python.

Related: rhbz#2117571
This commit is contained in:
Miro Hrončok 2022-06-17 09:03:18 +00:00
parent e9ea68926b
commit 589556411f
3 changed files with 10 additions and 2 deletions

View File

@ -129,6 +129,9 @@ fi
# The _auto_set_build_flags feature does not do this in %%generate_buildrequires section,
# but we want to get an environment consistent with %%build:
%{?_auto_set_build_flags:%set_build_flags}
# The default flags expect the package note file to exist
# see https://bugzilla.redhat.com/show_bug.cgi?id=2097535
%{?_package_note_flags:%_generate_package_note_file}
%{-R:
%{-r:%{error:The -R and -r options are mutually exclusive}}
%{-w:%{error:The -R and -w options are mutually exclusive}}

View File

@ -128,6 +128,8 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
%changelog
* Wed Jun 15 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.2-1
- Update %%pyproject_build_lib to support setuptools 62.1.0 and later
- %%pyproject_buildrequires: When extension modules are built,
support https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects
* Fri May 27 2022 Owen Taylor <otaylor@redhat.com> - 1.3.1-1
- %%pyproject_install: pass %%{_prefix} explicitly to pip install

View File

@ -28,6 +28,7 @@ Building this tests:
- the proper files are installed in the proper places
- module glob in %%pyproject_save_files (some modules are included, some not)
- combined manual and generated Buildrequires
- building an extension module via %%pyproject_buildrequires -w
%package -n python3-ldap
@ -48,11 +49,13 @@ rm Tests/t_ldapobject.py Tests/t_cext.py Tests/t_edit.py Tests/t_ldap_sasl.py Te
%generate_buildrequires
%pyproject_buildrequires -t
# -w is not required with this package, but we test that we can use it anyway
%pyproject_buildrequires -t -w
%build
%pyproject_wheel
#%%pyproject_wheel -- this is done via %%pyproject_buildrequires -w
# Internal check that we can import the built extension modules from %%{pyproject_build_lib}
%{python3} -c 'import _ldap' && exit 1 || true
PYTHONPATH=%{pyproject_build_lib} %{python3} -c 'import _ldap'