Go to file
Miro Hrončok 5b578a851f Set $RPM_BUILD_ROOT in %{python3_...} macros, for alternate sysconfig install scheme
Our Pythons currently patches distutils to install packages to
/usr/lib(64)/pythonX.Y/site-packages when the $RPM_BUILD_ROOT environment
variable is set (and to /usr/local/lib(64)/pythonX.Y/site-packages otherwise).
With the deprecation of distutils [1] we want to change the patch to create
and use a different sysconfig install scheme [2].

However, we have realized that macros defined as %(%{__python3} ...) don't
"see" the environment variables set by rpmbuild because they are expanded earlier
and hence e.g. %{python3_sitelib} evaluates to
/usr/local/lib/python3.X/site-packages -- which is not desired.
To be able to reliably detect an RPM build environment by checking
the presence of the $RPM_BUILD_ROOT environment variable,
we manually set it in the macro definitions.

Since %{buildroot} in not fully populated
(e.g. it can expand literally to
/home/anna/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64),
we don't use it here.
The variable simply needs to present in the environment.

See also the analysis of the build failures when this is not done [3].

[1] https://www.python.org/dev/peps/pep-0632/
[2] https://bugs.python.org/issue43976
[3] https://src.fedoraproject.org/rpms/python3.10/pull-request/63#comment-79042
2021-09-17 16:56:20 +02:00
tests Test bytecompilation & hardlinking with 3.8 and 2.7 2021-09-10 17:50:49 +02:00
.gitignore Initial setup of the repo 2016-01-12 23:33:17 +00:00
brp-fix-pyc-reproducibility New opt-in possibility to fix byte-compilation reproducibility 2020-07-21 11:42:54 +00:00
brp-python-bytecompile Remove unneeded arguments from the python_bytecompile function 2021-09-10 17:50:49 +02:00
brp-python-hardlink Include brp-python-hardlink in python-srpm-macros since it is no longer in RPM 4.17+ 2021-06-30 18:13:53 +02:00
compileall2.py Update of bundled compileall2 module to 0.7.1 (bugfix release) 2020-03-31 14:24:09 +02:00
macros.pybytecompile Use --hardlink-dupes for Python 3.4+ as well 2021-09-10 16:14:28 +02:00
macros.python Set $RPM_BUILD_ROOT in %{python3_...} macros, for alternate sysconfig install scheme 2021-09-17 16:56:20 +02:00
macros.python-srpm Move Python related BuildRoot Policy scripts from redhat-rpm-config to python-srpm-macros 2021-07-08 12:58:05 +02:00
macros.python3 Set $RPM_BUILD_ROOT in %{python3_...} macros, for alternate sysconfig install scheme 2021-09-17 16:56:20 +02:00
python-rpm-macros.spec Set $RPM_BUILD_ROOT in %{python3_...} macros, for alternate sysconfig install scheme 2021-09-17 16:56:20 +02:00
python.lua Update comment for python_altnames() to reflect the reality 2021-02-24 13:06:35 +01:00
sources Initial setup of the repo 2016-01-12 23:33:17 +00:00