From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Hinsen Subject: bug#30680: [PATCH] Patch Racket to fix bug #30680 Date: Mon, 13 Aug 2018 15:56:20 +0200 Message-ID: References: <87r2j3bfy0.fsf@ngyro.com> <87lg9bfhm8.fsf@dustycloud.org> <874lfzb966.fsf@ngyro.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpDLH-00056c-JY for bug-guix@gnu.org; Mon, 13 Aug 2018 09:57:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpDLC-0007Cr-Kl for bug-guix@gnu.org; Mon, 13 Aug 2018 09:57:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:44786) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpDLC-0007Cd-Ff for bug-guix@gnu.org; Mon, 13 Aug 2018 09:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fpDLC-0004O8-6R for bug-guix@gnu.org; Mon, 13 Aug 2018 09:57:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <874lfzb966.fsf@ngyro.com> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: guix-patches@gnu.org --=-=-= Content-Type: text/plain Timothy Sample writes: > Oops! My fault. The patch is attached here. *crosses fingers* I have ported the patch to Racket 7.0, the modified version is attached. It gets rid of all the store-related error messages I got when installing packages with raco, so as far as I am concerned the bug is indeed fixed. BTW, the patch (to Guix) for updating Racket to 7.0 is at https://debbugs.gnu.org/32355 (but does not yet include this patch to Racket). Thanks a lot for resolving this issue! Konrad. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Patch-for-compilation-under-Guix.patch >From da6defb46b69dfb55e5188ed851f5c1443f748ba Mon Sep 17 00:00:00 2001 From: Konrad Hinsen Date: Mon, 13 Aug 2018 14:50:37 +0200 Subject: [PATCH] Patch for compilation under Guix (Port to Racket 7.0 of Timothy Sample's patch for Racket 6.12) 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 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 --=-=-=--