diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-08-25 16:44:07 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-08-25 16:44:07 +0200 |
commit | 839167ff9d74fc490b32f6a197591964f73b65e5 (patch) | |
tree | d193bfad7c9ef5597c5cd7d2ea25fd007d01f88a /gnu/packages/patches/racket-store-checksum-override.patch | |
parent | 27c1df05a866b639a61e16d48b3f2da8fa5eb767 (diff) | |
parent | 030c912616c8ee1595218e304460041bcb4f1ceb (diff) |
Merge branch 'staging' into core-updates
Diffstat (limited to 'gnu/packages/patches/racket-store-checksum-override.patch')
-rw-r--r-- | gnu/packages/patches/racket-store-checksum-override.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gnu/packages/patches/racket-store-checksum-override.patch b/gnu/packages/patches/racket-store-checksum-override.patch new file mode 100644 index 0000000000..6c9cd5198a --- /dev/null +++ b/gnu/packages/patches/racket-store-checksum-override.patch @@ -0,0 +1,49 @@ +Racket uses checksums to test if it needs to recompile its source +files to bytecode. If Racket is updated by grafting, the source and +bytecode files get updated, but the checksum stays the same. Since +the checksum no longer matches the source file, Racket tries to +regenerate the bytecode and write it to the store, causing errors +because the store is immutable. This patch makes Racket ignore +checksums for files in the store. + +See <https://debbugs.gnu.org/30680> for details. +--- + collects/compiler/private/cm-minimal.rkt | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/collects/compiler/private/cm-minimal.rkt b/collects/compiler/private/cm-minimal.rkt +index a5a5407..15af6b8 100644 +--- a/collects/compiler/private/cm-minimal.rkt ++++ b/collects/compiler/private/cm-minimal.rkt +@@ -7,6 +7,7 @@ + racket/list + racket/path + racket/promise ++ racket/string + openssl/sha1 + setup/collects + compiler/compilation-path +@@ -543,6 +544,10 @@ + #f + (list src-hash recorded-hash))) + ++(define (store-reference? path) ++ (let ([store-prefix (or (getenv "NIX_STORE") "/gnu/store")]) ++ (string-prefix? (path->string path) store-prefix))) ++ + (define (rkt->ss p) + (if (path-has-extension? p #".rkt") + (path-replace-extension p #".ss") +@@ -595,7 +600,8 @@ + (trace-printf "newer src... ~a > ~a" path-time path-zo-time) + ;; If `sha1-only?', then `maybe-compile-zo' returns a #f or thunk: + (maybe-compile-zo sha1-only? deps path->mode roots path orig-path read-src-syntax up-to-date collection-cache new-seen)] +- [(different-source-sha1-and-dep-recorded path deps) ++ [(and (not (store-reference? path)) ++ (different-source-sha1-and-dep-recorded path deps)) + => (lambda (difference) + (trace-printf "different src hash... ~a" difference) + ;; If `sha1-only?', then `maybe-compile-zo' returns a #f or thunk: +-- +2.18.0 + |