From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +N3kFzUmGmJTJQAAgWs5BA (envelope-from ) for ; Sat, 26 Feb 2022 14:08:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uHFxFDUmGmJGYwEAauVa8A (envelope-from ) for ; Sat, 26 Feb 2022 14:08:05 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F3B2C2A05D for ; Sat, 26 Feb 2022 14:08:04 +0100 (CET) Received: from localhost ([::1]:57416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNwns-0003T1-5t for larch@yhetil.org; Sat, 26 Feb 2022 08:08:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNwl0-0000Nk-Cf for guix-patches@gnu.org; Sat, 26 Feb 2022 08:05:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNwl0-0003ZS-2y for guix-patches@gnu.org; Sat, 26 Feb 2022 08:05:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNwkz-0005cu-Sl; Sat, 26 Feb 2022 08:05:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v5 20/22] gnu: Add chez-scheme-for-racket. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Sat, 26 Feb 2022 13:05:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom , philip@philipmcgrath.com X-Debbugs-Original-Xcc: philip@philipmcgrath.com Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164588068521527 (code B ref 53878); Sat, 26 Feb 2022 13:05:05 +0000 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:45 +0000 Received: from localhost ([127.0.0.1]:54505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwke-0005b3-EP for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:44 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:39761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkK-0005ZZ-Q9 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:25 -0500 Received: by mail-qv1-f43.google.com with SMTP id a1so8844556qvl.6 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2Q1OWzRy3rV8t62kCwyjvj9dpd5izLsNY6H8+3NMcuU=; b=GOcqZASsRSiKGBVbAwtSv6TMJ4XBP/w2ICVrcx7oGtIqo5ejqyNPK58ozph8wgD/L3 HlO8TUFCKBtr3+eXtqFjdB32/BzrBd7kEUhuBZgowkbtOf/e0oZM/4Q7v2dvfpc/T/Nt M4h1Q0t4s3i/ulgmuxGi6gD1sjPdEL/ZGJIvT7xTecV2jPBjzUAzKwTkrsspXLemja3c 3QO9FaM177YnJZT/W3txeySFBgcEpo7RE8zxjyYPgzfvkXzgJfSRtMfKDzEYT+4jNfxk KUXQO/7DgtxrQjqDSpV9HJSigU0nLM8dcOK47nmbp8V0LBzweUMn1dW2XurngjvdFJgx En6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2Q1OWzRy3rV8t62kCwyjvj9dpd5izLsNY6H8+3NMcuU=; b=G1e1Lhj+TkhntqnKllwFH5/yNVEgSoihZMJpD7k/EDT5bJXL/tjjd4IcFHkXR7EQHq GtaiPP1ro0Pb+P9vcnsum7nR3auuXZWlsfhtkhlawjPTa8gxSavhmMeah7PXDGYyoOwb Gdq9wyOwRoN8G9ViMp3YVnDUCirUpH1beWb82GT1HAFwCzVn3VCeCLH6EJ4y4Ayy9Uq3 VIeldvZv+1YDA7q+WeBvzuMtyCZhVkX48tFZUMlPuSdOWykatzynDkgNFX0lrBY6TkXP tkIKgQ0K0fBWGJaJxedgbEsVZEDvMAmO6eMdfZPD6hH7KaG3pUQHZqBWtF4T4xSe/AER I6Mg== X-Gm-Message-State: AOAM531NtKAKP+E2B9O+OMk9NWQcChqIAsAZOdTONy9SyD6F1SBWnpS6 l/woGVnoXnmMg6WHYnVeNFdHZprc5gin9n7QM2w= X-Google-Smtp-Source: ABdhPJzwLzKtznRbruQAL8h0m5ckm1SWhQW0S/8enAP5Ojn13n+x/DbRJpLM/nwpCIhXkhCOduEtNQ== X-Received: by 2002:a0c:e0c4:0:b0:432:ad8a:a38f with SMTP id x4-20020a0ce0c4000000b00432ad8aa38fmr7971823qvk.65.1645880659265; Sat, 26 Feb 2022 05:04:19 -0800 (PST) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id c11-20020a05622a024b00b002ddb43850fdsm3266931qtx.15.2022.02.26.05.04.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:04:19 -0800 (PST) From: Philip McGrath Date: Sat, 26 Feb 2022 08:02:52 -0500 Message-Id: <20220226130254.1301333-21-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220226130254.1301333-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645880885; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2Q1OWzRy3rV8t62kCwyjvj9dpd5izLsNY6H8+3NMcuU=; b=ezYThqpyOjfiI41Hk3R9+YfYPmX0wQpvpeq7Kaakx97hZT7DcjHANKAZrctITkjtWmErT5 bCQQjVOSiR+cofpmvC2maBVXypss5LQJj0KTf7lz5/0KvX18+Mx0/xfIVyF+amrudKl0eS bAcx5KNp10lrs0DkcqKhzo4RGSQHTfwilOiibgGRe9brA1bfGsabG1YNmongdYOkqKr2xr TX6MLx0U2R3rMc+4OksELHtm4ZNO7pUlcnIl3W0MLNw4FdHg//BNNNitOAjIbOL9BnsIuG pECIzBAmZzquodxgRRj08dhlnJ6sNCWurV/M2yuXt3Dta0v7XWSGRNzmxk0Wbw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645880885; a=rsa-sha256; cv=none; b=Y8UOSxyTqJ8SHXxk4QNJjUXblRQHXNoJij1SwrfOjMTQAfjSZaK5d4Suoz5gG+19jnoGpZ BQlA+oC3b280AQIQMeDctN5rnBIryFHamfho/y0bDaKSSpRnXWrerMTFBukmokeQHJkX50 uFMO2531j3z+v4dgNVpXSQSlfecIyxtglaZZVE3lq94B7oQvGd82uQax1Y1bOIgxKLltyq mVywtYEQDzrL69apB3QLSuw8q5RTpRAlRsid0la44GpgKGj46rF4DVntbpAOOQ+2dQw+R9 Mgj7O+K7Sc9fsEShlFM2prEsaYKnSPNFQ5/xfTIiGZCnJf681SNQmrwxmqBI4A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=GOcqZASs; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.88 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=GOcqZASs; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: F3B2C2A05D X-Spam-Score: 2.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: YdzBCynutTaq The Racket variant of Chez Scheme can be used to support platforms that are not yet supported by upstream Chez Scheme. * gnu/packages/chez.scm (chez-scheme-for-racket): New variable. (chez-scheme-for-racket-bootstrap-bootfiles)[version, supported-systems]: Derive from 'chez-scheme-for-racket'. * gnu/packages/racket.scm (%racket-version): Update comment. --- gnu/packages/chez.scm | 97 ++++++++++++++++++++++++++++++++++++++--- gnu/packages/racket.scm | 3 +- 2 files changed, 91 insertions(+), 9 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index f258732baf..a6b5952819 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -52,6 +52,21 @@ (define-module (gnu packages chez) chez-machine->threaded unpack-nanopass+stex)) +;; 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. +;; +;; 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. +;; +;; Code: + (define (chez-machine->nonthreaded machine) "Given a string MACHINE naming a Chez Scheme machine type, returns a string naming the nonthreaded machine type for the same architecture and OS as @@ -327,6 +342,78 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license asl2.0))) +(define-public chez-scheme-for-racket + (package + (inherit chez-scheme) + (name "chez-scheme-for-racket") + (version "9.5.7.3") + ;; The version should match `(scheme-fork-version-number)`. + ;; 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 + (modify-inputs (package-inputs chez-scheme) + (delete "libx11" "util-linux:lib"))) + (native-inputs + (modify-inputs (package-native-inputs chez-scheme) + (replace "chez-scheme-bootstrap-bootfiles" + chez-scheme-for-racket-bootstrap-bootfiles))) + (arguments + (substitute-keyword-arguments (package-arguments chez-scheme) + ((#:configure-flags cfg-flags #~'()) + #~(cons "--disable-x11" #$cfg-flags)) + ((#: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")))))))) + (supported-systems (filter nix-system->chez-machine + %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 support +@item +Portable bytes (@code{pb}) support, which is mainly useful for bootstrapping +a build on any supported platform +@item +Unboxed floating-point arithmetic and flvectors +@item +Type reconstruction during optimization (especially for safe code) +@item +Continuation attachments +@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 +Faster multiplication and division for large exact numbers +@end itemize") + (license asl2.0))) + +;; +;; Bootfiles: +;; + (define-public chez-scheme-bootstrap-bootfiles (package (inherit chez-scheme) @@ -368,11 +455,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (package (inherit chez-scheme-bootstrap-bootfiles) (name "chez-scheme-for-racket-bootstrap-bootfiles") - (version "9.5.7.3") - ;; The version should match `(scheme-fork-version-number)`. - ;; 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. + (version (package-version chez-scheme-for-racket)) (source #f) ; avoid problematic cycle with racket.scm (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) ;; TODO: cross compilation @@ -398,8 +481,8 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (invoke (search-input-file (or native-inputs inputs) "/opt/racket-vm/bin/racket") "rktboot/main.rkt")))))))) - (supported-systems (filter nix-system->chez-machine - %supported-systems)) + (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 diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 9ed57e6154..3f73d6bc83 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -195,8 +195,7 @@ (define* (racket-vm-for-system #:optional racket-vm-cs racket-vm-bc)) -(define %racket-version "8.4") -;; ^ Remember to update chez-scheme-for-racket-bootstrap-bootfiles! +(define %racket-version "8.4") ; Remember to update chez-scheme-for-racket! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin -- 2.32.0