From 065143d597af4905cb11d24c306cb3d42557c097 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 20 Aug 2021 12:30:20 +0100 Subject: [PATCH] Apply patch from upstream to fix tests with SOURCE_DATE_EPOCH --- debian/patches/series | 1 + .../tests-Unset-SOURCE_DATE_EPOCH.patch | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 debian/patches/tests-Unset-SOURCE_DATE_EPOCH.patch diff --git a/debian/patches/series b/debian/patches/series index b73e566a..079800be 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ +tests-Unset-SOURCE_DATE_EPOCH.patch debian/Skip-test-pull-repeated-during-CI.patch diff --git a/debian/patches/tests-Unset-SOURCE_DATE_EPOCH.patch b/debian/patches/tests-Unset-SOURCE_DATE_EPOCH.patch new file mode 100644 index 00000000..054e55cc --- /dev/null +++ b/debian/patches/tests-Unset-SOURCE_DATE_EPOCH.patch @@ -0,0 +1,34 @@ +From: Simon McVittie +Date: Mon, 26 Jul 2021 11:48:45 +0100 +Subject: tests: Unset SOURCE_DATE_EPOCH + +Some distributions set this during build in order to have reproducible +builds from the same source code: for example, Debian uses the date +from debian/changelog. + +However, some of our tests assume that `ostree commit` will result in +a commit with the current date/time, and SOURCE_DATE_EPOCH breaks that +assumption. Unset it for our build-time tests. + +Bug: https://github.com/ostreedev/ostree/issues/2405 +Signed-off-by: Simon McVittie +Applied-upstream: 2021.4, commit:2c5fa2cdb6c304394ca629c959ec53d878f3f93a +--- + tests/libtest.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/libtest.sh b/tests/libtest.sh +index 260b8d1..f04ccaa 100755 +--- a/tests/libtest.sh ++++ b/tests/libtest.sh +@@ -69,6 +69,10 @@ if ! test -f .testtmp; then + touch .testtmp + fi + ++# Some distribution builds set this, but some of our build-time tests ++# assume this won't be used when committing ++unset SOURCE_DATE_EPOCH ++ + # Also, unbreak `tar` inside `make check`...Automake will inject + # TAR_OPTIONS: --owner=0 --group=0 --numeric-owner presumably so that + # tarballs are predictable, except we don't want this in our tests.