aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMark Peschel2023-09-21 17:09:26 -0400
committerMark Peschel2023-09-21 17:09:26 -0400
commitdda037f4b90f7ca0cfd5c36ca8ec78812703eb89 (patch)
tree82dc7092c609405fdcf867d011cc3d359faf672f /PKGBUILD
parent132dd5b03b69476b9bd556473b8a3a2d5baaf707 (diff)
downloadaur-dda037f4b90f7ca0cfd5c36ca8ec78812703eb89.tar.gz
Prevent build fail if upstream changes wheel name.
clean src/tmprocm between builds so we don't get duplicate .whl files. Also add quotes around $WHEEL_PACKAGE in python -m installer line, to make the errors more descriptive and also maybe prevent issues with spaces in dirnames.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD11
1 files changed, 8 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index c08147803d54..489a63d4a4b0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -90,6 +90,11 @@ prepare() {
git config advice.detachedHead false
git checkout $_known_good_commit
cd ..
+
+ # When upstream changes the name of the wheel, people who have built this package once will get a duplicate .whl file.
+ # This confuses `WHEEL_PACKAGE=$(find ...` and makes the python -m installer line fail.
+ # So clean tmprocm between builds.
+ [ -d "$srcdir"/tmprocm ] && rm "$srcdir"/tmprocm/*
# Allow any bazel version
echo "*" > tensorflow-upstream-rocm/.bazelversion
@@ -196,8 +201,8 @@ _package() {
# install python-version to get all extra headers
WHEEL_PACKAGE=$(find "${srcdir}"/$1 -name "tensor*.whl")
- python -m installer --destdir="$pkgdir" $WHEEL_PACKAGE
-
+ python -m installer --destdir="$pkgdir" "$WHEEL_PACKAGE"
+
# move extra headers to correct location
local _srch_path="${pkgdir}/usr/lib/python$(get_pyver)"/site-packages/tensorflow/include
check_dir "${_srch_path}" # we need to quit on broken search paths
@@ -240,7 +245,7 @@ _package() {
_python_package() {
WHEEL_PACKAGE=$(find "${srcdir}"/$1 -name "tensor*.whl")
- python -m installer --destdir="$pkgdir" $WHEEL_PACKAGE
+ python -m installer --destdir="$pkgdir" "$WHEEL_PACKAGE"
# create symlinks to headers
local _srch_path="${pkgdir}/usr/lib/python$(get_pyver)"/site-packages/tensorflow/include/