From patchwork Fri Mar 29 05:18:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 62348 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8197D27BBEA; Fri, 29 Mar 2024 05:20:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 86D1827BBE2 for ; Fri, 29 Mar 2024 05:20:16 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rq4ev-0003Jf-6w; Fri, 29 Mar 2024 01:20:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq4en-0003IQ-Rz for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:01 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq4en-00066N-HQ for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rq4eo-0004zI-99; Fri, 29 Mar 2024 01:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70065] [PATCH 1/6] gnu: zuo: Update to 1.9. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Fri, 29 Mar 2024 05:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70065 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70065@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 70065-submit@debbugs.gnu.org id=B70065.171168955419045 (code B ref 70065); Fri, 29 Mar 2024 05:20:02 +0000 Received: (at 70065) by debbugs.gnu.org; 29 Mar 2024 05:19:14 +0000 Received: from localhost ([127.0.0.1]:41475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4dz-0004ws-7t for submit@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:13 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:56749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4dv-0004wS-DZ for 70065@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:09 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 582F93200488 for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 29 Mar 2024 01:19:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1711689539; x=1711775939; bh=mr+5j6eHQoU8P/DNDo4dg 2o9zytkAnUvN1VhQ9t7qu8=; b=QhjlPDttJBj8EhDKMFOIdqo9UIgynBoAPLm6I Tlby2nqcIktQWgJhBQZ935tPGrxs4RFsvbK7ug5A8w8VDGrbuu1OlGBxXYCPwJjB D1+0DcScQcfsAp3lEZdpxv61KxiQscQkPFUkrEMKWIsAQKGpi/hHQUuHfrOHV3r5 FrJbmJJS0tDhoR3szKfivSIBAWANe9BIqSNchsVM05iSJWiVgIyzUk1lBsE2PX37 Jt500Me9zS+xJzaEYCGqAKyNk3YTFASrwBUQT26y+VmpexSRPTvQuahwfzTnPSm2 idBZs7sRapon43qks5xvHadmgLTK0BYotEQJyIq/JYj7Es8bA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1711689539; x= 1711775939; bh=mr+5j6eHQoU8P/DNDo4dg2o9zytkAnUvN1VhQ9t7qu8=; b=i odlFSG8hNKx0m4Ik9hR7rDkROf0t+QDYjspdaRRsQpZ/xzfVOe0lJbHzO5WGdlX9 dCUXcvuuJc5WR+Zp/7852cfD8qbLBuNnBxvgV7YZEd1aCzXwQtWq25zXeFLl2u7E dJtqi2m8Zpv+HoobWgsKGFmuGwPaOeBj4tAyiYjypT0HRTWVGgpPbeVInHCZW1h/ ui1GuDXAHUm95lAw3/zYkBQw6N5qu82J7igCTKF0yPxvf8d4ACq6NjL3rzNt/FQd oOD7vEslYnDvxfdmb0ZjeMPnEw0RvyNyGOk8iLdTT7WAWFKCeg3QkfAstxj/uuN/ wnBzmQU/lXwHmgV/+rC4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddvtddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdludegmdenucfjughrpefhvf fufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefrhhhilhhiphcuofgtifhr rghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrf grthhtvghrnhepgeeggeetgfejtedugeegteegleekvedtudevjeelhfeijeefhefhffel tdffffehnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgt ghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:18:59 -0400 (EDT) From: Philip McGrath Date: Fri, 29 Mar 2024 01:18:50 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Zuo now has tagged releases independent of the Racket release cycle. * gnu/packages/patches/racket-zuo-bin-sh.patch: Move to ... * gnu/packages/patches/zuo-bin-sh.patch: ... this file, and refresh it. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/racket/scm (%racket-origin)[patches]: Likewise. * gnu/packages/patches/racket-chez-scheme-bin-sh.patch: Refresh patch. * gnu/packages/patches/racket-rktio-bin-sh.patch: Likewise. * gnu/packages/racket/scm (%zuo-version): Move to ... (zuo)[version]: ... this field, and update to 1.9. [source]: Change to the repository where Zuo releases are tagged. [arguments]: Stop supplying '#:phases'. Change-Id: Ia82c0f7a8e4696ae08e30965e3f4ec85673b86e5 --- gnu/local.mk | 4 +- .../patches/racket-chez-scheme-bin-sh.patch | 21 +++++--- .../patches/racket-rktio-bin-sh.patch | 17 +++--- ...cket-zuo-bin-sh.patch => zuo-bin-sh.patch} | 33 +++++++----- gnu/packages/racket.scm | 54 +++++++++---------- 5 files changed, 70 insertions(+), 59 deletions(-) rename gnu/packages/patches/{racket-zuo-bin-sh.patch => zuo-bin-sh.patch} (72%) diff --git a/gnu/local.mk b/gnu/local.mk index 5429dc498c..a025276390 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1984,7 +1984,6 @@ dist_patch_DATA = \ %D%/packages/patches/racket-chez-scheme-bin-sh.patch \ %D%/packages/patches/racket-backport-8.11-layered-docs.patch \ %D%/packages/patches/racket-rktio-bin-sh.patch \ - %D%/packages/patches/racket-zuo-bin-sh.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restartd-update-robust.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ @@ -2225,7 +2224,8 @@ dist_patch_DATA = \ %D%/packages/patches/zig-do-not-link-against-librt.patch \ %D%/packages/patches/zig-use-baseline-cpu-by-default.patch \ %D%/packages/patches/zig-use-system-paths.patch \ - %D%/packages/patches/zsh-egrep-failing-test.patch + %D%/packages/patches/zsh-egrep-failing-test.patch \ + %D%/packages/patches/zuo-bin-sh.patch MISC_DISTRO_FILES = \ %D%/packages/ld-wrapper.in diff --git a/gnu/packages/patches/racket-chez-scheme-bin-sh.patch b/gnu/packages/patches/racket-chez-scheme-bin-sh.patch index 331b4f244b..e77c26f303 100644 --- a/gnu/packages/patches/racket-chez-scheme-bin-sh.patch +++ b/gnu/packages/patches/racket-chez-scheme-bin-sh.patch @@ -1,4 +1,4 @@ -From f86370295c5bb14d4bb93d0ccfa37a2b79f19f25 Mon Sep 17 00:00:00 2001 +From 5398e6d3305def343a009aba7c5f8915851c4115 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Wed, 24 Aug 2022 19:55:14 -0400 Subject: [PATCH] Chez Scheme: patch s_process for "/bin/sh" on Guix @@ -14,17 +14,22 @@ then `s_process` will call `execl` with the file specified by `_PATH_BSHELL` instead of "/bin/sh". Checking that the path specified by `_PATH_BSHELL` exists safeguards -against obscure errors if attempting to use stand-alone executables -built by the patched Racket in non-Guix envoronments. +against obscure errors if attempting to use the patched Chez Scheme +or executables it builds in non-Guix envoronments. This patch does not change the behavior of `s_system`, which relies on `system` from the C library. --- + +Notes: + See also chez-scheme-bin-sh.patch, racket-rktio-bin-sh.patch, + and zuo-bin-sh.patch. + racket/src/ChezScheme/c/prim5.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/racket/src/ChezScheme/c/prim5.c b/racket/src/ChezScheme/c/prim5.c -index 82bbf8d687..be8f603447 100644 +index 90b087f125..284f063f8b 100644 --- a/racket/src/ChezScheme/c/prim5.c +++ b/racket/src/ChezScheme/c/prim5.c @@ -27,6 +27,12 @@ @@ -40,7 +45,7 @@ index 82bbf8d687..be8f603447 100644 /* locally defined functions */ static INT s_errno(void); static IBOOL s_addr_in_heap(uptr x); -@@ -861,6 +867,17 @@ static ptr s_process(char *s, IBOOL stderrp) { +@@ -875,6 +881,17 @@ static ptr s_process(char *s, IBOOL stderrp) { INT tofds[2], fromfds[2], errfds[2]; struct sigaction act, oint_act; @@ -58,7 +63,7 @@ index 82bbf8d687..be8f603447 100644 if (pipe(tofds)) S_error("process","cannot open pipes"); if (pipe(fromfds)) { -@@ -897,7 +914,9 @@ static ptr s_process(char *s, IBOOL stderrp) { +@@ -911,7 +928,9 @@ static ptr s_process(char *s, IBOOL stderrp) { } } #endif /* __GNU__ Hurd */ @@ -70,7 +75,7 @@ index 82bbf8d687..be8f603447 100644 /*NOTREACHED*/ } else { -base-commit: 87eee6e2adb8c6bc11e60619c706fa6295096085 +base-commit: 78fef00d4d16a79fdf6ab31924b3a80cadf4b368 -- -2.32.0 +2.41.0 diff --git a/gnu/packages/patches/racket-rktio-bin-sh.patch b/gnu/packages/patches/racket-rktio-bin-sh.patch index ec6f0d9c56..d777c0979a 100644 --- a/gnu/packages/patches/racket-rktio-bin-sh.patch +++ b/gnu/packages/patches/racket-rktio-bin-sh.patch @@ -1,4 +1,4 @@ -From 6a553f24439fe64fd3a2f0b5902f00590ca4241f Mon Sep 17 00:00:00 2001 +From 5e546a30789e5c9b3c94674b94cb63e16ee2e951 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Thu, 4 Mar 2021 04:11:50 -0500 Subject: [PATCH] rktio: patch rktio_process for "/bin/sh" on Guix @@ -28,11 +28,16 @@ Checking that the path specified by `_PATH_BSHELL` exists safeguards against obscure errors if attempting to use stand-alone executables built by the patched Racket in non-Guix envoronments. --- + +Notes: + See also chez-scheme-bin-sh.patch, racket-chez-scheme-bin-sh.patch, + and zuo-bin-sh.patch. + racket/src/rktio/rktio_process.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/racket/src/rktio/rktio_process.c b/racket/src/rktio/rktio_process.c -index fafaf728c1..796ebc59ce 100644 +index 862850d93a..87daafef76 100644 --- a/racket/src/rktio/rktio_process.c +++ b/racket/src/rktio/rktio_process.c @@ -9,6 +9,7 @@ @@ -43,7 +48,7 @@ index fafaf728c1..796ebc59ce 100644 # ifdef USE_ULIMIT # include # endif -@@ -1301,12 +1302,14 @@ int rktio_process_allowed_flags(rktio_t *rktio) +@@ -1358,12 +1359,14 @@ int rktio_process_allowed_flags(rktio_t *rktio) /*========================================================================*/ rktio_process_result_t *rktio_process(rktio_t *rktio, @@ -59,7 +64,7 @@ index fafaf728c1..796ebc59ce 100644 rktio_process_result_t *result; intptr_t to_subprocess[2], from_subprocess[2], err_subprocess[2]; int pid; -@@ -1333,6 +1336,18 @@ rktio_process_result_t *rktio_process(rktio_t *rktio, +@@ -1390,6 +1393,18 @@ rktio_process_result_t *rktio_process(rktio_t *rktio, int i; #endif @@ -79,7 +84,7 @@ index fafaf728c1..796ebc59ce 100644 to_subprocess[0] = -1; to_subprocess[1] = -1; -base-commit: 9d228d16fb99c274c964e5bef93e97333888769f +base-commit: 78fef00d4d16a79fdf6ab31924b3a80cadf4b368 -- -2.32.0 +2.41.0 diff --git a/gnu/packages/patches/racket-zuo-bin-sh.patch b/gnu/packages/patches/zuo-bin-sh.patch similarity index 72% rename from gnu/packages/patches/racket-zuo-bin-sh.patch rename to gnu/packages/patches/zuo-bin-sh.patch index bcdcb8e963..92e3774424 100644 --- a/gnu/packages/patches/racket-zuo-bin-sh.patch +++ b/gnu/packages/patches/zuo-bin-sh.patch @@ -1,7 +1,7 @@ -From 73d9b77a11b4516905caf579abb559736f715ea6 Mon Sep 17 00:00:00 2001 +From cd6bed5d22ea9cb7bae2be134d5d04433fc8e313 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Mon, 11 Apr 2022 20:43:18 -0400 -Subject: [PATCH] Zuo: patch zuo_process for "/bin/sh" on Guix +Subject: [PATCH] patch zuo_process for "/bin/sh" on Guix If: @@ -16,17 +16,22 @@ then `zuo_process` will execute the file specified by `_PATH_BSHELL` instead of "/bin/sh". Checking that the path specified by `_PATH_BSHELL` exists safeguards -against obscure errors if attempting to use stand-alone executables -built by the patched Racket in non-Guix envoronments. +against obscure errors if attempting to use the patched Zuo +or derived executables in non-Guix envoronments. --- - racket/src/zuo/zuo.c | 20 ++++++++++++++++++-- + +Notes: + See also chez-scheme-bin-sh.patch, racket-chez-scheme-bin-sh.patch, + racket-rktio-bin-sh.patch. + + zuo.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) -diff --git a/racket/src/zuo/zuo.c b/racket/src/zuo/zuo.c -index 17f161826d..c4fb3929bb 100644 ---- a/racket/src/zuo/zuo.c -+++ b/racket/src/zuo/zuo.c -@@ -15,6 +15,7 @@ +diff --git a/zuo.c b/zuo.c +index d4163eb..bfc5484 100644 +--- a/zuo.c ++++ b/zuo.c +@@ -16,6 +16,7 @@ #include #include #ifdef ZUO_UNIX @@ -34,7 +39,7 @@ index 17f161826d..c4fb3929bb 100644 # include # include # include -@@ -5730,7 +5731,10 @@ static void zuo_pipe(zuo_raw_handle_t *_r, zuo_raw_handle_t *_w) +@@ -5949,7 +5950,10 @@ static void zuo_pipe(zuo_raw_handle_t *_r, zuo_raw_handle_t *_w) zuo_t *zuo_process(zuo_t *command_and_args) { const char *who = "process"; @@ -46,7 +51,7 @@ index 17f161826d..c4fb3929bb 100644 zuo_t *args = _zuo_cdr(command_and_args), *rev_args = z.o_null; zuo_t *options = z.o_empty_hash, *opt; zuo_t *dir, *l, *p_handle, *result; -@@ -5741,7 +5745,19 @@ zuo_t *zuo_process(zuo_t *command_and_args) +@@ -5960,7 +5964,19 @@ zuo_t *zuo_process(zuo_t *command_and_args) void *env; int as_child, exact_cmdline; @@ -68,7 +73,7 @@ index 17f161826d..c4fb3929bb 100644 zuo_t *a = _zuo_car(l); if (a == z.o_null) { -base-commit: 87eee6e2adb8c6bc11e60619c706fa6295096085 +base-commit: a0faa82c8383d206aa38d21462ca4ae699851a0b -- -2.32.0 +2.41.0 diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 5c863f1afd..6e19be1da3 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013-2016, 2018, 2020-2022 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021, 2022, 2023 Philip McGrath +;;; Copyright © 2021-2024 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -192,7 +192,6 @@ (define-module (gnu packages racket) ;; CODE: (define %racket-version "8.11.1") ; Remember to update chez-scheme-for-racket! -(define %zuo-version "1.7") ; defined in racket/src/zuo/zuo.c (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -206,8 +205,7 @@ (define %racket-origin (file-name (git-file-name "racket" %racket-version)) (patches (search-patches "racket-chez-scheme-bin-sh.patch" "racket-backport-8.11-layered-docs.patch" - "racket-rktio-bin-sh.patch" - "racket-zuo-bin-sh.patch")) + "racket-rktio-bin-sh.patch")) (modules '((guix build utils))) (snippet #~(begin @@ -229,30 +227,28 @@ (define %racket-origin (define-public zuo - (let ((revision #f)) - (package - (name "zuo") - (version (string-append %zuo-version - "-racket" - %racket-version - (if revision "-guix" "") - (or revision ""))) - (source %racket-origin) - (outputs '("out" "debug")) - (build-system gnu-build-system) - (arguments - (list - #:out-of-source? #t - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda args - (chdir "racket/src/zuo")))))) - (home-page "https://github.com/racket/zuo") - ;; ^ This is downstream of https://github.com/racket/racket, - ;; but it's designed to be a friendly landing place - (synopsis "Tiny Racket for build scripts") - (description "Zuo is a tiny Racket with primitives for dealing + (package + (name "zuo") + (version "1.9") ; defined in racket/src/zuo/zuo.c or the following + #;(displayln (~a (hash-ref (runtime-env) 'version) "." + (hash-ref (runtime-env) 'minor-version))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/zuo") + (commit (string-append "v" version)))) + (sha256 + (base32 "0zasir33nx1qi1ciz9dn6h8k39i443lr6apw5d1i6mjmhpzxmdhp")) + (file-name (git-file-name name version)) + (patches (search-patches "zuo-bin-sh.patch")))) + (outputs '("out" "debug")) + (build-system gnu-build-system) + (arguments + (list + #:out-of-source? #t)) + (home-page "https://github.com/racket/zuo") + (synopsis "Tiny Racket for build scripts") + (description "Zuo is a tiny Racket with primitives for dealing with files and running processes. It comes with a @command{make}-like embedded DSL, which is used to build Racket itself. @@ -261,7 +257,7 @@ (define-public zuo and expansion of the file content. That's how the @command{make}-like DSL is defined, and even the base Zuo language is defined by layers of @code{#lang}s. One of the early layers implements macros.") - (license (list license:asl2.0 license:expat))))) + (license (list license:asl2.0 license:expat)))) (define racket-vm-common-configure-flags From patchwork Fri Mar 29 05:18:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 62350 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 59DFF27BBE9; Fri, 29 Mar 2024 05:20:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 86AD227BBE9 for ; Fri, 29 Mar 2024 05:20:36 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rq4f5-0003KL-8F; Fri, 29 Mar 2024 01:20:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq4en-0003IS-Uq for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq4en-000671-Ks for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rq4eo-0004zR-MM; Fri, 29 Mar 2024 01:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70065] [PATCH 2/6] gnu: racket: Update to 8.12. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Fri, 29 Mar 2024 05:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70065 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70065@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 70065-submit@debbugs.gnu.org id=B70065.171168955919073 (code B ref 70065); Fri, 29 Mar 2024 05:20:02 +0000 Received: (at 70065) by debbugs.gnu.org; 29 Mar 2024 05:19:19 +0000 Received: from localhost ([127.0.0.1]:41486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4e3-0004xL-SS for submit@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:19 -0400 Received: from wfhigh2-smtp.messagingengine.com ([64.147.123.153]:56595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4dw-0004wb-Qd for 70065@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:12 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id E99A118000C5 for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 29 Mar 2024 01:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1711689541; x=1711775941; bh=MpWRHpFtbFtpvtdW1VSsJ egA9fKpG+xQu1xia8JwE/0=; b=dxzNzRKuoK6H8Tz8xM/3f96ZfV0w4gBMrt8tU JAaZKGB9mnJKk9DzDujUe3XRFzaQXWTx+IG9kd+gVloXeLNv1o5FxLe/nXbVw8rw 3wYPXgj3o8HQkOUJTYKcS+2cmh3Mb8RffnlC8FGNcssYq0XA+0FdTfP/gCe/VHaM 7HzwaNbHkxcpnPNNwHFa2jzMKLspKc1SgGV27klYZABnNIVbuHSn5gNdGy+PBC5l OhJvz7E4x+/2kVaI5nNwb6NpapWhhMyiDzncRmkgJhvy/Ob0bwW041H1nhu5eB2T oZdjWfCdTP5aaLz6CZCA0kyaXOkSMu5fkJgZHLRje7Vn8swVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1711689541; x= 1711775941; bh=MpWRHpFtbFtpvtdW1VSsJegA9fKpG+xQu1xia8JwE/0=; b=w CWHRTNTKtaxiRnHwUqCaDz6CnJ84LAzm5hwNd/HMtm8FZw3lbuQF5b0rPanvH28O kt1a7+SV9bBpyZDui8EakPxX99/B9RCChHlDuddlA/+IX9h4W6rXY8vuiNC+yEyj J4ZtwrJQOxS0HxYq8Gh1aVqxSSgtWCsacaan6yGcnesvCpuwmAOH+cXJfH1e+9aS 9b7NdAAFtUmHPsDzxUQXoeKsvRV4GPz8QbfqFKTb8vwGsENDGoHv4udM4BYHroyw j92sompk3y6BiD7BIznWZcPAMKxua+u+bh1myQhGqZq1UZ2/Nf048DUQuXEgCQqz Uf136w9r7KU6xmHb/aRbw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddvtddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne gfrhhlucfvnfffucdljedmnecujfgurhephffvufffkffojghfgggtgfesthekredtredt jeenucfhrhhomheprfhhihhlihhpucfotgfirhgrthhhuceophhhihhlihhpsehphhhilh hiphhmtghgrhgrthhhrdgtohhmqeenucggtffrrghtthgvrhhnpeeihedvgfegveehvdet udfhgffhffdtfeeliedtvdfhtdejleehgeetudeigfduveenucffohhmrghinhepughish gtohhurhhsvgdrghhrohhuphdpghhithhhuhgsrdgtohhmpdhgihhthhhusgdrihhopdhr rggtkhgvthdqlhgrnhhgrdhorhhgpdhgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghg rhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:00 -0400 (EDT) From: Philip McGrath Date: Fri, 29 Mar 2024 01:18:51 -0400 Message-ID: <6b2db55dfe43979e28bd85d2999919419d56dd84.1711688274.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches All of Racket's changes to Chez Scheme have been merged upstream. They are the basis for the Chez Scheme 10.0.0 release. For the forseeable future, Racket will continue to depend on a specific pre-release version of Chez Scheme as part of Racket's "ABI": see upstream discussion at . * gnu/packages/chez.scm (chez-configure): Change to define a phase to run the Chez Scheme configure script, renaming the old definition to ... (configure-chezschemelibdirs): ... this new variable. (chez-srfi, chez-matchable, chez-irregex, chez-fmt, chez-mit) (chez-scmutils)[arguments]<#:phases>: Update accordingly. (unpack-nanopass+stex): Replace with ... (unpack-nanopass): ... this new variable. (chez-scheme)[arguments]<#:phases>: Inline old definition of 'unpack-nanopass+stex' to facilitate transition. (chez-scheme-for-racket): Stop inheriting from 'chez-scheme'. [version]: Update to 9.9.9-pre-release.23. [outputs]: Add "debug" output. [native-inputs]: Add 'texlive-enumitem' for native builds. For cross builds, omit TeX-related inputs and add this-package:doc. [inputs, native-search-paths, home-page]: Rewrite without inheritance. [arguments]: Likewise, and adjust for upstream changes. [synopsis, description]: Rewrite to reflect upstreaming of Racket's changes to Chez Scheme. (chez-scheme-for-racket-bootstrap-bootfiles): Stop inheriting from 'chez-scheme-bootstrap-bootfiles'. [arguments]: Rewrite without inheritance. Use `make cross.boot` instead of broken experimental script for cross builds. [home-page]: Use bootstrapping Racket package instead of archived Git repository. [description]: Rewrite to reflect upstreaming of Racket's changes to Chez Scheme. * gnu/packages/patches/racket-backport-8.11-layered-docs.patch: Delete file. * gnu/packages/patches/racket-backport-8.12-chez-configure.patch: New file. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/racket.scm (%racket-origin)[patches]: Likewise. [snippet]: Also unbundle Zuo and potential pre-built boot files. (%racket-version): Update to 8.12. (racket-vm-cs)[arguments]<#:phases>: Use 'unpack-nanopass' instead of 'unpack-nanopass+stex'. (racket)[inputs] : Update hashes. : Likewise, and remove obsolete snippet. Change-Id: I11e7f44be37c60c91b03d246a50e75e418bd0672 --- gnu/local.mk | 4 +- gnu/packages/chez.scm | 519 ++++++++++-------- .../racket-backport-8.11-layered-docs.patch | 36 -- .../racket-backport-8.12-chez-configure.patch | 423 ++++++++++++++ gnu/packages/racket.scm | 61 +- 5 files changed, 758 insertions(+), 285 deletions(-) delete mode 100644 gnu/packages/patches/racket-backport-8.11-layered-docs.patch create mode 100644 gnu/packages/patches/racket-backport-8.12-chez-configure.patch diff --git a/gnu/local.mk b/gnu/local.mk index a025276390..a10aa2cefd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright © 2020, 2023 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan -# Copyright © 2021, 2022, 2023 Philip McGrath +# Copyright © 2021-2024 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher # Copyright © 2021 Dmitry Polyakov @@ -1982,7 +1982,7 @@ dist_patch_DATA = \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-chez-scheme-bin-sh.patch \ - %D%/packages/patches/racket-backport-8.11-layered-docs.patch \ + %D%/packages/patches/racket-backport-8.12-chez-configure.patch \ %D%/packages/patches/racket-rktio-bin-sh.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restartd-update-robust.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 2811cf3e01..c71d6fafd5 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Brendan Tildesley -;;; Copyright © 2021, 2022, 2023 Philip McGrath +;;; Copyright © 2021-2024 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -51,7 +51,7 @@ (define-module (gnu packages chez) #:export (chez-scheme-for-system racket-cs-native-supported-system? nix-system->pbarch-machine-type - unpack-nanopass+stex)) + unpack-nanopass)) ;; Commentary: ;; @@ -273,19 +273,14 @@ (define* (racket-cs-native-supported-system? #:optional ;; Chez Scheme: ;; - -(define unpack-nanopass+stex - #~(begin - (copy-recursively - (dirname (search-input-file %build-inputs - "lib/chez-scheme/nanopass.ss")) - "nanopass" - #:keep-mtime? #t) - (mkdir-p "stex") - (with-output-to-file "stex/Mf-stex" - (lambda () - ;; otherwise, it will try to download submodules - (display "# to placate ../configure"))))) +(define unpack-nanopass + #~(lambda* (#:key inputs native-inputs #:allow-other-keys) + (with-directory-excursion (if (directory-exists? "racket/src/ChezScheme") + "racket/src/ChezScheme" + ".") + (symlink (dirname (search-input-file (or native-inputs inputs) + "lib/chez-scheme/nanopass.ss")) + "nanopass")))) (define-public chez-scheme (package @@ -357,7 +352,17 @@ (define-public chez-scheme #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex (lambda args - #$unpack-nanopass+stex)) + (begin + (copy-recursively + (dirname (search-input-file %build-inputs + "lib/chez-scheme/nanopass.ss")) + "nanopass" + #:keep-mtime? #t) + (mkdir-p "stex") + (with-output-to-file "stex/Mf-stex" + (lambda () + ;; otherwise, it will try to download submodules + (display "# to placate ../configure")))))) (add-after 'unpack-nanopass+stex 'unpack-bootfiles (lambda* (#:key native-inputs inputs #:allow-other-keys) (when (directory-exists? "boot") @@ -462,152 +467,223 @@ (define-public chez-scheme and 32-bit PowerPC architectures.") (license asl2.0))) +(define chez-configure + ;; The custom Chez 'configure' script doesn't allow unrecognized flags, such + ;; as those automatically added by `gnu-build-system`. This replacement + ;; phase uses only the explicitly provided `#:configure-flags`. + #~(lambda* (#:key inputs (configure-flags '()) out-of-source? + #:allow-other-keys) + (let* ((abs-srcdir (getcwd)) + (srcdir (if out-of-source? + (string-append "../" (basename abs-srcdir)) + "."))) + (format #t "source directory: ~s (relative from build: ~s)~%" + abs-srcdir srcdir) + (when out-of-source? + (begin + (mkdir "../build") + (chdir "../build"))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" configure-flags) + (apply invoke + (string-append srcdir "/configure") + configure-flags)))) + (define-public chez-scheme-for-racket (package - (inherit chez-scheme) (name "chez-scheme-for-racket") - (version "9.9.9-pre-release.18") - ;; The version should match `scheme-version`. - ;; See racket/src/ChezScheme/s/cmacros.ss c. line 360. - ;; It will always be different than the upstream version! - ;; When updating, remember to also update %racket-version in racket.scm. - (source #f) ; avoid problematic cycle with racket.scm - (inputs - (let ((inputs (modify-inputs (package-inputs chez-scheme) - (replace "chez-scheme-bootstrap-bootfiles" - chez-scheme-for-racket-bootstrap-bootfiles) - (delete "libx11" "util-linux:lib")))) - (if (racket-cs-native-supported-system?) - inputs - (modify-inputs inputs - (prepend libffi))))) - (native-inputs - (let ((native-inputs (modify-inputs (package-native-inputs chez-scheme) - (prepend zuo)))) - (if (%current-target-system) - (modify-inputs native-inputs - (prepend this-package)) - native-inputs))) + ;; The version should match `(scheme-version-number #t)`. + ;; See s/cmacros.ss c. line 360. + (version "9.9.9-pre-release.23") + (source #f) + (build-system gnu-build-system) + (inputs `(,@(if (racket-cs-native-supported-system?) + '() + (list libffi)) + ,chez-scheme-for-racket-bootstrap-bootfiles + ,lz4 + ,ncurses ;<-- for expeditor + ,zlib)) + (native-inputs `(,@(if (%current-target-system) + (list this-package + `(,this-package "doc")) + (list stex-bootstrap + (texlive-updmap.cfg + (list texlive-enumitem)))) + ,chez-nanopass-bootstrap + ,zuo)) + (native-search-paths + (list (search-path-specification + (variable "CHEZSCHEMELIBDIRS") + (files '("lib/chez-scheme"))))) + (outputs '("out" "debug" "doc")) (arguments - (substitute-keyword-arguments (package-arguments chez-scheme) - ((#:out-of-source? _ #f) - #t) - ((#:configure-flags cfg-flags #~'()) - #~`("--disable-x11" - "--threads" ;; ok to potentially duplicate - #$(string-append "-m=" (or (racket-cs-native-supported-system?) - (nix-system->pbarch-machine-type))) - ;; ^ could skip -m= for non-cross non-pbarch builds - #$@(if (racket-cs-native-supported-system?) - #~() - ;; not inferred on non-native platforms: see - ;; https://racket.discourse.group/t/950/9 - #~("--enable-libffi" - "CFLAGS=-g -O2 -D_REENTRANT -pthread" - "LIBS=-lm -ldl -lrt -lffi -lncurses")) - #$@(if (%current-target-system) - (list (string-append "--toolprefix=" - (%current-target-system) - "-")) - '()) - ,@(let* ((chez+version (strip-store-file-name #$output)) - (doc-prefix (assoc-ref %outputs "doc")) - (doc-dir (string-append doc-prefix - "/share/doc/" - chez+version))) - (list (string-append "--installcsug=" - doc-dir - "/csug") - (string-append "--installreleasenotes=" - doc-dir - "/release_notes"))) - ,@#$cfg-flags)) - ((#:make-flags mk-flags #~'()) - #~(cons* (string-append "ZUO=" - #+(this-package-native-input "zuo") - "/bin/zuo") - (string-append "STEXLIB=" - #+(this-package-native-input "stex") - "/lib/stex") - #$mk-flags)) - ((#:phases those-phases #~%standard-phases) - #~(let* ((those-phases #$those-phases) - (gnu:unpack (assoc-ref those-phases 'unpack)) - (gnu:build (assoc-ref those-phases 'build))) - (modify-phases those-phases - (replace 'build - ;; need to override target for cross-compilation - ;; https://racket.discourse.group/t/950/19 - (lambda* (#:key target (make-flags '()) (parallel-build? #t) - #:allow-other-keys) - (gnu:build #:make-flags (if target - (cons "kernel" make-flags) - make-flags) - #:parallel-build? parallel-build?))) - (replace 'install-docs - (lambda* (#:key native-inputs (make-flags '()) - #:allow-other-keys) - ;; The tests for 'native-inputs' are cross-compilation - ;; workarounds that would be better to address upstream: - ;; see . - (when native-inputs - (substitute* "Makefile" - (("install-docs: build \\$[(]ZUO[)]") - "install-docs: $(ZUO)"))) - (apply invoke - "make" - "install-docs" - (if native-inputs - (cons (string-append - "Scheme=" - (search-input-file native-inputs - "/bin/scheme")) - make-flags) - make-flags)))) - (replace 'unpack - (lambda args - (gnu:unpack #:source #$(or (package-source this-package) - (package-source racket-vm-bc))))) - (add-after 'unpack 'chdir - (lambda args - (chdir "racket/src/ChezScheme")))))))) - (supported-systems %supported-systems) - (home-page "https://github.com/racket/ChezScheme") - ;; ^ This is downstream of https://github.com/racket/racket, - ;; but it's designed to be a friendly landing place for people - ;; who want a ChezScheme-shaped repositroy. - (synopsis "Variant of Chez Scheme extended for Racket") - (description "This variant of Chez Scheme is extended to support the -implementation of Racket. It may be useful on platforms that are not yet -supported by upstream Chez Scheme. - -Main additions to Chez Scheme in the Racket variant: -@itemize @bullet -@item -AArch64 and RV64G (RISC-V) code generation -@item -Portable bytecode (@code{pb}) mode, which is mainly useful for bootstrapping a -build on any platform, but can also be used on platforms without native-code -generation, compiled via Emscripten, linked with @code{libffi}, or used with -bytecode partially compiled to C -@item -Unboxed floating-point arithmetic and flvectors -@item -Faster multiplication and division for large exact numbers -@item -Type reconstruction during optimization (especially for safe code) -@item -Continuation marks -@item -Parallel garbage collection, in-place garbage collection for old-generation -objects (instead of always copying), and reachability-based memory -accounting -@item -Ordered finalization, immobile (but collectable) objects, weak/ephemeron -generic hash tables, and reference bytevectors -@item -Easier bootstrapping via old versions of Chez Scheme -@end itemize") + (list + #:modules + '((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match) + (srfi srfi-34)) + #:out-of-source? #t + ;; Intermittent failures: https://github.com/cisco/ChezScheme/issues/809 + #:tests? #f + #:test-target "test" ; test-one test-some-fast test-some test test-more + #:configure-flags + #~`(,@(let* ((chez+version (strip-store-file-name #$output)) + (doc-dir (string-append #$output:doc + "/share/doc/" + chez+version))) + (list (string-append "--installcsug=" + doc-dir + "/csug") + (string-append "--installreleasenotes=" + doc-dir + "/release_notes"))) + ,(string-append "--installprefix=" #$output) + #$@(if (%current-target-system) + (list (string-append "--toolprefix=" + (%current-target-system) + "-")) + '()) + ,@(if (false-if-exception + (search-input-directory %build-inputs "/include/X11")) + '() + '("--disable-x11")) + #$(string-append "-m=" (or (racket-cs-native-supported-system?) + (nix-system->pbarch-machine-type))) + ;; ^ could skip -m= for non-cross non-pbarch builds + #$@(if (racket-cs-native-supported-system?) + #~() + ;; not inferred on non-native platforms: see + ;; https://racket.discourse.group/t/950/9 + #~("--enable-libffi" + "CFLAGS+=-g -D_REENTRANT -pthread" + "LIBS+=-lm -ldl -lrt -lncurses")) + ,(string-append "STEXLIB=" + (or (false-if-exception + (search-input-directory %build-inputs + "/lib/stex")) + "/GuixNotUsingStex")) + "ZUO=zuo" + "ZLIB=-lz" + "LZ4=-llz4" + ;; Guix will do 'compress-man-pages', + ;; and letting Chez try caused an error (at one point) + "--nogzip-man-pages") + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (let ((unpack (assoc-ref %standard-phases 'unpack))) + (lambda args + (unpack #:source #$(or (package-source this-package) + (package-source racket-vm-bc)))))) + (add-after 'unpack 'unpack-nanopass + #$unpack-nanopass) + (add-after 'unpack-nanopass 'maybe-chdir + (lambda args + (when (directory-exists? "racket/src/ChezScheme") + (chdir "racket/src/ChezScheme")))) + (add-after 'maybe-chdir 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (when (directory-exists? "boot") + (delete-file-recursively "boot")) + (copy-recursively + (search-input-directory inputs "lib/chez-scheme-bootfiles") + "boot"))) + (replace 'configure + #$chez-configure) + (add-after 'configure 'configure-environment-variables + (lambda args + ;; mats/6.ms needs HOME to be set: + (setenv "HOME" "/tmp"))) + (replace 'build + ;; need to override target for cross-compilation + ;; https://racket.discourse.group/t/950/19 + (let ((gnu:build (assoc-ref %standard-phases 'build))) + (lambda* (#:key target (make-flags '()) (parallel-build? #t) + #:allow-other-keys) + (gnu:build #:make-flags (if target + (cons "kernel" make-flags) + make-flags) + #:parallel-build? parallel-build?)))) + (add-before 'check 'build-docs + ;; This comes BEFORE 'check because the test suite may take on the + ;; order of an hour (without parallelism), so we want to get any + ;; other errors first. + ;; TODO: improve cross support upstream. + (lambda* (#:key native-inputs (make-flags '()) #:allow-other-keys) + #$(if (%current-target-system) + #~(format #t "not building docs for cross~%") + #~(apply invoke "make" "docs" make-flags)))) + ;; The binary file name is called "scheme" as is the one from + ;; MIT/GNU Scheme. We add a symlink to use in case both are + ;; installed. + (add-after 'install 'install-symlink + (lambda* (#:key outputs #:allow-other-keys) + (let* ((bin-dir + (dirname (search-input-file outputs "/bin/scheme"))) + (boot-dir + (match (find-files (string-append bin-dir "/../lib") + "scheme.boot") + ((scheme.boot) + (dirname scheme.boot))))) + (for-each (lambda (dir) + (with-directory-excursion dir + (symlink "./scheme" "chez-scheme") + (when (file-exists? "scheme.boot") + (symlink "./scheme.boot" "chez-scheme.boot")))) + (list bin-dir boot-dir))))) + ;; Building the documentation requires stex and a running scheme. + ;; TODO: improve cross support upstream. + (add-after 'install-symlink 'install-docs + (lambda* (#:key native-inputs (make-flags '()) #:allow-other-keys) + #$(if (%current-target-system) + #~(let* ((rel + (string-append "share/doc/" + (strip-store-file-name #$output))) + (found/csug + (search-input-directory + native-inputs (string-append rel "/csug"))) + (found (substring found/csug + 0 + (- (string-length found/csug) + (string-length "/csug")))) + (dest (string-append #$output:doc "/" rel))) + (mkdir-p dest) + (with-directory-excursion dest + (for-each (lambda (f) + (symlink (string-append found "/" f) + f)) + '("csug" "csug.pdf" + "release_notes" "release_notes.pdf")))) + #~(apply invoke "make" "install-docs" make-flags)))) + (add-after 'install-docs 'link-doc-pdfs + ;; otherwise, it's hard to notice them in a forest of HTML files + ;; TODO: improve cross support upstream. + (lambda* (#:key outputs #:allow-other-keys) + #$(if (%current-target-system) + #~(format #t "nothing to be done for cross~%") + #~(with-directory-excursion + (string-append (or (assoc-ref outputs "doc") + (assoc-ref outputs "out")) + "/share/doc/" + (strip-store-file-name #$output)) + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (match (find-files + "csug" + "csug.*\\.pdf$" ;; embeded version number + #:fail-on-error? #t) + ((pth) + (symlink pth + "csug.pdf")))))))))) + (home-page "https://cisco.github.io/ChezScheme/") + (synopsis "Bootstrapping version of Chez Scheme") + (description + "This is the precise pre-release version of Chez Scheme from a specific +Racket release. It is used to build Racket and to bootstrap the released +version of Chez Scheme.") (license asl2.0))) ;; @@ -646,58 +722,70 @@ (define-public chez-scheme-bootstrap-bootfiles (define-public chez-scheme-for-racket-bootstrap-bootfiles (package - (inherit chez-scheme-bootstrap-bootfiles) (name "chez-scheme-for-racket-bootstrap-bootfiles") (version (package-version chez-scheme-for-racket)) (source #f) ; avoid problematic cycle with racket.scm (native-inputs - (cons* chez-nanopass-bootstrap - (if (%current-target-system) - (list zuo - chez-scheme-for-racket) - (list racket-vm-bc)))) + (cons chez-nanopass-bootstrap + (if (%current-target-system) + (list zuo + chez-scheme-for-racket) + (list racket-vm-bc)))) + (build-system copy-build-system) (arguments - (substitute-keyword-arguments - (package-arguments chez-scheme-bootstrap-bootfiles) - ((#:phases those-phases #~%standard-phases) - #~(let* ((those-phases #$those-phases) - (unpack (assoc-ref those-phases 'unpack))) - (modify-phases those-phases - (replace 'unpack - (lambda args - (unpack #:source #$(or (package-source this-package) - (package-source racket-vm-bc))))) - (add-after 'unpack 'chdir - (lambda args - (chdir "racket/src/ChezScheme"))) - (add-after 'chdir 'unpack-nanopass+stex - (lambda args - #$unpack-nanopass+stex)) - (add-before 'install 'build - (lambda* (#:key native-inputs inputs #:allow-other-keys) - #$(cond - ((%current-target-system) - ;; cross-compiling - #~(invoke - (search-input-file (or native-inputs inputs) - "/bin/zuo") - "makefiles/boot.zuo" - (search-input-file (or native-inputs inputs) - "/bin/scheme") - #$(or (racket-cs-native-supported-system?) - (nix-system->pbarch-machine-type)))) - (else - ;; bootstrapping - #~(invoke - (search-input-file (or native-inputs inputs) - "/opt/racket-vm/bin/racket") - "../rktboot/main.rkt")))))))))) - (supported-systems - (package-supported-systems chez-scheme-for-racket)) - (home-page "https://github.com/racket/ChezScheme") - ;; ^ This is downstream of https://github.com/racket/racket, - ;; but it's designed to be a friendly landing place for people - ;; who want a ChezScheme-shaped repositroy. + (list + #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")) + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (let ((unpack (assoc-ref %standard-phases 'unpack))) + (lambda args + (unpack #:source #$(or (package-source this-package) + (package-source racket-vm-bc)))))) + (add-after 'unpack 'unpack-nanopass + #$unpack-nanopass) + (add-after 'unpack-nanopass 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))) + (add-before 'install 'build + #$(cond + ((%current-target-system) + ;; cross-compiling + ;; TODO: share more of this with upstream, once we figure out + ;; how best to manage running Chez as a cross-compiler and the + ;; unfortate cycle with %racket-origin. + #~(lambda* (#:key native-inputs inputs (parallel-build? #t) + #:allow-other-keys) + (invoke "./configure" + "--force" ; don't complain about missing bootfiles + #$(string-append + "-m=" (or (racket-cs-native-supported-system?) + (nix-system->pbarch-machine-type))) + "ZUO=zuo" + ;; ignore submodules: + "ZLIB=-lz" + "LZ4=-llz4" + "STEXLIB=/GuixNotUsingStex") + (apply invoke + "make" + `(,@(if parallel-build? + `("-j" ,(number->string + (parallel-job-count))) + '()) + ,(string-append "SCHEME=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + "cross.boot")))) + (else + ;; bootstrapping + #~(lambda* (#:key native-inputs inputs #:allow-other-keys) + (invoke + (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "../rktboot/main.rkt")))))))) + (home-page "https://pkgs.racket-lang.org/package/cs-bootstrap") (synopsis "Chez Scheme bootfiles bootstrapped by Racket") (description "Chez Scheme is a self-hosting compiler: building it requires ``bootfiles'' containing the Scheme-implemented portions compiled for @@ -709,11 +797,8 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles Scheme compiler purely from source into Racket and apply the compiler to itself, thus bootstrapping Chez Scheme. Bootstrapping takes about 10 times as long as using an existing Chez Scheme, but @code{cs-bootstrap} supports Racket -7.1 and later, including the Racket BC variant. - -Note that the generated bootfiles are specific to Racket's fork of Chez -Scheme, and @code{cs-bootstrap} does not currently support building upstream -Chez Scheme."))) +7.1 and later, including the Racket BC variant.") + (license asl2.0))) ;; ;; Chez's bootstrap dependencies: @@ -935,7 +1020,7 @@ (define-public chez-nanopass ;; Help function for Chez Scheme to add the current path to ;; CHEZSCHEMELIBDIRS. -(define chez-configure +(define configure-chezschemelibdirs #~(lambda _ (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) (setenv "CHEZSCHEMELIBDIRS" @@ -975,7 +1060,7 @@ (define-public chez-srfi #:test-target "test" #:phases #~(modify-phases %standard-phases (replace 'configure - #$chez-configure)))) + #$configure-chezschemelibdirs)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -1159,7 +1244,7 @@ (define-public chez-matchable #:test-target "test" #:phases #~(modify-phases %standard-phases (replace 'configure - #$chez-configure)))) + #$configure-chezschemelibdirs)))) (synopsis "Portable hygienic pattern matcher for Scheme") (description "This package provides a superset of the popular Scheme @code{match} package by Andrew Wright, written in fully portable @@ -1191,7 +1276,7 @@ (define-public chez-irregex #:test-target "test" #:phases #~(modify-phases %standard-phases (replace 'configure - #$chez-configure)))) + #$configure-chezschemelibdirs)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -1223,7 +1308,7 @@ (define-public chez-fmt #:phases #~(modify-phases %standard-phases (replace 'configure - #$chez-configure) + #$configure-chezschemelibdirs) (replace 'build (lambda* (#:key (make-flags '()) #:allow-other-keys) (apply invoke "make" "chez-build" make-flags))) @@ -1285,7 +1370,7 @@ (define-public chez-mit #:test-target "test" #:phases #~(modify-phases %standard-phases (replace 'configure - #$chez-configure)))) + #$configure-chezschemelibdirs)))) (synopsis "MIT/GNU Scheme compatibility library for Chez Scheme") (description "This package provides a set of MIT/GNU Scheme compatibility libraries for Chez Scheme. The main goal was to provide the functionality @@ -1320,7 +1405,7 @@ (define-public chez-scmutils #:phases #~(modify-phases %standard-phases (replace 'configure - #$chez-configure) + #$configure-chezschemelibdirs) ;; Since the documentation is lacking, we install the source ;; code. For things to work correctly we have to replace ;; relative paths by absolute ones in 'include' forms. This diff --git a/gnu/packages/patches/racket-backport-8.11-layered-docs.patch b/gnu/packages/patches/racket-backport-8.11-layered-docs.patch deleted file mode 100644 index 07f105bb24..0000000000 --- a/gnu/packages/patches/racket-backport-8.11-layered-docs.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 1d8dbdf408db9e99f1382323477561d5148cd451 Mon Sep 17 00:00:00 2001 -From: Philip McGrath -Date: Fri, 20 Oct 2023 17:19:50 -0400 -Subject: [PATCH] racket-index: fix release.scrbl for layered installations -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Configure the release notes page to be rendered separately at every -installation layer. Otherwise, rendering documentation for packages -installed in a new layer might try to write to `release/in.sxref` -in the parent layer’s docs directory. - -Related to https://github.com/videolang/video/issues/67 -Related to https://issues.guix.gnu.org/56534 - -(cherry picked from commit 85f21854c0a41564b755fbe180fe6b85de6c4730) ---- - pkgs/racket-index/scribblings/main/info.rkt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pkgs/racket-index/scribblings/main/info.rkt b/pkgs/racket-index/scribblings/main/info.rkt -index 75c507848a..a6a3798f7c 100644 ---- a/pkgs/racket-index/scribblings/main/info.rkt -+++ b/pkgs/racket-index/scribblings/main/info.rkt -@@ -6,4 +6,4 @@ - ("local-redirect.scrbl" (depends-all-main no-depend-on every-main-layer) (omit) "local-redirect" 1 10) - ("license.scrbl" () (omit)) - ("acks.scrbl" () (omit)) -- ("release.scrbl" (depends-all-main no-depend-on) (omit)))) -+ ("release.scrbl" (depends-all-main no-depend-on every-main-layer) (omit)))) - -base-commit: c3a502c0ae9f4d615bfd85fc7d88b781826bbb09 --- -2.41.0 - diff --git a/gnu/packages/patches/racket-backport-8.12-chez-configure.patch b/gnu/packages/patches/racket-backport-8.12-chez-configure.patch new file mode 100644 index 0000000000..483948fec9 --- /dev/null +++ b/gnu/packages/patches/racket-backport-8.12-chez-configure.patch @@ -0,0 +1,423 @@ +From 82157f5b3fb9f71ad7fc978c428d423d06a4a0df Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Wed, 28 Feb 2024 19:41:22 -0500 +Subject: [PATCH 1/2] Chez Scheme: Repairs and improvements for building with + external dependencies + +* configure: support `ZUO=` + +Supplying `ZUO=` skips the submodule check in `configure` +and configures the generated makefile not to build or remove Zuo. + +* configure: support `STEXLIB=` + +For compatibility with older scripts, when not explicitly configured, +continue to honor the `STEXLIB` environment variable at build time. + +(cherry picked from commit 694fbd47a125c7fde10a328c6fda199dac19f802) +--- + racket/src/ChezScheme/BUILDING | 5 ++-- + racket/src/ChezScheme/build.zuo | 13 +++++++--- + racket/src/ChezScheme/configure | 27 ++++++++++++++++++++- + racket/src/ChezScheme/makefiles/Makefile.in | 6 ++--- + 4 files changed, 40 insertions(+), 11 deletions(-) + +diff --git a/racket/src/ChezScheme/BUILDING b/racket/src/ChezScheme/BUILDING +index 50fde27771..2df29b5bd8 100644 +--- a/racket/src/ChezScheme/BUILDING ++++ b/racket/src/ChezScheme/BUILDING +@@ -155,7 +155,8 @@ information on the supported options. + The generated makefile mostly just ensures that a `zuo` executable is + built in a `bin` directory, and then it defers the actual build work + to `zuo`, which uses the "main.zuo" file. If you have `zuo` installed, +-you can use `zuo` directly instead of `make`. In general, instead of ++you can use `zuo` directly instead of `make`: in that case, you may ++wish to use `./configure ZUO=`. In general, instead of + the command `make X` to build target `X` as described below, you can + use `zuo . X` (or `bin/zuo . X` after `bin/zuo` is built). + +@@ -339,7 +340,7 @@ The makefile supports several targets: + * `make clean` + + Removes all built elements from the workarea, and then removes +- `bin/zuo`. ++ `bin/zuo` (unless configured with `ZUO=`). + + + WINDOWS VIA COMMAND PROMPT +diff --git a/racket/src/ChezScheme/build.zuo b/racket/src/ChezScheme/build.zuo +index a211632a89..432cc6e5a1 100644 +--- a/racket/src/ChezScheme/build.zuo ++++ b/racket/src/ChezScheme/build.zuo +@@ -218,10 +218,15 @@ + token)) + + (define stexlib +- (let ((found (assoc "STEXLIB" (hash-ref (runtime-env) 'env)))) +- (if found +- (cdr found) +- (at-source "stex")))) ++ (let ([configured (hash-ref config 'STEXLIB "")] ++ [env (assoc "STEXLIB" (hash-ref (runtime-env) 'env))]) ++ (cond ++ [(not (equal? "" configured)) ++ configured] ++ [env ++ (cdr env)] ++ [else ++ (at-source "stex")]))) + (define stex-sources + (source-tree stexlib)) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 721d1d1335..f88c6f7625 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -93,6 +93,7 @@ default_warning_flags="-Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough" + CFLAGS_ADD= + zlibLib= + LZ4Lib= ++STEXLIB= + Kernel=KernelLib + buildKernelOnly=no + enableFrompb=yes +@@ -102,6 +103,7 @@ empetite=no + moreBootFiles= + preloadBootFiles= + alwaysUseBootFile= ++zuoExternal= + + CONFIG_UNAME=`uname` + +@@ -442,6 +444,12 @@ while [ $# != 0 ] ; do + LZ4=*) + LZ4Lib=`echo $1 | sed -e 's/^LZ4=//'` + ;; ++ STEXLIB=*) ++ STEXLIB=`echo $1 | sed -e 's/^STEXLIB=//'` ++ ;; ++ ZUO=*) ++ zuoExternal=`echo $1 | sed -e 's/^ZUO=//'` ++ ;; + *) + echo "option '$1' unrecognized or missing an argument; try $0 --help" + exit 1 +@@ -667,6 +675,8 @@ if [ "$help" = "yes" ]; then + echo " STRIP= executable stripper" + echo " ZLIB= link to instead of own zlib" + echo " LZ4= link to instead of own LZ4" ++ echo " STEXLIB= build docs with instead of own stex" ++ echo " ZUO= build with instead of own Zuo" + echo "" + echo "Available machine types: $machs" + echo "" +@@ -869,6 +879,16 @@ if [ "$addflags" = "yes" ] ; then + fi + fi + ++if [ "${zuoExternal}" = "" ] ; then ++ ZUO="bin/zuo" ++ RM_ZUO="rm -f bin/zuo" ++ ZUO_TARGET="bin/zuo" ++else ++ ZUO="${zuoExternal}" ++ RM_ZUO="@echo 'Not cleaning external ${zuoExternal}'" ++ ZUO_TARGET="DoNotBuildZuo" ++fi ++ + # more compile and link flags for c/Mf-unix and mats/Mf-unix + mdinclude= + mdcppflags= +@@ -1039,7 +1059,7 @@ cp "$srcdir"/makefiles/buildmain.zuo main.zuo + # Some idea, but in the workarea, so it refers to "workarea.zuo" here: + cp "$srcdir"/makefiles/workmain.zuo $w/main.zuo + +-# The content of "$w/Makefile" records configuration decisions, ++# The content of "$w/Mf-config" records configuration decisions, + # and the Zuo build script takes it from there + cat > $w/Mf-config << END + srcdir=$srcdir +@@ -1075,6 +1095,7 @@ cursesLib=$cursesLib + ncursesLib=$ncursesLib + zlibLib=$zlibLib + LZ4Lib=$LZ4Lib ++STEXLIB=$STEXLIB + warningFlags=$warningFlags + Kernel=$Kernel + installscriptname=$installscriptname +@@ -1086,6 +1107,10 @@ preloadBootFiles=$preloadBootFiles + alwaysUseBootFile=$alwaysUseBootFile + relativeBootFiles=$relativeBootFiles + ++ZUO=$ZUO ++RM_ZUO=$RM_ZUO ++ZUO_TARGET=$ZUO_TARGET ++ + InstallBin=$installbin + InstallLib=$installlib + InstallMan=$installman/man1 +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index cfdd0230a3..4865bf2e2f 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -3,8 +3,6 @@ workarea=$(w) + + include $(workarea)/Mf-config + +-ZUO=bin/zuo +- + .PHONY: build + build: $(ZUO) + + $(ZUO) $(workarea) MAKE="$(MAKE)" +@@ -140,9 +138,9 @@ pkg: $(ZUO) + .PHONY: clean + clean: $(ZUO) + + $(ZUO) $(workarea) clean MAKE="$(MAKE)" +- rm -f bin/zuo ++ $(RM_ZUO) + + # Using `+` here means that $(ZUO) gets built even if `-n`/`--dry-run` is provided to `make` +-$(ZUO): $(srcdir)/../zuo/zuo.c ++$(ZUO_TARGET): $(srcdir)/../zuo/zuo.c + + mkdir -p bin + + $(CC_FOR_BUILD) -DZUO_LIB_PATH='"'"$(upsrcdir)/../zuo/lib"'"' -o $(ZUO) $(srcdir)/../zuo/zuo.c + +base-commit: 78fef00d4d16a79fdf6ab31924b3a80cadf4b368 +-- +2.41.0 + + +From e2bc69c5ce7437dd9a1b30ac1b12b3a56872c491 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 10 Mar 2024 09:13:40 -0600 +Subject: [PATCH 2/2] Chez Scheme: adjust `configure ZUO=` support + +Continuing from 694fbd47a1, adjust the generated makefile so the +supplied `` is not a makefile dependency. That way, `ZUO=zuo` +works if `zuo` is installed and the current build directory is not the +source directory. (The `zuo` executable is a dependency in a real and +relevant sense, but not in the sense of dependencies that we normally +track in makefiles.) + +Also adapt the makefile for the case that `ZUO=...` is not supplied +and the build directory is not the source directory, in which case +`ZUO_LIB_PATH` needs to be relative to the source directory. + +Using `make ZUO=zuo` can also work, but in that case, `bin/zuo` is +still built as a dependency. It's possible that some portable makefile +magic could overcome that limitation, but it doesn't seem important. + +(cherry picked from commit 28157ba88d48fe645563f46f6c00d6626b3428fa) +--- + racket/src/ChezScheme/configure | 3 + + racket/src/ChezScheme/makefiles/Makefile.in | 70 +++++++++++---------- + 2 files changed, 40 insertions(+), 33 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index f88c6f7625..201dbe580f 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -881,10 +881,12 @@ fi + + if [ "${zuoExternal}" = "" ] ; then + ZUO="bin/zuo" ++ ZUO_DEP="${ZUO}" + RM_ZUO="rm -f bin/zuo" + ZUO_TARGET="bin/zuo" + else + ZUO="${zuoExternal}" ++ ZUO_DEP="" + RM_ZUO="@echo 'Not cleaning external ${zuoExternal}'" + ZUO_TARGET="DoNotBuildZuo" + fi +@@ -1108,6 +1110,7 @@ alwaysUseBootFile=$alwaysUseBootFile + relativeBootFiles=$relativeBootFiles + + ZUO=$ZUO ++ZUO_DEP=$ZUO_DEP + RM_ZUO=$RM_ZUO + ZUO_TARGET=$ZUO_TARGET + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index 4865bf2e2f..5ce237178e 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -4,51 +4,55 @@ workarea=$(w) + include $(workarea)/Mf-config + + .PHONY: build +-build: $(ZUO) ++build: $(ZUO_DEP) + + $(ZUO) $(workarea) MAKE="$(MAKE)" + + .PHONY: run +-run: $(ZUO) ++run: $(ZUO_DEP) + + $(ZUO) $(workarea) run + + .PHONY: kernel +-kernel: $(ZUO) ++kernel: $(ZUO_DEP) + + $(ZUO) $(workarea) kernel MAKE="$(MAKE)" + + .PHONY: install +-install: $(ZUO) ++install: $(ZUO_DEP) + $(ZUO) $(workarea) install MAKE="$(MAKE)" + + .PHONY: uninstall +-uninstall: $(ZUO) ++uninstall: $(ZUO_DEP) + + $(ZUO) $(workarea) uninstall MAKE="$(MAKE)" + +-.PHONY: test +-test: $(ZUO) +- + $(ZUO) $(workarea) test MAKE="$(MAKE)" ++.PHONY: test-one ++test-one: $(ZUO_DEP) ++ + $(ZUO) $(workarea) test-one MAKE="$(MAKE)" + + .PHONY: test-some-fast +-test-some-fast: $(ZUO) ++test-some-fast: $(ZUO_DEP) + + $(ZUO) $(workarea) test-some-fast MAKE="$(MAKE)" + + .PHONY: test-some +-test-some: $(ZUO) ++test-some: $(ZUO_DEP) + + $(ZUO) $(workarea) test-some MAKE="$(MAKE)" + ++.PHONY: test ++test: $(ZUO_DEP) ++ + $(ZUO) $(workarea) test MAKE="$(MAKE)" ++ + .PHONY: test-more +-test-more: $(ZUO) ++test-more: $(ZUO_DEP) + + $(ZUO) $(workarea) test-more MAKE="$(MAKE)" + + .PHONY: coverage +-coverage: $(ZUO) ++coverage: $(ZUO_DEP) + + $(ZUO) $(workarea) coverage MAKE="$(MAKE)" + + .PHONY: bootfiles +-bootfiles: $(ZUO) ++bootfiles: $(ZUO_DEP) + + $(ZUO) $(workarea) bootfiles MAKE="$(MAKE)" + + .PHONY: reset +-reset: $(ZUO) ++reset: $(ZUO_DEP) + + $(ZUO) $(workarea) reset MAKE="$(MAKE)" + + # Supply XM= to build boot files for +@@ -57,86 +61,86 @@ boot: + + $(ZUO) $(workarea) boot "$(XM)" MAKE="$(MAKE)" + + # `.boot` as alias for `boot XM=` +-%.boot: $(ZUO) ++%.boot: $(ZUO_DEP) + + $(ZUO) $(workarea) boot $* MAKE="$(MAKE)" + + .PHONY: auto.boot +-auto.boot: $(ZUO) ++auto.boot: $(ZUO_DEP) + + $(ZUO) $(workarea) boot MAKE="$(MAKE)" + + SCHEME=scheme + + .PHONY: cross.boot +-cross.boot: $(ZUO) ++cross.boot: $(ZUO_DEP) + + $(ZUO) $(workarea) boot SCHEME="$(SCHEME)" MAKE="$(MAKE)" + + .PHONY: re.boot +-re.boot: $(ZUO) ++re.boot: $(ZUO_DEP) + + $(ZUO) $(workarea) reboot SCHEME="$(SCHEME)" + + # Supply XM= to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine + .PHONY: bootquick +-bootquick: $(ZUO) ++bootquick: $(ZUO_DEP) + + $(ZUO) $(workarea) bootquick "$(XM)" MAKE="$(MAKE)" + + # `.bootquick` as alias for `boot XM=` +-%.bootquick: $(ZUO) ++%.bootquick: $(ZUO_DEP) + + $(ZUO) $(workarea) bootquick $* MAKE="$(MAKE)" + +-auto.bootquick: $(ZUO) ++auto.bootquick: $(ZUO_DEP) + + $(ZUO) $(workarea) bootquick MAKE="$(MAKE)" + + # Supply XM=-.bootpbchunk to repackage boot files for + # with pbchunk sources, including additional + # boot files + .PHONY: bootpbchunk +-bootpbchunk: $(ZUO) ++bootpbchunk: $(ZUO_DEP) + + $(ZUO) $(workarea) bootpbchunk "$(XM)" $(ARGS) MAKE="$(MAKE)" + + # `.bootpbchunk` as alias for `pbchunk XM=` +-%.bootpbchunk: $(ZUO) ++%.bootpbchunk: $(ZUO_DEP) + + $(ZUO) $(workarea) bootpbchunk $* $(ARGS) MAKE="$(MAKE)" + + .PHONY: docs +-docs: build $(ZUO) ++docs: build $(ZUO_DEP) + + $(ZUO) $(workarea) docs MAKE="$(MAKE)" + + .PHONY: csug +-csug: build $(ZUO) ++csug: build $(ZUO_DEP) + + $(ZUO) $(workarea) csug MAKE="$(MAKE)" + + .PHONY: release_notes +-release_notes: build $(ZUO) ++release_notes: build $(ZUO_DEP) + + $(ZUO) $(workarea) release_notes MAKE="$(MAKE)" + + .PHONY: install-docs +-install-docs: build $(ZUO) ++install-docs: build $(ZUO_DEP) + + $(ZUO) $(workarea) install-docs MAKE="$(MAKE)" + + .PHONY: install-csug +-install-csug: build $(ZUO) ++install-csug: build $(ZUO_DEP) + + $(ZUO) $(workarea) install-csug MAKE="$(MAKE)" + + .PHONY: install-release_notes +-install-release_notes: build $(ZUO) ++install-release_notes: build $(ZUO_DEP) + + $(ZUO) $(workarea) install-release_notes MAKE="$(MAKE)" + + .PHONY: bintar +-bintar: $(ZUO) ++bintar: $(ZUO_DEP) + + $(ZUO) $(workarea) bintar MAKE="$(MAKE)" + + .PHONY: rpm +-rpm: $(ZUO) ++rpm: $(ZUO_DEP) + + $(ZUO) $(workarea) rpm MAKE="$(MAKE)" + + .PHONY: pkg +-pkg: $(ZUO) ++pkg: $(ZUO_DEP) + + $(ZUO) $(workarea) pkg MAKE="$(MAKE)" + + .PHONY: clean +-clean: $(ZUO) ++clean: $(ZUO_DEP) + + $(ZUO) $(workarea) clean MAKE="$(MAKE)" + $(RM_ZUO) + +-- +2.41.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 6e19be1da3..d366f89845 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -105,7 +105,9 @@ (define-module (gnu packages racket) ;; 'distro-build' package to assemble custom Racket distributions. (Again, ;; the makefile just delegates to Zuo.) It is not part of Racket source ;; distributions: the root of a source distribution is basically 'racket/src' -;; with some extra package sources and configuration added. +;; with some extra package sources and configuration added. In fact, the +;; top-level 'Makefile' and the 'distro-build' package are what create Racket +;; source distributions. ;; ;; A ''minimal Racket'' installation includes two packages: 'base', which is a ;; sort of bridge between the current ``built-in'' collections and the package @@ -191,7 +193,7 @@ (define-module (gnu packages racket) ;; ;; CODE: -(define %racket-version "8.11.1") ; Remember to update chez-scheme-for-racket! +(define %racket-version "8.12") ; Remember to update chez-scheme-for-racket! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -201,16 +203,16 @@ (define %racket-origin (url "https://github.com/racket/racket") (commit %racket-commit))) (sha256 - (base32 "1iny1mn1lw07lj6h704ch5g2q1nsf0h88dgwqrlxhf8pwj4i76gl")) + (base32 "1f52yadmrsd2ddry47s68kxig185a58n19j23458wkck19nawjz5")) (file-name (git-file-name "racket" %racket-version)) (patches (search-patches "racket-chez-scheme-bin-sh.patch" - "racket-backport-8.11-layered-docs.patch" + "racket-backport-8.12-chez-configure.patch" "racket-rktio-bin-sh.patch")) (modules '((guix build utils))) (snippet #~(begin (use-modules (guix build utils)) - ;; Unbundle Chez submodules. + ;; Unbundle Chez submodules and boot files. (with-directory-excursion "racket/src/ChezScheme" ;; TODO: consider putting this in a (guix ...) or (guix build ...) ;; module so it can be shared with the upstream Chez Scheme origin @@ -218,10 +220,14 @@ (define %racket-origin (for-each (lambda (dir) (when (directory-exists? dir) (delete-file-recursively dir))) - '("stex" - "nanopass" + '("boot" "lz4" - "zlib"))) + "nanopass" + "stex" + "zlib" + "zuo"))) + ;; Unbundle Zuo. + (delete-file-recursively "racket/src/zuo") ;; Unbundle libffi. (delete-file-recursively "racket/src/bc/foreign/libffi"))))) @@ -445,10 +451,8 @@ (define-public racket-vm-cs (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:phases those-phases #~%standard-phases) #~(modify-phases #$those-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (with-directory-excursion "racket/src/ChezScheme" - #$unpack-nanopass+stex))))) + (add-after 'unpack 'unpack-nanopass + #$unpack-nanopass))) ((#:configure-flags _ '()) #~(cons* "--enable-csonly" "--enable-libz" @@ -697,7 +701,7 @@ (define-public racket "contract-profile" (base32 "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3") '(("contract-profile" "."))) (simple-racket-origin - "data" (base32 "1pml8g3zgvnaiqb659psh99m70v96m6nh9zash2vfgir46j4rjnh") + "data" (base32 "01sinnsnjiazvkj83k84izdnp38pd2aglbrs14mrdkwajgmpampk") '("data" "data-doc" "data-enumerate-lib" "data-lib")) (simple-racket-origin "datalog" (base32 "0nf6cy4djpyhfvgpa6yn72apbz9s83gp0qg95pzjd0az4v6qwq1s") @@ -706,7 +710,7 @@ (define-public racket "db" (base32 "0xx0k8yw2vb9b4vk2dwjfbpixnmriqsv7kpv3fvfxbwyg42y0db5") '("db" "db-doc" "db-lib")) (simple-racket-origin - "deinprogramm" (base32 "0ijngjyg2i528a4xv20db4adirvx5rj4m86fd70l33lgwv53w3s0") + "deinprogramm" (base32 "0f41sh90i4mml95x2gcmfvl2rc7m77vjbagmgjx270ng7xvz16lj") '("deinprogramm" "deinprogramm-signature")) (simple-racket-origin "distributed-places" (base32 "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0") @@ -715,7 +719,7 @@ (define-public racket "draw" (base32 "1h7mckay8yjcgmj3r0jkf1csn430gn43n8jl1l956q9gcprlmncl") '("draw" "draw-doc" "draw-lib")) (simple-racket-origin - "drracket" (base32 "00ay3pwl648wq8nnaap665c38clr39k0g1wslh2wclar32wjpgdc") + "drracket" (base32 "17bdbvsf5l8z96bwzg1q75gg70c6svbhw0g1k239fsjd3mivmki4") '("drracket" "drracket-plugin-lib" "drracket-tool" @@ -749,13 +753,13 @@ (define-public racket "games" (base32 "13z7fnbr48s98lmfxc0nbfhbqkd4hphymy2r63hqm783xzn6ylzi") '(("games" "."))) (simple-racket-origin - "gui" (base32 "10mlajn5xqgdwi7gf9lgszfv609pjp8m24lm97b8xh6fmjlkqi4b") + "gui" (base32 "08kzyscqc8hgc1f8q0bhibl44fkq8iiyz12f8bqdhqkcz8nx44sw") '("gui" "gui-doc" "gui-lib" "tex-table")) (simple-racket-origin "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") '("gui-pkg-manager-lib")) (simple-racket-origin - "htdp" (base32 "04p2xp4hnnsnmrmvw05fg4fv18k3g2rz5gmgs89sc6g8y886m6zz") + "htdp" (base32 "13d8xsvs60d7797w93g14dbdm98bixgy65akayij256pyiwnqwdc") '("htdp" "htdp-doc" "htdp-lib")) (simple-racket-origin "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") @@ -797,7 +801,7 @@ (define-public racket (url "https://github.com/RenaissanceBug/racket-cookies") (commit %racket-commit))) (sha256 (base32 - "05lnml9nszcq72k8bi4iwdyplp2iv23ywb2gmrs2hr8837fqi65y")) + "1zr31y1gqa3kkrwlf9bnw08nzij00x1l70qhfbpz0239bksn4mmb")) (file-name (git-file-name "RenaissanceBug-racket-cookies" %racket-version))) '("net-cookies" "net-cookies-doc" "net-cookies-lib")) @@ -823,7 +827,7 @@ (define-public racket "pconvert" (base32 "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1") '("pconvert-lib")) (simple-racket-origin - "pict" (base32 "1vsn91r167wssaflzz080nsrcf0jfhl2a48zcj9hvdb77arbj8kc") + "pict" (base32 "1ghds5by8i0k2djbig82xqp2ssy3nvdwm45l8ibsr99y0ay6z7gv") '("pict" "pict-doc" "pict-lib")) (simple-racket-origin "pict-snip" (base32 "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x") @@ -838,7 +842,7 @@ (define-public racket "planet" (base32 "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9") '("planet" "planet-doc" "planet-lib")) (simple-racket-origin - "plot" (base32 "17fhsymy884xr4jqk585rm5kwdgkgz0635916gh5y0fsnp5pir70") + "plot" (base32 "0jq9a366g7b2c9vp6yvpqikvklgyd6p4xj6v224g99yj8cgip40b") '("plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib")) (simple-racket-origin "preprocessor" (base32 "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg") @@ -852,11 +856,8 @@ (define-public racket (uri (git-reference (url "https://github.com/Metaxal/quickscript") (commit %racket-commit))) - (snippet - ;; See https://github.com/Metaxal/quickscript/issues/73 - #~(delete-file "register.rkt")) (sha256 (base32 - "0v27qknghfi0058vk8xwwlwqgqwdsxxmprrmag64cyygdz95sxym")) + "1ahznb9rhgaixd3fqn0pxighw4zbflwqc84r2yvn5nsfbp0mrq9b")) (file-name (git-file-name "Metaxal-quickscript" %racket-version))) '(("quickscript" "."))) (simple-racket-origin @@ -880,7 +881,7 @@ (define-public racket "racklog" (base32 "0fr8xij0sssfnmwn6dfdi4jj3l62f2yj3jrjljv13kaycrfls032") '(("racklog" "."))) (simple-racket-origin - "rackunit" (base32 "0axcy8283qqmcrhwwn0q0sfjznc8gkwbx06j41anayi5v9xp4698") + "rackunit" (base32 "06kpl51alm7akgmmh110ya28zgmx3as0szykfv2gwqmf7xcms1b7") '("rackunit" "rackunit-doc" "rackunit-gui" @@ -896,7 +897,7 @@ (define-public racket "realm" (base32 "0rlvwyd6rpyl0zda4a5p8dp346fvqzc8555dgfnrhliymkxb6x4g") '(("realm" "."))) (simple-racket-origin - "redex" (base32 "016m2fvfxjnx7l0ai6jlcmz4s8xipbq9k58fq7109akj9mvczgp9") + "redex" (base32 "1mwnxbfk2vbalndlq0996rzdi3a2z48m5xnb1ywzlsvnydrnkrk2") '("redex" "redex-benchmark" "redex-doc" @@ -911,7 +912,7 @@ (define-public racket "scheme-lib" (base32 "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x") '(("scheme-lib" "."))) (simple-racket-origin - "scribble" (base32 "0igcjgmpzbzzn1jfpa4jq18lqyhr6dsdwnbv6zv87x8cib9rwqrh") + "scribble" (base32 "0rk5q9r9fw826ag0npk5cwkzkapj2p243wwm9gn2l7j7cr6z1rvb") '("scribble" "scribble-doc" "scribble-html-lib" @@ -943,7 +944,7 @@ (define-public racket "snip" (base32 "1b90ccqilnyszbphms3svm3c7dbk7870ifybjjipss5srb32mj2d") '("snip" "snip-lib")) (simple-racket-origin - "typed-racket" (base32 "17mz7zqrialxfzkynj7h3kfhawdd6cgs24ns437gz087g2pmwi1x") + "typed-racket" (base32 "0vdsyr0qhpvac6h8mfdy6vqrsqsfa7kpg39n3h637hccxyfxv63f") '("source-syntax" "typed-racket" "typed-racket-compatibility" @@ -954,7 +955,7 @@ (define-public racket "srfi" (base32 "1l3nr3a8mlp505aaxlyp4i8jfijmpyl9h1wwv8hzm4kzzjv4sl8p") '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib")) (simple-racket-origin - "string-constants" (base32 "1djbjhsimikk18dkrajrlgjhlqfyvna4nz64ha4wjcaj5cfgcvdx") + "string-constants" (base32 "0225f1wmq1n9f2x1pg50fssdnd4bpc11q1jgsykwf4ik4fnaa520") '("string-constants" "string-constants-doc" "string-constants-lib")) (simple-racket-origin "swindle" (base32 "1q8vdxpzczzwdw2mys2caab45yvadmqkixsr29k8pl03n8dsg8j9") @@ -969,7 +970,7 @@ (define-public racket "unix-socket" (base32 "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y") '("unix-socket" "unix-socket-doc" "unix-socket-lib")) (simple-racket-origin - "web-server" (base32 "0vhw1hwdcv1ham086dy0nkl4r0a5qvsimw8048zjakvax7q4shsg") + "web-server" (base32 "1i4sxmcgj00ml7czsbyx1433hgf091n1p54xyal2f1fsskx5fg0y") '("web-server" "web-server-doc" "web-server-lib")) (simple-racket-origin "wxme" (base32 "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b") From patchwork Fri Mar 29 05:18:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 62352 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 60D4627BBEC; Fri, 29 Mar 2024 05:20:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BB7C327BBE2 for ; Fri, 29 Mar 2024 05:20:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rq4f8-0003NK-NK; Fri, 29 Mar 2024 01:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq4eo-0003J1-DP for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq4eo-00067A-2e for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rq4ep-0004zZ-4k; Fri, 29 Mar 2024 01:20:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70065] [PATCH 3/6] gnu: chez-scheme: Reorganize package definitions. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Fri, 29 Mar 2024 05:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70065 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70065@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 70065-submit@debbugs.gnu.org id=B70065.171168956019087 (code B ref 70065); Fri, 29 Mar 2024 05:20:03 +0000 Received: (at 70065) by debbugs.gnu.org; 29 Mar 2024 05:19:20 +0000 Received: from localhost ([127.0.0.1]:41488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4e7-0004xa-IT for submit@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:20 -0400 Received: from wfout2-smtp.messagingengine.com ([64.147.123.145]:59851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4dy-0004wd-QD for 70065@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:12 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.west.internal (Postfix) with ESMTP id 85ADD1C00089 for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 29 Mar 2024 01:19:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1711689543; x=1711775943; bh=vQqPRe3LRDGDDpUSHjZ4K7+PW2DVaq30 0T3tV3JtIDk=; b=X/epFJ4Yo2HEzRhP9l61V34Hrt1ZvJaBA2SBeXOtyijHM+RJ nHoEMz8JpIcz0U1julXuPtSiP2rNT+bcjLdqF2VoYrFqBOo7BJc+sAEvV1qrCDTP hd5QFW05RPMwdmqQxqMG0ROYo2r6/qS3EDNH3/RJKj2CZh2JffqyiPHw2J/gXSPj WK+XHmAA+3hL6Xo4Im3pGeDT9ucVSy3UVQpwBPNB03+P6SwiFZaEjo8M0ORxka7w jAs3NW4lCUAfUCGVeHtWbho/RHj7KibPGPe/k9gdaC8XNpGPc7kpLLs4jHmRPkcd wv/bcWp9KbnpPZjtWBg7CnN7v/UTCCLFW4CedQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1711689543; x=1711775943; bh=vQqPRe3LRDGDD pUSHjZ4K7+PW2DVaq300T3tV3JtIDk=; b=c3ABSD0m0+ksX+zsTfXfxHsykljr9 I3Ulpz8Ge+Aj1cLXVYpS/jV4VuK4veFa6aQ4SMxH3L0wx0A6v6ksN5rBwfVRUe8u kV5xBYUU5FPkevoKauRzBh2lB/xSnqlfA/MAfAHXESVt5+wbCGlKDQDr6QbNWEF/ Tpw3DMkXtk7zUPBgEy3+wL/IEKSwIcuPFsLUVTKdTKa3rJYC3TojAp8jcE+ddFl5 8W20wC0m0IkYt7CjGLGSE+e+TvQk7ecRSWIubkXDFOsBYtHu7eylXkxFq5KBTvtC 9Wg0pJbpNgN2xFJNitmU7huWA0Yzztkj4Wk+ToYTBB6l5oGaQFZSkSBkw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddvtddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefrhhhilhhi phcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh eqnecuggftrfgrthhtvghrnhepteevudeuteeuteehteeuteeiffefieefjeejtdeltdej feehteeuvdejvdehvedunecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuh gsrdhiohenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:02 -0400 (EDT) From: Philip McGrath Date: Fri, 29 Mar 2024 01:18:52 -0400 Message-ID: <5c84a4bda522531288944d78c505c4328735ac5d.1711688274.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches A future commit will change 'chez-scheme' to inherit from 'chez-scheme-for-racket', so 'chez-scheme-for-racket' will need to be defined before 'chez-scheme'. In an attempt to produce better diffs, this commit re-orders the definitions while keeping their contents exactly the same. * gnu/packages/chez.scm (chez-scheme): Move below 'chez-scheme-for-racket'. (chez-scheme-bootstrap-bootfiles): Move below 'chez-scheme-for-racket-bootstrap-bootfiles'. Change-Id: Ie088abea2b44329f9d8399fbfb95c51d8912b05e --- gnu/packages/chez.scm | 426 +++++++++++++++++++++--------------------- 1 file changed, 213 insertions(+), 213 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index c71d6fafd5..3b7e6a67b3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -282,191 +282,6 @@ (define unpack-nanopass "lib/chez-scheme/nanopass.ss")) "nanopass")))) -(define-public chez-scheme - (package - (name "chez-scheme") - ;; The version should match `(scheme-version-number)`. - ;; See s/cmacros.ss c. line 360. - (version "9.5.8") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 - "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) - (file-name (git-file-name name version)) - (patches (search-patches "chez-scheme-bin-sh.patch")) - (snippet #~(begin - (use-modules (guix build utils)) - ;; TODO: consider putting this in a (guix ...) or - ;; (guix build ...) module so it can be shared - ;; with the Racket origin without cyclic issues. - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib")))))) - (build-system gnu-build-system) - (inputs - (list - chez-scheme-bootstrap-bootfiles - `(,util-linux "lib") ;<-- libuuid - zlib - lz4 - ncurses ;<-- for expeditor - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - libx11)) - (native-inputs (list chez-nanopass-bootstrap - stex-bootstrap)) - (native-search-paths - (list (search-path-specification - (variable "CHEZSCHEMELIBDIRS") - (files '("lib/chez-scheme"))))) - (outputs '("out" "doc")) - (arguments - (list - #:modules - '((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw) - (ice-9 match)) - #:test-target "test" - #:configure-flags - #~`(,(string-append "--installprefix=" #$output) - #$@(if (and=> (chez-upstream-features-for-system) - (cut memq 'threads <>)) - #~("--threads") - #~()) - "ZLIB=-lz" - "LZ4=-llz4" - "--libkernel" - ;; Guix will do 'compress-man-pages', - ;; and letting Chez try causes an error - "--nogzip-man-pages") - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (begin - (copy-recursively - (dirname (search-input-file %build-inputs - "lib/chez-scheme/nanopass.ss")) - "nanopass" - #:keep-mtime? #t) - (mkdir-p "stex") - (with-output-to-file "stex/Mf-stex" - (lambda () - ;; otherwise, it will try to download submodules - (display "# to placate ../configure")))))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (when (directory-exists? "boot") - (delete-file-recursively "boot")) - (copy-recursively - (search-input-directory inputs - "lib/chez-scheme-bootfiles") - "boot"))) - ;; NOTE: The custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. This replacement phase uses only - ;; the explicitly provided `#:configure-flags`. - (replace 'configure - (lambda* (#:key inputs (configure-flags '()) out-of-source? - #:allow-other-keys) - (let* ((abs-srcdir (getcwd)) - (srcdir (if out-of-source? - (string-append "../" (basename abs-srcdir)) - "."))) - (format #t "source directory: ~s (relative from build: ~s)~%" - abs-srcdir srcdir) - (if out-of-source? - (begin - (mkdir "../build") - (chdir "../build"))) - (format #t "build directory: ~s~%" (getcwd)) - (format #t "configure flags: ~s~%" configure-flags) - (apply invoke - (string-append srcdir "/configure") - configure-flags)))) - (add-after 'configure 'configure-environment-variables - (lambda args - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" #$(cc-for-target)) - ;; Likewise, some tests have needed HOME to be set: - (setenv "HOME" "/tmp"))) - ;; The binary file name is called "scheme" as is the one from - ;; MIT/GNU Scheme. We add a symlink to use in case both are - ;; installed. - (add-after 'install 'install-symlink - (lambda* (#:key outputs #:allow-other-keys) - (let* ((scheme (search-input-file outputs "/bin/scheme")) - (bin-dir (dirname scheme))) - (symlink scheme - (string-append bin-dir "/chez-scheme")) - (match (find-files (string-append bin-dir "/../lib") - "scheme.boot") - ((scheme.boot) - (symlink scheme.boot - (string-append (dirname scheme.boot) - "/chez-scheme.boot"))))))) - ;; Building the documentation requires stex and a running scheme. - (add-after 'install-symlink 'install-docs - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((doc-prefix (or (assoc-ref outputs "doc") - (assoc-ref outputs "out"))) - (chez+version (strip-store-file-name #$output)) - (scheme (search-input-file outputs "/bin/scheme")) - (stexlib (search-input-directory (or native-inputs - inputs) - "/lib/stex")) - (doc-dir (string-append doc-prefix - "/share/doc/" - chez+version))) - (define* (stex-make #:optional (suffix "")) - (invoke "make" "install" - (string-append "Scheme=" scheme) - (string-append "STEXLIB=" stexlib) - (string-append "installdir=" doc-dir suffix))) - (with-directory-excursion "csug" - (stex-make "/csug")) - (with-directory-excursion "release_notes" - (stex-make "/release_notes"))))) - (add-after 'install-docs 'link-doc-pdfs - ;; otherwise, it's hard to notice them in a forest of HTML files - (lambda* (#:key outputs #:allow-other-keys) - (with-directory-excursion - (string-append (or (assoc-ref outputs "doc") - (assoc-ref outputs "out")) - "/share/doc/" - (strip-store-file-name #$output)) - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (match (find-files "csug" - "csug.*\\.pdf$" ;; embeded version number - #:fail-on-error? #t) - ((pth) - (symlink pth - "csug.pdf"))))))))) - (supported-systems - (delete - "armhf-linux" ;; XXX reportedly broken, needs checking - (filter chez-upstream-features-for-system - %supported-systems))) - (home-page "https://cisco.github.io/ChezScheme/") - (synopsis "R6RS Scheme compiler and run-time") - (description - "Chez Scheme is a compiler and run-time system for the language of the -Revised^6 Report on Scheme (R6RS), with numerous extensions. The compiler -generates native code for each target processor, with support for x86, x86_64, -and 32-bit PowerPC architectures.") - (license asl2.0))) - (define chez-configure ;; The custom Chez 'configure' script doesn't allow unrecognized flags, such ;; as those automatically added by `gnu-build-system`. This replacement @@ -686,39 +501,194 @@ (define-public chez-scheme-for-racket version of Chez Scheme.") (license asl2.0))) -;; -;; Bootfiles: -;; - -(define-public chez-scheme-bootstrap-bootfiles +(define-public chez-scheme (package - (inherit chez-scheme) - (name "chez-scheme-bootstrap-bootfiles") - (inputs '()) - (native-inputs '()) - (outputs '("out")) - (build-system copy-build-system) - ;; TODO: cross compilation + (name "chez-scheme") + ;; The version should match `(scheme-version-number)`. + ;; See s/cmacros.ss c. line 360. + (version "9.5.8") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) + (file-name (git-file-name name version)) + (patches (search-patches "chez-scheme-bin-sh.patch")) + (snippet #~(begin + (use-modules (guix build utils)) + ;; TODO: consider putting this in a (guix ...) or + ;; (guix build ...) module so it can be shared + ;; with the Racket origin without cyclic issues. + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))))) + (build-system gnu-build-system) + (inputs + (list + chez-scheme-bootstrap-bootfiles + `(,util-linux "lib") ;<-- libuuid + zlib + lz4 + ncurses ;<-- for expeditor + ;; for X11 clipboard support in expeditor: + ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 + libx11)) + (native-inputs (list chez-nanopass-bootstrap + stex-bootstrap)) + (native-search-paths + (list (search-path-specification + (variable "CHEZSCHEMELIBDIRS") + (files '("lib/chez-scheme"))))) + (outputs '("out" "doc")) (arguments - (list #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (list + #:modules + '((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match)) + #:test-target "test" + #:configure-flags + #~`(,(string-append "--installprefix=" #$output) + #$@(if (and=> (chez-upstream-features-for-system) + (cut memq 'threads <>)) + #~("--threads") + #~()) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do 'compress-man-pages', + ;; and letting Chez try causes an error + "--nogzip-man-pages") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (begin + (copy-recursively + (dirname (search-input-file %build-inputs + "lib/chez-scheme/nanopass.ss")) + "nanopass" + #:keep-mtime? #t) + (mkdir-p "stex") + (with-output-to-file "stex/Mf-stex" + (lambda () + ;; otherwise, it will try to download submodules + (display "# to placate ../configure")))))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (when (directory-exists? "boot") + (delete-file-recursively "boot")) + (copy-recursively + (search-input-directory inputs + "lib/chez-scheme-bootfiles") + "boot"))) + ;; NOTE: The custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. This replacement phase uses only + ;; the explicitly provided `#:configure-flags`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) out-of-source? + #:allow-other-keys) + (let* ((abs-srcdir (getcwd)) + (srcdir (if out-of-source? + (string-append "../" (basename abs-srcdir)) + "."))) + (format #t "source directory: ~s (relative from build: ~s)~%" + abs-srcdir srcdir) + (if out-of-source? + (begin + (mkdir "../build") + (chdir "../build"))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" configure-flags) + (apply invoke + (string-append srcdir "/configure") + configure-flags)))) + (add-after 'configure 'configure-environment-variables + (lambda args + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + ;; Likewise, some tests have needed HOME to be set: + (setenv "HOME" "/tmp"))) + ;; The binary file name is called "scheme" as is the one from + ;; MIT/GNU Scheme. We add a symlink to use in case both are + ;; installed. + (add-after 'install 'install-symlink + (lambda* (#:key outputs #:allow-other-keys) + (let* ((scheme (search-input-file outputs "/bin/scheme")) + (bin-dir (dirname scheme))) + (symlink scheme + (string-append bin-dir "/chez-scheme")) + (match (find-files (string-append bin-dir "/../lib") + "scheme.boot") + ((scheme.boot) + (symlink scheme.boot + (string-append (dirname scheme.boot) + "/chez-scheme.boot"))))))) + ;; Building the documentation requires stex and a running scheme. + (add-after 'install-symlink 'install-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((doc-prefix (or (assoc-ref outputs "doc") + (assoc-ref outputs "out"))) + (chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) + (doc-dir (string-append doc-prefix + "/share/doc/" + chez+version))) + (define* (stex-make #:optional (suffix "")) + (invoke "make" "install" + (string-append "Scheme=" scheme) + (string-append "STEXLIB=" stexlib) + (string-append "installdir=" doc-dir suffix))) + (with-directory-excursion "csug" + (stex-make "/csug")) + (with-directory-excursion "release_notes" + (stex-make "/release_notes"))))) + (add-after 'install-docs 'link-doc-pdfs + ;; otherwise, it's hard to notice them in a forest of HTML files + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion + (string-append (or (assoc-ref outputs "doc") + (assoc-ref outputs "out")) + "/share/doc/" + (strip-store-file-name #$output)) + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (match (find-files "csug" + "csug.*\\.pdf$" ;; embeded version number + #:fail-on-error? #t) + ((pth) + (symlink pth + "csug.pdf"))))))))) (supported-systems - (filter (lambda (system) - (and=> (chez-upstream-features-for-system system) - (cut memq 'bootstrap-bootfiles <>))) - %supported-systems)) - (synopsis "Chez Scheme bootfiles (binary seed)") + (delete + "armhf-linux" ;; XXX reportedly broken, needs checking + (filter chez-upstream-features-for-system + %supported-systems))) + (home-page "https://cisco.github.io/ChezScheme/") + (synopsis "R6RS Scheme compiler and run-time") (description - "Chez Scheme is a self-hosting compiler: building it requires -``bootfiles'' containing the Scheme-implemented portions compiled for the -current platform. (Chez can then cross-compile bootfiles for all other -supported platforms.) + "Chez Scheme is a compiler and run-time system for the language of the +Revised^6 Report on Scheme (R6RS), with numerous extensions. The compiler +generates native code for each target processor, with support for x86, x86_64, +and 32-bit PowerPC architectures.") + (license asl2.0))) -This package provides bootstrap bootfiles for upstream Chez Scheme. -Currently, it simply packages the binaries checked in to the upstream -repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to -work with upstream Chez Scheme so that we can bootstrap these files from -source."))) +;; +;; Bootfiles: +;; (define-public chez-scheme-for-racket-bootstrap-bootfiles (package @@ -800,6 +770,36 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles 7.1 and later, including the Racket BC variant.") (license asl2.0))) +(define-public chez-scheme-bootstrap-bootfiles + (package + (inherit chez-scheme) + (name "chez-scheme-bootstrap-bootfiles") + (inputs '()) + (native-inputs '()) + (outputs '("out")) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (supported-systems + (filter (lambda (system) + (and=> (chez-upstream-features-for-system system) + (cut memq 'bootstrap-bootfiles <>))) + %supported-systems)) + (synopsis "Chez Scheme bootfiles (binary seed)") + (description + "Chez Scheme is a self-hosting compiler: building it requires +``bootfiles'' containing the Scheme-implemented portions compiled for the +current platform. (Chez can then cross-compile bootfiles for all other +supported platforms.) + +This package provides bootstrap bootfiles for upstream Chez Scheme. +Currently, it simply packages the binaries checked in to the upstream +repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to +work with upstream Chez Scheme so that we can bootstrap these files from +source."))) + ;; ;; Chez's bootstrap dependencies: ;; From patchwork Fri Mar 29 05:18:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 62353 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7B5A427BBE2; Fri, 29 Mar 2024 05:20:54 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D209B27BBEA for ; Fri, 29 Mar 2024 05:20:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rq4fI-0003Sl-Lc; Fri, 29 Mar 2024 01:20:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq4ep-0003Jc-PH for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:07 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq4ep-00068j-Fp for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rq4eq-0004zy-EC; Fri, 29 Mar 2024 01:20:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70065] [PATCH 4/6] gnu: chez-scheme: Update to 10.0.0. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com, philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Fri, 29 Mar 2024 05:20:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70065 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70065@debbugs.gnu.org Cc: Andrew Tropin , Katherine Cox-Buday , Liliana Marie Prikler , Philip McGrath X-Debbugs-Original-Xcc: Andrew Tropin , Katherine Cox-Buday , Liliana Marie Prikler , Philip McGrath Received: via spool by 70065-submit@debbugs.gnu.org id=B70065.171168956919122 (code B ref 70065); Fri, 29 Mar 2024 05:20:04 +0000 Received: (at 70065) by debbugs.gnu.org; 29 Mar 2024 05:19:29 +0000 Received: from localhost ([127.0.0.1]:41494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4eF-0004yF-LB for submit@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:29 -0400 Received: from wfhigh2-smtp.messagingengine.com ([64.147.123.153]:54093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4e0-0004wg-3X for 70065@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:17 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 2B5C218000F1 for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 29 Mar 2024 01:19:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1711689544; x=1711775944; bh=0WBNIW92DLokPdD1YMHEZMuWmocdLqN9 5kt3C6QB4uI=; b=iBl+btoQZIxnfAZm56hoM4WJaEq+MgkrA4Uib7UbeFeyCd7H 5OFc1mY/MultUF6bokJaTH2ACW0bMbtA4ksn7uNRAAzR+Tie22oBafBUYWRfoB+y Mk0LkHAm+MDQxzV5g68ZNlOB8C8bjlYwGz+qIHXOZd72VJ4T+Fn83f5N5qNid3MC lgYmXxzzrhX+hjSI+U8AxgbLr1TskNLFHuzUzzPKkDf7YQHos7FytLRuAyJ64Zk/ lOQmaHLoXYZ5WhViczSSe5xUPNJGJ1uMHyzHD+2e1T6W77PoomEp+cA3eb7aBOYr +561qadcVGsrgVNsA0UEeL/CD7g+KbMAHS3rYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1711689544; x=1711775944; bh=0WBNIW92DLokP dD1YMHEZMuWmocdLqN95kt3C6QB4uI=; b=l8641E2J6mebzbEcmm0/K33kjB8jm 8wF0Rk33yXpaHo1+idpronUkGPW5m8IBYYivnqvvvmXfH7+ugLDrDBAlZ/x4Ii0y m/AfC7e9xmk6H0RelCnGFAa4PB3ux2ssKAu0Nb1Zpgxpdx47IX0ERMNaRhAHnNnK nCpWVS+LpjgoFGAQx5Asxfq7sQTbpkGEisB/AXSrKax5BsWHVRhNJ+36UMT11fVt d0Evt7UtEncwObc/eaX70BwbHpzT2Tmg03NsAXShYjDA2cCeuer0q+VnrmNAxq0z IBh/4Tl1cTc0azuMNsCJ15Ylo/2ozdar3mGcqgL8FoS+8ke81FdJLmaZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddvtddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefrhhhilhhi phcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh eqnecuggftrfgrthhtvghrnhepudeigedvhfeuteetveektdeffeettdfhkeehudehtdel leetteeigedvjeeufffhnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuh gsrdhiohdpnhhonhhgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtoh hm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:04 -0400 (EDT) From: Philip McGrath Date: Fri, 29 Mar 2024 01:18:53 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/chez-scheme-bin-sh.patch: Refresh patch. * gnu/packages/patches/chez-scheme-backport-configure.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez.scm (chez-scheme): Update to 10.0.0. Inherit from 'chez-scheme-for-racket'. [source]: Use "chez-scheme-backport-configure.patch". : Also unbundle Zuo. [native-inputs, native-search-paths, outputs, arguments] [supported-systems]: Inherit from 'chez-scheme-for-racket'. [inputs]: Likewise, replacing the bootfile package and adding libx11. [description]: Update based on the User's Guide, release notes, man page, and README file. (chez-scheme-bootstrap-bootfiles)[supported-systems]: All systems are now supported. (chez-scheme-for-system): Deprecate it, since 'chez-scheme' now supports all systems. (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex) (chez-fmt, chez-mit, chez-scmutils)[native-inputs]: Use 'chez-scheme' instead of 'chez-scheme-for-system'. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez)[inputs]: Likewise. Change-Id: I287ff66f385f20e69c1411abcc94f19dd45870c5 --- gnu/local.mk | 1 + gnu/packages/chez.scm | 222 ++------- gnu/packages/emacs-xyz.scm | 2 +- .../chez-scheme-backport-configure.patch | 463 ++++++++++++++++++ gnu/packages/patches/chez-scheme-bin-sh.patch | 37 +- 5 files changed, 522 insertions(+), 203 deletions(-) create mode 100644 gnu/packages/patches/chez-scheme-backport-configure.patch diff --git a/gnu/local.mk b/gnu/local.mk index a10aa2cefd..b5f922b538 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1017,6 +1017,7 @@ dist_patch_DATA = \ %D%/packages/patches/ccextractor-add-missing-header.patch \ %D%/packages/patches/ccextractor-autoconf-tesseract.patch \ %D%/packages/patches/ccextractor-fix-ocr.patch \ + %D%/packages/patches/chez-scheme-backport-configure.patch \ %D%/packages/patches/chez-scheme-bin-sh.patch \ %D%/packages/patches/circos-remove-findbin.patch \ %D%/packages/patches/cdparanoia-fpic.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 3b7e6a67b3..406180ce0f 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -27,6 +27,7 @@ (define-module (gnu packages chez) #:select (gpl2+ gpl3+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat public-domain)) #:use-module (guix packages) + #:use-module (guix deprecation) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) @@ -68,22 +69,9 @@ (define-module (gnu packages chez) ;; ;; Code: -(define* (chez-scheme-for-system #:optional - (system (or (%current-target-system) - (%current-system)))) - "Return 'chez-scheme' if it fully supports SYSTEM, including support for -bootstrapping and native threads. Otherwise, return -'chez-scheme-for-racket'." - (if (and=> (chez-upstream-features-for-system system) - (lambda (features) - (every (cut memq <> features) - '(threads - ;; We can cross-compile for platforms without - ;; bootstrap bootfiles, but we can't self-host - ;; on them short of adding more binary seeds. - bootstrap-bootfiles)))) - chez-scheme - chez-scheme-for-racket)) +(define-deprecated (chez-scheme-for-system #:optional system) chez-scheme + "Returns 'chez-scheme'." + chez-scheme) (define* (target-chez-arch #:optional (system (or (%current-target-system) @@ -503,10 +491,11 @@ (define-public chez-scheme-for-racket (define-public chez-scheme (package + (inherit chez-scheme-for-racket) (name "chez-scheme") - ;; The version should match `(scheme-version-number)`. + ;; The version should match `(scheme-version-number #t)`. ;; See s/cmacros.ss c. line 360. - (version "9.5.8") + (version "10.0.0") (source (origin (method git-fetch) (uri (git-reference @@ -514,9 +503,10 @@ (define-public chez-scheme (commit (string-append "v" version)))) (sha256 (base32 - "0xchqq8cm0ka5wgpn18sjs0hh15rc3nb7xrjqbbc9al3asq0d7gc")) + "1q66vafhiwk617z51qkm1v64r3bxqhhf5lzrmsa4l9d5yhvlyk09")) (file-name (git-file-name name version)) - (patches (search-patches "chez-scheme-bin-sh.patch")) + (patches (search-patches "chez-scheme-backport-configure.patch" + "chez-scheme-bin-sh.patch")) (snippet #~(begin (use-modules (guix build utils)) ;; TODO: consider putting this in a (guix ...) or @@ -525,165 +515,30 @@ (define-public chez-scheme (for-each (lambda (dir) (when (directory-exists? dir) (delete-file-recursively dir))) - '("stex" + '("lz4" "nanopass" - "lz4" - "zlib")))))) + "stex" + "zlib" + "zuo")))))) (build-system gnu-build-system) (inputs - (list - chez-scheme-bootstrap-bootfiles - `(,util-linux "lib") ;<-- libuuid - zlib - lz4 - ncurses ;<-- for expeditor - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - libx11)) - (native-inputs (list chez-nanopass-bootstrap - stex-bootstrap)) - (native-search-paths - (list (search-path-specification - (variable "CHEZSCHEMELIBDIRS") - (files '("lib/chez-scheme"))))) - (outputs '("out" "doc")) - (arguments - (list - #:modules - '((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw) - (ice-9 match)) - #:test-target "test" - #:configure-flags - #~`(,(string-append "--installprefix=" #$output) - #$@(if (and=> (chez-upstream-features-for-system) - (cut memq 'threads <>)) - #~("--threads") - #~()) - "ZLIB=-lz" - "LZ4=-llz4" - "--libkernel" - ;; Guix will do 'compress-man-pages', - ;; and letting Chez try causes an error - "--nogzip-man-pages") - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (begin - (copy-recursively - (dirname (search-input-file %build-inputs - "lib/chez-scheme/nanopass.ss")) - "nanopass" - #:keep-mtime? #t) - (mkdir-p "stex") - (with-output-to-file "stex/Mf-stex" - (lambda () - ;; otherwise, it will try to download submodules - (display "# to placate ../configure")))))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (when (directory-exists? "boot") - (delete-file-recursively "boot")) - (copy-recursively - (search-input-directory inputs - "lib/chez-scheme-bootfiles") - "boot"))) - ;; NOTE: The custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. This replacement phase uses only - ;; the explicitly provided `#:configure-flags`. - (replace 'configure - (lambda* (#:key inputs (configure-flags '()) out-of-source? - #:allow-other-keys) - (let* ((abs-srcdir (getcwd)) - (srcdir (if out-of-source? - (string-append "../" (basename abs-srcdir)) - "."))) - (format #t "source directory: ~s (relative from build: ~s)~%" - abs-srcdir srcdir) - (if out-of-source? - (begin - (mkdir "../build") - (chdir "../build"))) - (format #t "build directory: ~s~%" (getcwd)) - (format #t "configure flags: ~s~%" configure-flags) - (apply invoke - (string-append srcdir "/configure") - configure-flags)))) - (add-after 'configure 'configure-environment-variables - (lambda args - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" #$(cc-for-target)) - ;; Likewise, some tests have needed HOME to be set: - (setenv "HOME" "/tmp"))) - ;; The binary file name is called "scheme" as is the one from - ;; MIT/GNU Scheme. We add a symlink to use in case both are - ;; installed. - (add-after 'install 'install-symlink - (lambda* (#:key outputs #:allow-other-keys) - (let* ((scheme (search-input-file outputs "/bin/scheme")) - (bin-dir (dirname scheme))) - (symlink scheme - (string-append bin-dir "/chez-scheme")) - (match (find-files (string-append bin-dir "/../lib") - "scheme.boot") - ((scheme.boot) - (symlink scheme.boot - (string-append (dirname scheme.boot) - "/chez-scheme.boot"))))))) - ;; Building the documentation requires stex and a running scheme. - (add-after 'install-symlink 'install-docs - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((doc-prefix (or (assoc-ref outputs "doc") - (assoc-ref outputs "out"))) - (chez+version (strip-store-file-name #$output)) - (scheme (search-input-file outputs "/bin/scheme")) - (stexlib (search-input-directory (or native-inputs - inputs) - "/lib/stex")) - (doc-dir (string-append doc-prefix - "/share/doc/" - chez+version))) - (define* (stex-make #:optional (suffix "")) - (invoke "make" "install" - (string-append "Scheme=" scheme) - (string-append "STEXLIB=" stexlib) - (string-append "installdir=" doc-dir suffix))) - (with-directory-excursion "csug" - (stex-make "/csug")) - (with-directory-excursion "release_notes" - (stex-make "/release_notes"))))) - (add-after 'install-docs 'link-doc-pdfs - ;; otherwise, it's hard to notice them in a forest of HTML files - (lambda* (#:key outputs #:allow-other-keys) - (with-directory-excursion - (string-append (or (assoc-ref outputs "doc") - (assoc-ref outputs "out")) - "/share/doc/" - (strip-store-file-name #$output)) - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (match (find-files "csug" - "csug.*\\.pdf$" ;; embeded version number - #:fail-on-error? #t) - ((pth) - (symlink pth - "csug.pdf"))))))))) - (supported-systems - (delete - "armhf-linux" ;; XXX reportedly broken, needs checking - (filter chez-upstream-features-for-system - %supported-systems))) + (modify-inputs (package-inputs chez-scheme-for-racket) + (replace "chez-scheme-for-racket-bootstrap-bootfiles" + chez-scheme-bootstrap-bootfiles) + ;; for X11 clipboard support in expeditor: + ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 + (prepend libx11))) + ;; replace unpack phase? (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description - "Chez Scheme is a compiler and run-time system for the language of the -Revised^6 Report on Scheme (R6RS), with numerous extensions. The compiler -generates native code for each target processor, with support for x86, x86_64, -and 32-bit PowerPC architectures.") + "Chez Scheme is both a programming language and a high-performance +implementation of that language. The language is a superset of R6RS Scheme +with numerous extensions, including native threads, non-blocking I/O, local +modules, and much more. Chez Scheme compiles source expressions incrementally +to machine code, providing the speed of compiled code in an interactive +system. The system is intended to be as reliable and efficient as possible, +with reliability taking precedence over efficiency if necessary.") (license asl2.0))) ;; @@ -782,11 +637,6 @@ (define-public chez-scheme-bootstrap-bootfiles (arguments (list #:install-plan #~`(("boot/" "lib/chez-scheme-bootfiles")))) - (supported-systems - (filter (lambda (system) - (and=> (chez-upstream-features-for-system system) - (cut memq 'bootstrap-bootfiles <>))) - %supported-systems)) (synopsis "Chez Scheme bootfiles (binary seed)") (description "Chez Scheme is a self-hosting compiler: building it requires @@ -1054,7 +904,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list (chez-scheme-for-system))) + (list chez-scheme)) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -1085,7 +935,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list (chez-scheme-for-system) + (list chez-scheme ghostscript (texlive-updmap.cfg (list texlive-charter @@ -1152,7 +1002,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list (chez-scheme-for-system) + (list chez-scheme chez-web (texlive-updmap.cfg))) (arguments @@ -1238,7 +1088,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list (chez-scheme-for-system))) + (list chez-scheme)) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -1270,7 +1120,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list (chez-scheme-for-system))) + (list chez-scheme)) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -1301,7 +1151,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list (chez-scheme-for-system))) + (list chez-scheme)) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -1364,7 +1214,7 @@ (define-public chez-mit (inputs (list chez-srfi)) ; for tests (native-inputs - (list (chez-scheme-for-system))) + (list chez-scheme)) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -1395,7 +1245,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list (chez-scheme-for-system))) + (list chez-scheme)) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index d4819c62ce..731f479560 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -767,7 +767,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list (chez-scheme-for-system))) + (list chez-scheme)) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/patches/chez-scheme-backport-configure.patch b/gnu/packages/patches/chez-scheme-backport-configure.patch new file mode 100644 index 0000000000..584dcb3f0b --- /dev/null +++ b/gnu/packages/patches/chez-scheme-backport-configure.patch @@ -0,0 +1,463 @@ +From 24ab36374f2e366b6c939fffe8c129c8b0ae3b9c Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Wed, 28 Feb 2024 19:41:22 -0500 +Subject: [PATCH 1/2] Repairs and improvements for building with external + dependencies (#807) + +* configure: fix zlib and lz4 submodule checks + +Conditionals to skip the submodule checks were using the wrong +variable names, so the checks were always skipped. The correct +behavior is to perform the check unless given `ZLIB=` or +`LZ4=`, as applicable. + +* configure: support `ZUO=` + +Supplying `ZUO=` skips the submodule check in `configure` +and configures the generated makefile not to build or remove Zuo. + +* configure: support `STEXLIB=` + +For compatibility with older scripts, when not explicitly configured, +continue to honor the `STEXLIB` environment variable at build time. + +(cherry picked from commit b8838c3280ef10e115236d2f7ac9ae857f83e268) +--- + BUILDING | 5 +++-- + build.zuo | 13 +++++++++---- + configure | 40 +++++++++++++++++++++++++++++++++------- + makefiles/Makefile.in | 6 ++---- + 4 files changed, 47 insertions(+), 17 deletions(-) + +diff --git a/BUILDING b/BUILDING +index 7b3dc9c8..9e9a268b 100644 +--- a/BUILDING ++++ b/BUILDING +@@ -149,7 +149,8 @@ information on the supported options. + The generated makefile mostly just ensures that a `zuo` executable is + built in a `bin` directory, and then it defers the actual build work + to `zuo`, which uses the "main.zuo" file. If you have `zuo` installed, +-you can use `zuo` directly instead of `make`. In general, instead of ++you can use `zuo` directly instead of `make`: in that case, you may ++wish to use `./configure ZUO=`. In general, instead of + the command `make X` to build target `X` as described below, you can + use `zuo . X` (or `bin/zuo . X` after `bin/zuo` is built). + +@@ -333,7 +334,7 @@ The makefile supports several targets: + * `make clean` + + Removes all built elements from the workarea, and then removes +- `bin/zuo`. ++ `bin/zuo` (unless configured with `ZUO=`). + + + WINDOWS VIA COMMAND PROMPT +diff --git a/build.zuo b/build.zuo +index c21d2caa..c5896396 100644 +--- a/build.zuo ++++ b/build.zuo +@@ -224,10 +224,15 @@ + token)) + + (define stexlib +- (let ((found (assoc "STEXLIB" (hash-ref (runtime-env) 'env)))) +- (if found +- (cdr found) +- (at-source "stex")))) ++ (let ([configured (hash-ref config 'STEXLIB "")] ++ [env (assoc "STEXLIB" (hash-ref (runtime-env) 'env))]) ++ (cond ++ [(not (equal? "" configured)) ++ configured] ++ [env ++ (cdr env)] ++ [else ++ (at-source "stex")]))) + (define stex-sources + (source-tree stexlib)) + +diff --git a/configure b/configure +index 2b4b594e..782dd09b 100755 +--- a/configure ++++ b/configure +@@ -93,6 +93,7 @@ default_warning_flags="-Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough" + CFLAGS_ADD= + zlibLib= + LZ4Lib= ++STEXLIB= + Kernel=KernelLib + buildKernelOnly=no + enableFrompb=yes +@@ -103,6 +104,7 @@ moreBootFiles= + preloadBootFiles= + alwaysUseBootFile= + skipSubmoduleUpdate= ++zuoExternal= + + CONFIG_UNAME=`uname` + +@@ -446,6 +448,12 @@ while [ $# != 0 ] ; do + LZ4=*) + LZ4Lib=`echo $1 | sed -e 's/^LZ4=//'` + ;; ++ STEXLIB=*) ++ STEXLIB=`echo $1 | sed -e 's/^STEXLIB=//'` ++ ;; ++ ZUO=*) ++ zuoExternal=`echo $1 | sed -e 's/^ZUO=//'` ++ ;; + *) + echo "option '$1' unrecognized or missing an argument; try $0 --help" + exit 1 +@@ -672,6 +680,8 @@ if [ "$help" = "yes" ]; then + echo " STRIP= executable stripper" + echo " ZLIB= link to instead of own zlib" + echo " LZ4= link to instead of own LZ4" ++ echo " STEXLIB= build docs with instead of own stex" ++ echo " ZUO= build with instead of own Zuo" + echo "" + echo "Available machine types: $machs" + echo "" +@@ -889,28 +899,39 @@ submod_instructions () { + exit 1 + } + +-if [ ! -f "$srcdir"/zuo/configure ] ; then +- submod_instructions 'Source in "zuo" is missing' ++if [ "${zuoExternal}" = "" ] ; then ++ if [ ! -f "$srcdir"/zuo/configure ] ; then ++ submod_instructions 'Source in "zuo" is missing' ++ fi ++ ZUO="bin/zuo" ++ RM_ZUO="rm -f bin/zuo" ++ ZUO_TARGET="bin/zuo" ++else ++ ZUO="${zuoExternal}" ++ RM_ZUO="@echo 'Not cleaning external ${zuoExternal}'" ++ ZUO_TARGET="DoNotBuildZuo" + fi + + if [ ! -f "$srcdir"/nanopass/nanopass.ss ] ; then + submod_instructions 'Source in "nanopass" is missing' + fi + +-if [ "${zlibDep}" != "" ] ; then ++if [ "${zlibLib}" = "" ] ; then + if [ ! -f "$srcdir"/zlib/configure ] ; then + submod_instructions 'Source in "zlib" is missing' + fi + fi + +-if [ "${LZ4Dep}" != "" ] ; then ++if [ "${LZ4Lib}" = "" ] ; then + if [ ! -f "$srcdir"/lz4/lib/Makefile ] ; then + submod_instructions 'Source in "lz4" is missing' + fi + fi + +-if [ ! -f "$srcdir"/stex/Mf-stex ] ; then +- submod_instructions 'Source in "stex" is missing' ++if [ "${STEXLIB}" = "" ] ; then ++ if [ ! -f "$srcdir"/stex/Mf-stex ] ; then ++ submod_instructions 'Source in "stex" is missing' ++ fi + fi + + # more compile and link flags for c/Mf-unix and mats/Mf-unix +@@ -1083,7 +1104,7 @@ cp "$srcdir"/makefiles/buildmain.zuo main.zuo + # Some idea, but in the workarea, so it refers to "workarea.zuo" here: + cp "$srcdir"/makefiles/workmain.zuo $w/main.zuo + +-# The content of "$w/Makefile" records configuration decisions, ++# The content of "$w/Mf-config" records configuration decisions, + # and the Zuo build script takes it from there + cat > $w/Mf-config << END + srcdir=$srcdir +@@ -1119,6 +1140,7 @@ cursesLib=$cursesLib + ncursesLib=$ncursesLib + zlibLib=$zlibLib + LZ4Lib=$LZ4Lib ++STEXLIB=$STEXLIB + warningFlags=$warningFlags + Kernel=$Kernel + installscriptname=$installscriptname +@@ -1130,6 +1152,10 @@ preloadBootFiles=$preloadBootFiles + alwaysUseBootFile=$alwaysUseBootFile + relativeBootFiles=$relativeBootFiles + ++ZUO=$ZUO ++RM_ZUO=$RM_ZUO ++ZUO_TARGET=$ZUO_TARGET ++ + InstallBin=$installbin + InstallLib=$installlib + InstallMan=$installman/man1 +diff --git a/makefiles/Makefile.in b/makefiles/Makefile.in +index 3b95f065..0e3d307d 100644 +--- a/makefiles/Makefile.in ++++ b/makefiles/Makefile.in +@@ -3,8 +3,6 @@ workarea=$(w) + + include $(workarea)/Mf-config + +-ZUO=bin/zuo +- + .PHONY: build + build: $(ZUO) + + $(ZUO) $(workarea) MAKE="$(MAKE)" +@@ -144,9 +142,9 @@ pkg: $(ZUO) + .PHONY: clean + clean: $(ZUO) + + $(ZUO) $(workarea) clean MAKE="$(MAKE)" +- rm -f bin/zuo ++ $(RM_ZUO) + + # Using `+` here means that $(ZUO) gets built even if `-n`/`--dry-run` is provided to `make` +-$(ZUO): $(srcdir)/zuo/zuo.c ++$(ZUO_TARGET): $(srcdir)/zuo/zuo.c + + mkdir -p bin + + $(CC_FOR_BUILD) -DZUO_LIB_PATH='"'"../zuo/lib"'"' -o $(ZUO) $(srcdir)/zuo/zuo.c + +base-commit: 253230f7dfbb4fe777277d6bbf93f39f9567f086 +-- +2.41.0 + + +From 665bccc1c074131e790879adc1436f8059801171 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 17 Mar 2024 09:06:30 -0600 +Subject: [PATCH 2/2] adjust `configure ZUO=` support (#816) + +Continuing from b8838c3280, adjust the generated makefile so the +supplied `` is not a makefile dependency. That way, `ZUO=zuo` +works if `zuo` is installed and the current build directory is not the +source directory. (The `zuo` executable is a dependency in a real and +relevant sense, but not in the sense of dependencies that we normally +track in makefiles.) + +Also adapt the makefile for the case that `ZUO=...` is not supplied +and the build directory is not the source directory, in which case +`ZUO_LIB_PATH` needs to be relative to the source directory. + +Using `make ZUO=zuo` can also work, but in that case, `bin/zuo` is +still built as a dependency. It's possible that some portable makefile +magic could overcome that limitation, but it doesn't seem important. + +(cherry picked from commit d327968f37cdf669d15a9ad6d356bbf92c502bb9) +--- + configure | 3 ++ + makefiles/Makefile.in | 66 +++++++++++++++++++++---------------------- + 2 files changed, 36 insertions(+), 33 deletions(-) + +diff --git a/configure b/configure +index 782dd09b..9adae37a 100755 +--- a/configure ++++ b/configure +@@ -904,10 +904,12 @@ if [ "${zuoExternal}" = "" ] ; then + submod_instructions 'Source in "zuo" is missing' + fi + ZUO="bin/zuo" ++ ZUO_DEP="${ZUO}" + RM_ZUO="rm -f bin/zuo" + ZUO_TARGET="bin/zuo" + else + ZUO="${zuoExternal}" ++ ZUO_DEP="" + RM_ZUO="@echo 'Not cleaning external ${zuoExternal}'" + ZUO_TARGET="DoNotBuildZuo" + fi +@@ -1153,6 +1155,7 @@ alwaysUseBootFile=$alwaysUseBootFile + relativeBootFiles=$relativeBootFiles + + ZUO=$ZUO ++ZUO_DEP=$ZUO_DEP + RM_ZUO=$RM_ZUO + ZUO_TARGET=$ZUO_TARGET + +diff --git a/makefiles/Makefile.in b/makefiles/Makefile.in +index 0e3d307d..fc8605a0 100644 +--- a/makefiles/Makefile.in ++++ b/makefiles/Makefile.in +@@ -4,55 +4,55 @@ workarea=$(w) + include $(workarea)/Mf-config + + .PHONY: build +-build: $(ZUO) ++build: $(ZUO_DEP) + + $(ZUO) $(workarea) MAKE="$(MAKE)" + + .PHONY: run +-run: $(ZUO) ++run: $(ZUO_DEP) + + $(ZUO) $(workarea) run + + .PHONY: kernel +-kernel: $(ZUO) ++kernel: $(ZUO_DEP) + + $(ZUO) $(workarea) kernel MAKE="$(MAKE)" + + .PHONY: install +-install: $(ZUO) ++install: $(ZUO_DEP) + $(ZUO) $(workarea) install MAKE="$(MAKE)" + + .PHONY: uninstall +-uninstall: $(ZUO) ++uninstall: $(ZUO_DEP) + + $(ZUO) $(workarea) uninstall MAKE="$(MAKE)" + + .PHONY: test-one +-test-one: $(ZUO) ++test-one: $(ZUO_DEP) + + $(ZUO) $(workarea) test-one MAKE="$(MAKE)" + + .PHONY: test-some-fast +-test-some-fast: $(ZUO) ++test-some-fast: $(ZUO_DEP) + + $(ZUO) $(workarea) test-some-fast MAKE="$(MAKE)" + + .PHONY: test-some +-test-some: $(ZUO) ++test-some: $(ZUO_DEP) + + $(ZUO) $(workarea) test-some MAKE="$(MAKE)" + + .PHONY: test +-test: $(ZUO) ++test: $(ZUO_DEP) + + $(ZUO) $(workarea) test MAKE="$(MAKE)" + + .PHONY: test-more +-test-more: $(ZUO) ++test-more: $(ZUO_DEP) + + $(ZUO) $(workarea) test-more MAKE="$(MAKE)" + + .PHONY: coverage +-coverage: $(ZUO) ++coverage: $(ZUO_DEP) + + $(ZUO) $(workarea) coverage MAKE="$(MAKE)" + + .PHONY: bootfiles +-bootfiles: $(ZUO) ++bootfiles: $(ZUO_DEP) + + $(ZUO) $(workarea) bootfiles MAKE="$(MAKE)" + + .PHONY: reset +-reset: $(ZUO) ++reset: $(ZUO_DEP) + + $(ZUO) $(workarea) reset MAKE="$(MAKE)" + + # Supply XM= to build boot files for +@@ -61,90 +61,90 @@ boot: + + $(ZUO) $(workarea) boot "$(XM)" MAKE="$(MAKE)" + + # `.boot` as alias for `boot XM=` +-%.boot: $(ZUO) ++%.boot: $(ZUO_DEP) + + $(ZUO) $(workarea) boot $* MAKE="$(MAKE)" + + .PHONY: auto.boot +-auto.boot: $(ZUO) ++auto.boot: $(ZUO_DEP) + + $(ZUO) $(workarea) boot MAKE="$(MAKE)" + + SCHEME=scheme + + .PHONY: cross.boot +-cross.boot: $(ZUO) ++cross.boot: $(ZUO_DEP) + + $(ZUO) $(workarea) boot SCHEME="$(SCHEME)" MAKE="$(MAKE)" + + .PHONY: re.boot +-re.boot: $(ZUO) ++re.boot: $(ZUO_DEP) + + $(ZUO) $(workarea) reboot SCHEME="$(SCHEME)" + + # Supply XM= to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine + .PHONY: bootquick +-bootquick: $(ZUO) ++bootquick: $(ZUO_DEP) + + $(ZUO) $(workarea) bootquick "$(XM)" MAKE="$(MAKE)" + + # `.bootquick` as alias for `boot XM=` +-%.bootquick: $(ZUO) ++%.bootquick: $(ZUO_DEP) + + $(ZUO) $(workarea) bootquick $* MAKE="$(MAKE)" + +-auto.bootquick: $(ZUO) ++auto.bootquick: $(ZUO_DEP) + + $(ZUO) $(workarea) bootquick MAKE="$(MAKE)" + + # Supply XM=-.bootpbchunk to repackage boot files for + # with pbchunk sources, including additional + # boot files + .PHONY: bootpbchunk +-bootpbchunk: $(ZUO) ++bootpbchunk: $(ZUO_DEP) + + $(ZUO) $(workarea) bootpbchunk "$(XM)" $(ARGS) MAKE="$(MAKE)" + + # `.bootpbchunk` as alias for `pbchunk XM=` +-%.bootpbchunk: $(ZUO) ++%.bootpbchunk: $(ZUO_DEP) + + $(ZUO) $(workarea) bootpbchunk $* $(ARGS) MAKE="$(MAKE)" + + .PHONY: docs +-docs: build $(ZUO) ++docs: build $(ZUO_DEP) + + $(ZUO) $(workarea) docs MAKE="$(MAKE)" + + .PHONY: csug +-csug: build $(ZUO) ++csug: build $(ZUO_DEP) + + $(ZUO) $(workarea) csug MAKE="$(MAKE)" + + .PHONY: release_notes +-release_notes: build $(ZUO) ++release_notes: build $(ZUO_DEP) + + $(ZUO) $(workarea) release_notes MAKE="$(MAKE)" + + .PHONY: install-docs +-install-docs: build $(ZUO) ++install-docs: build $(ZUO_DEP) + + $(ZUO) $(workarea) install-docs MAKE="$(MAKE)" + + .PHONY: install-csug +-install-csug: build $(ZUO) ++install-csug: build $(ZUO_DEP) + + $(ZUO) $(workarea) install-csug MAKE="$(MAKE)" + + .PHONY: install-release_notes +-install-release_notes: build $(ZUO) ++install-release_notes: build $(ZUO_DEP) + + $(ZUO) $(workarea) install-release_notes MAKE="$(MAKE)" + + .PHONY: bintar +-bintar: $(ZUO) ++bintar: $(ZUO_DEP) + + $(ZUO) $(workarea) bintar MAKE="$(MAKE)" + + .PHONY: rpm +-rpm: $(ZUO) ++rpm: $(ZUO_DEP) + + $(ZUO) $(workarea) rpm MAKE="$(MAKE)" + + .PHONY: pkg +-pkg: $(ZUO) ++pkg: $(ZUO_DEP) + + $(ZUO) $(workarea) pkg MAKE="$(MAKE)" + + .PHONY: clean +-clean: $(ZUO) ++clean: $(ZUO_DEP) + + $(ZUO) $(workarea) clean MAKE="$(MAKE)" + $(RM_ZUO) + + # Using `+` here means that $(ZUO) gets built even if `-n`/`--dry-run` is provided to `make` + $(ZUO_TARGET): $(srcdir)/zuo/zuo.c + + mkdir -p bin +- + $(CC_FOR_BUILD) -DZUO_LIB_PATH='"'"../zuo/lib"'"' -o $(ZUO) $(srcdir)/zuo/zuo.c ++ + $(CC_FOR_BUILD) -DZUO_LIB_PATH='"'"$(upsrcdir)/zuo/lib"'"' -o $(ZUO) $(srcdir)/zuo/zuo.c +-- +2.41.0 + diff --git a/gnu/packages/patches/chez-scheme-bin-sh.patch b/gnu/packages/patches/chez-scheme-bin-sh.patch index 7650914f01..c2a4b292f7 100644 --- a/gnu/packages/patches/chez-scheme-bin-sh.patch +++ b/gnu/packages/patches/chez-scheme-bin-sh.patch @@ -1,6 +1,6 @@ -From 3c838e6a0c3214d95bf02048cddccfd1b69a679f Mon Sep 17 00:00:00 2001 +From b8428ad25b437acf4bd8210b14db207b71fe44c3 Mon Sep 17 00:00:00 2001 From: Philip McGrath -Date: Thu, 19 May 2022 13:41:56 -0400 +Date: Wed, 24 Aug 2022 19:55:14 -0400 Subject: [PATCH] patch s_process for "/bin/sh" on Guix If: @@ -14,22 +14,27 @@ then `s_process` will call `execl` with the file specified by `_PATH_BSHELL` instead of "/bin/sh". Checking that the path specified by `_PATH_BSHELL` exists safeguards -against obscure errors if attempting to use stand-alone executables -built by the patched Racket in non-Guix envoronments. +against obscure errors if attempting to use the patched Chez Scheme +or executables it builds in non-Guix envoronments. This patch does not change the behavior of `s_system`, which relies on `system` from the C library. --- + +Notes: + See also racket-chez-scheme-bin-sh.patch, racket-rktio-bin-sh.patch, + and zuo-bin-sh.patch. + c/prim5.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/c/prim5.c b/c/prim5.c -index 5a07893..bc2736c 100644 +index 90b087f1..284f063f 100644 --- a/c/prim5.c +++ b/c/prim5.c -@@ -23,6 +23,12 @@ - #include - #include +@@ -27,6 +27,12 @@ + #include + #endif +/* BEGIN PATCH for Guix */ +#ifndef WIN32 @@ -39,8 +44,8 @@ index 5a07893..bc2736c 100644 + /* locally defined functions */ static INT s_errno(void); - static iptr s_addr_in_heap(uptr x); -@@ -746,6 +752,17 @@ static ptr s_process(char *s, IBOOL stderrp) { + static IBOOL s_addr_in_heap(uptr x); +@@ -875,6 +881,17 @@ static ptr s_process(char *s, IBOOL stderrp) { INT tofds[2], fromfds[2], errfds[2]; struct sigaction act, oint_act; @@ -58,10 +63,10 @@ index 5a07893..bc2736c 100644 if (pipe(tofds)) S_error("process","cannot open pipes"); if (pipe(fromfds)) { -@@ -771,7 +788,9 @@ static ptr s_process(char *s, IBOOL stderrp) { - CLOSE(1); if (dup(fromfds[1]) != 1) _exit(1); - CLOSE(2); if (dup(stderrp ? errfds[1] : 1) != 2) _exit(1); - {INT i; for (i = 3; i < NOFILE; i++) (void)CLOSE(i);} +@@ -911,7 +928,9 @@ static ptr s_process(char *s, IBOOL stderrp) { + } + } + #endif /* __GNU__ Hurd */ - execl("/bin/sh", "/bin/sh", "-c", s, NULL); + /* BEGIN PATCH for Guix */ + execl(guix_sh, guix_sh, "-c", s, NULL); @@ -70,7 +75,7 @@ index 5a07893..bc2736c 100644 /*NOTREACHED*/ } else { -base-commit: 9df56e7b25bc523663eac3da24be33afc5f76c84 +base-commit: 253230f7dfbb4fe777277d6bbf93f39f9567f086 -- -2.32.0 +2.41.0 From patchwork Fri Mar 29 05:18:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 62351 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 76F1E27BBE9; Fri, 29 Mar 2024 05:20:44 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 40F4E27BBE2 for ; Fri, 29 Mar 2024 05:20:42 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rq4fG-0003QP-36; Fri, 29 Mar 2024 01:20:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq4eo-0003JD-Pu for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq4eo-00067J-GH for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rq4ep-0004zh-Ic; Fri, 29 Mar 2024 01:20:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70065] [PATCH 5/6] gnu: chez-scheme: Update and simplify machine-type handling. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Fri, 29 Mar 2024 05:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70065 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70065@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 70065-submit@debbugs.gnu.org id=B70065.171168956119099 (code B ref 70065); Fri, 29 Mar 2024 05:20:03 +0000 Received: (at 70065) by debbugs.gnu.org; 29 Mar 2024 05:19:21 +0000 Received: from localhost ([127.0.0.1]:41490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4e8-0004xo-Mq for submit@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:21 -0400 Received: from wfout2-smtp.messagingengine.com ([64.147.123.145]:38521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4e1-0004wi-Pc for 70065@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:14 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.west.internal (Postfix) with ESMTP id 052DD1C000A6 for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 29 Mar 2024 01:19:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1711689546; x=1711775946; bh=l99BGI7dBeu6d8SAQn/mt lZ+Mp4fNGrNbT7WRFCLA+I=; b=ECMVpEuTbyNrQv12u2ZRgHy57FfynM6NaKtHB ZFUIkFFQkBltdOsCFHVRqWYXFKSKcjrSeosm3NFSUothRS0+uyPZiHb/VnJIKHbP F+/Ej7wiAt2/wHp8wL9LB7MrMjunoyjwjGFPATVJLLVml1+A41CeenNVcJ5hJZjw S3AyDmLKIV8OtfiAjAtWPXkiOvmPP53Hf1+9yKHyxvWLNzt8DxPTt8rhRfbEZhLF SQEE9bfJ7bnV6vvC/ZbYHOhV+AFLW/EHUXiZ0AugwUcA0uAPU50RmN4iL1A8dp/F x4aON0z0tOBcQC7Tu87Q+KrxdOiRUVNMSwsfwgKv/M3JN11AA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1711689546; x= 1711775946; bh=l99BGI7dBeu6d8SAQn/mtlZ+Mp4fNGrNbT7WRFCLA+I=; b=p GsxRf/MQP7SUzI/xFfRRtCPjfQXkPdMZbj58u3dyfCGhpVaYS9LswMihVd3+o918 EG/faRUl6puIcS2dlM1/jVpTdkuWB08mSedgkKo2XsVZZ/eFkPNK6NkL/GkhEo93 e47D82Plr6tTV4DT8MoHMKDibVAqIZRJxx+uIWAcFyQ7WilJs5v7UFf+cn75X0N9 mFoQkVoVKGg7n4zqwAlYr0S1yKnpGalX3Mw2lEKOJH6AvZoFeQC0nFo8wmAu2nwr NiwxIWqNr/N6P5VjwqWYo5vV5SuLHUOqTk/hw6bZPLPCE5ae9m2ljzFH/4TX0Hvr 3dihZRgZFYWbGpce+tzvA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddvtddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhggtgfgsehtke ertdertdejnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphhhilhhiphes phhhihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnhephffgieefhf egieelhfehvdekteekvdffkeeiieekhffglefhkeeigffggeevheevnecuffhomhgrihhn peguihhstghouhhrshgvrdhgrhhouhhpnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgt ohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:06 -0400 (EDT) From: Philip McGrath Date: Fri, 29 Mar 2024 01:18:54 -0400 Message-ID: <1b01392a622c3ba51360ffccfa1746738fc39837.1711688274.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Since Chez Scheme 10.0.0 supports all of the backends added in Racket's branch, the complexity of '%chez-features-table' is no longer needed. Ideally, even more of this logic could be maintained upstream, but this change will simplify maintenance in the mean time. * gnu/packages/chez.scm (target-chez-arch): Recognize loongarch64. (chez-upsteam-features-for-system): Remove function. (%chez-features-table): Replace with ... (define-machine-types, %machine-types): ... this new macro and variable, using the list copied directly from the Chez Scheme source code. (nix-system->pbarch-machine-type): Update docstring, since pbarch machine types are supported upstream as of Chez Scheme 10.0.0. (racket-cs-native-supported-system?): Replace with ... (nix-system->native-chez-machine-type): ... this new function, implemented using '%machine-types'. (chez-scheme-for-racket): Update accordingly. (chez-scheme-for-racket-bootstrap-bootfiles): Likewise. * gnu/packages/racket.scm (racket-vm-cs): Likewise. Change-Id: I46efebaf48cce388075ab4873c16a6f5f9692bb7 --- gnu/packages/chez.scm | 197 ++++++++++++++++------------------------ gnu/packages/racket.scm | 4 +- 2 files changed, 81 insertions(+), 120 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 406180ce0f..3f9bdbfbfc 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -50,7 +50,7 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (chez-scheme-for-system - racket-cs-native-supported-system? + nix-system->native-chez-machine-type nix-system->pbarch-machine-type unpack-nanopass)) @@ -93,6 +93,8 @@ (define* (target-chez-arch #:optional (system "ppc32") ((target-riscv64? system) "rv64") + ((string-prefix? "loongarch64-" system) + "la64") (else #f))) @@ -127,111 +129,67 @@ (define* (target-chez-os #:optional (system (or (%current-target-system) (else #f))) -(define %chez-features-table - ;; An alist of alists mapping: - ;; os -> arch -> (or/c #f (listof symbol?)) - ;; where: - ;; - `os` is a string for the OS part of a Chez Scheme machine type; and - ;; - `arch` is a string for the architecture part of a Chez machine type. - ;; - ;; The absence of an entry for a given arch--os pair means that neither - ;; upstream Chez Scheme nor the Racket variant can generate native code for - ;; that system. (The Racket variant can still provide support via its - ;; ``portable bytecode'' backends and optional compilation to C.) A value - ;; of `#f` means that upstream Chez Scheme does not support the arch--os - ;; pair at all, but the Racket variant does. A list has the same meaning as - ;; a result from `chez-upstream-features-for-system`. - ;; - ;; The arch--os pairs marked "commented out" have been commented out in the - ;; STeX source for the upstream release notes since the initial release as - ;; free software, but they are reported to work and/or have been described - ;; as supported by upstream maintainers. - ;; - ;; For this overall approach to make sense, we assume that Racket's variant - ;; of Chez Scheme can generate native code for a superset of the platforms - ;; supported upstream, supports threads on all platforms it supports at all - ;; (because they are needed for Racket), and doesn't need bootstrap - ;; bootfiles. Those assumptions have held for several years. - '(;; Linux - ("le" - ("i3" threads bootstrap-bootfiles) - ("a6" threads bootstrap-bootfiles) - ("arm32" bootstrap-bootfiles) - ("arm64" . #f) - ("rv64" . #f) - ("ppc32" threads)) - ;; Hurd - ("gnu" - ("i3" . #f)) - ;; FreeBSD - ("fb" - ("i3" threads) ;; commented out - ("a6" threads) ;; commented out - ("arm32" . #f) - ("arm64" . #f) - ("ppc32" . #f)) - ;; OpenBSD - ("ob" - ("i3" threads) ;; commented out - ("a6" threads) ;; commented out - ("arm32" . #f) - ("arm64" . #f) - ("ppc32" . #f)) - ;; NetBSD - ("nb" - ("i3" threads) ;; commented out - ("a6" threads) ;; commented out - ("arm32" . #f) - ("arm64" . #f) - ("ppc32" . #f)) - ;; OpenSolaris / OpenIndiana / Illumos - ("s2" - ("i3" threads) ;; commented out - ("a6" threads)) ;; commented out - ;; QNX - ("qnx" - ("i3" . #f)) - ;; Windows - ("nt" - ("i3" threads bootstrap-bootfiles) - ("a6" threads bootstrap-bootfiles) - ;; ^ threads "experiemental", but reportedly fine - ("arm64" . #f)) - ;; Darwin - ("osx" - ("i3" threads bootstrap-bootfiles) - ("a6" threads bootstrap-bootfiles) - ("arm64" . #f) - ("ppc32" . #f)))) - -(define* (chez-upstream-features-for-system #:optional - (system - (or (%current-target-system) - (%current-system)))) - "Return a list of symbols naming features supported by upstream Chez Scheme -for the Nix system identifier SYSTEM, or @code{#f} if upstream Chez Scheme -does not support SYSTEM at all. - -If native threads are supported, the returned list will include -@code{'threads}. If bootstrap bootfiles for SYSTEM are distributed in the -upstream Chez Scheme repository, the returned list will include -@code{'bootstrap-bootfiles}. Other feature symbols may be added in the -future." - (let ((chez-arch (target-chez-arch system)) - (chez-os (target-chez-os system))) - (and=> (assoc-ref %chez-features-table chez-os) - (cut assoc-ref <> chez-arch)))) +(define-syntax define-machine-types + (lambda (stx) + (syntax-case stx (any) + ((_ any id0 id ...) + #`(define #,(datum->syntax #'id0 '%machine-types) + '(id0 id ...)))))) +;; The following is copied from s/cmacros.ss, line 36, in the Chez source +(define-machine-types + any + pb tpb + pb32l tpb32l + pb32b tpb32b + pb64l tpb64l + pb64b tpb64b + i3nt ti3nt + i3osx ti3osx + i3le ti3le + i3fb ti3fb + i3ob ti3ob + i3nb ti3nb + i3s2 ti3s2 + i3qnx ti3qnx + i3gnu ti3gnu + a6nt ta6nt + a6osx ta6osx + a6le ta6le + a6fb ta6fb + a6ob ta6ob + a6nb ta6nb + a6s2 ta6s2 + ppc32osx tppc32osx + ppc32le tppc32le + ppc32fb tppc32fb + ppc32ob tppc32ob + ppc32nb tppc32nb + arm32le tarm32le + arm32fb tarm32fb + arm32ob tarm32ob + arm32nb tarm32nb + arm64nt tarm64nt + arm64osx tarm64osx + arm64le tarm64le + arm64fb tarm64fb + arm64ob tarm64ob + arm64nb tarm64nb + rv64le trv64le + rv64fb trv64fb + rv64ob trv64ob + rv64nb trv64nb + la64le tla64le +) (define* (nix-system->pbarch-machine-type #:optional (system (or (%current-target-system) (%current-system))) #:key (threads? #t)) - "Return a string naming the pseudo–machine type used by Racket's variant of -Chez Scheme to represent the appropriate ``pbarch'' backend for SYSTEM: that -is, the ``portable bytecode'' backend specialized for SYSTEM's word size and -endianness. The result will name the threaded machine type unless THREADS? is -provided and is #f." + "Return a string naming the Chez Scheme machine type of the appropriate +``pbarch'' backend for SYSTEM: that is, the ``portable bytecode'' backend +specialized for SYSTEM's word size and endianness. The result will name the +threaded machine type unless THREADS? is provided as #f." (string-append (if threads? "t" "") @@ -243,20 +201,23 @@ (define* (nix-system->pbarch-machine-type #:optional "l" "b"))) -(define* (racket-cs-native-supported-system? #:optional - (system - (or (%current-target-system) - (%current-system)))) - "Can Racket's variant of Chez Scheme generate native code for SYSTEM? If -so, return the applicable machine type as a string. Otherwise, when SYSTEM -can use only the ``portable bytecode'' backends, return #f." - (let ((chez-arch (target-chez-arch system)) - (chez-os (target-chez-os system))) - (and (and=> (assoc-ref %chez-features-table chez-os) - ;; NOT assoc-ref: supported even if cdr is #f - (cut assoc chez-arch <>)) - (string-append "t" chez-arch chez-os)))) - +(define* (nix-system->native-chez-machine-type #:optional + (system + (or (%current-target-system) + (%current-system))) + #:key (threads? #t)) + "Return a string naming the Chez Scheme machine type of the native-code +backend for SYSTEM, if such a native-code backend exists. Otherwise, when +SYSTEM can use only the ``portable bytecode'' backends, return #f. The result +will name the threaded machine type unless THREADS? is provided as #f." + (let* ((chez-arch (target-chez-arch system)) + (chez-os (target-chez-os system)) + (machine + (and chez-arch chez-os + (string-append (if threads? "t" "") chez-arch chez-os)))) + (and machine + (memq (string->symbol machine) %machine-types) + machine))) ;; ;; Chez Scheme: ;; @@ -300,7 +261,7 @@ (define-public chez-scheme-for-racket (version "9.9.9-pre-release.23") (source #f) (build-system gnu-build-system) - (inputs `(,@(if (racket-cs-native-supported-system?) + (inputs `(,@(if (nix-system->native-chez-machine-type) '() (list libffi)) ,chez-scheme-for-racket-bootstrap-bootfiles @@ -353,10 +314,10 @@ (define-public chez-scheme-for-racket (search-input-directory %build-inputs "/include/X11")) '() '("--disable-x11")) - #$(string-append "-m=" (or (racket-cs-native-supported-system?) + #$(string-append "-m=" (or (nix-system->native-chez-machine-type) (nix-system->pbarch-machine-type))) ;; ^ could skip -m= for non-cross non-pbarch builds - #$@(if (racket-cs-native-supported-system?) + #$@(if (nix-system->native-chez-machine-type) #~() ;; not inferred on non-native platforms: see ;; https://racket.discourse.group/t/950/9 @@ -585,7 +546,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (invoke "./configure" "--force" ; don't complain about missing bootfiles #$(string-append - "-m=" (or (racket-cs-native-supported-system?) + "-m=" (or (nix-system->native-chez-machine-type) (nix-system->pbarch-machine-type))) "ZUO=zuo" ;; ignore submodules: diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d366f89845..f50f6f3eab 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -433,7 +433,7 @@ (define-public racket-vm-cs (inputs (let ((inputs (modify-inputs (package-inputs racket-vm-cgc) (prepend zlib lz4)))) - (if (racket-cs-native-supported-system?) + (if (nix-system->native-chez-machine-type) (modify-inputs inputs (delete "libffi")) inputs))) @@ -461,7 +461,7 @@ (define-public racket-vm-cs #+(this-package-native-input "chez-scheme-for-racket") "/bin/scheme") - #$@(if (racket-cs-native-supported-system?) + #$@(if (nix-system->native-chez-machine-type) #~() #~(#$(string-append "--enable-mach=" (nix-system->pbarch-machine-type)) From patchwork Fri Mar 29 05:18:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 62349 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C918D27BBEA; Fri, 29 Mar 2024 05:20:29 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BF51127BBE2 for ; Fri, 29 Mar 2024 05:20:27 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rq4f9-0003OV-Pg; Fri, 29 Mar 2024 01:20:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rq4ep-0003JO-7x for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rq4eo-00067b-Ty for guix-patches@gnu.org; Fri, 29 Mar 2024 01:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rq4eq-0004zq-02; Fri, 29 Mar 2024 01:20:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70065] [PATCH 6/6] gnu: chez-scheme: Bootstrap from source. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Fri, 29 Mar 2024 05:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70065 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70065@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 70065-submit@debbugs.gnu.org id=B70065.171168956719114 (code B ref 70065); Fri, 29 Mar 2024 05:20:03 +0000 Received: (at 70065) by debbugs.gnu.org; 29 Mar 2024 05:19:27 +0000 Received: from localhost ([127.0.0.1]:41492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4eE-0004yB-MU for submit@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:27 -0400 Received: from wfout2-smtp.messagingengine.com ([64.147.123.145]:57777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rq4e3-0004wr-BV for 70065@debbugs.gnu.org; Fri, 29 Mar 2024 01:19:16 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.west.internal (Postfix) with ESMTP id 8B5A71C000A5 for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 29 Mar 2024 01:19:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1711689548; x=1711775948; bh=yq81QbPyW8nLfJOKbwkZ0 m0ui5wMDlMKyykyox9aK0c=; b=LihfTXCaRsJSQ7RUdQzS+EIY14PoLigyehupJ t3Dg02EPx1CllamBmI+22sqmQ4ZWuie90pgfWoghhHnMayEOeqmaUpb6YR0gr7eF YqqTcLRTwUa7B7fdVQUR1LCoqaBmaBE8PKy/AtC+VJejv5ZvgDoMhtCqvly8I9NN 3YzM+aRXU1P+0tj/JXogLqkvI97z3ptBxnDAS0jZnasSuOdzCt1+SD+14TBpUhjS wrQ8i5fF60WgwLa0OB3kSn7HmG7i+wn/VoWkoDQm5yANc1m/NKVc1i9EW07XeGHK m/4zlXGU07VCNFiiks6PCbCgdmt2dpGil1IKo6Q8tIWYNJjMg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1711689548; x= 1711775948; bh=yq81QbPyW8nLfJOKbwkZ0m0ui5wMDlMKyykyox9aK0c=; b=C EMtTFCY8elzHffX254B+2SHKnqLZCF6jzTFzKn9nZr0jp1hcBgjZ0uZ436BPc5do Ghw7CxTHx9PsWO1DUTVlrGV24goc+rak0BhQbwL74qL7SctGBiFENanH90xkes5S sfp53XFZVNRNoJQ+WSPzt7D3mwS23eq8pTKsmdNv1jr8Woks4bDTcBUPgpB5yBED 7bbkaZsLlR3KnS2CjkVNpvB3LcQ5BRVae2mAI+KWzzHnm4cyA7H8YrTU15dKOB0f yxVPKA+Asd+ZC9pDILKG6gfLgpKxOsEivlURNKt7F38x3bqbxRAORzIV6KIjUuay wMT8xcLfZQgOZbLQCwxCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddvtddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheprfhhihhl ihhpucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeggeeuvdeuieffgeeigfegkefgfffgjeegleeghfeh fffgkeeuueffhffgieehieenucffohhmrghinheprhgrtghkvghtqdhlrghnghdrohhrgh dpghhithhhuhgsrdhiohdpughishgtohhurhhsvgdrghhrohhuphenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhlih hpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for <70065@debbugs.gnu.org>; Fri, 29 Mar 2024 01:19:07 -0400 (EDT) From: Philip McGrath Date: Fri, 29 Mar 2024 01:18:55 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/chez.scm (chez-scheme)[source]: Also unbundle pre-built boot files. (chez-scheme-bootstrap-bootfiles): Stop inheriting from 'chez-scheme'. [native-inputs]: Add 'zuo', 'chez-nanopass-bootstrap', and either 'chez-scheme-for-racket' or, for cross builds, 'chez-scheme'. [build-system]: Change to gnu-build-system. [arguments]: Change to run 'configure' and then bootstrap via `make re.boot` or, for cross builds, `make cross.boot` [synopsis, description]: Update accordingly. (chez-scheme-for-racket-bootstrap-bootfiles)[synopsis]: Write "boot files" as two words in prose. [description]: Likewise. * gnu/packages/racket.scm: Update comments. Change-Id: I55d9b57090ecaca0aa2ab19c2c3ebae2243a9173 --- gnu/packages/chez.scm | 123 +++++++++++++++++++++++++++++++--------- gnu/packages/racket.scm | 24 +++++--- 2 files changed, 112 insertions(+), 35 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 3f9bdbfbfc..11de3b9523 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -57,15 +57,54 @@ (define-module (gnu packages chez) ;; Commentary: ;; ;; The bootstrapping paths for Chez Scheme and Racket are closely -;; entwined. Racket CS (the default Racket implementation) is based on (a fork -;; of) Chez Scheme. Racket's variant of Chez Scheme shares sources for -;; nanopass and stex with upstream Chez Scheme. +;; entwined. See "Bootstrapping Racket" in the commentary on "racket.scm" for +;; details on the Racket portion of Chez Scheme's bootstrapping path. ;; -;; Racket's variant of Chez Scheme can be bootstrapped by an older Racket -;; implementation, Racket BC, which can be bootstrapped from C. Porting that -;; code to work with upstream Chez Scheme (or finding an old version that -;; does) is our best hope for some day bootstrapping upstream Chez Scheme from -;; source. +;; Chez Scheme is a self-hosting compiler. A small kernel implemented in C +;; loads "boot files" (in a custom object file format) compiled from the parts +;; of the system implemented in Chez Scheme. (While Chez Scheme generates +;; native machine code, it implements its own linker and loader.) +;; +;; As of Chez Scheme 10.0.0 (and the pre-release versions that preceded it on +;; the Racket branch), there are several ways to obtain boot files: +;; +;; 1. The Racket package "cs-bootstrap" (in the "racket/src/rktboot/" +;; directory of the main Racket Git repository) simulates enough of Chez +;; Scheme to load the Chez Scheme compiler purely from source into Racket +;; and apply the compiler to itself, producing the needed boot files +;; (albeit very slowly). +;; Any variant of Racket since version 7.1 can run the simulation. Using +;; the older Racket BC implementation, which does not depend on Chez +;; Scheme, breaks the dependency cycle. +;; However, the simulation relies on implementation details of Chez +;; Scheme, so a given version of Chez Scheme can only be bootstrapped by +;; the corresponding version of the "cs-bootstrap" package. +;; +;; 2. The Chez Scheme makefile provides a "re.boot" target for bootstrapping +;; via a different version of Chez Scheme (9.5.4 or later). +;; This path manages potential differences in implementation details +;; across Chez Scheme versions using a strategy similar to "cs-bootstrap", +;; but the compatibility shim is maintained with the Chez Scheme source +;; code (in "s/reboot.ss"). Also, it's faster, since less indirection is +;; needed. +;; +;; 3. For cross-compilation, or with an extremely similar Chez Scheme, the +;; makefile provides "cross.boot" and related targets. +;; +;; 4. The Chez Scheme Git repository includes pre-built "pb" (portable +;; bytecode) boot files, which can be used for bootstrapping on any +;; platform, but these binary files are removed from the source Guix uses. +;; +;; Concretely, we use racket-vm-bc to bootstrap chez-scheme-for-racket, which +;; we then use to bootstrap both chez-scheme and racket-vm-cs. +;; +;; In principle, it would be possible instead to use chez-scheme to bootstrap +;; chez-scheme-for-racket. However, since Racket is ultimately used for +;; bootstrapping, chez-scheme would still need to be rebuilt when Racket +;; changes, whereas treating chez-scheme as a leaf avoids having to rebuild +;; Racket when upstream Chez Scheme changes. Furthermore, since "cs-bootstrap" +;; is developed in the Racket source repository, we don't have to look for the +;; version of "cs-bootstrap" compatible with the upstream Chez Scheme release. ;; ;; Code: @@ -476,7 +515,8 @@ (define-public chez-scheme (for-each (lambda (dir) (when (directory-exists? dir) (delete-file-recursively dir))) - '("lz4" + '("boot" + "lz4" "nanopass" "stex" "zlib" @@ -572,10 +612,10 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles "/opt/racket-vm/bin/racket") "../rktboot/main.rkt")))))))) (home-page "https://pkgs.racket-lang.org/package/cs-bootstrap") - (synopsis "Chez Scheme bootfiles bootstrapped by Racket") - (description "Chez Scheme is a self-hosting compiler: building it -requires ``bootfiles'' containing the Scheme-implemented portions compiled for -the current platform. (Chez can then cross-compile bootfiles for all other + (synopsis "Chez Scheme boot files bootstrapped by Racket") + (description "Chez Scheme is a self-hosting compiler: building it requires +``boot files'' containing the Scheme-implemented portions compiled for the +current platform. (Chez can then cross-compile boot files for all other supported platforms.) The Racket package @code{cs-bootstrap} (part of the main Racket Git @@ -588,28 +628,57 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (define-public chez-scheme-bootstrap-bootfiles (package - (inherit chez-scheme) (name "chez-scheme-bootstrap-bootfiles") - (inputs '()) - (native-inputs '()) + (version (package-version chez-scheme)) + (source (package-source chez-scheme)) + (native-inputs (list chez-nanopass-bootstrap + (if (%current-target-system) + chez-scheme + chez-scheme-for-racket) + zuo)) (outputs '("out")) - (build-system copy-build-system) - ;; TODO: cross compilation + (build-system gnu-build-system) (arguments - (list #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")))) - (synopsis "Chez Scheme bootfiles (binary seed)") + (list + #:configure-flags + #~`("--force" ; don't complain about missing bootfiles + "ZLIB=-lz" "LZ4=-llz4" "STEXLIB=/GuixNotUsingStex" ; ignore submods + "ZUO=zuo" + ;; could skip -m= for non-cross non-pbarch builds + #$(string-append "-m=" (or (nix-system->native-chez-machine-type) + (nix-system->pbarch-machine-type)))) + #:make-flags + #~(list (string-append "SCHEME=" + (search-input-file %build-inputs "/bin/scheme")) + #$(if (%current-target-system) + "cross.boot" + "re.boot")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass + #$unpack-nanopass) + (replace 'configure + #$chez-configure) + (delete 'check) + (replace 'install + (lambda args + (mkdir-p (string-append #$output "/lib")) + (copy-recursively + "boot" + (string-append #$output "/lib/chez-scheme-bootfiles"))))))) + (home-page "https://cisco.github.io/ChezScheme/") + (synopsis "Bootstrapped Chez Scheme boot files") (description "Chez Scheme is a self-hosting compiler: building it requires -``bootfiles'' containing the Scheme-implemented portions compiled for the +``boot files'' containing the Scheme-implemented portions compiled for the current platform. (Chez can then cross-compile bootfiles for all other supported platforms.) -This package provides bootstrap bootfiles for upstream Chez Scheme. -Currently, it simply packages the binaries checked in to the upstream -repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to -work with upstream Chez Scheme so that we can bootstrap these files from -source."))) +This package provides boot files for the released version of Chez Scheme +bootstrapped by @code{chez-scheme-for-racket}. Chez Scheme 9.5.4 or any later +version can be used for bootstrapping. Guix ultimately uses the Racket package +@code{cs-bootstrap} to bootstrap its initial version of Chez Scheme.") + (license asl2.0))) ;; ;; Chez's bootstrap dependencies: diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index f50f6f3eab..2b20353159 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -72,6 +72,7 @@ (define-module (gnu packages racket) ;; ├── bc/ ;; ├── cs/ ;; ├── ChezScheme/ +;; ├── rktboot/ ;; ├── zuo/ ;; └── ... ;; @@ -149,14 +150,12 @@ (define-module (gnu packages racket) ;; - Racket BC [3M] needs an existing Racket to run "xform", ;; which transforms its own C source code to add additional annotations ;; for the precise garbage collector. -;; - Racket CS needs (bootfiles for) Racket's fork of Chez Scheme. -;; It also needs an existing Racket to compile Racket-implemented +;; - Racket CS needs (boot files for) the corresponding version of Chez +;; Scheme. It also needs an existing Racket to compile Racket-implemented ;; parts of the runtime system to R6RS libraries. -;; - Chez Scheme also needs bootfiles for itself, but Racket can simulate -;; enough of Chez Scheme to load Racket's fork of the Chez Scheme compiler -;; purely from source into Racket and apply the compiler to itself, -;; producing the needed bootfiles (albeit very slowly). -;; Any variant of Racket since version 7.1 can run the simulation. +;; - Chez Scheme also needs boot files for itself, but Racket BC can +;; bootstrap these using the code in "racket/src/rktboot/". +;; See the commentary in "chez.scm" for further details ;; ;; So, we build CGC to build 3M to build bootfiles and CS. ;; @@ -164,6 +163,14 @@ (define-module (gnu packages racket) ;; often use "BC" to mean "3M", consistent with `(banner)` and the ;; suffixes used on executables when more than one variant co-exists.) ;; +;; Since the pre-releases for Chez Scheme 10.0.0, all of Racket's changes have +;; been merged upstream, and development will be kept in sync going +;; forward. However, there is no plan to align the Chez Scheme and Racket +;; release cycles. For the near fulture, a given released version of Racket +;; will continue to depend on a specific pre-release version of Chez Scheme as +;; part of Racket CS's "ABI". See upstream discussion at +;; . +;; ;; One remaining bootstrapping limitation is that Racket's reader, module ;; system, and macro expander are implemented in Racket. For Racket CS, ;; they are compiled to R6RS libraries as discussed above. This note from the @@ -189,7 +196,8 @@ (define-module (gnu packages racket) ;; Zuo is notably *not* a problem for bootstrapping. The implementation is a ;; single hand-written C file designed to build with just `cc -o zuo zuo.c`, ;; even with very old or limited compilers. (We use the Autoconf support for -;; convienience.) +;; convienience.) As of Zuo 1.8, Zuo has tagged releases in its own repository +;; independent of the Racket release cycle. ;; ;; CODE: