Don't leak $TMPDIR outside of pyproject macros
During %install, the BRB scripts might be affected by it
This commit is contained in:
parent
c0c09a476a
commit
c95238388a
@ -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__
|
||||||
|
@ -6,7 +6,7 @@ License: MIT
|
|||||||
|
|
||||||
# Keep the version at zero and increment only release
|
# Keep the version at zero and increment only release
|
||||||
Version: 0
|
Version: 0
|
||||||
Release: 39%{?dist}
|
Release: 40%{?dist}
|
||||||
|
|
||||||
# Macro files
|
# Macro files
|
||||||
Source001: macros.pyproject
|
Source001: macros.pyproject
|
||||||
@ -104,6 +104,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
|
||||||
|
|
||||||
* Mon Mar 29 2021 Miro Hrončok <mhroncok@redhat.com> - 0-39
|
* Mon Mar 29 2021 Miro Hrončok <mhroncok@redhat.com> - 0-39
|
||||||
- Handle tox provision (tox.requires / tox.minversion)
|
- Handle tox provision (tox.requires / tox.minversion)
|
||||||
- Fixes: rhbz#1922495
|
- Fixes: rhbz#1922495
|
||||||
|
@ -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