From fc7ff8198ad8341cb510587dc67b44b59f9aa4df Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 28 Mar 2023 22:16:36 +0000 Subject: [PATCH] build: don't assume git repo in make_packages.sh to be able to run it from an unpacked sdist --- contrib/make_packages.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/make_packages.sh b/contrib/make_packages.sh index a7e970ef6..60dc6e661 100755 --- a/contrib/make_packages.sh +++ b/contrib/make_packages.sh @@ -8,6 +8,7 @@ PROJECT_ROOT="$CONTRIB"/.. PACKAGES="$PROJECT_ROOT"/packages/ test -n "$CONTRIB" -a -d "$CONTRIB" || exit +cd "$CONTRIB" if [ -d "$PACKAGES" ]; then rm -r "$PACKAGES" @@ -21,7 +22,7 @@ python3 -m venv "$venv_dir" source "$venv_dir"/bin/activate # installing pinned build-time requirements, such as pip/wheel/setuptools -python -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \ +python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \ -r "$CONTRIB"/deterministic-build/requirements-build-base.txt # opt out of compiling C extensions @@ -34,7 +35,7 @@ export FROZENLIST_NO_EXTENSIONS=1 # if we end up having to compile something, at least give reproducibility a fighting chance export LC_ALL=C export TZ=UTC -export SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct)" +export SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct 2>/dev/null || printf 1530212462)" export PYTHONHASHSEED="$SOURCE_DATE_EPOCH" export BUILD_DATE="$(LC_ALL=C TZ=UTC date +'%b %e %Y' -d @$SOURCE_DATE_EPOCH)" export BUILD_TIME="$(LC_ALL=C TZ=UTC date +'%H:%M:%S' -d @$SOURCE_DATE_EPOCH)" @@ -49,4 +50,4 @@ export BUILD_TIME="$(LC_ALL=C TZ=UTC date +'%H:%M:%S' -d @$SOURCE_DATE_EPOCH)" # note: --no-build-isolation is needed so that pip uses the locally available setuptools and wheel, # instead of downloading the latest ones python3 -m pip install --no-build-isolation --no-compile --no-dependencies --no-binary :all: \ - -r "$CONTRIB"/deterministic-build/requirements.txt -t "$CONTRIB"/../packages + -r "$CONTRIB"/deterministic-build/requirements.txt -t "$PACKAGES"