Skip to content

Commit 977bec1

Browse files
committed
Merge #20937: guix: Make nsis reproducible by respecting SOURCE-DATE-EPOCH
1fca981 lint: Skip whitespace lint for guix patches (Carl Dong) a91c46c guix: Make nsis reproducible by respecting SOURCE-DATE-EPOCH (Carl Dong) Pull request description: ``` When building nsis, if VERSION is not specified, it defaults to cvs_version which is non-deterministic as it includes the current date. This patches nsis to default to SOURCE_DATE_EPOCH if it exists so that nsis is reproducible. Upstream change: NSIS-Dev/nsis#13 ``` Sidenote: also a good demonstration of how Guix allows us to flexibly patch our tools! Note to reviewers: if you want to compare hashes, please build after Jan 16th 2021 without my substitute server enabled! ACKs for top commit: fanquake: ACK 1fca981 Tree-SHA512: b800e0ce5f73827ad353739effb9167ec3a6bdb362c725ae20dd3f025ce78660f85c70ce1d75cd0896facf1e8fe38a9e058459ed13dec71ab3a2fe41e20eaa5d
2 parents bc51b99 + 1fca981 commit 977bec1

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

contrib/guix/manifest.scm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
(guix profiles)
2626
(guix utils))
2727

28+
(define-syntax-rule (search-our-patches file-name ...)
29+
"Return the list of absolute file names corresponding to each
30+
FILE-NAME found in ./patches relative to the current file."
31+
(parameterize
32+
((%patch-path (list (string-append (dirname (current-filename)) "/patches"))))
33+
(list (search-patch file-name) ...)))
34+
2835
(define (make-ssp-fixed-gcc xgcc)
2936
"Given a XGCC package, return a modified package that uses the SSP function
3037
from glibc instead of from libssp.so. Our `symbol-check' script will complain if
@@ -150,6 +157,10 @@ chain for " target " development."))
150157
(home-page (package-home-page pthreads-xgcc))
151158
(license (package-license pthreads-xgcc)))))
152159

160+
(define (make-nsis-with-sde-support base-nsis)
161+
(package-with-extra-patches base-nsis
162+
(search-our-patches "nsis-SConstruct-sde-support.patch")))
163+
153164

154165
(packages->manifest
155166
(append
@@ -189,7 +200,9 @@ chain for " target " development."))
189200
(let ((target (getenv "HOST")))
190201
(cond ((string-suffix? "-mingw32" target)
191202
;; Windows
192-
(list zip (make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32") nsis-x86_64))
203+
(list zip
204+
(make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
205+
(make-nsis-with-sde-support nsis-x86_64)))
193206
((string-contains target "riscv64-linux-")
194207
(list (make-bitcoin-cross-toolchain "riscv64-linux-gnu"
195208
#:base-gcc-for-libc gcc-7)))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/SConstruct b/SConstruct
2+
index e8252c9..41786f2 100755
3+
--- a/SConstruct
4+
+++ b/SConstruct
5+
@@ -95,8 +95,8 @@ default_doctype = 'html'
6+
if defenv.WhereIs('hhc', os.environ['PATH']):
7+
default_doctype = 'chm'
8+
9+
-from time import strftime, gmtime
10+
-cvs_version = strftime('%d-%b-%Y.cvs', gmtime())
11+
+import time
12+
+cvs_version = time.strftime('%d-%b-%Y.cvs', time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
13+
14+
opts = Variables()
15+

test/lint/lint-whitespace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if [ -z "${COMMIT_RANGE}" ]; then
3333
fi
3434

3535
showdiff() {
36-
if ! git diff -U0 "${COMMIT_RANGE}" -- "." ":(exclude)depends/patches/" ":(exclude)src/leveldb/" ":(exclude)src/crc32c/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/" ":(exclude)src/qt/locale/"; then
36+
if ! git diff -U0 "${COMMIT_RANGE}" -- "." ":(exclude)depends/patches/" ":(exclude)contrib/guix/patches/" ":(exclude)src/leveldb/" ":(exclude)src/crc32c/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/" ":(exclude)src/qt/locale/"; then
3737
echo "Failed to get a diff"
3838
exit 1
3939
fi

0 commit comments

Comments
 (0)