Don't leak $TMPDIR outside of pyproject macros
During %install, the BRB scripts might be affected by it Related: rhbz#1950291
This commit is contained in:
parent
18de094680
commit
1cacdb2b62
@ -15,17 +15,15 @@
|
|||||||
%pyproject_record %{_builddir}/pyproject-record
|
%pyproject_record %{_builddir}/pyproject-record
|
||||||
|
|
||||||
%pyproject_wheel() %{expand:\\\
|
%pyproject_wheel() %{expand:\\\
|
||||||
export TMPDIR="${PWD}/%{_pyproject_builddir}"
|
mkdir -p "${PWD}/%{_pyproject_builddir}"
|
||||||
mkdir -p "${TMPDIR}"
|
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" TMPDIR="${PWD}/%{_pyproject_builddir}" \\\
|
||||||
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \\\
|
|
||||||
%{__python3} -m pip wheel --wheel-dir %{_pyproject_wheeldir} --no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --no-clean --progress-bar off --verbose .
|
%{__python3} -m pip wheel --wheel-dir %{_pyproject_wheeldir} --no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --no-clean --progress-bar off --verbose .
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
%pyproject_install() %{expand:\\\
|
%pyproject_install() %{expand:\\\
|
||||||
specifier=$(ls %{_pyproject_wheeldir}/*.whl | xargs basename --multiple | sed -E 's/([^-]+)-([^-]+)-.+\\\.whl/\\\1==\\\2/')
|
specifier=$(ls %{_pyproject_wheeldir}/*.whl | xargs basename --multiple | sed -E 's/([^-]+)-([^-]+)-.+\\\.whl/\\\1==\\\2/')
|
||||||
export TMPDIR="${PWD}/%{_pyproject_builddir}"
|
TMPDIR="${PWD}/%{_pyproject_builddir}" %{__python3} -m pip install --root %{buildroot} --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links %{_pyproject_wheeldir} $specifier
|
||||||
%{__python3} -m pip install --root %{buildroot} --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links %{_pyproject_wheeldir} $specifier
|
|
||||||
if [ -d %{buildroot}%{_bindir} ]; then
|
if [ -d %{buildroot}%{_bindir} ]; then
|
||||||
%py3_shebang_fix %{buildroot}%{_bindir}/*
|
%py3_shebang_fix %{buildroot}%{_bindir}/*
|
||||||
rm -rfv %{buildroot}%{_bindir}/__pycache__
|
rm -rfv %{buildroot}%{_bindir}/__pycache__
|
||||||
|
@ -12,7 +12,7 @@ License: MIT
|
|||||||
# In other cases, such as backports, increment the point
|
# In other cases, such as backports, increment the point
|
||||||
# release.
|
# release.
|
||||||
Version: 0
|
Version: 0
|
||||||
Release: 39.2%{?dist}
|
Release: 40%{?dist}
|
||||||
|
|
||||||
# Macro files
|
# Macro files
|
||||||
Source001: macros.pyproject
|
Source001: macros.pyproject
|
||||||
@ -110,6 +110,9 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu May 27 2021 Miro Hrončok <mhroncok@redhat.com> - 0-40
|
||||||
|
- Don't leak $TMPDIR outside of pyproject macros
|
||||||
|
|
||||||
* Thu Apr 22 2021 Miro Hrončok <mhroncok@redhat.com> - 0-39.2
|
* Thu Apr 22 2021 Miro Hrončok <mhroncok@redhat.com> - 0-39.2
|
||||||
- Handle tox provision (tox.requires / tox.minversion)
|
- Handle tox provision (tox.requires / tox.minversion)
|
||||||
- Generate BuildRequires on extras in lower case
|
- Generate BuildRequires on extras in lower case
|
||||||
|
@ -36,8 +36,15 @@ Summary: %{summary}
|
|||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
# Internal check that $TMPDIR is not changed
|
||||||
|
TPMDIR_original="$TMPDIR"
|
||||||
|
|
||||||
%pyproject_install
|
%pyproject_install
|
||||||
|
|
||||||
|
# Internal check that $TMPDIR is not changed
|
||||||
|
test "$TMPDIR" == "$TPMDIR_original"
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# Internal check that the RECORD and REQUESTED files are
|
# Internal check that the RECORD and REQUESTED files are
|
||||||
# always removed in %%pyproject_wheel
|
# always removed in %%pyproject_wheel
|
||||||
|
Loading…
Reference in New Issue
Block a user