gnu: mariadb: Remove huge mysql_embedded executable.
[jackhill/guix/guix.git] / gnu / packages / patches / racket-store-checksum-override.patch
1 Racket uses checksums to test if it needs to recompile its source
2 files to bytecode. If Racket is updated by grafting, the source and
3 bytecode files get updated, but the checksum stays the same. Since
4 the checksum no longer matches the source file, Racket tries to
5 regenerate the bytecode and write it to the store, causing errors
6 because the store is immutable. This patch makes Racket ignore
7 checksums for files in the store.
8
9 See <https://debbugs.gnu.org/30680> for details.
10
11 diff -ruN racket-6.12/collects/compiler/cm.rkt racket-6.12-patched/collects/compiler/cm.rkt
12 --- racket-6.12/collects/compiler/cm.rkt 1969-12-31 19:00:00.000000000 -0500
13 +++ racket-6.12-patched/collects/compiler/cm.rkt 2018-08-12 06:36:46.061142149 -0400
14 @@ -7,6 +7,7 @@
15 racket/list
16 racket/path
17 racket/promise
18 + racket/string
19 openssl/sha1
20 racket/place
21 setup/collects
22 @@ -627,6 +628,10 @@
23 #f
24 (list src-hash recorded-hash)))
25
26 +(define (store-reference? path)
27 + (let ([store-prefix (or (getenv "NIX_STORE") "/gnu/store")])
28 + (string-prefix? (path->string path) store-prefix)))
29 +
30 (define (rkt->ss p)
31 (if (path-has-extension? p #".rkt")
32 (path-replace-extension p #".ss")
33 @@ -679,7 +684,8 @@
34 (trace-printf "newer src... ~a > ~a" path-time path-zo-time)
35 ;; If `sha1-only?', then `maybe-compile-zo' returns a #f or thunk:
36 (maybe-compile-zo sha1-only? deps path->mode roots path orig-path read-src-syntax up-to-date collection-cache new-seen)]
37 - [(different-source-sha1-and-dep-recorded path deps)
38 + [(and (not (store-reference? path))
39 + (different-source-sha1-and-dep-recorded path deps))
40 => (lambda (difference)
41 (trace-printf "different src hash... ~a" difference)
42 ;; If `sha1-only?', then `maybe-compile-zo' returns a #f or thunk: