summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorTimothy Sample <samplet@ngyro.com>2018-08-12 11:12:38 -0400
committerChristopher Lemmer Webber <cwebber@dustycloud.org>2018-08-12 20:20:36 -0400
commite3fc9bcce2cfc26a60747c58f5c8c59cc8400785 (patch)
treeaf69756b22e755e8748583686ea6ff7b2285c7a5 /gnu/packages
parent5a0696b2e35e09e6fe21db3df6a8005f3c953896 (diff)
downloadguix-e3fc9bcce2cfc26a60747c58f5c8c59cc8400785.tar.gz
gnu: racket: Ignore bytecode checksums in the store.
Fixes <https://debbugs.gnu.org/30680>.

* gnu/packages/patches/racket-store-checksum-override.patch: New file.
* gnu/packages/scheme.scm (racket)[sources]: Add it.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/patches/racket-store-checksum-override.patch42
-rw-r--r--gnu/packages/scheme.scm3
2 files changed, 44 insertions, 1 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..b22facca0d
--- /dev/null
+++ b/gnu/packages/patches/racket-store-checksum-override.patch
@@ -0,0 +1,42 @@
+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.
+
+diff -ruN racket-6.12/collects/compiler/cm.rkt racket-6.12-patched/collects/compiler/cm.rkt
+--- racket-6.12/collects/compiler/cm.rkt	1969-12-31 19:00:00.000000000 -0500
++++ racket-6.12-patched/collects/compiler/cm.rkt	2018-08-12 06:36:46.061142149 -0400
+@@ -7,6 +7,7 @@
+          racket/list
+          racket/path
+          racket/promise
++         racket/string
+          openssl/sha1
+          racket/place
+          setup/collects
+@@ -627,6 +628,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")
+@@ -679,7 +684,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:
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 4178a45a89..b30245ccea 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -421,7 +421,8 @@ implementation techniques and as an expository tool.")
              (patches (search-patches
                        ;; See: https://github.com/racket/racket/issues/1962
                        ;; This can be removed in whatever Racket release comes after 6.12
-                       "racket-fix-xform-issue.patch"))))
+                       "racket-fix-xform-issue.patch"
+                       "racket-store-checksum-override.patch"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases