2018-08-12 11:12:38 -04:00
|
|
|
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.
|
|
|
|
|
2019-06-08 22:37:50 -04:00
|
|
|
---
|
2018-08-02 10:23:11 -04:00
|
|
|
--- a/collects/compiler/private/cm-minimal.rkt
|
|
|
|
+++ b/collects/compiler/private/cm-minimal.rkt
|
2020-02-18 10:19:27 -05:00
|
|
|
@@ -6,6 +6,7 @@
|
2018-08-12 11:12:38 -04:00
|
|
|
racket/list
|
|
|
|
racket/path
|
|
|
|
racket/promise
|
|
|
|
+ racket/string
|
2019-06-08 22:37:50 -04:00
|
|
|
file/sha1
|
|
|
|
setup/cross-system
|
2020-02-18 10:19:27 -05:00
|
|
|
compiler/compilation-path
|
|
|
|
@@ -268,7 +269,8 @@
|
2019-06-08 22:37:50 -04:00
|
|
|
(trace-printf "newer src... ~a > ~a" path-time path-zo-time)
|
|
|
|
(maybe-compile-zo deps path->mode roots path orig-path read-src-syntax up-to-date collection-cache new-seen
|
|
|
|
#:trying-sha1? sha1-only?)]
|
|
|
|
- [(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 for ~a..." difference path)
|
2020-02-18 10:19:27 -05:00
|
|
|
(maybe-compile-zo deps path->mode roots path orig-path read-src-syntax up-to-date collection-cache new-seen
|
|
|
|
@@ -1012,5 +1014,9 @@
|
|
|
|
#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)))
|
|
|
|
+
|
|
|
|
;; Make sure `recompile-from` is machine-independent so that
|
|
|
|
;; recompilation makes sense.
|
|
|
|
;; The compilation lock must is held for the source of `recompile-from`.
|