From unknown Sat Jun 21 03:29:36 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#53878 <53878@debbugs.gnu.org> To: bug#53878 <53878@debbugs.gnu.org> Subject: Status: [PATCH 00/11] Update Racket to 8.4. Adjust Chez Scheme Reply-To: bug#53878 <53878@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:29:36 +0000 retitle 53878 [PATCH 00/11] Update Racket to 8.4. Adjust Chez Scheme reassign 53878 guix-patches submitter 53878 Philip McGrath severity 53878 normal tag 53878 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:13:24 2022 Received: (at submit) by debbugs.gnu.org; 8 Feb 2022 15:13:24 +0000 Received: from localhost ([127.0.0.1]:48304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSBI-0006d8-FY for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:13:24 -0500 Received: from lists.gnu.org ([209.51.188.17]:48924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSBG-0006d1-SU for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:13:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHSBG-0007G5-Iy for guix-patches@gnu.org; Tue, 08 Feb 2022 10:13:22 -0500 Received: from [2607:f8b0:4864:20::a35] (port=45788 helo=mail-vk1-xa35.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHSBE-000755-Am for guix-patches@gnu.org; Tue, 08 Feb 2022 10:13:22 -0500 Received: by mail-vk1-xa35.google.com with SMTP id l14so9919497vko.12 for ; Tue, 08 Feb 2022 07:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZiPiADDfFL30/ot2+angaoDI+VIsbhxDMmgvstn2p9Q=; b=T1AkTCg45QXhHn9mGXkFYD+U+lTrReflBN44jS3p8rOlSVMM3AfpOEgmQ8LxJ1z6CI smpJO5aLymV9EtuaYmpKrgAEMMZpeCQAIwy4rVNZ/m8vY5eEcKACXCFGFSYLKQCHj03q /yTwA9+yDnkjnYtLlw4fH2QgYM0GQ1yIw6eSlh+N8hcQE4jChZsuIHi6c/qJOK8yqIDU GfJVPJxBO0mo/EMa0tdzswqZOMyCPlpk5A3ezZKolqomwN1gFeU7nCgQp9NnFlEzcK1S /GSr8WO97Dv7wkVHF3MJBK7ZTo7RZfrGNfz5TnxbL62e9JzEDjdKRiZXYuWpN2ZL7Ma3 5OrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZiPiADDfFL30/ot2+angaoDI+VIsbhxDMmgvstn2p9Q=; b=CdGOfPTzwDLSO140sPUz3Evos9nBWA3xwzBqGSY2PU/yKVIoz7GVTIl8cFda/VUu4S vPaziLJ0J27EzEMjGSI1MhzABuP8FnyHoT1Gl3prUwKqxnzQEUTsQLnVpn3/DNYKJrLj O8eXPzv0Ge1x8UJRwJ+LaQ4MHb76axj38rIN5MFGoOaU+sjgUrj2KTwRGR6ttn2BBOHm ETa6tNkpJSD+a10SN3nAFxLcxRoJNz5t3okPFcARYQZR5GunoWQhy2VMSrLeIB5Yg4Sb u6lsyHAAQjdJKV0VhXvjUyH0/bmD7Pia5So/cTaUKk2lLC+knGJh51f5cKN34SIZk42K Y1nQ== X-Gm-Message-State: AOAM532ecZfSi4I7zaIaVe0xjyTDfiwnudn4XBHsZGKUbVBU4lYHM+BC KUgQ0AF81BtUc0mhco9TjTT3gDwRxf2GonETOg4= X-Google-Smtp-Source: ABdhPJyq4ZVDm6B7VcUQgd5g7UYLBbs9gRbQJ61Rm866OFF6yg55ov/Z3KOm0jdpEEEWPDxW6UThbQ== X-Received: by 2002:a1f:78cd:: with SMTP id t196mr289298vkc.24.1644333198230; Tue, 08 Feb 2022 07:13:18 -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 r26sm662483uaw.12.2022.02.08.07.13.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:13:18 -0800 (PST) From: Philip McGrath To: guix-patches@gnu.org Subject: [RFC PATCH 0/9] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Tue, 8 Feb 2022 10:13:16 -0500 Message-Id: <20220208151316.1897345-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::a35 (failed) Received-SPF: neutral client-ip=2607:f8b0:4864:20::a35; envelope-from=philip@philipmcgrath.com; helo=mail-vk1-xa35.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) Racket 8.4 hasn't been released yet (expect it in a matter of days), but I wanted to solicit feedback on these changes early. On the Racket side of things, discussions upstream and with other distribution packagers have clarified what a ``minimal Racket'' package ought to consist of, which in turn suggested a nice new boundary between the lowest-level Racket VM packages, which are concerned with bootstrapping and platform support, and a more uniform use of layered and tethered installations for both the 'racket-minimal' and 'racket' packages. I've also started getting the sources for the other main-distribution Racket packages directly from their respective repositories, rather than extracting them from the bundled tarballs. All in all, it's a few steps closer to the goal of a build system for Racket packages. For Chez Scheme, I set out to package Racket's variant of Chez Scheme---which supports architectures not yet supported upstream, e.g. aarch64---and to share more between the upstream and Racket packages. I also tweaked various things I found along the way: hopefully some are clear improvements, though there are some prime opportunities for bikeshedding about naming things. Let me know what you think! -Philip Philip McGrath (9): gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: Add chez-scheme-racket-variant. gnu: racket: Update to 8.3.900. gnu/local.mk | 5 +- gnu/packages/chez-and-racket-bootstrap.scm | 1108 ++++++++++++ gnu/packages/chez.scm | 628 +++---- gnu/packages/emacs-xyz.scm | 4 +- gnu/packages/loko.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 +++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1552 +++++++++++------ 8 files changed, 2850 insertions(+), 942 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:02 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:02 +0000 Received: from localhost ([127.0.0.1]:48321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHa-0006oQ-HL for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:02 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:42540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHX-0006o7-5i for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:19:53 -0500 Received: by mail-qk1-f172.google.com with SMTP id m25so13918129qka.9 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:19:51 -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=7mMUIg0Ha/tNSMjmyEByTZqFtJw12N6jcbuEp4+cklE=; b=idKejRPvXKv8orwE+jDPD6tI+HX1WwmneQOj87z89OBHav3olZAMtTWouu2uJyaK0e vQLYEQIzSn6uz1XGlKUffEd2IMeBM7LLyb09LMeVnEEug+AZXpwvt2h0zRJcGMUCLOFf 0xPlyzyoJfw4MfA6YkBHkSswv9VKK2lHfcjQHu+YY2/E3oa4ytP19eGj2HCde85lf7Nj HvTBh9FYREH+zokVRF1LqSvJt8+pZLTerQpQd4R3X0XEhU4YaUc0Po7MAxR6WipIzj4P WS7/LNhj/SqSYvirPgKenYPkytWkhb3+a5FQiN7cFL69iN7DpJKN0JPGKe4kkC8eI09U WNlg== 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=7mMUIg0Ha/tNSMjmyEByTZqFtJw12N6jcbuEp4+cklE=; b=glVJb+04Ch9q1nQxEQ9nrQaKb5cAeihfJ3b7nhkOVXs+LyYm+By/XaSGVsKFre+JbF jrup/lQcGJndoTs4FSNXnM9afiV/jJXrYJxapbOL83sQPcW/JcvjDcSa5Bgvo9WkVEOb dkFOjAxa3a2Lks1e/aloVDBOJM9JrEQMQXdVL0eak6sj1bOVoXaJns7/iov9o7/YNcZk 07dLUTnZ+CV0uEauDEfjm0Gs2YhPlmtzsxJby29VSASmwnIX+Lf98gIZ++j3AjRlD7S5 uaVZ+yIYj0XGkkPtYiLuBgyp/YnsEiP9OEHTwnbugvQnV6PNhpJmmUKQ0obdaLJAA52p 9lTg== X-Gm-Message-State: AOAM532dVWdk+jRMlOBkEEeBn7uKtByWZPqYMkdz90uWBy0tWhFI4icM gCATAR0PJTiJAZWZMVibli8j+2kjpNKu7l/hko0= X-Google-Smtp-Source: ABdhPJwWgklzDIKq3KVk7Em4rEn+cfCBnlP7r5N5OF7Q/ERTKN/MXcP8u2sulDik/lfdGBSbXQuY6g== X-Received: by 2002:ae9:e843:: with SMTP id a64mr2820243qkg.60.1644333584926; Tue, 08 Feb 2022 07:19:44 -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 b9sm6946239qkj.24.2022.02.08.07.19.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:19:44 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 1/9] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). Date: Tue, 8 Feb 2022 10:18:49 -0500 Message-Id: <20220208151857.1900389-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151316.1897345-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (nanopass, stex, chez-scheme): Move to ... * gnu/packages/chez-and-racket-bootstrap.scm: ... this new file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/emacs-xyz.scm: Adjust imports accordingly. * gnu/packages/loko.scm: Likewise. * gnu/packages/racket.scm: Likewise. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 278 +++++++++++++++++++++ gnu/packages/chez.scm | 225 +---------------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- gnu/packages/racket.scm | 2 +- 6 files changed, 283 insertions(+), 227 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm diff --git a/gnu/local.mk b/gnu/local.mk index f14daf2edd..e3104fc0b6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -144,6 +144,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/certs.scm \ %D%/packages/check.scm \ %D%/packages/chemistry.scm \ + %D%/packages/chez-and-racket-bootstrap.scm \ %D%/packages/chez.scm \ %D%/packages/chicken.scm \ %D%/packages/chromium.scm \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm new file mode 100644 index 0000000000..f102b099fb --- /dev/null +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -0,0 +1,278 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Federico Beffa +;;; Copyright © 2016 Efraim Flashner +;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2019 Brett Gilio +;;; Copyright © 2020 Brendan Tildesley +;;; Copyright © 2021, 2022 Philip McGrath +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages chez-and-racket-bootstrap) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages compression) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages linux) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages netpbm) + #:use-module (gnu packages tex) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) + +;; Commentary: +;; +;; Alphabetically and chronologically, Chez comes before Racket. +;; +;; 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. +;; +;; Putting the relevant definitions together in this module avoids having to +;; work around dependency cycles. +;; +;; Code: + +(define nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) + +(define stex + ;; This commit includes a fix, which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (version "1.2.2") + (version (git-version version "1" commit))) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name "stex" version))))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version "9.5.6") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet + ;; Remove bundled libraries. + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib"))))))) + (build-system gnu-build-system) + (inputs + `(("libuuid" ,util-linux "lib") + ("zlib" ,zlib) + ("zlib:static" ,zlib "static") + ("lz4" ,lz4) + ("lz4:static" ,lz4 "static") + ;; for expeditor: + ("ncurses" ,ncurses) + ;; for X11 clipboard support in expeditor: + ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 + ("libx11" ,libx11))) + (native-inputs + `(("nanopass" ,nanopass) ; source only + ;; for docs + ("stex" ,stex) + ("xorg-rgb" ,xorg-rgb) + ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek))) + ("ghostscript" ,ghostscript) + ("netpbm" ,netpbm))) + (native-search-paths + (list (search-path-specification + (variable "CHEZSCHEMELIBDIRS") + (files (list (string-append "lib/csv" version "-site")))))) + (outputs '("out" "doc")) + (arguments + `(#:modules + ((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match)) + #:test-target "test" + #:configure-flags + '("--threads") ;; TODO when we fix armhf, it doesn't support --threads + #:phases + (modify-phases %standard-phases + ;; put these where configure expects them to be + (add-after 'unpack 'unpack-nanopass+stex + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (for-each (lambda (dep) + (define src + (assoc-ref (or native-inputs inputs) dep)) + (copy-recursively src dep + #:keep-mtime? #t)) + '("nanopass" "stex")))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs outputs + (configure-flags '()) + #:allow-other-keys) + (let* ((zlib-static (assoc-ref inputs "zlib:static")) + (lz4-static (assoc-ref inputs "lz4:static")) + (out (assoc-ref outputs "out")) + ;; add flags which are always required: + (flags (cons* + (string-append "--installprefix=" out) + (string-append "ZLIB=" zlib-static "/lib/libz.a") + (string-append "LZ4=" lz4-static "/lib/liblz4.a") + ;; Guix will do compress man pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" ,(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke + "./configure" + 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* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib")) + (name "chez-scheme")) + (symlink (string-append bin "/scheme") + (string-append bin "/" name)) + (map (lambda (file) + (symlink file (string-append (dirname file) + "/" name ".boot"))) + (find-files lib "scheme.boot"))))) + ;; Building explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (stex-output "/tmp") + (doc-dir (string-append stex-output + "/share/doc/" + stex+version))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/" + stex+version) + (string-append "Scheme=" + (assoc-ref outputs "out") + "/bin/scheme")) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((chez+version (strip-store-file-name + (assoc-ref outputs "out"))) + (stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + (scheme (string-append (assoc-ref outputs "out") + "/bin/scheme")) + ;; see note on stex-output in phase build-stex, above: + (stexlib (string-append "/tmp" + "/lib/" + stex+version)) + (doc-dir (string-append (assoc-ref outputs "doc") + "/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))) + ;; Chez Scheme does not have a MIPS backend. + ;; FIXME: Debian backports patches to get armhf working. + ;; We should too. It is the Chez machine type arm32le + ;; (no threaded version upstream yet, though there is in + ;; Racket's fork), more specifically (per the release notes) ARMv6. + (supported-systems (fold delete %supported-systems + '("mips64el-linux" "armhf-linux"))) + (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 license:asl2.0))) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 47904e7b4e..caf61a95f5 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,6 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Brendan Tildesley -;;; Copyright © 2021 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,234 +31,12 @@ (define-module (gnu packages chez) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (guix build-system gnu) - #:use-module (gnu packages compression) - #:use-module (gnu packages ncurses) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages ghostscript) - #:use-module (gnu packages linux) - #:use-module (gnu packages netpbm) #:use-module (gnu packages tex) - #:use-module (gnu packages compression) - #:use-module (gnu packages image) - #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) -(define nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - -(define-public chez-scheme - (package - (name "chez-scheme") - (version "9.5.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) - (build-system gnu-build-system) - (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) - (native-inputs - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) - (native-search-paths - (list (search-path-specification - (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) - (outputs '("out" "doc")) - (arguments - `(#:modules - ((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw) - (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) - ;; Chez Scheme does not have a MIPS backend. - ;; FIXME: Debian backports patches to get armhf working. - ;; We should too. It is the Chez machine type arm32le - ;; (no threaded version upstream yet, though there is in - ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) - (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-public chez-srfi (package (name "chez-srfi") diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 9b57b36623..c6a62e8767 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -145,7 +145,7 @@ (define-module (gnu packages emacs-xyz) #:use-module (gnu packages aspell) #:use-module (gnu packages audio) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages cmake) #:use-module (gnu packages code) #:use-module (gnu packages cpp) diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index ef9312afe3..74a649b8a1 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -24,7 +24,7 @@ (define-module (gnu packages loko) #:use-module (gnu packages package-management) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) - #:use-module (gnu packages chez)) + #:use-module (gnu packages chez-and-racket-bootstrap)) (define-public loko-scheme (package diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d0a5ca494b..865fdff70f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -34,7 +34,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages fontutils) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:06 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:06 +0000 Received: from localhost ([127.0.0.1]:48327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHi-0006p6-33 for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:06 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]:38606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHb-0006oE-0h for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:19:56 -0500 Received: by mail-qt1-f169.google.com with SMTP id r14so14957314qtt.5 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:19:55 -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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=K64/GPTBN/2+C41FolXWzjcATpl2ea5VeDRGqxTBF6LZ8BNso4c/TbJvJ1v22tsobz sT8DZVtHsCZmu1erVYONFKxjgEHBXyW+9Kpoc0ng9M5Az65TnGg8khPUv09nUVs1sXcF 5bJOv2b8bazHce7W4ligdRghJVAZL0m2jZ4Pv4Owm4vLgXhKkAlCVvsVVfS81CTYFHwt uhRXK6yLbhhmItrwJV9i29nWRnJ/rx+2EzjeK9blhTi4njA0h27QpH7A3hUGSh6HsXEL qWLuTt2Qak+wQstfCGL1nrLD3itqDoWljDyq2WmVFRFyHDHWFlyyBAquz/mJcUYVSzVx rrLQ== 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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=Tw+BxB1KN3WIYyNXMm9AP7bDmJRO5TIcABK3ZxT6pebUvlr8kSnJmcANQoTaGPeu5h u2vvgtLsskOx+IFeSB4fdWkXInCbGaWDMJmlY7FYC/aTik7azH+PAr4N4HBaFPX+fZI+ NoKAepyGRMraALkmWj64JLDwS8BdR7pHpnh/3ahYX/sd7uDq+2g4XcLIyia0WkNYBQOe FwVRAiIEyJb0gOHyP5iiNGzgWqYFQ3z5gxAZYlFhySrD0K13dtEcg5JRXGcwmWqbTMg1 nzfWCj3vPBYN8lKYdRCT4PC1c82cvCW5P2f/FtAXe/1C+hS115sl0bXMGBkcrPYdt8iI pmZw== X-Gm-Message-State: AOAM532B2hTgwyuJoDMjpwR4eOfkW3d+jqnCDROQvXNVzuZqO8OFSU0e P54sStBQNeu+uoBX4yfjOH8BIOfidmV2ALsxnJU= X-Google-Smtp-Source: ABdhPJw6B+3sDqJ5g0bgQUzRekg2wtLfxpinBSkz3TbDwc1wEAcN8pyk6lTpEVJI86LbMRs7oL/BcQ== X-Received: by 2002:ac8:5911:: with SMTP id 17mr3258671qty.417.1644333589042; Tue, 08 Feb 2022 07:19:49 -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 s14sm7366085qkp.79.2022.02.08.07.19.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:19:48 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 2/9] gnu: chez-scheme: Use "lib/chez-scheme" for search path. Date: Tue, 8 Feb 2022 10:18:50 -0500 Message-Id: <20220208151857.1900389-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". * gnu/packages/chez.scm (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Update accordingly. Also, remove input labels and use G-expressions. --- gnu/packages/chez-and-racket-bootstrap.scm | 2 +- gnu/packages/chez.scm | 373 +++++++++++---------- 2 files changed, 191 insertions(+), 184 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index f102b099fb..1ed4631ced 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -136,7 +136,7 @@ (define-public chez-scheme (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) + (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments `(#:modules diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index caf61a95f5..54bbee7923 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -37,6 +37,28 @@ (define-module (gnu packages chez) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) + +;; Help function for Chez Scheme to add the current path to +;; CHEZSCHEMELIBDIRS. +(define chez-configure + #~(lambda _ + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) + (setenv "CHEZSCHEMELIBDIRS" + (if chez-env + (string-append ".:" chez-env) + "."))))) + +;; Help function to define make flags for some Chez Scheme custom make +;; files. +(define (chez-make-flags name version) + #~(let ((out #$output)) + (list + ;; Set 'schemedir' so that libraries are installed in + ;; 'lib/chez-scheme' like Chez's 'native-search-paths' expects. + (string-append "schemedir=" out "/lib/chez-scheme") + (string-append "PREFIX=" out) + (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) + (define-public chez-srfi (package (name "chez-srfi") @@ -54,13 +76,11 @@ (define-public chez-srfi (native-inputs (list chez-scheme)) (arguments - `(#:make-flags (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out) - "CHEZ=chez-scheme --libdirs ./" - (string-append "chezversion=" ,(package-version chez-scheme)))) - #:test-target "test" - #:phases (modify-phases %standard-phases - (delete 'configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -85,42 +105,48 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("ghostscript" ,ghostscript) - ("texlive" ,(texlive-updmap.cfg (list texlive-oberdiek - texlive-epsf - texlive-metapost - texlive-charter - texlive-pdftex - texlive-context - texlive-cm - texlive-tex-plain))))) + (list chez-scheme + ghostscript + ;; FIXME: This package fails to build with the error: + ;; mktexpk: don't know how to create bitmap font for bchr8r + ;; Replacing the following with `texlive` fixes it. + ;; What is missing? + (texlive-updmap.cfg (list texlive-oberdiek + texlive-epsf + texlive-metapost + texlive-charter + texlive-pdftex + texlive-context + texlive-cm + texlive-tex-plain)))) (arguments - `(#:make-flags (list (string-append "PREFIX=" %output) - (string-append "DOCDIR=" %output "/share/doc/" - ,name "-" ,version) - (string-append "LIBDIR=" %output "/lib/chezweb") - (string-append "TEXDIR=" %output "/share/texmf-local")) - #:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - ;; This package has a custom "bootstrap" script that - ;; is meant to be run from the Makefile. - (delete 'bootstrap) - (replace 'configure - (lambda* _ - (copy-file "config.mk.template" "config.mk") - (substitute* "tangleit" - (("\\./cheztangle\\.ss" all) - (string-append "chez-scheme --program " all))) - (substitute* "weaveit" - (("mpost chezweb\\.mp") - "mpost --tex=tex chezweb.mp") - (("\\./chezweave" all) - (string-append "chez-scheme --program " all))) - (substitute* "installit" - (("-g \\$GROUP -o \\$OWNER") "")) - #t))))) + (list + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "DOCDIR=" #$output "/share/doc/" + #$name "-" #$version) + ;; lib/chez-scheme/chezweb ??? + (string-append "LIBDIR=" #$output "/lib/chezweb") + (string-append "TEXDIR=" #$output "/share/texmf-local")) + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + ;; This package has a custom "bootstrap" script that + ;; is meant to be run from the Makefile. + (delete 'bootstrap) + (replace 'configure + (lambda* _ + (copy-file "config.mk.template" "config.mk") + (substitute* "tangleit" + (("\\./cheztangle\\.ss" all) + (string-append "scheme --program " all))) + (substitute* "weaveit" + (("mpost chezweb\\.mp") + "mpost --tex=tex chezweb.mp") + (("\\./chezweave" all) + (string-append "scheme --program " all))) + (substitute* "installit" + (("-g \\$GROUP -o \\$OWNER") ""))))))) (home-page "https://github.com/arcfide/ChezWEB") (synopsis "Hygienic Literate Programming for Chez Scheme") (description "ChezWEB is a system for doing Knuthian style WEB @@ -144,95 +170,74 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("chez-web" ,chez-web) - ("texlive" ,(texlive-updmap.cfg (list texlive-pdftex))))) + (list chez-scheme + chez-web + (texlive-updmap.cfg (list texlive-pdftex)))) (arguments - `(#:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-web (assoc-ref inputs "chez-web")) - (chez (assoc-ref inputs "chez-scheme")) - (chez-h (dirname (car (find-files chez "scheme\\.h"))))) - (substitute* "Makefile" - (("(SCHEMEH=).*$" all var) - (string-append var chez-h))) - #t))) - (add-before 'build 'tangle - (lambda* (#:key inputs #:allow-other-keys) - (setenv "TEXINPUTS" - (string-append - (getcwd) ":" - (assoc-ref inputs "chez-web") "/share/texmf-local/tex/generic:" - ":")) - ;; just using "make" tries to build the .c files before - ;; they are created. - (and (invoke "make" "sockets") - (invoke "make")))) - (replace 'build - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - ;; make sure Chez Scheme can find the shared libraries. - (substitute* "sockets.ss" - (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" - all cmd so) - (string-append cmd " \"" chez-site "/" so "\"")) - (("sockets-stub\\.[sd][oy].*" all) - (string-append chez-site "/" all))) - ;; to compile chez-sockets, the .so files must be - ;; installed (because of the absolute path we - ;; inserted above). - (for-each (lambda (f d) (install-file f d)) - '("socket-ffi-values.so" "sockets-stub.so") - (list chez-site chez-site)) - (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) - (replace 'install - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/chez-sockets")) - (doc (string-append out "/share/doc/" ,name "-" ,version)) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - (for-each (lambda (f d) (install-file f d)) - '("sockets.pdf" "sockets.so") - (list doc chez-site)) - #t)))))) + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((scheme (search-input-file (or native-inputs inputs) + "/bin/scheme")) + (lib (string-append (dirname scheme) "/../lib")) + (header-file (car (find-files lib "scheme\\.h"))) + (include-dir (dirname header-file))) + (substitute* "Makefile" + (("(SCHEMEH=).*$" _ var) + (string-append var include-dir)))))) + (add-before 'build 'tangle + (lambda* (#:key inputs #:allow-other-keys) + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" + (assoc-ref inputs "chez-web") + "/share/texmf-local/tex/generic:" + ":")) + ;; just using "make" tries to build the .c files before + ;; they are created. + (and (invoke "make" "sockets") + (invoke "make")))) + (replace 'build + (lambda args + (let ((chez-site (string-append #$output + "/lib/chez-scheme/arcfide"))) + ;; make sure Chez Scheme can find the shared libraries. + (substitute* "sockets.ss" + (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post)) + (("(\")(sockets-stub\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post))) + ;; to compile chez-sockets, the .so files must be + ;; installed (because of the absolute path we + ;; inserted above). + (for-each (lambda (f) + (install-file f chez-site)) + '("socket-ffi-values.so" + "sockets-stub.so")) + (invoke "bash" + "-c" + (format #f "echo '~s' | scheme -q" + '(compile-file "sockets.sls")))))) + (replace 'install + (lambda args + (install-file "sockets.so" + (string-append #$output + "/lib/chez-scheme/arcfide")) + (install-file "sockets.pdf" + (string-append #$output + "/share/doc/" + #$name "-" #$version))))))) (home-page "https://github.com/arcfide/chez-sockets") (synopsis "Extensible sockets library for Chez Scheme") (description "Chez-sockets is an extensible sockets library for Chez Scheme.") (license expat)))) -;; Help function for Chez Scheme to add the current path to -;; CHEZSCHEMELIBDIRS. -(define chez-configure - '(lambda _ - (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) - (setenv "CHEZSCHEMELIBDIRS" - (if chez-env - (string-append ".:" chez-env) - ".")) - #t))) - -;; Help function to define make flags for some Chez Scheme custom make -;; files. -(define (chez-make-flags name version) - `(let ((out (assoc-ref %outputs "out"))) - (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" ,(package-version chez-scheme)) - (string-append "PREFIX=" out) - (string-append "DOCDIR=" out "/share/doc/" - ,name "-" ,version)))) - (define-public chez-matchable (package (name "chez-matchable") @@ -253,10 +258,11 @@ (define-public chez-matchable (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -284,10 +290,11 @@ (define-public chez-irregex (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -314,17 +321,18 @@ (define-public chez-fmt (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "chez-check" - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - (replace 'build - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-build" make-flags))) - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-install" make-flags)))))) + (list #:make-flags (chez-make-flags name version) + #:test-target "chez-check" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-build" make-flags))) + (replace 'install + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-install" make-flags)))))) (home-page "http://synthcode.com/scheme/fmt") (synopsis "Combinator formatting library for Chez Scheme") (description "This package provides a library of procedures for @@ -354,10 +362,11 @@ (define-public chez-mit (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -386,46 +395,44 @@ (define-public chez-scmutils (propagated-inputs (list chez-mit chez-srfi)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:tests? #f ; no test suite - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - ;; 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 - ;; in turn requires us to compile the files in the final - ;; destination. - (delete 'build) - (add-after 'install 'install-src - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-src" make-flags))) - (add-after 'install-src 'absolute-path-in-scm-files - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils") - (string-append "include \"" (dirname file))))) - (find-files out "\\.sls")) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils/simplify") - (string-append "include \"" (dirname file))))) - (find-files out "fbe-syntax\\.scm")) - #t))) + (list + #:make-flags (chez-make-flags name version) + #:tests? #f ; no test suite + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + ;; 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 + ;; in turn requires us to compile the files in the final + ;; destination. + (delete 'build) + (add-after 'install 'install-src + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "install-src" make-flags))) + (add-after 'install-src 'absolute-path-in-scm-files + (lambda* (#:key #:allow-other-keys) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils") + (string-append "include \"" (dirname file))))) + (find-files #$output "\\.sls")) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils/simplify") + (string-append "include \"" (dirname file))))) + (find-files #$output "fbe-syntax\\.scm")))) (add-after 'absolute-path-in-scm-files 'build - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (mk-file (car (find-files out "Makefile")))) + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (let ((mk-file (car (find-files #$output "Makefile")))) (with-directory-excursion (dirname mk-file) (apply invoke "make" "build" make-flags))))) (add-after 'build 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (for-each delete-file - (find-files out "Makefile|compile-all\\.ss")) - #t)))))) + (lambda args + (for-each delete-file + (find-files #$output + "Makefile|compile-all\\.ss"))))))) (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") (description "This package provides a port of the MIT/GNU Scheme Scmutils program to Chez Scheme. The port consists of a set of -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:06 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:06 +0000 Received: from localhost ([127.0.0.1]:48331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHm-0006pU-5H for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:06 -0500 Received: from mail-qk1-f171.google.com ([209.85.222.171]:44682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHe-0006oO-L0 for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:19:58 -0500 Received: by mail-qk1-f171.google.com with SMTP id c189so13888922qkg.11 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:19:58 -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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=aRGBJskz6GUlOoCA8CwkCe52dVeXdj+e7d1RggRckseyF+6iLeFDD2Pq7Yw4Gigqo4 +yQaOqJRcLdicn+o8S6Tg1M5HG8D1ztsKn+gqB3N1h7++llrMG82uND16t/Fp3VqxnKW FZ6KFSGWpQDguJnFPgyteclXh/fBBhvexNISpcaKJFJkTAIa4VzlCilYXx2iV9Fc2dw+ IfZruM64F0wvbUsDTcBxh4ubgZhzNsmmGDINh9L5i54F9jRfnhfT1ZBvsP99qIlTJqys Nup/nZzkfrImUcX/Wk/05RtcOWe8ii4LAtapO8Y8QIN9JOS5vReOpTbf89L+oC/Bro/a 8NSQ== 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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=dIhU4pVrjmQVaouz1FsoGWkY1Cl0eesbIF5JXwz/Twg7wHCxC8v/p/jUfONzW4+BcD CDSFopsaaExugoL7PK21VtdZ/0GRdKOSRz+RGA/yFrBiL4Fw2GTG1lHFa1QdEpJSvyK6 N8bo1ot0ae+FtvQMXqI7yX51INNBT6AZhca7P4Ebbl4hIA7ru5buhhgwjuUTylxTXvln yrRN8FkP1OfeseEQ4wU4wm1DGysc5IIkhBhbE8CqpEwFhgtpAwbhRJsvPGVlkqT96wy7 hMI5UnW53h0IFrh/ioVetmtoEq80mDkMjmyPMnej3sh8k9ogSu8OcrHu4PeYfDYem2lK uDsA== X-Gm-Message-State: AOAM531DmLTARfzf8VcUQJ8DzKXMwsQuJPsfVy1zJIobAw4zvtDyo3E/ r5drN+NRsqWvIU8U2GM3Kzr0pyITl7AJypmM5KI= X-Google-Smtp-Source: ABdhPJytDorG4rsyAhLZJgnrhyo7FB9C0NDMMo31OS8EyjwWRJhkA8zpooqW99RbnTmBZyGR9cj0VA== X-Received: by 2002:a05:620a:7e7:: with SMTP id k7mr2905118qkk.268.1644333593128; Tue, 08 Feb 2022 07:19:53 -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 z4sm7798083qtw.4.2022.02.08.07.19.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:19:52 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 3/9] gnu: chez-scheme: Use shared zlib and lz4. Date: Tue, 8 Feb 2022 10:18:51 -0500 Message-Id: <20220208151857.1900389-3-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez-and-racket-bootstrap (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 1ed4631ced..11d570059b 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -114,9 +114,7 @@ (define-public chez-scheme (inputs `(("libuuid" ,util-linux "lib") ("zlib" ,zlib) - ("zlib:static" ,zlib "static") ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") ;; for expeditor: ("ncurses" ,ncurses) ;; for X11 clipboard support in expeditor: @@ -169,14 +167,14 @@ (define src (lz4-static (assoc-ref inputs "lz4:static")) (out (assoc-ref outputs "out")) ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) + (flags (cons* (string-append "--installprefix=" out) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do compress-man-pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) (format #t "configure flags: ~s~%" flags) ;; Some makefiles (for tests) don't seem to propagate CC ;; properly, so we take it out of their hands: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:07 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:07 +0000 Received: from localhost ([127.0.0.1]:48333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHm-0006pb-Hd for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:07 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:37455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHi-0006oc-Ro for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:04 -0500 Received: by mail-qt1-f175.google.com with SMTP id k25so14970007qtp.4 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:20:02 -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=Lox4biAAsxxoQq6Fxhf7L0m7IO8uJocQ7vmE7rh9eMo=; b=d/SXfZZZKNPr3Izd1vZH+0Vl1JVAWxj1tcETStFR/LR9JdXnlEDPudcYWqo5qI0TAl lg3gM2U58beMYCGqGngN+t1PWpawLflEdkqP3PljUHRWoMMBCOycwBvrwMSQ6z8j5M90 LtekX6+xzrDofxvCQBcRnCNkLVt5EvAkCRdbvae5r7GiJanL7Hs+e9BeBxBrZgng2Z3g B8gu5WW6ZDGJ2h+9T8aijb/QsG/cKnxkscZXH7EYvKhElUxpC8ujnd2pifP5DCFTC1je 3FvwX00I55UTYq9W9Ylj/L14/l5bmBCBI+HOY9WOChpaMSwlW/BHcLNdPKGyJ69Qftcs Z2LQ== 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=Lox4biAAsxxoQq6Fxhf7L0m7IO8uJocQ7vmE7rh9eMo=; b=PD2rS2zFXF5Q7JBOlbmsdcaMkheQMIGLQAgNODxfKzjKNvH7006MOuc5V+NYBqKllY F48aT3YOSWOVgJ3jN0UWNTgJYJ1XqkQYv8/JTFLf5N1Sc39i7DcTGD0pasWe8DBnzgvT /S5NxFYNwvrH5zQHGD2QblNPOJ6PLgrSPQZ27eZw/6nhCeKeaO6po9d2bST5i+rtzUvJ 2GmSdre9tkpQp0mbUytUXQNwI58Nh6kNOSMwQy+WHoECAuq5dGaGMqy8WPTCZvIIuXkU mqdw4DBUoXt2mClK3QGfAQGI5C+NtBAhpFohjNBLWPlLuwCOVFyqNCI9WmZuVYzb2hkF kkLg== X-Gm-Message-State: AOAM533I6s+IMuyvn1SUNqtQ7Id3uEj6YMOJPWGEVQ5LQOL5kCBDNRdQ nO/3wKQVSlBHNw7ez9B8FOKG5ChWN3IYTqbvXVc= X-Google-Smtp-Source: ABdhPJwxRY4fMALJhhf9CHH/SnTYMV6okkLOetQf398LAQRbDv0nHrUPVGYXzvEwTlD8Y9xhHrB9dQ== X-Received: by 2002:ac8:5c83:: with SMTP id r3mr3381850qta.400.1644333597194; Tue, 08 Feb 2022 07:19:57 -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 de43sm6815533qkb.4.2022.02.08.07.19.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:19:57 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 4/9] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. Date: Tue, 8 Feb 2022 10:18:52 -0500 Message-Id: <20220208151857.1900389-4-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-machine->unthreaded, chez-machine->upstream-restriction, chez-machine->nix-system, nix-system->chez-machine): New private functions. (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private constants. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-machine->upstream-restriction'. --- gnu/packages/chez-and-racket-bootstrap.scm | 142 ++++++++++++++++++++- 1 file changed, 140 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 11d570059b..fc1da53178 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -28,7 +28,9 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -61,6 +63,134 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; Code: +(define (chez-machine->unthreaded mach) + "Given a string MACH naming a Chez Scheme machine type, returns a string +naming the unthreaded machine type for the same architecture and OS as MACH. +The returned string may share storage with MACH." + (if (eqv? #\t (string-ref mach 0)) + (substring mach 1) + mach)) +(define (chez-machine->threaded mach) + "Like @code{chez-machine->unthreaded}, but returns the threaded machine +type." + (if (eqv? #\t (string-ref mach 0)) + mach + (string-append "t" mach))) + +;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt +;; in https://github.com/racket/raco-cross. +;; For supported platforms, refer to release_notes/release_notes.stex in the +;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md +;; in https://github.com/racket/racket. +(define %nix-arch-to-chez-alist + `(("x86_64" . "a6") + ("i386" . "i3") + ("aarch64" . "arm64") + ("armhf" . "arm32") ;; Chez supports ARM v6+ + ("ppc" . "ppc32"))) +(define %nix-os-to-chez-alist + `(("w64-mingw32" . "nt") + ("darwin" . "osx") + ("linux" . "le") + ("freebsd" . "fb") + ("openbsd" . "ob") + ("netbsd" . "nb") + ("solaris" . "s2"))) + +(define (chez-machine->upstream-restriction mach) + "Given a string MACH naming a Chez Scheme machine type, returns a symbol +naming a restriction on the upstream Chez Scheme implementation compared to +the Racket variant, or @code{#f} if no such restriction exists. The +restriction is reported for the architecture--OS pair, regardless of whether +MACH specifies a threaded or an unthreaded variant. + +Possible restrictions currently include: +@itemize @bullet +@item +@code{'no-threads}: Support for native threads is not available upstream. +@item +@code{'no-support}: The upstream release doesn't claim to support this +architecture--OS combination at all. +@end itemize + +See @code{chez-machine->nix-system} for more details about acceptable values +for MACH." + (let ((mach (chez-machine->unthreaded mach))) + (cond + ((string-prefix? "arm64" mach) + 'no-support) + ((string-prefix? "arm32" mach) + (if (string-suffix? "le" mach) + 'no-threads + 'no-support)) + ((string-prefix? "ppc32" mach) + (if (string-suffix? "le" mach) + #f + 'no-support)) + (else + #f)))) + +(define (chez-machine->nix-system mach) + "Return the Nix system type corresponding to the Chez Scheme machine type +MACH. If MACH is not a string representing a known machine type, an exception +is raised. This function does not distinguish between threaded and unthreaded +variants of MACH. + +Note that this function only handles Chez Scheme machine types in the +strictest sense, not other kinds of descriptors sometimes used in place of a +Chez Scheme machine type by the Racket, such as @code{\"pb\"}, @code{#f}, or +@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type +for the host system is often still relevant.)" + (let ((mach (chez-machine->unthreaded mach))) + (let find-arch ((alist %nix-arch-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (string-prefix? chez mach) + (string-append + nix "-" (let ((mach-os (substring mach (string-length chez)))) + (let find-os ((alist %nix-os-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (equal? chez mach-os) + nix + (find-os alist))))))) + (find-arch alist))))))) + +(define* (nix-system->chez-machine #:optional (system (%current-system)) + #:key (threads? 'always)) + "Return the Chez Scheme machine type corresponding to the Nix system +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme +machine type is undefined. + +When THREADS? is @code{'always} (the default), the threaded variant of the +machine type will be returned: note that the package returned by +@code{chez-scheme-for-system} will always support native threads. When +THREADS? is @code{#f}, the unthreaded machine type will be returned. If +THREADS? is @code{'upstream} (the default), the threaded variant of the +machine type will be returned if and only if it is supported by upstream Chez +Scheme (see @code{chez-machine->upstream-restriction}). If THREADS? is any +other value, an exception is raised." + (let* ((hyphen (string-index system #\-)) + (nix-arch (substring system 0 hyphen)) + (nix-os (substring system (+ 1 hyphen))) + (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) + (chez-os (assoc-ref %nix-os-to-chez-alist nix-os)) + (mach (and chez-arch chez-os (string-append chez-arch chez-os)))) + (and mach + (match threads? + ('always + (chez-machine->threaded mach)) + (#f + mach) + ('upstream + (if (chez-machine->upstream-restriction mach) + mach + (chez-machine->threaded mach))))))) + +;; +;; Chez Scheme: +;; + (define nanopass (let ((version "1.9.2")) (origin @@ -264,8 +394,16 @@ (define* (stex-make #:optional (suffix "")) ;; We should too. It is the Chez machine type arm32le ;; (no threaded version upstream yet, though there is in ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) + (supported-systems + (delete + "armhf-linux" ;; <-- should work, but reportedly broken + (filter + (lambda (system) + (and=> (nix-system->chez-machine system) + (lambda (mach) + (not (eq? 'no-support + (chez-machine->upstream-restriction mach)))))) + %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:12 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:12 +0000 Received: from localhost ([127.0.0.1]:48336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHq-0006py-6u for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:12 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:46052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHn-0006pG-Hg for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:08 -0500 Received: by mail-qt1-f179.google.com with SMTP id o3so14923297qtm.12 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:20:07 -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=pPVuXg7gVXZ3jAwTsq5yu0X4YPc8QLkBQML+AQw3usg=; b=U3Zs/aQkzHb4DzK/T8Uq8xdmBHlH/Jf/rKyu58XAWRTIK0PukijlksBakZRLtN4eH8 lSInuo0mmInvoVrap6CV/96VBZn31il9bjFyVQZzEPdRSGIKiDTqxqTmdXYZ++EFF+d7 o+WDtv1MJ17TpaZlSLv9t7GBoFcPkDmZKHan/3BFsqZNUybR9WSp0mr52KQxZJLr+43D Qj3h7/o43BTv5yvk2txrRUujJ4X1h7s5OFNC+TxaEaCejzhHy47hZ2e44386diTDXEIw OEA/5xcetJZSAzdfie80V89YRqt35tt2EHURXLAw4Xlx0c2s477RTNUkF/2taXKb5fVo X0WQ== 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=pPVuXg7gVXZ3jAwTsq5yu0X4YPc8QLkBQML+AQw3usg=; b=yCb3ctrwrZsPwQSkEyeNnctbcR2aMDfDEqPvw5rK+1fF/7QM8o4NcmsLi05lsh8wCu ULwgiB/hkN/qunhF2o1hrWSdbNF9CPEtCspMt1dOXNp10gco6Udeo6mCFUr9N1wr5q3p 5MbBM/YatbwbOwVh7CeE91RybXlVPjYf7HdPkmGzls1MKwttUNQI/JKgb4OwH2ULYLtg cZLFCy5VEjBV9wkRZQDPYsnCIc1FmP4KBrDzfa7HF3t0zaHHsUMLIApRVOzrcjEJ/shV JdDbg51kkMesPGKFokQN5mlXNe1+1UYuM++qDYqF3bYG+ZZePTIEymiggWcva7SDVhl2 b9xA== X-Gm-Message-State: AOAM532vKZDqUDWc+VQCcLwG/Ww4UcfHLnJi06A4MANdGLzP5WJQN116 Od8ouEGBLASMQMgZ895W3YYkVBDIqCwWAqcu3T4= X-Google-Smtp-Source: ABdhPJw8uKo8SSViF77hW3HGRVdh5fSD2G1tAmayYlvbtNNIjosJy1qY4KX7cAb+j39nyIeh4eBE/w== X-Received: by 2002:a05:622a:3cc:: with SMTP id k12mr3264375qtx.582.1644333601667; Tue, 08 Feb 2022 07:20:01 -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 b8sm7699311qtx.79.2022.02.08.07.20.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:20:01 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 5/9] gnu: Add stex. Date: Tue, 8 Feb 2022 10:18:53 -0500 Message-Id: <20220208151857.1900389-5-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (stex-bootstrap): New variable. (stex): Change from origin to package inheriting from 'stex-bootstrap'. (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove labels. Remove dependencies of stex-bootstrap. [inputs]: Remove labels. [arguments]: Adapt to use 'stex-bootstrap', 'search-input-file', and G-expressions. (nanopass): Make it public as a temporary workaround for Racket. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 435 ++++++++++++--------- gnu/packages/racket.scm | 5 +- 2 files changed, 263 insertions(+), 177 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index fc1da53178..c0d5e2897d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -31,6 +31,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -191,113 +192,83 @@ (define* (nix-system->chez-machine #:optional (system (%current-system)) ;; Chez Scheme: ;; -(define nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define unbundle-chez-submodules + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))) -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) +(define (unpack-nanopass+stex) + ;; delayed resolution of `nanopass` + #~(begin + (copy-recursively #$nanopass + "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-public chez-scheme (package (name "chez-scheme") + ;; The version should match `(scheme-version-number)`. + ;; See s/cmacros.ss c. line 360. (version "9.5.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet unbundle-chez-submodules))) (build-system gnu-build-system) (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("lz4" ,lz4) - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) - (native-inputs - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) + (list + `(,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 stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* (string-append "--installprefix=" out) + #:test-target "test" + ;; TODO when we fix armhf, it may not support --threads + #:configure-flags #~'("--threads") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + #$(unpack-nanopass+stex))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) + ;; add flags which are always required: + (let ((flags (cons* (string-append "--installprefix=" #$output) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" @@ -305,90 +276,59 @@ (define src ;; and letting Chez try causes an error "--nogzip-man-pages" configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke "./configure" 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* ((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. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'install-symlink 'install-doc + (lambda* (#:key native-inputs inputs outputs + #:allow-other-keys) + (match (assoc-ref outputs "doc") + (#f + (format #t "not installing docs~%")) + (doc-prefix + (let* ((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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le @@ -412,3 +352,150 @@ (define* (stex-make #:optional (suffix "")) generates native code for each target processor, with support for x86, x86_64, and 32-bit PowerPC architectures.") (license license:asl2.0))) + +;; +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") ;; can run without compiling + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + (let ((machine #$(nix-system->chez-machine + (or (%current-target-system) + (%current-system))))) + (if (and (not (eqv? #\t (string-ref machine 0))) + (string-contains scheme "racket")) + (string-append "t" machine) + machine))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine + "\\."))))) + (else + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is considered part of the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license license:expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (outputs '("out" "doc")) + (properties '()))) + +(define-public nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 865fdff70f..d8338bcd6f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,9 +333,8 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) "stex")) - ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) - "nanopass")))) + ("stex" ,(package-source stex)) + ("nanopass" ,nanopass))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:14 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:15 +0000 Received: from localhost ([127.0.0.1]:48339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHu-0006qM-92 for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:14 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:36654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHs-0006ph-48 for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:12 -0500 Received: by mail-qk1-f169.google.com with SMTP id g145so13938387qke.3 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:20:12 -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=OHi5UQoFB1TOERCpD+rOBVLSgC5wmclNxCKp0Fgy8WU=; b=f8ecb/8y+elp+xDM+uAdt82sVaeHSHu5dxLbzaKPJiAgsuRCtWyneUQdPW8LkV6xd6 C742R4APLmFsKF/aU/DyBGy2cI6srVdak9GelIASkvK0ti26nTQEDUmXayFXwdcoS2I1 aDZBvkeFH7MJKlsCV7hviGQhdsodb/1vMqN0zeP0NMsnJ2pz3/6vnHjRPaEY09naZO5Q wf/q0yT0/fXeUOkNVqjxRfcSKg+SVu0hDxI97QTttpVhuami2RdDAfR0/2jUxO1sLOQr 0EH4TrJIuWDMVfQwpZHzztLQ2yn1KR8a+H+/a8mAVxl4da6WMG86cX/0Rh4p5QE4tQXa PU9Q== 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=OHi5UQoFB1TOERCpD+rOBVLSgC5wmclNxCKp0Fgy8WU=; b=cuvRYro26Tr9YNNduwgd9IF0IiHkuQbhaMCD3eDZujbpUMcu9FuUZH3VkC4Kb8zdrn drgqDddRKVVQ+/AhFnPDGUtxP9dLvVSQKzZLvisczYWl+76NwUro7P0mq8s1iR/z9PLP V8lprbeSFGL1ay/NKE+vu/UwGH9CU0l4QIHcdI57s9KHTEu/dxK0pGt1JLUi1GNMSdin 5lQnZHrrbfUYQN4QlyPKNd9igu5v4c7hNlyMJzgPigP5tCwPX5P28wEViW9fRSuoS2ZR vOZwHirqngdVqGvzBclGCVW2Dtc82kLy41sGVfgLdVZOCTELl8InhdYbADkKPV2wzk4I aK9g== X-Gm-Message-State: AOAM531SUZkf1sgAprU+mFgBh2TvcGUM4K45iixDRD9RC7i4HszZ021L 2uI8GhgEFgZgiUkH2Vrseq9DHIMXQg2nhCose2g= X-Google-Smtp-Source: ABdhPJxfaejY4Cf44sISOIusr2dGu026KSyGPKAGfjEKbor0xK9F8ykoXnnZS87z2kT+r+OFXGmZ7g== X-Received: by 2002:a37:6257:: with SMTP id w84mr2810206qkb.364.1644333606551; Tue, 08 Feb 2022 07:20:06 -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 n19sm7454564qtk.66.2022.02.08.07.20.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:20:06 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 6/9] gnu: Add chez-nanopass. Date: Tue, 8 Feb 2022 10:18:54 -0500 Message-Id: <20220208151857.1900389-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-scheme)[native-inputs]: Add it. (chez-nanopass): New variable. (unpack-nanopass+stex): Adapt accordingly. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Likewise. --- gnu/packages/chez-and-racket-bootstrap.scm | 96 ++++++++++++++++++---- gnu/packages/racket.scm | 2 +- 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index c0d5e2897d..9125d34ab7 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -203,12 +203,13 @@ (define unbundle-chez-submodules "lz4" "zlib")))) -(define (unpack-nanopass+stex) - ;; delayed resolution of `nanopass` +(define unpack-nanopass+stex #~(begin - (copy-recursively #$nanopass - "nanopass" - #:keep-mtime? #t) + (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 () @@ -241,7 +242,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs (list stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -261,7 +262,7 @@ (define-public chez-scheme #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex (lambda args - #$(unpack-nanopass+stex))) + #$unpack-nanopass+stex)) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -490,12 +491,75 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license license:expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d8338bcd6f..e8d016c07b 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -334,7 +334,7 @@ (define-public racket-bootstrap-chez-bootfiles racket-minimal racket-minimal-bc-3m)) ("stex" ,(package-source stex)) - ("nanopass" ,nanopass))) + ("nanopass" ,(package-source chez-nanopass)))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:18 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:18 +0000 Received: from localhost ([127.0.0.1]:48343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHx-0006qh-Ux for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:18 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:41529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHw-0006q3-20 for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:16 -0500 Received: by mail-qt1-f172.google.com with SMTP id y8so14946873qtn.8 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:20:16 -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=6AE1/qxcrotEryrbburLPzrMBVE8hEJhgaS/TLE/JiI=; b=NdhTYKBDp5oCxCyHVcIpQsvyv3DoyanmIChfarYyaMcZEX6yXrbfyAbkxKoV8Btb5J FmtN6WJVI7HbBISWTIou1f5hv/uRZ3kgwTzCZeeTVBeHrVHg5Y6hcDHT8UtgUMVAZLvU 7j8AZXEgHP+BZfzlnh71clureduZs6uf39a/odBakHaTtI3pN/kpz2PfVvsDfDAWV32N +E2PrlfOporFzGnx9g+NcGPdIlh07qFqVvRI9Ql4de4EJfeDWhOqsEYu3D2m6op8qi3b ZLlSUQC82vi6LqafMDPok9NCFj76GWC7PsGGNPuQFUR+cb33DOE7ULLIhtiImShHxQLw j8ZQ== 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=6AE1/qxcrotEryrbburLPzrMBVE8hEJhgaS/TLE/JiI=; b=bI2BWgWDOoJLbM7Vr/bn/FqoQEPTHZa5tQKLVYNdLXM1o2sPrIrk2CtNlp8ENlIoks LOAnQQelsaTNLoUENWzKDLGFXKLb61sb945KrkA6xWF8M2BNBpX2zQd0QXBKl3hOPSqn ub+YqxOH1/ZGt7oSwFUUrjAFnUDD5kBH945mU1AJAKTUzqPC4zSnRnLBbu2T80ap2hon +tmTLeyKMMCIIFkGdrHcanjpThjYzOcsQbddIF/4cXH6Wk6jIf3O72hi84Y8iDNekZbi Ws3IHCeZWfneSkNCJr32fvX68E4L7oOL/gPRLe6MjRfWtTZBoO9CDw5j3JGwAzqNda3S N4PQ== X-Gm-Message-State: AOAM532UHdBg2LQgr+4ktoD8kV/dRLP+27Ikc3IzBRb9l/ZoSvK4geRB ipW+TUhqxGQlQ2+XRrFgyR0s/jZ3tNa/XLOOfw8= X-Google-Smtp-Source: ABdhPJwSExUTsZrcY0O0PbMuFOLneErr+RxL6fiKJRZIKRitY0C7d0dGFWDTctDzZ3mTpPDqvVzWMw== X-Received: by 2002:ac8:6bd6:: with SMTP id b22mr3347208qtt.366.1644333610549; Tue, 08 Feb 2022 07:20:10 -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 g24sm7048455qkk.76.2022.02.08.07.20.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:20:10 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 7/9] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Tue, 8 Feb 2022 10:18:55 -0500 Message-Id: <20220208151857.1900389-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This might seem a bit silly in isolation, but it makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]: Add new phase 'unpack-bootfiles'. [version, source, home-page]: Derive from 'chez-scheme-bootstrap-bootfiles'. --- gnu/packages/chez-and-racket-bootstrap.scm | 57 ++++++++++++++++++++-- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 9125d34ab7..c6e4e07085 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -216,9 +216,9 @@ (define unpack-nanopass+stex ;; otherwise, it will try to download submodules (display "# to placate ../configure"))))) -(define-public chez-scheme +(define-public chez-scheme-bootstrap-bootfiles (package - (name "chez-scheme") + (name "chez-scheme-bootstrap-bootfiles") ;; The version should match `(scheme-version-number)`. ;; See s/cmacros.ss c. line 360. (version "9.5.6") @@ -230,8 +230,45 @@ (define-public chez-scheme (sha256 (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) + (file-name (git-file-name "chez-scheme" version)) (snippet unbundle-chez-submodules))) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (supported-systems + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((mach (nix-system->chez-machine system #:threads? #f))) + (or (equal? "arm32le" mach) + (and mach + (member (substring mach 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> mach) + '("le" "nt" "osx")))))) + %supported-systems)) + (home-page "https://cisco.github.io/ChezScheme/") + (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 upsream +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.") + (properties `((hidden? . #t))) + (license license:asl2.0))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version (package-version chez-scheme-bootstrap-bootfiles)) + (source (package-source chez-scheme-bootstrap-bootfiles)) (build-system gnu-build-system) (inputs (list @@ -242,7 +279,9 @@ (define-public chez-scheme ;; 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-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -263,6 +302,14 @@ (define-public chez-scheme (add-after 'unpack 'unpack-nanopass+stex (lambda args #$unpack-nanopass+stex)) + (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 (or native-inputs 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`. @@ -345,7 +392,7 @@ (define* (stex-make #:optional (suffix "")) (not (eq? 'no-support (chez-machine->upstream-restriction mach)))))) %supported-systems))) - (home-page "https://cisco.github.io/ChezScheme/") + (home-page (package-home-page chez-scheme-bootstrap-bootfiles)) (synopsis "R6RS Scheme compiler and run-time") (description "Chez Scheme is a compiler and run-time system for the language of the -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:35 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:35 +0000 Received: from localhost ([127.0.0.1]:48348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSI6-0006r6-EF for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:35 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:39699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSI1-0006qV-HG for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:25 -0500 Received: by mail-qv1-f43.google.com with SMTP id k4so14243583qvt.6 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:20:21 -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=YNQurAskELdFuVn95qcNrVc3dbFYUr6m0VNOG9sK0rg=; b=M/HbTz919VUa9vySd4lsqpdcqZX7FurLn47kdTjTFAoCr/fnbD1nXwqsAYZB3dx/6M GB3xBDvdD6IeIri0iREIHi9KWaJ7Njx+v9NP3+T15me861Kw4NR8Y6cfQCprpkuJSeMx bQG7zHeTcBWII9Fu3l7xKEzOx9w6myJDfWT8hZG6Rk22PL6Wngt5qLE4wMRQLCPrdFkQ tGWuBXCbWVSENO08Fqgv+f/9cl+I9IUFUuNIxGUaPD2rKZ08bP1vI1OLpxIJV4kl6kY0 J4ibVNq7TTFSNQln/I4Bv6YjD1gthvyrS0CHeTac2F592b3y+fn5AXqztvdos1F+TNxX UkGA== 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=YNQurAskELdFuVn95qcNrVc3dbFYUr6m0VNOG9sK0rg=; b=W6n32tSJlGwO97MQ7JTue3BFQjhwbgyTM27YENLZd0yaVaV7TOSqmPtSRzVGIP9nld 7hWX/XErdhbXZK9UMjd9FAaq6bYesrwZ9wkN9AaGvITrZfIWZ9rDHuQtqMlP16f3XQFx er7yoii+TtYFyoMY614zdXo5tgMD4A9ST7tRfy17B3iYU6Vn9FEM4NsUUu9VLFWLVsYU FSn5EZsfcgrnNGFty0/W9zT6LoSTBZRUgQK8fAE692VV+Hz5/+OYBzovoJ64icKGalJ/ XahOTcHJJwH251Q/dPrR9/FmxFXT484C43Jplm9DCURGZqAr+EZ+RXyzLTa4HKU0MM4B tSTw== X-Gm-Message-State: AOAM5324c7RZev9gtqMFCEd+iQZb5DIa5Onv++413Bi0m+SVsp3MgRcW Fqinl+Z5/XA2GKbUlDc3x/jb/K1i2fN7t8Dr1eA= X-Google-Smtp-Source: ABdhPJwYvjxkwNmaGtnVmJqLHLp4HsKGQxiGkGIx4n4ApODLTLQ20oMaIKTpXqCVbExEjc99Ov9UpQ== X-Received: by 2002:ad4:5de2:: with SMTP id jn2mr3331653qvb.59.1644333614749; Tue, 08 Feb 2022 07:20:14 -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 y5sm7244798qkp.37.2022.02.08.07.20.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:20:14 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 8/9] gnu: Add chez-scheme-racket-variant. Date: Tue, 8 Feb 2022 10:18:56 -0500 Message-Id: <20220208151857.1900389-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) The Racket variant of Chez Scheme can be used to support platforms that are not yet supported by upstream Chez Scheme. The new function 'chez-scheme-for-system' selects the Chez Scheme package that best supports the target system. In the process, we also add packages for 'racket-vm-cgc', 'racket-vm-bc', and 'racket-vm-cs'. A future commit will change 'racket-minimal' to use the Racket VM implementation that best supports the target system, as reported by 'racket-vm-for-system'. * gnu/packages/patches/racket-enable-scheme-backport.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cgc): (racket-vm-bc): (racket-vm-cs): (chez-scheme-racket-variant-bootstrap-bootfiles): (chez-scheme-racket-variant): New variables. (chez-scheme-for-system, racket-vm-for-system): New exported functions. * gnu/packages/loko.scm (loko-scheme): Use 'chez-scheme-for-system'. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise * gnu/packages/chez.scm (chez-srfi): (chez-web): (chez-sockets): (chez-matchable): (chez-irregex): (chez-fmt): (chez-mit): (chez-scmutils): Likewise. (chez-mit)[origin]: Add workaround for Racket variant. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 512 +++++++++++++++++- gnu/packages/chez.scm | 40 +- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- .../racket-enable-scheme-backport.patch | 465 ++++++++++++++++ 6 files changed, 1003 insertions(+), 19 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index e3104fc0b6..94de782ca9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1785,6 +1785,7 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-enable-scheme-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index c6e4e07085..46da8e3ef2 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -34,15 +34,20 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages ncurses) #:use-module (gnu packages netpbm) #:use-module (gnu packages tex) #:use-module (gnu packages xorg) #:use-module ((guix licenses) - #:prefix license:)) + #:prefix license:) + #:export (chez-scheme-for-system + racket-vm-for-system)) ;; Commentary: ;; @@ -62,8 +67,164 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; Putting the relevant definitions together in this module avoids having to ;; work around dependency cycles. ;; +;; Anatomy of Racket: +;; ------------------ +;; +;; The main Racket Git repository () is +;; organized broadly like this: +;; +;; . +;; ├── Makefile +;; ├── pkgs/ +;; └── racket/ +;; ├── collects/ +;; └── src/ +;; ├── configure +;; ├── Makefile.in +;; ├── bc/ +;; ├── cs/ +;; ├── ChezScheme/ +;; └── ... +;; +;; The 'racket/src/' directory contains the source of the runtime system, core +;; compiler, and primitives for the major Racket implementations: this layer +;; is called the ``Racket VM''. It is basically a normal autotools +;; project. (Even when Racket VM implementations use components implemented in +;; Racket, they are compiled in special modes to produce VM primitives.) +;; (There are or have been experimental Racket VM implementations elsewhere, +;; e.g. .) One way of thinking about the +;; bounary between the Racket VM and Racket programs is that the VM implements +;; the primitives accessed by the 'ffi/unsafe/vm' library. Another perspective +;; is that DrRacket's ``Open defining file''/``Jump to definition'' features +;; can navigate into Racket programs, including into the implementation of +;; 'racket/base', but can not jump into the implementation of the Racket VM +;; itself. A third, related perspective is that Racket code is usually +;; installed with source files alongside compiled code (though this is not +;; mandatory), whereas the Racket VM is installed only in compiled form. +;; +;; The 'racket/collects/' directory contains ``built in'' Racket libraries +;; that are not part of any package, including the implementation of +;; 'racket/base': in particular, it must contain enough to implement `raco pkg +;; install'. It is theoretically possible to use the Racket VM layer without +;; the main collections, but it is not stable or useful. +;; +;; The 'pkgs/' directory contains Racket packages that are especially closely +;; tied to the implementation of the Racket VM, including 'compiler-lib', +;; 'racket-doc', and 'racket-test'. Some of these packages depend on Racket +;; packages that are developed in other Git repositories, predominantly but +;; not exclusively under the 'racket' GitHub organization. Conversely, not all +;; of the packages developed in the main Git repository are part of the main +;; Racket distribution. (Additionally, components of the Racket VM that are +;; implemented in Racket can be installed as packages, mostly for ease of +;; development.) +;; +;; The top-level 'Makefile' is more like a directory of scripts: it has +;; convienience targets for developing Racket, and it cooperates with the +;; 'distro-build' package to assemble custom Racket distributions. 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. +;; +;; A ''minimal Racket'' installation includes two packages: 'base', which is a +;; sort of bridge between the current ``built-in'' collections and the package +;; system's model of dependencies, and 'racket-lib', which, for installations +;; that can not rely on a system package manager, pulls in the SQLite and +;; OpenSSL shared libraries as platform-specific dependencies for use by the +;; ``built-in'' collections. +;; +;; The main Racket distribution consists of installing the 'main-distribution' +;; package and all of its dependencies. +;; +;; The default mode when building Racket (or installing it with the released +;; installers) is an ``in-place build'', which produces a self-contained, +;; relocatable, roughly FHS-like directory. (Racket also supports +;; ``Unix-style'' installations, which rearrange the parts of an in-place +;; build into Racket-specific subdirectories and generally tries to work for +;; installation into an FHS-based system.) Certain tools, e.g. 'distro-build' +;; and 'raco cross', are able to work with an in-place Racket build. +;; +;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and +;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and +;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store +;; output. The function 'racket-vm-for-system' returns the recomended Racket +;; VM package for a given system. +;; +;; The file 'racket.scm' builds on these packages to define 'racket-minimal' +;; and 'racket' packages. These use Racket's support for ``layered +;; installations'', which allow an immutable base layer to be extended with +;; additional packages. The use the layer configuration directly provide +;; ready-to-install FHS-like trees, rather than relying on the built in +;; ``Unix-style install'' mechanism. +;; +;; Bootstrapping Racket: +;; --------------------- +;; +;; Here's how bootstrapping Racket works: +;; +;; - Racket BC [CGC] can be built with only a C compiler (except for +;; one caveat discussed below). +;; - 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 +;; 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. +;; +;; So, we build CGC to build 3M to build bootfiles and CS. +;; +;; (Note: since the CGC variant is basically only for bootstrapping, we +;; often use "BC" to mean "3M", consistent with `(banner)` and the +;; suffixes used on executables when more than one variant co-exists.) +;; +;; 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 +;; README file applies to all such subsystems: +;; +;; The Racket version must be practically the same as the current Racket +;; verson, although it can be the Racket BC implementation (instead of +;; the Racket CS implementation). +;; +;; Unlike Chez Scheme boot files, the files generated in "schemified" +;; are human-readable and -editable Scheme code. That provides a way +;; out of bootstrapping black holes, even without BC. +;; +;; However, other Racket subsystems implemented in Racket for Racket CS +;; use older C implementations for Racket BC, whereas the reader, expander, +;; and module system were completely replaced with the Racket implementation +;; +;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) +;; are embeded in C as a static string constant. Eventually, they are further +;; compiled by the C-implemented Racket BC bytecode and JIT compilers. +;; (On platforms where Racket BC's JIT is not supported, yet another compiler +;; instead compiles the linklets to C code, but this is not a bootstrapping +;; issue.) +;; ;; Code: +(define* (chez-scheme-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'chez-scheme' if it supports SYSTEM without restrictions; +'chez-scheme-racket-variant' otherwise." + (if (and=> (nix-system->chez-machine system) + chez-machine->upstream-restriction) + chez-scheme-racket-variant + chez-scheme)) + +(define* (racket-vm-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." + (if (nix-system->chez-machine system) + racket-vm-cs + racket-vm-bc)) + (define (chez-machine->unthreaded mach) "Given a string MACH naming a Chez Scheme machine type, returns a string naming the unthreaded machine type for the same architecture and OS as MACH. @@ -189,19 +350,19 @@ (define* (nix-system->chez-machine #:optional (system (%current-system)) (chez-machine->threaded mach))))))) ;; -;; Chez Scheme: +;; Chez auxiliary G-expressions: ;; (define unbundle-chez-submodules #~(begin (use-modules (guix build utils)) (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib")))) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))) (define unpack-nanopass+stex #~(begin @@ -216,6 +377,235 @@ (define unpack-nanopass+stex ;; otherwise, it will try to download submodules (display "# to placate ../configure"))))) +;; +;; Racket VM: +;; + +(define (racket-vm-common-configure-flags) + ;; under a lambda extraction to avoid evaluating bash-minimal too early + #~`(,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/libtool")) + => (lambda (libtool) + (list (string-append "--enable-lt=" libtool)))) + (else + '())) + ,@(cond + ((false-if-exception + (search-input-file %build-inputs "/opt/racket-vm/bin/racket")) + => (lambda (racket) + (list (string-append "--enable-racket=" racket)))) + (else + '())) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")) + "--disable-strip" + "--enable-origtree")) + +(define-public racket-vm-cgc + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (hidden-package + (package + (name "racket-vm-cgc") + (version "8.3.900") + ;; ^ Remember to also update the version of + ;; chez-scheme-racket-variant-bootstrap-bootfiles + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racket") + ;;(commit (string-append "v" version)))) + (commit "a8f2969753f70e70d73308250cae1d4eda087319"))) + (sha256 + (base32 "141c18wmvb6039cw87mvmm6xxs6k01wkcrxj0hfa1r8za25qa934")) + (file-name (git-file-name "racket" version)) + (patches (search-patches "racket-minimal-sh-via-rktio.patch" + ;; Remove by Racket 8.5: + "racket-enable-scheme-backport.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Unbundle Chez submodules. + (with-directory-excursion "racket/src/ChezScheme" + #$unbundle-chez-submodules) + ;; Unbundle libffi. + (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + (inputs (list ncurses ;; <- common to all variants (for #%terminal) + bash-minimal ;; <- common to all variants (for `system`) + libffi)) ;; <- only for BC variants + (native-inputs (list libtool)) ;; <- only for BC variants + (outputs '("out" "debug")) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) + (guix build gnu-build-system) + (guix build utils)) + #:strip-directories #~'("opt/racket-vm/bin" + "opt/racket-vm/lib") + #:phases + #~(let () + (define* ((wrap-racket-vm-outputs phase) . args) + (apply + phase + (let loop ((args args)) + (match args + ((#:outputs outputs . args) + `(#:outputs + ,(let loop ((outputs outputs)) + (match outputs + ((("out" . out) . outputs) + `(("out" . ,(string-append out "/opt/racket-vm/")) + ,@outputs)) + ((other . outputs) + (cons other (loop outputs))))) + ,@args)) + ((arg . args) + (cons arg (loop args))))))) + (modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (replace 'configure + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'configure))) + (replace 'patch-shebangs + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-shebangs))) + (replace 'validate-runpath + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'validate-runpath))) + (replace 'make-dynamic-linker-cache + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) + (replace 'patch-dot-desktop-files + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) + (home-page "https://racket-lang.org") + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. + +Racket CGC is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat))))) + +(define-public racket-vm-bc + (package + (inherit racket-vm-cgc) + (name "racket-vm-bc") + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc))) + (arguments + (substitute-keyword-arguments (package-arguments racket-vm-cgc) + ((#:configure-flags _ '()) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket BC [3M] implementation") + (description "The Racket BC (``before Chez'' or ``bytecode'') +implementation was the default before Racket 8.0. It uses a compiler written +in C targeting architecture-independent bytecode, plus a JIT compiler on most +platforms. Racket BC has a different C API and supports a slightly different +set of architectures than the current default runtime system, Racket CS (based +on ``Chez Scheme''). It is the recommended implementation for architectures +that Racket CS doesn't support. + +This package is the normal implementation of Racket BC with a precise garbage +collector, 3M (``Moving Memory Manager'')."))) + +(define-public racket-vm-cs + (package + (inherit racket-vm-bc) + (name "racket-vm-cs") + (inputs + (modify-inputs (package-inputs racket-vm-cgc) + (prepend zlib lz4) + (delete "libffi"))) + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (delete "libtool") + (prepend chez-scheme-racket-variant + chez-nanopass-bootstrap + racket-vm-bc))) + (arguments + (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))))) + ((#:configure-flags _ '()) + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + (string-append "--enable-scheme=" + #$(this-package-native-input + "chez-scheme-racket-variant") + "/bin/scheme") + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket CS implementation") + (description "The Racket CS implementation, which uses ``Chez Scheme'' as +its core compiler and runtime system, has been the default Racket VM +implemetation since Racket 8.0. It performs better than the Racket BC +implementation for most programs. + +Using the Racket VM packages directly is not recommended: instead, install the +@code{racket-minimal} or @code{racket} packages.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) + +;; +;; Chez Scheme: +;; + (define-public chez-scheme-bootstrap-bootfiles (package (name "chez-scheme-bootstrap-bootfiles") @@ -401,6 +791,112 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license license:asl2.0))) + +(define-public chez-scheme-racket-variant-bootstrap-bootfiles + (package + (inherit chez-scheme-bootstrap-bootfiles) + (name "chez-scheme-racket-variant-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! + (source (package-source racket-vm-cgc)) + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) + (arguments + (substitute-keyword-arguments + (package-arguments chez-scheme-bootstrap-bootfiles) + ((#:phases those-phases #~%standard-phases) + #~(modify-phases #$those-phases + (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) + (invoke (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "rktboot/main.rkt"))))))) + (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 "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 +supported platforms.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +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.") + (properties `()) + (license license:asl2.0))) + +(define-public chez-scheme-racket-variant + (package + (inherit chez-scheme) + (name "chez-scheme-racket-variant") + (version (package-version chez-scheme-racket-variant-bootstrap-bootfiles)) + (source (package-source racket-vm-cgc)) + (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-racket-variant-bootstrap-bootfiles))) + (arguments + (substitute-keyword-arguments (package-arguments chez-scheme) + ((#:configure-flags cfg-flags #~'()) + #~(cons "--disable-x11" #$cfg-flags)) + ((#:phases those-phases #~%standard-phases) + #~(modify-phases #$those-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))))))) + (supported-systems (filter nix-system->chez-machine + %supported-systems)) + (home-page + (package-home-page chez-scheme-racket-variant-bootstrap-bootfiles)) + (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 license:asl2.0))) + ;; ;; Chez's bootstrap dependencies: ;; diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 54bbee7923..aa8c305d72 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -74,7 +74,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -105,7 +105,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) ghostscript ;; FIXME: This package fails to build with the error: ;; mktexpk: don't know how to create bitmap font for bchr8r @@ -170,7 +170,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) chez-web (texlive-updmap.cfg (list texlive-pdftex)))) (arguments @@ -256,7 +256,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -288,7 +288,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -319,7 +319,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -355,12 +355,34 @@ (define-public chez-mit (commit (string-append "v" version)))) (sha256 (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (snippet + ;; Workaround for chez-scheme-racket-variant. + ;; See: https://github.com/racket/racket/issues/4151 + #~(begin + (use-modules (guix build utils)) + (substitute* "mit/core.sls" + (("[(]import ") + "(import (only (chezscheme) import)\n") + (("[(]define string->uninterned-symbol gensym[)]") + (format #f "~s" + '(begin + (import (only (chezscheme) + meta-cond + library-exports)) + (meta-cond + ((memq 'string->uninterned-symbol + (library-exports '(chezscheme))) + (import (only (chezscheme) + string->uninterned-symbol))) + (else + (define string->uninterned-symbol + gensym))))))))))) (build-system gnu-build-system) (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -391,7 +413,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index c6a62e8767..54774d9cad 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -451,7 +451,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index 74a649b8a1..a7ab12a0c4 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -71,7 +71,7 @@ (define-public loko-scheme #t))))) (native-inputs `(("akku" ,akku) - ("chez-scheme" ,chez-scheme) + ("chez-scheme" ,(chez-scheme-for-system)) ("struct" ,guile-struct-pack) ("laesare" ,guile-laesare) ("pfds" ,guile-pfds) diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch new file mode 100644 index 0000000000..3a5a4a3d82 --- /dev/null +++ b/gnu/packages/patches/racket-enable-scheme-backport.patch @@ -0,0 +1,465 @@ +From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 10:36:09 -0700 +Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` + +(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) + +(Fixed conflicts by dropping pbchunks and pbarch changes.) +--- + racket/src/ChezScheme/configure | 15 ++++++++++++++- + racket/src/ChezScheme/s/Mf-base | 4 ++-- + racket/src/ChezScheme/s/Mf-cross | 4 +++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 4515ffc105..0098829091 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -45,6 +45,7 @@ threads=yes + nothreads=no + temproot="" + help=no ++forceworkarea=no + gzipmanpages=yes + installowner="" + installgroup="" +@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do + --pb) + pb=yes + ;; ++ --force) ++ forceworkarea=yes ++ ;; + --installprefix=*) + installprefix=`echo $1 | sed -e 's/^--installprefix=//'` + ;; +@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then + echo " --toolprefix= prefix tool (compiler, linker, ...) names" + echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" + echo " --workarea= build directory ($w)" ++ echo " --force configure even without boot files" + echo " CC= C compiler" + echo " CPPFLAGS= C preprocessor flags" + echo " CFLAGS= C compiler flags" +@@ -721,8 +726,16 @@ case "${flagsmuni}" in + ;; + esac + ++if [ "$w" = "$m" ] ; then ++ configuringin="" ++else ++ configuringin=" in $w" ++fi ++ + if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then +- echo "Configuring for $m" ++ echo "Configuring for $m$configuringin" ++elif [ "$forceworkarea" = yes ] ; then ++ echo "Configuring for $m$configuringin despite missing boot files" + else + if [ "$m" = "" ] ; then + maybem="" +diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base +index cc6178c973..1f4a967998 100644 +--- a/racket/src/ChezScheme/s/Mf-base ++++ b/racket/src/ChezScheme/s/Mf-base +@@ -94,7 +94,7 @@ endif + # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme + # implementation + Scheme = ../bin/$m/scheme${ExeSuffix} +-export SCHEMEHEAPDIRS=../boot/%m ++export SCHEMEHEAPDIRS=../boot/$m + export CHEZSCHEMELIBDIRS=. + + # Define the libdirs separator character +@@ -691,4 +691,4 @@ reset-one: + + .PHONY: run + run: +- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) ++ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) +diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross +index d796cbb459..397af59a28 100644 +--- a/racket/src/ChezScheme/s/Mf-cross ++++ b/racket/src/ChezScheme/s/Mf-cross +@@ -43,5 +43,7 @@ x$(xm).$(m): + $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch + mv xpatch x$(xm).$(m) + ++ifneq ($(SCHEMEHEAPDIRS),:) + # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed +-nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++endif +-- +2.32.0 + + +From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 11:03:30 -0700 +Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable + +When the same Chez Scheme version as used by Racket is already +available, then `--enable-scheme=...` can supply an executable. For +cross builds, `--enable-scheme=...` can still supply a build +directory, instead, as before. + +(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) +--- + racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ + racket/src/README.txt | 30 +++++++++++--- + racket/src/configure | 8 +++- + racket/src/cs/README.txt | 6 ++- + racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- + racket/src/cs/c/configure | 24 +++++++++-- + racket/src/cs/c/configure.ac | 21 ++++++++-- + 7 files changed, 112 insertions(+), 24 deletions(-) + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index c396efc851..3998ef9ccd 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -59,6 +59,9 @@ reset: + %.boot: + (cd $(workarea) && $(MAKE) $*.boot) + ++auto.boot: ++ (cd $(workarea) && $(MAKE) $(defaultm).boot) ++ + # .bootquick to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine +diff --git a/racket/src/README.txt b/racket/src/README.txt +index 98647aebce..d77310b4a4 100644 +--- a/racket/src/README.txt ++++ b/racket/src/README.txt +@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of + ======================================================================== + + Cross-compilation requires at least two flags to `configure`: ++`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) ++`--enable-scheme-SCHEME`. ++ ++More information: + + * `--host=OS`, where OS is something like `i386-gnu-linux` to + indicate the target platform. +@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: + run `configure` again (with no arguments) in a "local" subdirectory + to create a build for the current platform. + +-An additional flag is needed for building Racket CS, unless the flag +-`--enable-racket=auto` is used: +- +- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" +- directory where Chez Scheme is built for the host system. ++ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable ++ executable that runs on the build platform; the executable must be ++ the same version as used in Racket built for the target platform. ++ ++ Supplying `--enable-scheme=DIR` is also supported in cross-build ++ mode, where DIR is a path that has a "ChezScheme" directory where ++ Chez Scheme is built for the host system. ++ ++The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are ++allowed for non-cross builds, too: ++ ++ * For Racket CS, supplying either selects a Racket or Chez Scheme ++ implementation used to create boot files to the build platform. ++ Suppling Chez Scheme is a much more direct path, but when Racket is ++ supplied, its version does not have to match the version being ++ built. ++ ++ * For Racket BC, `--enable-racket=RACKET` selects a Racket for ++ prepare C sources to cooperate with garbage collection. Its version ++ needs to be close to the one being built, and potentially exactly ++ the same version. + + Some less commonly needed `configure` flags are for Racket BC: + +diff --git a/racket/src/configure b/racket/src/configure +index c9f3ba4419..1b53ec7ce2 100755 +--- a/racket/src/configure ++++ b/racket/src/configure +@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" + use_cs=maybe + use_bc=maybe + supplied_racket=no ++supplied_scheme=no + enable_boothelp= + + # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, +@@ -34,6 +35,9 @@ for arg in $*; do + --enable-racket=*) + supplied_racket=yes + ;; ++ --enable-scheme=*) ++ supplied_scheme=yes ++ ;; + --help | -h) + echo $0: + echo see --help-bc or --help-cs, since the Racket CS build and the +@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then + fi + + if test "$use_cs" = "yes" ; then +- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then +- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly ++ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then ++ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly + exit 1 + fi + +diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt +index 2ece417b78..8e6fc57b74 100644 +--- a/racket/src/cs/README.txt ++++ b/racket/src/cs/README.txt +@@ -39,6 +39,11 @@ build: + installed in the "../ChezScheme/boot/pb" directory as described by + "../ChezScheme/BUILDING". + ++ Supplying `--enable-scheme=...` is also an option if you alerady ++ have the same version of Chez Scheme built on the current platform. ++ Another build will be created, anyway, but more quickly than ++ without Chez Scheme. ++ + * Racket is needed to generate the files in the "schemified" + directory from the sources in sibling directories like "../io". The + Racket version must be practically the same as the current Racket +@@ -48,7 +53,6 @@ build: + Unlike Chez Scheme boot files, the files generated in "schemified" + are human-readable and -editable Scheme code. That provides a way + out of bootstrapping black holes, even without BC. +- + + + ======================================================================== +diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in +index 54a644a1d9..d73993f0fc 100644 +--- a/racket/src/cs/c/Makefile.in ++++ b/racket/src/cs/c/Makefile.in +@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ + SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) + SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme + SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) +-SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_existing = @MAKE_SCHEME_SCHEME@ ++SCHEME = $(SCHEME@USE_SCHEME_MODE@) + + TARGET_MACH = @TARGET_MACH@ + SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) +@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. + @INCLUDEDEP@ @srcdir@/../../version/version.mak + + cs: +- $(MAKE) scheme@T_CROSS_MODE@ ++ $(MAKE) scheme@MAKE_SCHEME_MODE@ + $(MAKE) racket-so + cd rktio; $(MAKE) + $(MAKE) racketcs +@@ -121,9 +123,13 @@ racket-so: + + RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ + ++TARGET_MACH_built = $(TARGET_MACH) ++TARGET_MACH_existing = xc-$(TARGET_MACH) ++XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch ++ + CS_PROGS = SCHEME="$(SCHEME)" + CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ +-CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" ++CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" + PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" + + build-racket-so: +@@ -163,6 +169,15 @@ pb-bootquick: + cd $(SCHEME_WORKAREA) && $(MAKE) reset + $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) + ++scheme-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot ++ $(MAKE) mach-make ++ ++$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: ++ mkdir -p $(SCHEME_WORKAREA) ++ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" ++ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all ++ + mach-make: + $(MAKE) config-scheme + cd $(SCHEME_WORKAREA) && $(MAKE) +@@ -182,24 +197,33 @@ config-scheme: + + scheme-cross: + env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt ++ $(MAKE) finish-scheme-cross ++ ++finish-scheme-cross: + $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) + cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) + cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t +- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch ++ $(MAKE) $(XPATCH_FILE) ++ ++scheme-cross-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) ++ $(MAKE) finish-scheme-cross + + # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older +-# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files +-XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ +- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot ++# than the build- use as Racket for build; or "auto" to create +- --enable-scheme= use as host's build directory for cross ++ --enable-scheme= use as host build for cross + --enable-mach= use Chez Scheme machine type + --enable-target= cross-build for Chez Scheme machine type + --enable-portable prefer portable to host-specific +@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" + show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' + + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + show_explicitly_enabled "${enable_portable}" "portable" +@@ -4745,9 +4748,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags + + + ++ ++ ++ + + + +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 464ebe1760..aaee88156d 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev + AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) + m4_include(../ac/path_arg.m4) + AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket for build; or "auto" to create]) +-AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host's build directory for cross]) ++AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host build for cross]) + AC_ARG_ENABLE(mach, [ --enable-mach= use Chez Scheme machine type ]) + AC_ARG_ENABLE(target, [ --enable-target= cross-build for Chez Scheme machine type ]) + m4_include(../ac/portable_arg.m4) +@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" + show_explicitly_enabled "${enable_xonx}" "Unix style" + m4_include(../ac/path_show.m4) + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + m4_include(../ac/portable_show.m4) +@@ -504,9 +504,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) + AC_SUBST(CROSS_MODE) + AC_SUBST(T_CROSS_MODE) + AC_SUBST(TT_CROSS_MODE) ++AC_SUBST(MAKE_SCHEME_MODE) ++AC_SUBST(MAKE_SCHEME_SCHEME) ++AC_SUBST(USE_SCHEME_MODE) + AC_SUBST(SETUP_BOOT_MODE) + AC_SUBST(OSX) + AC_SUBST(NOT_OSX) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 10:20:43 2022 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:43 +0000 Received: from localhost ([127.0.0.1]:48350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSIF-0006rM-69 for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:43 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:38683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSI5-0006qo-E5 for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:29 -0500 Received: by mail-qt1-f178.google.com with SMTP id r14so14958758qtt.5 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:20:25 -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=T3cyE9lcD862EBq1rkflPLpvKGsEIw4dspBeMEtTzIg=; b=dBZqJ9aUHG2nJinzJAi/eVPvH2NY+lu8+5byNWNqSqv7WlShSnN3uYBhPUCzGyY3oo N/htYzXb1F+xvoz6gNnfJtaM/u5fxnGYSRJYkRnygbNByFc54xIv6qa+Ovuu01WiN+li +cYrgWX7d4j6PuPGu3VH0KKOLg1zg/d3aeJdUS/HEp2nebgC/AgTSW5QIkG2i+03ql+H xoR7cdq8ESXLoNeDtu4e8q5/RV6r2dd9Inby4V/OQFtW1D9EWjnCFqDBz6fZnJEoqiJG Q2fVK4IvxHnLBD52Fb+8LmQV9EJRmDcUqpaPLVMWE2sLVkjelgcwI7/fj3M8niIjfmnX w1Fw== 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=T3cyE9lcD862EBq1rkflPLpvKGsEIw4dspBeMEtTzIg=; b=74uQzfYMxEw28wAKrP+Wfg9kx0eV3o2JBa1DZ3k9CqlJAZJgOOXhydN1gNAGfASrsK wapdfE17JjJxup/DwGnn1oJh9Iv0Fge3ub8JDALSZlhtSQdTBTMGUzsC46UxvD0+nhmW xc1gaXUk+tlt0qyxl8+VzydRubBl1ZlqMOFh7zCkyqFzIq5HXQM5MlfeyWMw6ZUR2Tbb Uo3JVEgR1yUyHEvKkI3wVnlukgULj0sYZDplla37AvBLW0gFwqsd6I3tQGaMOO/FXboK qyP3iBBT0KXBkVnEFt5L521WfZvMzih2HMi+xRhk/hbw5zUA2QKbIXOzYY3aS2w0DQ4j w5Qg== X-Gm-Message-State: AOAM533gRU9cMPhB667u5bgPJFwFkpQX0f8qVzvuMQr2cnVP7bkw+uM8 DQtJHhULwBd8Kmg82HI7e3agBsBsN4Vv3dXp2/Y= X-Google-Smtp-Source: ABdhPJw/kWosZqDPBlq1tyz2SmqY5d/KBiWJhWOgLASIQBf1U98M1vQXXHORKY2X7AbQxcciM+0o5w== X-Received: by 2002:a05:622a:1a90:: with SMTP id s16mr3340584qtc.586.1644333619121; Tue, 08 Feb 2022 07:20: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 y15sm7455924qkp.22.2022.02.08.07.20.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:20:18 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [RFC PATCH 9/9] gnu: racket: Update to 8.3.900. Date: Tue, 8 Feb 2022 10:18:57 -0500 Message-Id: <20220208151857.1900389-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.3.900. Rewrite [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.178 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.178 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.3.900. Rewrite [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.3.900. Rewrite to use 'racket-vm-for-system', label-less inputs, G-expressions, and Git origins for main-distribution packages. --- gnu/local.mk | 3 +- ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1549 +++++++++++------ 3 files changed, 1053 insertions(+), 525 deletions(-) create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index 94de782ca9..742e072e73 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright © 2020 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan -# Copyright © 2021 Philip McGrath +# Copyright © 2021, 2022 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher # Copyright © 2021 Dmitry Polyakov @@ -1786,6 +1786,7 @@ dist_patch_DATA = \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-enable-scheme-backport.patch \ + %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch new file mode 100644 index 0000000000..1e018eaa79 --- /dev/null +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -0,0 +1,26 @@ +From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Mon, 31 Jan 2022 15:31:22 -0700 +Subject: [PATCH] fix creation of tethered launchers + +Related to racket/racket#4133 + +(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) +--- + gui-lib/mred/installer.rkt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt +index b1691472..9ef06c53 100644 +--- a/gui-lib/mred/installer.rkt ++++ b/gui-lib/mred/installer.rkt +@@ -72,4 +72,5 @@ + (list "-A" (path->string (find-system-path 'addon-dir))))) + + (define (config-flags) +- (list "-G" (path->string (find-config-dir)))) ++ (list "-X" (path->string (find-collects-dir)) ++ "-G" (path->string (find-config-dir)))) +-- +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index e8d016c07b..e3c38714c1 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021 Philip McGrath +;;; Copyright © 2021, 2022 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -21,8 +21,6 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages racket) - #:use-module ((guix licenses) - #:select (asl2.0 expat lgpl3+)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -30,7 +28,10 @@ (define-module (gnu packages racket) #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) + #:use-module (ice-9 exceptions) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) @@ -47,200 +48,87 @@ (define-module (gnu packages racket) #:use-module (gnu packages multiprecision) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages xorg)) - -;; Commentary: -;; -;; Here's how bootstrapping minimal Racket works: -;; -;; - Racket BC [CGC] can be built with only a C compiler (except for -;; one caveat discussed below). -;; - 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 -;; 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. -;; -;; So, we build CGC to build 3M to build bootfiles and CS. -;; -;; 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 -;; README file applies to all such subsystems: -;; -;; The Racket version must be practically the same as the current Racket -;; verson, although it can be the Racket BC implementation (instead of -;; the Racket CS implementation). -;; -;; Unlike Chez Scheme boot files, the files generated in "schemified" -;; are human-readable and -editable Scheme code. That provides a way -;; out of bootstrapping black holes, even without BC. -;; -;; However, other Racket subsystems implemented in Racket for Racket CS -;; use older C implementations for Racket BC, whereas the reader, expander, -;; and module system were completely replaced with the Racket implementation -;; as of Racket 7.0. -;; -;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) -;; are embeded in C as a static string constant. Eventually, they are further -;; compiled by the C-implemented Racket BC bytecode and JIT compilers. -;; (On platforms where Racket BC's JIT is not supported, yet another compiler -;; instead compiles the linklets to C code, but this is not a bootstrapping -;; issue.) -;; -;; Code: - -(define cfg-flag:sh-for-rktio - `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - (assoc-ref %build-inputs "sh") - "/bin/sh")) -(define cfg-flag:enable-lt - `(string-append "--enable-lt=" - (assoc-ref %build-inputs "libtool") - "/bin/libtool")) -(define cfg-flag:enable-racket - `(let ((racket (assoc-ref %build-inputs "racket"))) - (string-append "--enable-racket=" - racket - "/bin/racket"))) - -(define unpack-nanopass+stex - ;; Copied from chez-scheme. - ;; TODO: Eventually, we should refactor Chez Scheme - ;; enough to share more directly, so that we can make - ;; Racket's version of Chez avalable as a Guix package, - ;; e.g. for architectures not supported upstream. - ;; For now, we let Racket drive the Chez build process - ;; other than this step. - `(for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex"))) - + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) (define-public racket-minimal (package (name "racket-minimal") - (version "8.3") ; note: remember to also update racket! - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit (string-append "v" version)))) - (sha256 - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") - (file-name (git-file-name name version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) - (modules '((guix build utils))) - (snippet - (with-imported-modules '((guix build utils)) - #~(begin - ;; Unbundle Chez submodules. - (with-directory-excursion "racket/src/ChezScheme" - ;; Remove bundled libraries (copied from 'chez-scheme'). - (for-each delete-file-recursively - '("stex" - "nanopass" - "lz4" - "zlib"))) - ;; Unbundle libffi. - (delete-file-recursively "racket/src/bc/foreign/libffi")))))) - (inputs - `(;; common to all racket-minimal variants: - ("openssl" ,openssl) - ("sqlite" ,sqlite) - ("sh" ,bash-minimal) - ;; only for CS - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static"))) - (native-inputs - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) + (version (package-version (racket-vm-for-system))) + (source (package-source (racket-vm-for-system))) + ;; For cross-compilation, Matthew Flatt recommends reusing + ;; as much of `raco cross` as possible. So, put that off until + ;; we have a build system for Racket packages. + (inputs (list openssl sqlite (racket-vm-for-system))) (build-system gnu-build-system) (arguments - `(#:configure-flags - (list "--enable-csonly" - "--enable-libz" - "--enable-liblz4" - ,cfg-flag:enable-racket - ,cfg-flag:sh-for-rktio) - #:out-of-source? #true - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main distribution. - #:tests? #f - #:modules ((ice-9 match) - (guix build gnu-build-system) - (guix build utils)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (string-append (assoc-ref inputs "bootfiles") "/boot") - "boot")) - #t)) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f ,@(map (lambda (lib) - (string-append (assoc-ref inputs lib) - "/lib")) - '("openssl" - "sqlite")))) - (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - ,version - "/catalog/") - #f)))))) - #t)) - (add-before 'configure 'change-directory - (lambda _ - (chdir "racket/src") - #t)) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda* (#:key outputs #:allow-other-keys) - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append (assoc-ref outputs "out") - "/share/racket/pkgs")) - #t))))) + (list + #:configure-flags + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + (list #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib")))) + #:make-flags #~`("base") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (ice-9 match)) + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs configure-flags make-flags + #:allow-other-keys) + (let* ((vm-dir (search-input-directory inputs "opt/racket-vm")) + (racket (string-append vm-dir "/bin/racket"))) + (apply invoke + racket + #$make-installation-layer.rkt + `(,@(cond + ((false-if-exception + (search-input-file + inputs "etc/racket/config.rktd")) + => (lambda (file) + `("--parent" + ,(dirname (dirname (dirname file)))))) + (else + '())) + ,@configure-flags + ,vm-dir + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p (string-append #$output "/lib/racket/pkgs")) + (for-each (lambda (name) + (copy-recursively + (string-append "pkgs/" name) + (string-append #$output "/lib/racket/pkgs/" name))) + '("base" "racket-lib")))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket + (search-input-file inputs "/opt/racket-vm/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) (home-page "https://racket-lang.org") (synopsis "Racket without bundled packages such as DrRacket") (description @@ -254,280 +142,77 @@ (define (write-racket-hash alist) DrRacket IDE, are not included.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list asl2.0 expat)))) - - -(define-public racket-minimal-bc-3m - (hidden-package - (package - (inherit racket-minimal) - (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (delete "zlib" "zlib:static" "lz4" "lz4:static") - (prepend libffi ;; <- only for BC variants - ))) - (native-inputs - `(("libtool" ,libtool) - ("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc)))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) - ((#:configure-flags _ '()) - `(list "--enable-bconly" - ,cfg-flag:enable-racket - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)) - ((#:phases usual-phases) - `(modify-phases ,usual-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") - (description "The Racket BC (``before Chez'' or ``bytecode'') -implementation was the default before Racket 8.0. It uses a compiler written -in C targeting architecture-independent bytecode, plus a JIT compiler on most -platforms. Racket BC has a different C API and supports a slightly different -set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). - -This package is the normal implementation of Racket BC with a precise garbage -collector, 3M (``Moving Memory Manager'').") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list lgpl3+ asl2.0 expat))))) - - -(define-public racket-minimal-bc-cgc - (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs - (alist-delete "racket" (package-native-inputs racket-minimal-bc-3m))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:configure-flags _ '()) - `(list "--enable-cgcdefault" - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the -Racket CS implementation. - -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) - - -(define-public racket-bootstrap-chez-bootfiles - (hidden-package - (package - (inherit racket-minimal) - (name "racket-bootstrap-chez-bootfiles") - (inputs `()) - (native-inputs - `(("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-3m)) - ("stex" ,(package-source stex)) - ("nanopass" ,(package-source chez-nanopass)))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (delete 'configure) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (invoke (string-append (assoc-ref inputs "racket") - "/bin/racket") - "rktboot/main.rkt" - "--dest" (assoc-ref outputs "out"))) - #t)) - (delete 'check) - (delete 'install)))) - (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 -supported platforms.) - -The Racket package @code{cs-bootstrap} (part of the main Racket Git -repository) implements enough of a Chez Scheme simulation to load the Chez -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.") - (license (list asl2.0))))) - - -(define %installer-mirrors - ;; Source: - ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58 - ;; Matthew Flatt says: "note that many are commented out" - ;; INVARIANT: End with a trailing "/"! - '("https://mirror.racket-lang.org/installers/" - "https://www.cs.utah.edu/plt/installers/" - "https://plt.cs.northwestern.edu/racket-mirror/" - "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" - ;; Universität Tübingen is using a self-signed HTTPS certificate: - "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" - "https://racket.infogroep.be/" - )) - -(define %main-repo-main-distribution-pkgs - ;; These are the packages developed in the main Racket Git repository - ;; that are part of the main distribution. - '("at-exp-lib" - "base" - "compiler-lib" - ;; NOT "compiler-test" - "compiler" - "net-doc" - "net-lib" - ;; NOT "net-test" - "net" - ;; NOT "plt-services" - ;; NOT "racket-benchmarks" - ;; NOT "racket-build-guide" - "racket-doc" - "racket-index" - "racket-lib" - ;; NOT "racket-test-core" - ;; NOT "racket-test-extra" - ;; NOT "racket-test" - "zo-lib")) - + (license (list license:asl2.0 license:expat)))) (define-public racket (package (inherit racket-minimal) (name "racket") - (version (package-version racket-minimal)) ; needed for origin uri to work - (source - (origin - (method url-fetch) - (uri (map (lambda (base) - (string-append base version "/racket-src.tgz")) - %installer-mirrors)) - (sha256 - (base32 - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) - (snippet - #~(begin - (use-modules (guix build utils) - (ice-9 match) - (ice-9 regex)) - ;; unbundle minimal Racket - (for-each delete-file-recursively - '("collects" - "doc" - "etc" - "README" - "src")) - ;; unbundle package sources included elsewhere - (with-directory-excursion "share/pkgs" - (for-each delete-file-recursively - '#+%main-repo-main-distribution-pkgs)) - #t)))) + (source #f) (inputs - `(("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("glib" ,glib) - ("glu" ,glu) - ("gmp" ,gmp) - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("mpfr" ,mpfr) - ("pango" ,pango) - ("unixodbc" ,unixodbc) - ("libedit" ,libedit))) - (native-inputs - `(("racket" ,racket-minimal) - ("extend-layer" ,extend-layer) - ("main-repo" ,(package-source racket-minimal)))) + (list cairo + fontconfig + glib + glu + gmp + gtk+ ;; propagates gdk-pixbuf+svg + libjpeg-turbo + libpng + libx11 ;; ?? wayland ?? + mesa + mpfr + pango + unixodbc + libedit ;; TODO reconsider in light of expeditor and readline-gpl + racket-minimal ;; <-- TODO non-tethered layer + (racket-vm-for-system))) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'configure 'unpack-packages - (let ((unpack (assoc-ref %standard-phases 'unpack))) - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out")) - (pkgs-dir (string-append prefix "/share/racket/pkgs"))) - (mkdir-p pkgs-dir) - (copy-recursively - "share/links.rktd" - (string-append prefix "/share/racket/links.rktd")) - (copy-recursively "share/pkgs" pkgs-dir) - ;; NOTE: unpack changes the working directory - (unpack #:source (assoc-ref (or native-inputs inputs) - "main-repo")) - (for-each (lambda (pkg) - (define dest (string-append pkgs-dir "/" pkg)) - (mkdir-p dest) - (copy-recursively (string-append "pkgs/" pkg) - dest)) - ',%main-repo-main-distribution-pkgs) - #t)))) - (replace 'configure - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out"))) - (apply invoke - (string-append racket "/bin/racket") - (assoc-ref inputs "extend-layer") - racket - prefix - (map - (lambda (lib) - (string-append (assoc-ref inputs lib) "/lib")) - '("cairo" - "fontconfig" - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))) - #t))) - (replace 'build - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) - "racket") - "/bin/racket") - "--config" - (string-append (assoc-ref outputs "out") - "/etc/racket") - "-l" - "raco" - "setup") - #t)) - (delete 'install)) - ;; we still don't have these: - #:tests? #f)) + (substitute-keyword-arguments (package-arguments racket-minimal) + ((#:configure-flags _ '()) + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit")))))) + ((#:make-flags _ '()) + #~`("main-distribution")) + ((#:phases parent-phases #~%standard-phases) + #~(modify-phases #$parent-phases + (delete 'unpack) + (replace 'build + (lambda args + (mkdir-p (string-append #$output "/lib/racket/pkgs")) + (for-each + (match-lambda + ((name src) + (copy-recursively + src + (string-append #$output "/lib/racket/pkgs/" name)))) + '(#$@main-distribution-packages)))))))) (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -539,82 +224,898 @@ (define dest (string-append pkgs-dir "/" pkg)) DrRacket IDE, libraries for GUI and web programming, and implementations of languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) - -(define extend-layer +(define make-installation-layer.rkt (scheme-file - "extend-layer.rkt" + "make-installation-layer.rkt" `(module - extend-layer racket/base + make-installation-layer racket/base (require racket/cmdline racket/match racket/file + racket/port racket/list racket/pretty) - (define config-file-pth - "etc/racket/config.rktd") (define (build-path-string . args) (path->string (apply build-path args))) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) - (command-line - #:args (parent-layer prefix . lib-dir*) - (let* ([config - (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) - (hash-set* - config - main-key - (build-path-string prefix pth) - search-key - (list* #f - (hash-ref config - main-key - (build-path-string parent-layer pth)) - (filter values (hash-ref config search-key null)))))] - [config - (hash-set config - 'apps-dir - (build-path-string prefix "share/applications"))] - [config - ;; place new foreign lib-search-dirs before old - ;; foreign dirs, but after Racket layers - (let-values - ([(rkt extra) - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - (hash-ref config 'lib-search-dirs))]) - (hash-set config + (define tethered? #f) + (define parent #f) + (define extra-foreign-lib-search-dirs '()) + (define-values [vm-dir prefix] + (command-line + #:once-each + [("--tethered") "create a tethered layer" + (set! tethered? #t)] + [("--parent") dir "path of parent layer, if any" + (set! parent dir)] + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (vm-dir prefix) + (values vm-dir prefix))) + (let* ([config + (for/fold + ([config (file->value + (if parent + (build-path parent "etc/racket/config.rktd") + (build-path vm-dir "etc/config.rktd")))]) + ([spec + (in-list + '((lib-dir lib-search-dirs "lib/racket" "lib") + (share-dir share-search-dirs "share/racket" "share") + (links-file links-search-files + "lib/racket/links.rktd" + "share/links.rktd") + (pkgs-dir pkgs-search-dirs "lib/racket/pkgs" "share/pkgs") + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(bin-dir bin-search-dirs "bin" "bin") + (bin-dir bin-search-dirs "unused-untethered-bin" "bin") + (man-dir man-search-dirs "share/man" "share/man") + (doc-dir doc-search-dirs "share/doc/racket" "doc") + (include-dir include-search-dirs + "include/racket" + "include")))]) + (match-define (list main-key search-key pth vm-pth) spec) + (hash-set* + config + main-key + (build-path-string prefix pth) + search-key + (list* #f + (hash-ref config + main-key + (lambda () + (if parent + (build-path-string parent pth) + (build-path-string vm-dir vm-pth)))) + (filter values (hash-ref config search-key null)))))] + [config + (hash-update config 'lib-search-dirs - (append rkt - lib-dir* - extra)))] - [bin-dir - (hash-ref config 'bin-dir)] - [config - (hash-set* config - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) - (make-parent-directory* new-config-pth) - (call-with-output-file* - new-config-pth - (lambda (out) - (pretty-write config out)))))))) + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] + [config + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaroung Guile reader/printer: + ['|3m| "-bc"] + [_ ""]) + "-guix"))] + [config + (cond + [tethered? + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(define bin-dir (hash-ref config 'bin-dir)) + (define bin-dir (build-path-string prefix "bin")) + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [else + config])]) + (define new-config-pth + (build-path prefix "etc/racket/config.rktd")) + (make-parent-directory* new-config-pth) + (call-with-output-file* + new-config-pth + (lambda (out) + (pretty-write config out))))))) + +(define-public main-distribution-packages + (let* ((%racket-version (package-version (racket-vm-for-system))) + (%racket-commit (string-append "v" %racket-version))) + ;; on release, commit will be %racket-commit + (append-map + (match-lambda + ((source . pkgs) + (map (match-lambda + ((? string? name) + (list name (file-append source (string-append "/" name)))) + ((name ".") + (list name source)) + ((name rel-path) + (list name (file-append source (string-append "/" rel-path))))) + pkgs))) + `((,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/2d") + (commit "9519bb9102389fb8716703176540ba3949770b82"))) + (sha256 (base32 + "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) + (file-name + (git-file-name "racket-2d" %racket-version))) + "2d" "2d-doc" "2d-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/algol60") + (commit "e9bcd18562c84eaff34f220312f102bd8db46e97"))) + (sha256 (base32 + "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx")) + (file-name + (git-file-name "racket-algol60" %racket-version))) + ("algol60" ".")) + (,(package-source (racket-vm-for-system)) + ("at-exp-lib" "pkgs/at-exp-lib") + ("compiler" "pkgs/compiler") + ("compiler-lib" "pkgs/compiler-lib") + ("net" "pkgs/net") + ("net-doc" "pkgs/net-doc") + ("net-lib" "pkgs/net-lib") + ("racket-doc" "pkgs/racket-doc") + ("racket-index" "pkgs/racket-index") + ("sandbox-lib" "pkgs/sandbox-lib") + ("zo-lib" "pkgs/zo-lib")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/cext-lib") + (commit "0552d61f3b019167c4144fcb4e2108732d30f85c"))) + (sha256 (base32 + "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341")) + (file-name (git-file-name "racket-cext-lib" %racket-version))) + "cext-lib" "dynext-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/class-iop") + (commit "f640064b50109887c40da6df3d3cebf635040794"))) + (sha256 (base32 + "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l")) + (file-name (git-file-name "racket-class-iop" %racket-version))) + "class-iop-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/compatibility") + (commit "37f11132cdad7ef27386b68383d073f275d67c31"))) + (sha256 (base32 + "0bfqwscjpyi325br5pa6g62g9c8lq18a80zp5g3d2qzn3n3mi6x0")) + (file-name (git-file-name "racket-compatibility" %racket-version))) + "compatibility" "compatibility-doc" "compatibility-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/contract-profile") + (commit "95d980a076126b8e4e4284e912f2a7d9d3ab6860"))) + (sha256 (base32 + "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3")) + (file-name + (git-file-name "racket-contract-profile" %racket-version))) + ("contract-profile" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/data") + (commit "e32d012b394e32e102e8a9adfcc885bb0541ab51"))) + (sha256 (base32 + "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55")) + (file-name (git-file-name "racket-data" %racket-version))) + "data" "data-doc" "data-enumerate-lib" "data-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/datalog") + (commit "7d160a86451af8298093d07674a2eb0e1a0161a4"))) + (sha256 (base32 + "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp")) + (file-name (git-file-name "racket-datalog" %racket-version))) + ("datalog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/db") + (commit "a692d8ebf93ddde5f6cf3c2405b6651039afc2dc"))) + (sha256 (base32 + "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5")) + (file-name (git-file-name "racket-db" %racket-version))) + "db" "db-doc" "db-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/deinprogramm") + (commit "2894fce2d5296c0eb5d7dcbf4828995941e5a476"))) + (sha256 (base32 + "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd")) + (file-name (git-file-name "racket-deinprogramm" %racket-version))) + "deinprogramm" "deinprogramm-signature") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/distributed-places") + (commit "4e75977ab091999dfd7de765e7807fabc06a6bf3"))) + (sha256 (base32 + "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0")) + (file-name + (git-file-name "racket-distributed-places" %racket-version))) + "distributed-places" "distributed-places-doc" "distributed-places-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/draw") + (commit "cca0deb3ff5a570c1c3c03ea0983d106492444b7"))) + (sha256 (base32 + "1qai7sph1pyvc5j2pvwkxlzl2jgzj23s8nlfbdx74xk17i4p0xzp")) + (file-name (git-file-name "racket-draw" %racket-version))) + "draw" "draw-doc" "draw-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/drracket") + (commit "601bc502eda4ca2739189dd17afe6cb664f5ff53"))) + (sha256 (base32 + "183bhyhihp9rbhq6jbjxns57xxdxwf1j2ypbx6cdx5x4bhii9qk1")) + (file-name (git-file-name "racket-drracket" %racket-version))) + "drracket" + "drracket-plugin-lib" + "drracket-tool" + "drracket-tool-doc" + "drracket-tool-lib" + "drracket-tool-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/ds-store") + (commit "949ca63dd00522b3ab8aec2d71c543ece8266872"))) + (sha256 (base32 + "0ajr27kipp4dr1qlisaghsb3h7lhhjwrfw2r79b5myczsa1mp661")) + (file-name (git-file-name "racket-ds-store" %racket-version))) + "ds-store" "ds-store-doc" "ds-store-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eli-tester") + (commit "036e07d43a1f478ea1750881d5591d983ce1ffaf"))) + (sha256 (base32 + "0icx6wn14gjm8kdmq1jppqgq87sxkras4qb5xmdr6wigxafhjqyk")) + (file-name (git-file-name "racket-eli-tester" %racket-version))) + ("eli-tester" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eopl") + (commit "d0550fdd1c2e5b20640f94ed99602d4e79ea20a4"))) + (sha256 (base32 + "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s")) + (file-name (git-file-name "racket-eopl" %racket-version))) + ("eopl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/errortrace") + (commit "6e89c54a5f9de8b925ad668888aa241722e5bbfc"))) + (sha256 (base32 + "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip")) + (file-name (git-file-name "racket-errortrace" + (package-version (racket-vm-for-system))))) + "errortrace" "errortrace-doc" "errortrace-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/expeditor") + (commit "34973c081bdf6ffec0c69c0126d8849a00e012a3"))) + (sha256 (base32 + "0wsjisd81lhr3g1alg51v8pzwz53zfjx6c36sg7fjcza4crhk1pf")) + (file-name (git-file-name "racket-expeditor" %racket-version))) + "expeditor" "expeditor-doc" "expeditor-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/frtime") + (commit "a3c93aeae3e3d2a421afb7269ff282c573507cd0"))) + (sha256 (base32 + "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5")) + (file-name (git-file-name "racket-frtime" %racket-version))) + ("frtime" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/future-visualizer") + (commit "671d32970eef64d549a5cdbe5e3d048474c7304a"))) + (sha256 (base32 + "1758qq769m0r14xf64sl2ix2l9z340kvapar0j7s5kdg42lmvnhm")) + (file-name + (git-file-name "racket-future-visualizer" %racket-version))) + "future-visualizer" "future-visualizer-pict" "future-visualizer-typed") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/games") + + (commit "56d67ba04465aa19f1b3057df46bf235c79bba14"))) + (sha256 (base32 + "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d")) + (file-name (git-file-name "racket-games" %racket-version))) + ("games" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui") + (commit "3b27c9f593e138c71ae009ad5741bf7f7282e6b3"))) + (sha256 (base32 + "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) + (file-name (git-file-name "racket-gui" %racket-version))) + "gui" "gui-doc" "gui-lib" "tex-table") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui-pkg-manager") + (commit "70cc90538c5dffb722e17cabb769aeadfef32ec4"))) + (sha256 (base32 + "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5")) + (file-name + (git-file-name "racket-gui-pkg-manager" %racket-version))) + "gui-pkg-manager-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/htdp") + (commit "9cf89561d818be718a07c9b8f214af83a914e86c"))) + (sha256 (base32 + "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl")) + (file-name (git-file-name "racket-htdp" %racket-version))) + "htdp" "htdp-doc" "htdp-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/html") + (commit "9331d4f7169f8c5932f8d2ae721b2a96515ac895"))) + (sha256 (base32 + "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x")) + (file-name (git-file-name "racket-html" %racket-version))) + "html" "html-doc" "html-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/icons") + (commit "14b164c20e1214ffa1e7585d0b6597d5c3f0351a"))) + (sha256 (base32 + "1s5a6j11fg3fdr6b7vm2q7q178d7q8b8igy73bs211r27qrd1gg7")) + (file-name (git-file-name "racket-icons" %racket-version))) + ("icons" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/images") + (commit "b3d032087d9544a0561b61fedc09adc2c63ed29d"))) + (sha256 (base32 + "0rpjxqw34bq5m08kh1ldl1mr7s9z1lyydxxcyzb292kqh9qiqvfl")) + (file-name (git-file-name "racket-images" %racket-version))) + "images" "images-doc" "images-gui-lib" "images-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/lazy") + (commit "a35720c304eafa6f9610b9ac986a89d3e0f0e889"))) + (sha256 (base32 + "176ylzgbdsbmqknpihaz519afq71pyjkv1h87j5v8jfbpbddyfsf")) + (file-name (git-file-name "racket-lazy" %racket-version))) + ("lazy" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/macro-debugger") + (commit "e5bbfbeeff6f4a41e7d66b1a1c3da47bdc0d5b6b"))) + (sha256 (base32 + "14hyrwbkffr61fk44l02xb47bhv5zccw0ymaa9kxld86hvyqhqbm")) + (file-name (git-file-name "racket-macro-debugger" %racket-version))) + "macro-debugger" "macro-debugger-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/main-distribution") + (commit "df36b6bb46f038f6e22a19b7b9d7d061b9631600"))) + (sha256 (base32 + "0m2n9s32s8a4a2gn4ywrm9l8jycdm5ayi5w9kh5wchhrrw7qzq7y")) + (file-name + (git-file-name "racket-main-distribution" %racket-version))) + ("main-distribution" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/make") + (commit "7493795aba151f7164caf497003746dd049b8ae4"))) + (sha256 (base32 + "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa")) + (file-name (git-file-name "racket-make" %racket-version))) + ("make" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/math") + (commit "67e19384a0923ccbf2ed9e8b7ce55ff92fdefe0e"))) + (sha256 (base32 + "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac")) + (file-name (git-file-name "racket-math" %racket-version))) + "math" "math-doc" "math-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mysterx") + (commit "905834527683db700b87ba2b510c07aa0c688de4"))) + (sha256 (base32 + "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48")) + (file-name (git-file-name "racket-mysterx" %racket-version))) + ("mysterx" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzcom") + (commit "14a3d57e7020e5fc65d60d20849ca6378f4d4def"))) + (sha256 (base32 + "0rc9pfj7gwm5azghqvcibz6si1x5s2v8mr2yngk7ssq9gzfbi6a4")) + (file-name (git-file-name "racket-mzcom" %racket-version))) + ("mzcom" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzscheme") + (commit "b7e47a2244d848820f7eb1c80cad62b7cfdcb987"))) + (sha256 (base32 + "192c52zi726h5wjamxrhivjw2waq1im0zpyxhbrkrxknm8x84bs9")) + (file-name (git-file-name "racket-mzscheme" %racket-version))) + "mzscheme" "mzscheme-doc" "mzscheme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RenaissanceBug/racket-cookies") + (commit "06e14b37fbd237b74563661c522df02855dadd2f"))) + (sha256 (base32 + "0k0hifxhywl5c3hjcaiizc098dpyk001d981p572gly116yvjxc1")) + (file-name + (git-file-name "RenaissanceBug-racket-cookies" %racket-version))) + "net-cookies" "net-cookies-doc" "net-cookies-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stamourv/optimization-coach") + (commit "dbd6cf06613bf285b4540301ea86dd87239eab7d"))) + (sha256 (base32 + "0b27sw48d7rhz0hin88c7rbr9vpg1c23sn82nd4jkmq54h6gasr1")) + (file-name + (git-file-name "stamourv-optimization-coach" %racket-version))) + ("optimization-coach" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/option-contract") + (commit "399ad3351df83dee3dd2e8c4bec14ad5bcd2be8e"))) + (sha256 (base32 + "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk")) + (file-name + (git-file-name "racket-option-contract" %racket-version))) + "option-contract" "option-contract-doc" "option-contract-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/parser-tools") + (commit "4f9bcab9167b690b16b79a13ce91e8ec765c00a3"))) + (sha256 (base32 + "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3")) + (file-name (git-file-name "racket-parser-tools" %racket-version))) + "parser-tools" "parser-tools-doc" "parser-tools-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pconvert") + (commit "d8ab4fd6f5e2f35d9738db1677dfb89e3c4ce011"))) + (sha256 (base32 + "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1")) + (file-name (git-file-name "racket-pconvert" %racket-version))) + "pconvert-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict") + (commit "9e0de9ea7204219a95d734c250afac740cb35534"))) + (sha256 (base32 + "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x")) + (file-name (git-file-name "racket-pict" %racket-version))) + "pict" "pict-doc" "pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict-snip") + (commit "cd389ba6471a045c791e2dd6e483e356017499d8"))) + (sha256 (base32 + "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x")) + (file-name (git-file-name "racket-pict-snip" %racket-version))) + "pict-snip" "pict-snip-doc" "pict-snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/picturing-programs") + (commit "f2ce24d8e7cbefe585e3d849324b61ad2e680556"))) + (sha256 (base32 + "1g6xr39hx1j03gb3d4dljm3v91xcj2gfpq3dgy5xvplzr6cmmxgr")) + (file-name + (git-file-name "racket-picturing-programs" %racket-version))) + ("picturing-programs" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plai") + (commit "9f227e6403a07735765a57ff521d5f78588543c6"))) + (sha256 (base32 + "0i983sh0r0zm2ng4j44m5aw9669kh5fhp91bzpc9jm280rfcqvyl")) + (file-name (git-file-name "racket-plai" %racket-version))) + "plai" "plai-doc" "plai-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/planet") + (commit "350f5da48d98303fe6ee510892c958ed46766154"))) + (sha256 (base32 + "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9")) + (file-name (git-file-name "racket-planet" %racket-version))) + "planet" "planet-doc" "planet-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plot") + (commit "6da78b761a6005fdfe771318097513adf38c9564"))) + (sha256 (base32 + "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7")) + (file-name (git-file-name "racket-plot" %racket-version))) + "plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/preprocessor") + (commit "8e683244eea9dd5526324529f972947f7111810f"))) + (sha256 (base32 + "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg")) + (file-name (git-file-name "racket-preprocessor" %racket-version))) + ("preprocessor" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/profile") + (commit "a9fc521dbeb859ea6683cee4a83ed24d1e15ca12"))) + (sha256 (base32 + "179i86lyby29nywz60l4vnadi02w8b12h7501nm5h5g4pq9jjmbb")) + (file-name (git-file-name "racket-profile" %racket-version))) + "profile" "profile-doc" "profile-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Metaxal/quickscript") + (commit "24912978e7b104449e801cf0a8469b8f363aa170"))) + (sha256 (base32 + "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + (file-name (git-file-name "Metaxal-quickscript" %racket-version))) + ("quickscript" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r5rs") + (commit "26ca7fc5a03cc7ae797e9269444d97e6728a1b0d"))) + (sha256 (base32 + "1g3cysj7z88r38vkzvi8g2fb2hn4yg1fdhy5smxw303jxgl3inp6")) + (file-name (git-file-name "racket-r5rs" %racket-version))) + "r5rs" "r5rs-doc" "r5rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r6rs") + (commit "f4d66a2c31749e3795722092b0a9d4fa698c2992"))) + (sha256 (base32 + "0b1ymzdp10r0flw2acbidjsh5ma1pm5hy54jss37sxf89z3xbvm4")) + (file-name (git-file-name "racket-r6rs" %racket-version))) + "r6rs" "r6rs-doc" "r6rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeapostrophe/racket-cheat") + (commit "6e79a13b9e24969a87c8a1c191d38ee4f4c55cf9"))) + (sha256 (base32 + "06wcj558rzkbl2bwkmikyspya9v1f4iwlzwnwxpkc33h2xapwabr")) + (file-name + (git-file-name "jeapostrophe-racket-cheat" %racket-version))) + ("racket-cheat" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racklog") + (commit "4bad4b9e9bcc363df453ae5e4211641cddc29e4b"))) + (sha256 (base32 + "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb")) + (file-name (git-file-name "racket-racklog" %racket-version))) + ("racklog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/rackunit") + (commit "6c04ee267d258a13f9c5cbc437dac60234e54ef4"))) + (sha256 (base32 + "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p")) + (file-name (git-file-name "racket-rackunit" %racket-version))) + "rackunit" + "rackunit-doc" + "rackunit-gui" + "rackunit-lib" + "rackunit-plugin-lib" + "rackunit-typed" + "schemeunit" + "testing-util-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/readline") + (commit "df55a811d57d6677959fde479106bc43b99d6bdd"))) + (sha256 (base32 + "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn")) + (file-name (git-file-name "racket-readline" %racket-version))) + "readline" "readline-doc" "readline-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/realm") + (commit "81afce5b4c4fc3e9a06e813b888d7c8ea10b6a32"))) + (sha256 (base32 + "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi")) + (file-name (git-file-name "racket-realm" %racket-version))) + ("realm" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/redex") + (commit "85446b0caf8560c30d7e2ed9c23104bf20b27ae6"))) + (sha256 (base32 + "1jv0b043ppph75bjzfdc0jibgpig34lnsbksxnqz03pmv3yxp6cr")) + (file-name (git-file-name "racket-redex" %racket-version))) + "redex" + "redex-benchmark" + "redex-doc" + "redex-examples" + "redex-gui-lib" + "redex-lib" + "redex-pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sasl") + (commit "3fd78eb8a0ba7ad86d8f78e866d737b177144729"))) + (sha256 (base32 + "0ibh4wb4gn8pggx6gkv4vk4d6rwzn5nrvjibhvkzhaynf6lhb824")) + (file-name (git-file-name "racket-sasl" %racket-version))) + "sasl" "sasl-doc" "sasl-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scheme-lib") + (commit "408f9398ec237b791ca103bb9e1400df1cef18f5"))) + (sha256 (base32 + "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x")) + (file-name (git-file-name "racket-scheme-lib" %racket-version))) + ("scheme-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scribble") + (commit "d2d820bdedf7ec4971ed03e9a0adcfb5f71ed1fa"))) + (sha256 (base32 + "15rhf4lhrwqab9vdq42mf227ialm6yi5q8hxsb4kw4yq6dks4xcd")) + (file-name (git-file-name "racket-scribble" %racket-version))) + "scribble" "scribble-doc" "scribble-html-lib" "scribble-lib" + "scribble-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/serialize-cstruct-lib") + (commit "cabf4188a34c70af2f6a376fc3b0f55d035a2ab7"))) + (sha256 (base32 + "1rq3n1fa7ldjwx3lrh9ybhig7jlsw1crpzyklbzp3xqdw6jymfnz")) + (file-name + (git-file-name "racket-serialize-cstruct-lib" %racket-version))) + ("serialize-cstruct-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sgl") + (commit "d1906923a74a362a2bfb32f3b9bfe1351f4d1534"))) + (sha256 (base32 + "0nkymhdyjrwi5h199j4w5zh7y3x3ai42gsiwxzh0hy7yqrqqg9zv")) + (file-name (git-file-name "racket-sgl" %racket-version))) + ("sgl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/shell-completion") + (commit "3bc582e4167a46ade43dfd50df06a2e6e08e90ab"))) + (sha256 (base32 + "04m144gy2mp4fiq6rcbf12wjr8mws8k9scfhg9lc38vqppp4lxsj")) + (file-name + (git-file-name "racket-shell-completion" %racket-version))) + ("shell-completion" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/simple-tree-text-markup") + (commit "06bbcd3651e518a53cffa5f8484fe127574fed06"))) + (sha256 (base32 + "0fyd9gfz6bnv0m1901wv5mnhc05rm8hw9i6ddrqx33hs6qsg2zqr")) + (file-name + (git-file-name "racket-simple-tree-text-markup" %racket-version))) + "simple-tree-text-markup" + "simple-tree-text-markup-doc" + "simple-tree-text-markup-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slatex") + (commit "47e1d3e3e33d826bc2b26f9e8998eb235b23a9a5"))) + (sha256 (base32 + "0pkm2isbbdk63slrbsxcql7rr0wdrw5kapw1xq4ps5k8dhlzv8x0")) + (file-name (git-file-name "racket-slatex" %racket-version))) + ("slatex" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slideshow") + (commit "e8b2471aaafef035e12e641dd34226f36a9ca16a"))) + (sha256 (base32 + "1znv1i2d0610hhy71q932xy7wka00q3q50in1xfnk8ibg7nzkagm")) + (file-name (git-file-name "racket-slideshow" %racket-version))) + "slideshow" "slideshow-doc" "slideshow-exe" "slideshow-lib" + "slideshow-plugin") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/snip") + (commit "d553e3bd27c866cb93d5144c0f07e4024827167b"))) + (sha256 (base32 + "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj")) + (file-name (git-file-name "racket-snip" %racket-version))) + "snip" "snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/typed-racket") + (commit "4b07b7b6cab5c08b5b589d3f501376fc0a2b935d"))) + (sha256 (base32 + "0vvy7byynbk7rx2a0cr3ky2ifgmhcrw22xyiibd4c4knqqkdcmc7")) + (file-name (git-file-name "racket-typed-racket" %racket-version))) + "source-syntax" + "typed-racket" + "typed-racket-compatibility" + "typed-racket-doc" + "typed-racket-lib" + "typed-racket-more") + (,(origin + (method git-fetch) + (uri (git-reference + ;;(url "https://github.com/racket/srfi") + (url "https://github.com/LiberalArtist/srfi") + ;; FSDG fix for SRFI 5: + ;; see https://github.com/racket/srfi/pull/15 and + ;; https://lists.gnu.org/archive/html/guix-devel/2022-01/msg00426.html + ;; (Probably can be merged upstream before we update to 8.4.) + (commit "8de2fb2c566f285ee3fc14bad15d74e21de014cd"))) + (sha256 (base32 + "07xi9pdg5sqcy1njppmqaaigrf054d6h74wfcwq5ikg2kjgc0d5w")) + (file-name (git-file-name "racket-srfi" %racket-version))) + "srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/string-constants") + (commit "90fdb2613beaefe57fa0305fe90e635e2b8a8f57"))) + (sha256 (base32 + "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6")) + (file-name + (git-file-name "racket-string-constants" %racket-version))) + "string-constants" "string-constants-doc" "string-constants-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/swindle") + (commit "122e38efb9842394ef6462053991efb4bd0edf3b"))) + (sha256 (base32 + "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67")) + (file-name (git-file-name "racket-swindle" %racket-version))) + ("swindle" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/syntax-color") + (commit "c3ba4e86790946ed77192b541f49930e5861619d"))) + (sha256 (base32 + "1dwl0v2ghdyyk5x5rw20il192wrq9myijz98dfncy5cz0hqlm25f")) + (file-name (git-file-name "racket-syntax-color" %racket-version))) + "syntax-color" "syntax-color-doc" "syntax-color-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/trace") + (commit "7878c9ed33da27810a55d8bdd603f56dd4c89fb7"))) + (sha256 (base32 + "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia")) + (file-name (git-file-name "racket-trace" %racket-version))) + ("trace" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/unix-socket") + (commit "698eade65ae2cd8b747ba08a3820950e385b2a81"))) + (sha256 (base32 + "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y")) + (file-name (git-file-name "racket-unix-socket" %racket-version))) + "unix-socket" "unix-socket-doc" "unix-socket-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/web-server") + (commit "655676cdebe6d6223935ec5b288d574639ced431"))) + (sha256 (base32 + "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn")) + (file-name (git-file-name "racket-web-server" %racket-version))) + "web-server" "web-server-doc" "web-server-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/wxme") + (commit "555a380a63e63977fec77c4063d58f6bdf646249"))) + (sha256 (base32 + "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b")) + (file-name (git-file-name "racket-wxme" %racket-version))) + "wxme" "wxme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/xrepl") + (commit "3f3d7c2619ca73df982dc1dc67ed8040709b6d38"))) + (sha256 (base32 + "1sw0g0cnkq6xc8x8i2mfz7qkimrv1c7gbhqfkm0zwafzi2zbvbh7")) + (file-name (git-file-name "racket-xrepl" %racket-version))) + "xrepl" "xrepl-doc" "xrepl-lib"))))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 09 08:42:22 2022 Received: (at 53878) by debbugs.gnu.org; 9 Feb 2022 13:42:22 +0000 Received: from localhost ([127.0.0.1]:50248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHnEj-0007bf-Sk for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:42:22 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:37906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHnEi-0007bU-Bk for 53878@debbugs.gnu.org; Wed, 09 Feb 2022 08:42:21 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Jv1Jg6zptz3xcX; Wed, 9 Feb 2022 14:42:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1644414132; bh=4f9Q+6uV1XSamIXEfUfLH9MOs6JAT6peLEECeS9i1Lc=; h=Subject:From:To:Date:In-Reply-To:References; b=SRRjXlVgozpFeXVj4qBbgx1aX/OozNZyJE2ofuRr6oAN6HC9Zdmoln9Lnus3LrWcy D1sVUxYaCaiom+9XJnLMXprHZAKNix5NIMbL01fScyRixqIEGFabV3OMiBV9tXdxN8 tA+XQ/Tk2OK2Nz/YhDNY0/zaJaND2Ky52Obhizqw= Message-ID: <769cda9ec17a152dc999592827759234436da712.camel@ist.tugraz.at> Subject: Re: [RFC PATCH 8/9] gnu: Add chez-scheme-racket-variant. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Wed, 09 Feb 2022 14:42:11 +0100 In-Reply-To: <20220208151857.1900389-8-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> <20220208151857.1900389-8-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Dienstag, dem 08.02.2022 um 10:18 -0500 schrieb Philip McGrath: > The Racket variant of Chez Scheme can be used to support platforms > that > are not yet supported by upstream Chez Scheme. The new function > 'chez-scheme-for-system' selects the Chez Scheme package that best > supports the target system. > > In the process, we also add packages for 'racket-vm-cgc', > 'racket-vm-bc', and 'racket-vm-cs'. A future commit will change > 'racket-minimal' to use the Racket VM implementation that best > supports > the target system, as reported by 'racket-vm-for-system'. > > * gnu/packages/patches/racket-enable-scheme-backport.patch: New > patch. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cgc): > (racket-vm-bc): > (racket-vm-cs): > (chez-scheme-racket-variant-bootstrap-bootfiles): > (chez-scheme-racket-variant): New variables. > (chez-scheme-for-system, racket-vm-for-system): New exported > functions. > * gnu/packages/loko.scm (loko-scheme): Use 'chez-scheme-for-system'. > * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise > * gnu/packages/chez.scm (chez-srfi): > (chez-web): > (chez-sockets): > (chez-matchable): > (chez-irregex): > (chez-fmt): > (chez-mit): > (chez-scmutils): Likewise. > (chez-mit)[origin]: Add workaround for Racket variant. This patch does a lot and should probably be separated into several commits. As far as the name "chez-scheme-racket-variant" is concerned, I am not really a fan of it. How would "chez-scheme-for-racket" sound? From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 09 20:30:18 2022 Received: (at 53878) by debbugs.gnu.org; 10 Feb 2022 01:30:18 +0000 Received: from localhost ([127.0.0.1]:53141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHyHq-0003pZ-3Q for submit@debbugs.gnu.org; Wed, 09 Feb 2022 20:30:18 -0500 Received: from mail-qk1-f174.google.com ([209.85.222.174]:42965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHyHn-0003pF-MF for 53878@debbugs.gnu.org; Wed, 09 Feb 2022 20:30:16 -0500 Received: by mail-qk1-f174.google.com with SMTP id m25so3393726qka.9 for <53878@debbugs.gnu.org>; Wed, 09 Feb 2022 17:30:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=+VwT6RDEpfdOgZ8/GOKiEAd/j/yBv/FctREh/SzIGOY=; b=hXlufIIrdSjWwju8iK/k950+q+hXQft28O+6aiV/qsPMGS1DjNTH3bNW1NZi3I8IXp TSB7aQUAKA3yirpEMNHgjzq/2vfQwvfb2G1R4owF8G1xuGD35xoKZ9f3d31I1xSm3a6R q7NwbIf3J58aAq5RpmqG6yVc1zHArUVjZy01b2j5e8DF8xkkbM4j2AreNDRgPzXquSs4 wzs/DO9bc2VI1cNZwYoVOhTOVR5cL/hr/Bw3SZAW8rwuiTz9k+ZGOZte6BVvjjcSsyHP qabV/qTMmA4SmJ4ShIZ0kepnUBq/q+ul4rmg5Pse6zq8mepiD/wRapGGy95jhkWBeLA0 3y0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=+VwT6RDEpfdOgZ8/GOKiEAd/j/yBv/FctREh/SzIGOY=; b=3CYo0I9my7CCkfxdks5tlLXjBCU9cA7i9luJFBByU0ZMRMz+q2MHcizXUxtpjfdeEr r/uAgEdbvd/8yEoSo6VWdzO7vZOYFNuJm/GHtlYycKH2iHp5rZGVfnInxlRkFLBlAP/Q 08FLrveOPs+rEjL0ochtjV58/HGPgJBbQmJzrNrH4FGBbnPrXq+gqzhbtKsZ4rCEpcz3 6f0R0X98ZXXgjTccImFZd2KmzJfft8iWR93Ez2Qx5CVw7C+VmzKd1fk2qqG02k9KAzeU fqbxjtUsG9Mpe4nwDo5S9tth0EJD5Af3pV9yN3mZWO5vFBx2UGT14AwdKyJRnwsWmtSn dzdQ== X-Gm-Message-State: AOAM532hZy0gp/1jK62RAPvGrqgIGsm//UmxZ3STwp/wDN4LWoqaPGfQ Js4p6sBL+Zk7eLSKXJoZcp5DGO8r8QpWPronFGI= X-Google-Smtp-Source: ABdhPJwmKogi17f2zW9Ef29jmi+sm8p7wfkqC5Bm5l7xZbzlpdntjczrmyTo8slDcMG62JChfMl4ww== X-Received: by 2002:a05:620a:2a05:: with SMTP id o5mr2681617qkp.447.1644456610157; Wed, 09 Feb 2022 17:30:10 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id m130sm8977731qke.55.2022.02.09.17.30.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Feb 2022 17:30:09 -0800 (PST) Message-ID: <6abafa84-4f63-2bf0-4464-9c7742798902@philipmcgrath.com> Date: Wed, 9 Feb 2022 20:30:08 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [RFC PATCH 8/9] gnu: Add chez-scheme-racket-variant. Content-Language: en-US To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> <20220208151857.1900389-8-philip@philipmcgrath.com> <769cda9ec17a152dc999592827759234436da712.camel@ist.tugraz.at> From: Philip McGrath In-Reply-To: <769cda9ec17a152dc999592827759234436da712.camel@ist.tugraz.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/9/22 08:42, Liliana Marie Prikler wrote: > Am Dienstag, dem 08.02.2022 um 10:18 -0500 schrieb Philip McGrath: > This patch does a lot and should probably be separated into several > commits. As far as the name "chez-scheme-racket-variant" is concerned, > I am not really a fan of it. How would "chez-scheme-for-racket" sound? > Thanks for taking a look! Calling it "chez-scheme-for-racket" is fine with me---it's a little shorter, at least. As far as splitting it up, yes, that makes sense. (There had at one point been some entanglements that I thought would make that difficult, but I've since fixed all those issues anyway.) What do you think of splitting it like this? >> * gnu/packages/patches/racket-enable-scheme-backport.patch: New >> patch. >> * gnu/local.mk (dist_patch_DATA): Add it. >> * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cgc): --- >> (racket-vm-bc): --- >> (racket-vm-cs): --- >> (chez-scheme-racket-variant-bootstrap-bootfiles): >> (chez-scheme-racket-variant): New variables. --- >> (chez-scheme-for-system, --- >> (chez-mit)[origin]: Add workaround for Racket variant. --- >> * gnu/packages/loko.scm (loko-scheme): Use 'chez-scheme-for-system'. >> * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise >> * gnu/packages/chez.scm (chez-srfi): >> (chez-web): >> (chez-sockets): >> (chez-matchable): >> (chez-irregex): >> (chez-fmt): >> (chez-mit): >> (chez-scmutils): Likewise. --- >> racket-vm-for-system): New exported >> functions. Alternatively, I could see adding the snippet to "chez-mit" in the same commit as changing it to use "chez-scheme-for-system", or I could split each changed package into its own commit (though those would be extremely small), or put the definition of "chez-scheme-for-system" together with its uses, or ... Racket 8.4 was just released,[0] so I plan to send a revised series today or tomorrow. -Philip [0]: https://blog.racket-lang.org/2022/02/racket-v8-4.html From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 10 02:09:01 2022 Received: (at 53878) by debbugs.gnu.org; 10 Feb 2022 07:09:01 +0000 Received: from localhost ([127.0.0.1]:53541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nI3Zd-0004y6-Ig for submit@debbugs.gnu.org; Thu, 10 Feb 2022 02:09:01 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:27350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nI3Zb-0004xt-Eg for 53878@debbugs.gnu.org; Thu, 10 Feb 2022 02:09:00 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4JvSXP143Vz3xdm; Thu, 10 Feb 2022 08:08:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1644476933; bh=ww6Nkfw0X8V1bUpHnbCN667h3F37yOZq+NIiaHkORRk=; h=Subject:From:To:Date:In-Reply-To:References; b=dtlhB4vroI6WgDjl4/wXwFQ2sEoLSejL7sJ1q/NLlvAHILbVoodp5/Egt84U99JUk VlvebZ3Vbs2y1iIe63LWHBsy5XP3o5/VRBo1TC9MaYIDisGd2oSrFbXgSzzUENtLQq Oy2drwklp6qBeXwfvZ3XlgnZn/SDDFsY0tKHQy8I= Message-ID: Subject: Re: [RFC PATCH 8/9] gnu: Add chez-scheme-racket-variant. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Thu, 10 Feb 2022 08:08:53 +0100 In-Reply-To: <6abafa84-4f63-2bf0-4464-9c7742798902@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-1-philip@philipmcgrath.com> <20220208151857.1900389-8-philip@philipmcgrath.com> <769cda9ec17a152dc999592827759234436da712.camel@ist.tugraz.at> <6abafa84-4f63-2bf0-4464-9c7742798902@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Mittwoch, dem 09.02.2022 um 20:30 -0500 schrieb Philip McGrath: > Calling it "chez-scheme-for-racket" is fine with me---it's a little > shorter, at least. Okay. > As far as splitting it up, yes, that makes sense. (There had at one > point been some entanglements that I thought would make that > difficult, but I've since fixed all those issues anyway.) What do you > think of splitting it like this? I'm not entirely sure how the interdependencies are, but I'd do... >  >> * gnu/packages/patches/racket-enable-scheme-backport.patch: New >  >> patch. >  >> * gnu/local.mk (dist_patch_DATA): Add it. >  >> * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cgc): > --- >  >> (racket-vm-bc): > --- >  >> (racket-vm-cs): > --- >  >> (chez-scheme-for-racket-bootstrap-bootfiles): >  >> (chez-scheme-for-racket): New variables. These, then > >> (chez-mit)[origin]: Add workaround for chez-scheme-for- > racket. then > --- >  >> (chez-scheme-for-system, racket-vm-for-system): New variables. > --- >  >> * gnu/packages/loko.scm (loko-scheme): Use 'chez-scheme-for- > system'. >  >> * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise >  >> * gnu/packages/chez.scm (chez-srfi): >  >> (chez-web): >  >> (chez-sockets): >  >> (chez-matchable): >  >> (chez-irregex): >  >> (chez-fmt): >  >> (chez-mit): >  >> (chez-scmutils): Likewise. > --- If that's not possible, you can keep racket-vm-for-system as the final patch. > Racket 8.4 was just released,[0] so I plan to send a revised series > today or tomorrow. Cool. > [0]: https://blog.racket-lang.org/2022/02/racket-v8-4.html From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:52:52 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:52:52 +0000 Received: from localhost ([127.0.0.1]:39044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnc-00039Q-4h for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:52:52 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:42508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnX-000394-DA for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:52:50 -0500 Received: by mail-qv1-f50.google.com with SMTP id k9so13401367qvv.9 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:52:47 -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=/BYx7+Q2KC6lOAcpZEtuj1QAg26zYDyYu8QmaGtyNCQ=; b=Sd1Z4xOoW36PQaksoe8kSMlOg8Gda2j8fbNGVxRT+V79i4HH1UT7nJusX2687xgUdM cyLsMR9yR+vTy4tj63R8UKt4kVXn/JCiwQz5Ngbp6J4NxK1WW55jUPu1H9FDdIFSRmS4 dKHgovTD44n5FsdP30PP1huXi5a9BuDVHqC3d6CyY28qjQv8TeN7Ur5U1iF0H5uupn1g OluBwdcu3NPG3nsk+tW9dGmD89y20Ar6X6EtFIGbJkSSdg9cPikG7JHrz02UGCwfoKwL HzxflTwjxLNfzOzbQjgBsXHnYbyHMxcZuQZX2N2iwwAPNhbCSsGa1t1+CvCstmcuu/Oi ubDw== 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=/BYx7+Q2KC6lOAcpZEtuj1QAg26zYDyYu8QmaGtyNCQ=; b=FJBs1vf1cu+ap+6+n/ay0Da/MFCUVEg4sQjIwdKmKl6XW2prMlUj0OovjviiwkRPIu b+IPJzUdrjWQJyYBw8QiVjg06pFVluenGAgmZvRMX8qMNfzh+y0F9MwZDAMB5Y0kf6u9 jlZW+1AyF2AwNx92WH+5c6fl7dovYBRUdveSxgCg28Sh9DK1ZjDfCq1mLCAiiWpA8M7a xXhsis4y3nNRFexa5Cc2CKVceoS0YyFBmEiqJvZgF+PqKK+VMf1bAoHtyPv4VD3cj6pr QER0KXdIGuZKk1S7TDlrqkfWl7Fchn/42N99IccAIYyCoRtO9qCCZXnBgqUVxQc/SGm2 W5ow== X-Gm-Message-State: AOAM533rA6D331LMYEvxfKC4fgLDOfBjScxZqyjM9DjEl08e9yGZ3kZ5 7bJwGPAO0QnlUtNxfqtfPJepiGVunUajADQLlDY= X-Google-Smtp-Source: ABdhPJxS+byPLaG5TRiKkuZKk9PeFHN/M7uFQEicS0OXveXqCdaQsmUGaOkd0Coy6od5XFXKxKnFMw== X-Received: by 2002:a05:6214:2aa9:: with SMTP id js9mr7741125qvb.43.1644789161540; Sun, 13 Feb 2022 13:52:41 -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 g17sm12995340qkl.122.2022.02.13.13.52.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:52:41 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 00/11] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sun, 13 Feb 2022 16:51:16 -0500 Message-Id: <20220213215127.218952-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, Here's a revised series with the actual Racket 8.4 release! I've split the 'chez-scheme-for-racket' patch basically as Liliana suggested in except that I've added 'racket-vm-for-system' in the commit which actually uses it (the final one), rather than the commit that adds 'chez-scheme-for-system'. -Philip Philip McGrath (11): gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: Add chez-scheme-for-racket. gnu: chez-mit: Support chez-scheme-for-racket. gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. gnu: racket: Update to 8.4. gnu/local.mk | 6 +- gnu/packages/chez-and-racket-bootstrap.scm | 1103 + gnu/packages/chez.scm | 628 +- gnu/packages/emacs-xyz.scm | 4 +- gnu/packages/loko.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 + ...acket-gui-tethered-launcher-backport.patch | 26 + .../patches/racket-srfi-fsdg-backport.patch | 41622 ++++++++++++++++ gnu/packages/racket.scm | 1554 +- 9 files changed, 44470 insertions(+), 942 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch create mode 100644 gnu/packages/patches/racket-srfi-fsdg-backport.patch -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:02 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:02 +0000 Received: from localhost ([127.0.0.1]:39047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnf-00039g-Js for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:02 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:33337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnc-00039A-OJ for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:52:54 -0500 Received: by mail-qk1-f182.google.com with SMTP id o10so13044418qkg.0 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:52:52 -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=YXEzfRfk7WXdireVn5LxJcvoc08nT3yzfc0dg5tOroo=; b=XtYjrFv5LAkRNY1uTMATTZuIprTbR7ddGlMc3iraNwPWHTwHHQCWk2k3f5cxXR0Mn4 drfxHIAxEPrlM6o08kvHaYHtrvlHChNS7pevYiChCBVFo02U9+a7ZZPhfSf5ixsG9B4g DuDNdLmRQSPjx7NSJUJeVOMKSs0okz7de1kEAkWIwy/z7cdebeLhNH0VYLmR99WfCNTd 7xDfI2BzVFWoLL6CLT10c11plk28pGtDO0IIIFqtzq1hD6QzvTAFnJL+zpb8WAe8z9fD QbIlKIKBB62ivaGhXe7dqFftwlaMe5NQLhpBjYWkxZL1tlRQ8RHI/iVFDZUzX1zSKSWo pBtQ== 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=YXEzfRfk7WXdireVn5LxJcvoc08nT3yzfc0dg5tOroo=; b=VG9eK+HpE/LubKb/Jxk1SwHQF3mnY9+igRTrRuuZaBj3W4GTSFoe1rnM/Ba0p1zUgx wvpb6HpMUYc0XF+9aaN9tkCVMCO11+RsDSAGo9koNv3NgmCE8LYO0n4l3paSBNrbB2B4 ir3jWqQUC5kfrPaH2qf81T35g9YTZwMJoQMIRAyRq2wleVhB3UAD/NUKoTw4VWWqX8ar sfD/RzIKsG3laN/AiOiruYzuyR9UZL0TOZVnWVncMh7cZ75UxzlNbt7q30MUQNqV7uoh QZis3cNsRo47bCQ3EKNFKYxH4ZsU9byMtm1QVx4zLZpzGrh7h/wJTBcOy9+XmaC6PjhM 1Bng== X-Gm-Message-State: AOAM533QdJJ/GJh4H0bAjTOWSTLRxmgs/jlJAegLudhPaoqwZMOSU/1e Lt0532aZgGLPIBRilmkM6CXtURx4atmCYmQjwz8= X-Google-Smtp-Source: ABdhPJyvctNiTnk+nNemk18lSctuuif13w62WGjLLELFjh8PhjXHE8qV2UH6SbpMD3X7JljllYhXnA== X-Received: by 2002:a05:620a:458f:: with SMTP id bp15mr5655084qkb.670.1644789166543; Sun, 13 Feb 2022 13:52:46 -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 b14sm784193qkp.23.2022.02.13.13.52.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:52:46 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 01/11] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). Date: Sun, 13 Feb 2022 16:51:17 -0500 Message-Id: <20220213215127.218952-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (nanopass, stex, chez-scheme): Move to ... * gnu/packages/chez-and-racket-bootstrap.scm: ... this new file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/emacs-xyz.scm: Adjust imports accordingly. * gnu/packages/loko.scm: Likewise. * gnu/packages/racket.scm: Likewise. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 278 +++++++++++++++++++++ gnu/packages/chez.scm | 225 +---------------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- gnu/packages/racket.scm | 2 +- 6 files changed, 283 insertions(+), 227 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm diff --git a/gnu/local.mk b/gnu/local.mk index 1b08b40b9c..72e086d465 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -144,6 +144,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/certs.scm \ %D%/packages/check.scm \ %D%/packages/chemistry.scm \ + %D%/packages/chez-and-racket-bootstrap.scm \ %D%/packages/chez.scm \ %D%/packages/chicken.scm \ %D%/packages/chromium.scm \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm new file mode 100644 index 0000000000..f102b099fb --- /dev/null +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -0,0 +1,278 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Federico Beffa +;;; Copyright © 2016 Efraim Flashner +;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2019 Brett Gilio +;;; Copyright © 2020 Brendan Tildesley +;;; Copyright © 2021, 2022 Philip McGrath +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages chez-and-racket-bootstrap) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages compression) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages linux) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages netpbm) + #:use-module (gnu packages tex) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) + +;; Commentary: +;; +;; Alphabetically and chronologically, Chez comes before Racket. +;; +;; 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. +;; +;; Putting the relevant definitions together in this module avoids having to +;; work around dependency cycles. +;; +;; Code: + +(define nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) + +(define stex + ;; This commit includes a fix, which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (version "1.2.2") + (version (git-version version "1" commit))) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name "stex" version))))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version "9.5.6") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet + ;; Remove bundled libraries. + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib"))))))) + (build-system gnu-build-system) + (inputs + `(("libuuid" ,util-linux "lib") + ("zlib" ,zlib) + ("zlib:static" ,zlib "static") + ("lz4" ,lz4) + ("lz4:static" ,lz4 "static") + ;; for expeditor: + ("ncurses" ,ncurses) + ;; for X11 clipboard support in expeditor: + ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 + ("libx11" ,libx11))) + (native-inputs + `(("nanopass" ,nanopass) ; source only + ;; for docs + ("stex" ,stex) + ("xorg-rgb" ,xorg-rgb) + ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek))) + ("ghostscript" ,ghostscript) + ("netpbm" ,netpbm))) + (native-search-paths + (list (search-path-specification + (variable "CHEZSCHEMELIBDIRS") + (files (list (string-append "lib/csv" version "-site")))))) + (outputs '("out" "doc")) + (arguments + `(#:modules + ((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match)) + #:test-target "test" + #:configure-flags + '("--threads") ;; TODO when we fix armhf, it doesn't support --threads + #:phases + (modify-phases %standard-phases + ;; put these where configure expects them to be + (add-after 'unpack 'unpack-nanopass+stex + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (for-each (lambda (dep) + (define src + (assoc-ref (or native-inputs inputs) dep)) + (copy-recursively src dep + #:keep-mtime? #t)) + '("nanopass" "stex")))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs outputs + (configure-flags '()) + #:allow-other-keys) + (let* ((zlib-static (assoc-ref inputs "zlib:static")) + (lz4-static (assoc-ref inputs "lz4:static")) + (out (assoc-ref outputs "out")) + ;; add flags which are always required: + (flags (cons* + (string-append "--installprefix=" out) + (string-append "ZLIB=" zlib-static "/lib/libz.a") + (string-append "LZ4=" lz4-static "/lib/liblz4.a") + ;; Guix will do compress man pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" ,(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke + "./configure" + 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* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib")) + (name "chez-scheme")) + (symlink (string-append bin "/scheme") + (string-append bin "/" name)) + (map (lambda (file) + (symlink file (string-append (dirname file) + "/" name ".boot"))) + (find-files lib "scheme.boot"))))) + ;; Building explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (stex-output "/tmp") + (doc-dir (string-append stex-output + "/share/doc/" + stex+version))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/" + stex+version) + (string-append "Scheme=" + (assoc-ref outputs "out") + "/bin/scheme")) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((chez+version (strip-store-file-name + (assoc-ref outputs "out"))) + (stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + (scheme (string-append (assoc-ref outputs "out") + "/bin/scheme")) + ;; see note on stex-output in phase build-stex, above: + (stexlib (string-append "/tmp" + "/lib/" + stex+version)) + (doc-dir (string-append (assoc-ref outputs "doc") + "/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))) + ;; Chez Scheme does not have a MIPS backend. + ;; FIXME: Debian backports patches to get armhf working. + ;; We should too. It is the Chez machine type arm32le + ;; (no threaded version upstream yet, though there is in + ;; Racket's fork), more specifically (per the release notes) ARMv6. + (supported-systems (fold delete %supported-systems + '("mips64el-linux" "armhf-linux"))) + (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 license:asl2.0))) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 47904e7b4e..caf61a95f5 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,6 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Brendan Tildesley -;;; Copyright © 2021 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,234 +31,12 @@ (define-module (gnu packages chez) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (guix build-system gnu) - #:use-module (gnu packages compression) - #:use-module (gnu packages ncurses) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages ghostscript) - #:use-module (gnu packages linux) - #:use-module (gnu packages netpbm) #:use-module (gnu packages tex) - #:use-module (gnu packages compression) - #:use-module (gnu packages image) - #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) -(define nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - -(define-public chez-scheme - (package - (name "chez-scheme") - (version "9.5.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) - (build-system gnu-build-system) - (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) - (native-inputs - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) - (native-search-paths - (list (search-path-specification - (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) - (outputs '("out" "doc")) - (arguments - `(#:modules - ((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw) - (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) - ;; Chez Scheme does not have a MIPS backend. - ;; FIXME: Debian backports patches to get armhf working. - ;; We should too. It is the Chez machine type arm32le - ;; (no threaded version upstream yet, though there is in - ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) - (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-public chez-srfi (package (name "chez-srfi") diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index e4390bad96..02694b636a 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -145,7 +145,7 @@ (define-module (gnu packages emacs-xyz) #:use-module (gnu packages aspell) #:use-module (gnu packages audio) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages cmake) #:use-module (gnu packages code) #:use-module (gnu packages cpp) diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index ef9312afe3..74a649b8a1 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -24,7 +24,7 @@ (define-module (gnu packages loko) #:use-module (gnu packages package-management) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) - #:use-module (gnu packages chez)) + #:use-module (gnu packages chez-and-racket-bootstrap)) (define-public loko-scheme (package diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d0a5ca494b..865fdff70f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -34,7 +34,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages fontutils) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:06 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:06 +0000 Received: from localhost ([127.0.0.1]:39052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnm-0003AS-IK for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:06 -0500 Received: from mail-qk1-f176.google.com ([209.85.222.176]:38558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMng-00039N-F7 for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:52:57 -0500 Received: by mail-qk1-f176.google.com with SMTP id o12so12991779qke.5 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:52:56 -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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=bS8sdXzawKvauYvMn/TI7vpoDtoQ/CctUvFJeFo4FsJ+ZyBYQrQn5zxUbyUCDSdLk7 GKnL2QH28Pc8JFbLEai+tEqPXxz8SsRg4YyawlcS4tOymiScEHcdIhtxV8fbgmDY45bb Pi1/+/mmYex2x+7mlJ96cUotMrrzQ+lXguPUCtFP8OlBePX+srSfH5Z98q4KXFu4brEW K3BFvXI1NDSnj0q1Y2gp0toZavUk/7urOHHiNtDOpzheY9tgQLcVa/mzoQWq/j/AxptY EQKOWi+OeOzQLNlUnyhCIPxLZWF6059U/ghexssyM/DXjXomDXj38aPk4Im0+srAqB40 OFdg== 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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=R5ua7ArIn72zVxD+tJcI48LIFYWQr7MJ9c4pybx9FxgVlEgWZ2S5m6W1UKeEjbtxub X51lusurwiK3zMQXfrbWyk6dO1X5sNFqBo5O1HubPcf1dw0grHgjHuJgcL6ZqPljBP3a Q0rmOZnQrIWHvHN9c6/lgnjFpWVI0L3wqaKjkULTZYWHQyHtCumrAzxVa1xK1/41xDFn QF0GXfCE/HcapV6XtO/OFQSCGa1SInkeRaxgddgJAUAJCrsDwMU8hiBS6mcpqHrjf9HB b6/eNL7VOROMwKpfEUROBI52UNHddBLhxs389NVyEcEPqtOatg8wsYln7V/WDcmXNDv0 KiFA== X-Gm-Message-State: AOAM531tXZdwzyYT4qo8RaZb0VpYBcRNaV11iG/jZgjEmqWQmFgEAgAR sgyVDGY0m/B9q9Z1mrOc30clmu3Gg4fgT/NpD34= X-Google-Smtp-Source: ABdhPJzJ2C1oKdIUBWFP09FEUeQj0prgjRTaC5MZ0+bOCEiANiDoNnSNTQ315LQtHHjb4saG0C2/Bw== X-Received: by 2002:a05:620a:2682:: with SMTP id c2mr5764719qkp.481.1644789170633; Sun, 13 Feb 2022 13:52:50 -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 e1sm7959297qtw.71.2022.02.13.13.52.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:52:50 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 02/11] gnu: chez-scheme: Use "lib/chez-scheme" for search path. Date: Sun, 13 Feb 2022 16:51:18 -0500 Message-Id: <20220213215127.218952-3-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". * gnu/packages/chez.scm (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Update accordingly. Also, remove input labels and use G-expressions. --- gnu/packages/chez-and-racket-bootstrap.scm | 2 +- gnu/packages/chez.scm | 373 +++++++++++---------- 2 files changed, 191 insertions(+), 184 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index f102b099fb..1ed4631ced 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -136,7 +136,7 @@ (define-public chez-scheme (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) + (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments `(#:modules diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index caf61a95f5..54bbee7923 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -37,6 +37,28 @@ (define-module (gnu packages chez) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) + +;; Help function for Chez Scheme to add the current path to +;; CHEZSCHEMELIBDIRS. +(define chez-configure + #~(lambda _ + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) + (setenv "CHEZSCHEMELIBDIRS" + (if chez-env + (string-append ".:" chez-env) + "."))))) + +;; Help function to define make flags for some Chez Scheme custom make +;; files. +(define (chez-make-flags name version) + #~(let ((out #$output)) + (list + ;; Set 'schemedir' so that libraries are installed in + ;; 'lib/chez-scheme' like Chez's 'native-search-paths' expects. + (string-append "schemedir=" out "/lib/chez-scheme") + (string-append "PREFIX=" out) + (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) + (define-public chez-srfi (package (name "chez-srfi") @@ -54,13 +76,11 @@ (define-public chez-srfi (native-inputs (list chez-scheme)) (arguments - `(#:make-flags (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out) - "CHEZ=chez-scheme --libdirs ./" - (string-append "chezversion=" ,(package-version chez-scheme)))) - #:test-target "test" - #:phases (modify-phases %standard-phases - (delete 'configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -85,42 +105,48 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("ghostscript" ,ghostscript) - ("texlive" ,(texlive-updmap.cfg (list texlive-oberdiek - texlive-epsf - texlive-metapost - texlive-charter - texlive-pdftex - texlive-context - texlive-cm - texlive-tex-plain))))) + (list chez-scheme + ghostscript + ;; FIXME: This package fails to build with the error: + ;; mktexpk: don't know how to create bitmap font for bchr8r + ;; Replacing the following with `texlive` fixes it. + ;; What is missing? + (texlive-updmap.cfg (list texlive-oberdiek + texlive-epsf + texlive-metapost + texlive-charter + texlive-pdftex + texlive-context + texlive-cm + texlive-tex-plain)))) (arguments - `(#:make-flags (list (string-append "PREFIX=" %output) - (string-append "DOCDIR=" %output "/share/doc/" - ,name "-" ,version) - (string-append "LIBDIR=" %output "/lib/chezweb") - (string-append "TEXDIR=" %output "/share/texmf-local")) - #:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - ;; This package has a custom "bootstrap" script that - ;; is meant to be run from the Makefile. - (delete 'bootstrap) - (replace 'configure - (lambda* _ - (copy-file "config.mk.template" "config.mk") - (substitute* "tangleit" - (("\\./cheztangle\\.ss" all) - (string-append "chez-scheme --program " all))) - (substitute* "weaveit" - (("mpost chezweb\\.mp") - "mpost --tex=tex chezweb.mp") - (("\\./chezweave" all) - (string-append "chez-scheme --program " all))) - (substitute* "installit" - (("-g \\$GROUP -o \\$OWNER") "")) - #t))))) + (list + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "DOCDIR=" #$output "/share/doc/" + #$name "-" #$version) + ;; lib/chez-scheme/chezweb ??? + (string-append "LIBDIR=" #$output "/lib/chezweb") + (string-append "TEXDIR=" #$output "/share/texmf-local")) + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + ;; This package has a custom "bootstrap" script that + ;; is meant to be run from the Makefile. + (delete 'bootstrap) + (replace 'configure + (lambda* _ + (copy-file "config.mk.template" "config.mk") + (substitute* "tangleit" + (("\\./cheztangle\\.ss" all) + (string-append "scheme --program " all))) + (substitute* "weaveit" + (("mpost chezweb\\.mp") + "mpost --tex=tex chezweb.mp") + (("\\./chezweave" all) + (string-append "scheme --program " all))) + (substitute* "installit" + (("-g \\$GROUP -o \\$OWNER") ""))))))) (home-page "https://github.com/arcfide/ChezWEB") (synopsis "Hygienic Literate Programming for Chez Scheme") (description "ChezWEB is a system for doing Knuthian style WEB @@ -144,95 +170,74 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("chez-web" ,chez-web) - ("texlive" ,(texlive-updmap.cfg (list texlive-pdftex))))) + (list chez-scheme + chez-web + (texlive-updmap.cfg (list texlive-pdftex)))) (arguments - `(#:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-web (assoc-ref inputs "chez-web")) - (chez (assoc-ref inputs "chez-scheme")) - (chez-h (dirname (car (find-files chez "scheme\\.h"))))) - (substitute* "Makefile" - (("(SCHEMEH=).*$" all var) - (string-append var chez-h))) - #t))) - (add-before 'build 'tangle - (lambda* (#:key inputs #:allow-other-keys) - (setenv "TEXINPUTS" - (string-append - (getcwd) ":" - (assoc-ref inputs "chez-web") "/share/texmf-local/tex/generic:" - ":")) - ;; just using "make" tries to build the .c files before - ;; they are created. - (and (invoke "make" "sockets") - (invoke "make")))) - (replace 'build - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - ;; make sure Chez Scheme can find the shared libraries. - (substitute* "sockets.ss" - (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" - all cmd so) - (string-append cmd " \"" chez-site "/" so "\"")) - (("sockets-stub\\.[sd][oy].*" all) - (string-append chez-site "/" all))) - ;; to compile chez-sockets, the .so files must be - ;; installed (because of the absolute path we - ;; inserted above). - (for-each (lambda (f d) (install-file f d)) - '("socket-ffi-values.so" "sockets-stub.so") - (list chez-site chez-site)) - (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) - (replace 'install - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/chez-sockets")) - (doc (string-append out "/share/doc/" ,name "-" ,version)) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - (for-each (lambda (f d) (install-file f d)) - '("sockets.pdf" "sockets.so") - (list doc chez-site)) - #t)))))) + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((scheme (search-input-file (or native-inputs inputs) + "/bin/scheme")) + (lib (string-append (dirname scheme) "/../lib")) + (header-file (car (find-files lib "scheme\\.h"))) + (include-dir (dirname header-file))) + (substitute* "Makefile" + (("(SCHEMEH=).*$" _ var) + (string-append var include-dir)))))) + (add-before 'build 'tangle + (lambda* (#:key inputs #:allow-other-keys) + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" + (assoc-ref inputs "chez-web") + "/share/texmf-local/tex/generic:" + ":")) + ;; just using "make" tries to build the .c files before + ;; they are created. + (and (invoke "make" "sockets") + (invoke "make")))) + (replace 'build + (lambda args + (let ((chez-site (string-append #$output + "/lib/chez-scheme/arcfide"))) + ;; make sure Chez Scheme can find the shared libraries. + (substitute* "sockets.ss" + (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post)) + (("(\")(sockets-stub\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post))) + ;; to compile chez-sockets, the .so files must be + ;; installed (because of the absolute path we + ;; inserted above). + (for-each (lambda (f) + (install-file f chez-site)) + '("socket-ffi-values.so" + "sockets-stub.so")) + (invoke "bash" + "-c" + (format #f "echo '~s' | scheme -q" + '(compile-file "sockets.sls")))))) + (replace 'install + (lambda args + (install-file "sockets.so" + (string-append #$output + "/lib/chez-scheme/arcfide")) + (install-file "sockets.pdf" + (string-append #$output + "/share/doc/" + #$name "-" #$version))))))) (home-page "https://github.com/arcfide/chez-sockets") (synopsis "Extensible sockets library for Chez Scheme") (description "Chez-sockets is an extensible sockets library for Chez Scheme.") (license expat)))) -;; Help function for Chez Scheme to add the current path to -;; CHEZSCHEMELIBDIRS. -(define chez-configure - '(lambda _ - (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) - (setenv "CHEZSCHEMELIBDIRS" - (if chez-env - (string-append ".:" chez-env) - ".")) - #t))) - -;; Help function to define make flags for some Chez Scheme custom make -;; files. -(define (chez-make-flags name version) - `(let ((out (assoc-ref %outputs "out"))) - (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" ,(package-version chez-scheme)) - (string-append "PREFIX=" out) - (string-append "DOCDIR=" out "/share/doc/" - ,name "-" ,version)))) - (define-public chez-matchable (package (name "chez-matchable") @@ -253,10 +258,11 @@ (define-public chez-matchable (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -284,10 +290,11 @@ (define-public chez-irregex (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -314,17 +321,18 @@ (define-public chez-fmt (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "chez-check" - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - (replace 'build - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-build" make-flags))) - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-install" make-flags)))))) + (list #:make-flags (chez-make-flags name version) + #:test-target "chez-check" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-build" make-flags))) + (replace 'install + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-install" make-flags)))))) (home-page "http://synthcode.com/scheme/fmt") (synopsis "Combinator formatting library for Chez Scheme") (description "This package provides a library of procedures for @@ -354,10 +362,11 @@ (define-public chez-mit (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -386,46 +395,44 @@ (define-public chez-scmutils (propagated-inputs (list chez-mit chez-srfi)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:tests? #f ; no test suite - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - ;; 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 - ;; in turn requires us to compile the files in the final - ;; destination. - (delete 'build) - (add-after 'install 'install-src - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-src" make-flags))) - (add-after 'install-src 'absolute-path-in-scm-files - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils") - (string-append "include \"" (dirname file))))) - (find-files out "\\.sls")) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils/simplify") - (string-append "include \"" (dirname file))))) - (find-files out "fbe-syntax\\.scm")) - #t))) + (list + #:make-flags (chez-make-flags name version) + #:tests? #f ; no test suite + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + ;; 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 + ;; in turn requires us to compile the files in the final + ;; destination. + (delete 'build) + (add-after 'install 'install-src + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "install-src" make-flags))) + (add-after 'install-src 'absolute-path-in-scm-files + (lambda* (#:key #:allow-other-keys) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils") + (string-append "include \"" (dirname file))))) + (find-files #$output "\\.sls")) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils/simplify") + (string-append "include \"" (dirname file))))) + (find-files #$output "fbe-syntax\\.scm")))) (add-after 'absolute-path-in-scm-files 'build - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (mk-file (car (find-files out "Makefile")))) + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (let ((mk-file (car (find-files #$output "Makefile")))) (with-directory-excursion (dirname mk-file) (apply invoke "make" "build" make-flags))))) (add-after 'build 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (for-each delete-file - (find-files out "Makefile|compile-all\\.ss")) - #t)))))) + (lambda args + (for-each delete-file + (find-files #$output + "Makefile|compile-all\\.ss"))))))) (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") (description "This package provides a port of the MIT/GNU Scheme Scmutils program to Chez Scheme. The port consists of a set of -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:07 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:07 +0000 Received: from localhost ([127.0.0.1]:39055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnq-0003Ak-Qa for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:07 -0500 Received: from mail-qt1-f176.google.com ([209.85.160.176]:38644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnk-00039f-Ey for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:00 -0500 Received: by mail-qt1-f176.google.com with SMTP id r14so14012645qtt.5 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:00 -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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=knl7LDfUD7f9wj7gODsWLpZQ7+iZL4ctHsMUkk99xXnZ5XJqCFbxn3Mmelx+XqB383 Y7fVpO3Dt6yY7FH492mfS95sqvd1YLYbR7YGSmDmqi7W4NZbtuRyod8V2bq767v+1mEC +h4aG7yBW4Q9MpULg2uZs4gKQ2ny3X5n4H1N0x2Il+h/dvms7zjZcPx+sEitbnwQGQF4 ZCJmR1RPeijb0fr6Zde4+2TMtrnbsWA48HwqIw7HhErimIy8sv+MKOIOXvW9dEZIb12z +qaa24hvU2c/4Hdfva2uQWaDQGdpGo0DG5CI0RYBxNUi4iRtug2nr9ahlIYJ9OngflvD crYg== 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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=fOOLG8pmsN7CWDnBrMikJSOIcoYavyB/t/5OEGrOvN+tNlwOmfojEE93dVmZ93rCFR p6SMt7QCLKgZ1fUwar0244eoom+zvOk0CL8b43DasOPzUyoVzSH3DrFlZ3Ua28KMp72x EGXVFSsuV3A6W0IDST758296dntDQLWjdhMk4Lf838vhaRMFJvvriFHXeQDDtlC3UPZ5 dZzvXNCkSvYyNX1moKz0zZDmxB7wWIGfxN1i4rqJde0ZkK2u2CTQO05wPri7LTyF4Bxw 3OlSj87RYgs23BKfGuYDpBy7qu3l/+uyN/OnPKWSwQQ6QXh7zW2BNLA+NLSsofBZhDCn xfig== X-Gm-Message-State: AOAM5325BUP7KtbRQmbRaguwqQurf9LOd1KH80biAtZV8yHmu4GiMECg UkA3mbo5Jt7s/7auy3xSXFNJrF8Pyy9b3gcIS1k= X-Google-Smtp-Source: ABdhPJzH0A7gjSpVyoeO3q/Qbwvmf22OGZK11UeuY2NARSQva05aq2GVFemjS0fPwckgmtKrIMW13A== X-Received: by 2002:a05:622a:4cc:: with SMTP id q12mr7798291qtx.561.1644789174806; Sun, 13 Feb 2022 13:52:54 -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 p10sm15537738qtx.62.2022.02.13.13.52.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:52:54 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 03/11] gnu: chez-scheme: Use shared zlib and lz4. Date: Sun, 13 Feb 2022 16:51:19 -0500 Message-Id: <20220213215127.218952-4-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez-and-racket-bootstrap (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 1ed4631ced..11d570059b 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -114,9 +114,7 @@ (define-public chez-scheme (inputs `(("libuuid" ,util-linux "lib") ("zlib" ,zlib) - ("zlib:static" ,zlib "static") ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") ;; for expeditor: ("ncurses" ,ncurses) ;; for X11 clipboard support in expeditor: @@ -169,14 +167,14 @@ (define src (lz4-static (assoc-ref inputs "lz4:static")) (out (assoc-ref outputs "out")) ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) + (flags (cons* (string-append "--installprefix=" out) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do compress-man-pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) (format #t "configure flags: ~s~%" flags) ;; Some makefiles (for tests) don't seem to propagate CC ;; properly, so we take it out of their hands: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:09 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:10 +0000 Received: from localhost ([127.0.0.1]:39058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnt-0003B0-4i for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:09 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:33342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMno-00039u-Ko for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:05 -0500 Received: by mail-qk1-f177.google.com with SMTP id o10so13044635qkg.0 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:04 -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=Lox4biAAsxxoQq6Fxhf7L0m7IO8uJocQ7vmE7rh9eMo=; b=QSu4qpMq8pjrATd5vBunqgkFvoB6jFyUtXzY9a50hwT6KhueTe5sAuJM0dPyUHQqaK 9b8xFhBO84LqteCTOAK5Jr7En0bOn1ihTHb2n0PSGahBTOkO61/cYkpyq0QsTboBVwYh m8uGTaS57wDZJ+I/ZrEHYnCGoiUbVgshaR+PXrehYmC7HoWjFTcp8+wCNulaaXN1ivoY eH2HWp29Z6qMy+qiSXG8NvHxzL4exY5UIWhNih8Hl8uNETBdwz8iT8jyRNjUXtQbHxL/ E2m5jFNKXYnX5ixCnNo00qMg3dOqfez5pXWR1tIVrvrLjPrx+woftnBsKu1wIqcyW/W8 Rf0A== 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=Lox4biAAsxxoQq6Fxhf7L0m7IO8uJocQ7vmE7rh9eMo=; b=uvkU1d54ZdmexbTbeJEm7uL3trE5FX8L64WBxTIFdJkH8l3Dy3zR9AMVy8qoLPaWwW 3+8rUwUCSmdE1geNiIKXZBUzbAXZ8sqz1DATNHRcpKIKwnDnI70ht+WNWfTIHb6SMggi YUZKvbn2TTGIUQs1V8Iy8+vRwsjxZhYhWR0/N/mVwCYePeaRYNzYe3uR2mqOxF5FEzrg 3N9fcVZgCk0t1hToZJVLcIcvKLvNDHRLV9ok1jpUdFZBuoZT4Tnw/4SpBTQOLSz6KMkl +o8zcBxfKw4ZKUZNYz+r7kbwVODxVlaiXPruhOpTYjvtz34z6NNPd3c/OGxEtrct+zvM B/NQ== X-Gm-Message-State: AOAM531qVj663zYYrx5Ls+Vph80CBXSPBzlFzaAC4yZc2NEK60Mp1e+D BiYHpbTu4EhGhZ8jOy6hPQGxJdylwEuPX0jjK3A= X-Google-Smtp-Source: ABdhPJxVs7Xpyad4UMkgLrm5MjktsXpKWBxoYu7ZhaMxsWmEJJVRI7cN0K1jZyEy5egCE09R30TP6g== X-Received: by 2002:a05:620a:25cc:: with SMTP id y12mr5773709qko.94.1644789178891; Sun, 13 Feb 2022 13:52:58 -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 s34sm16669359qtc.88.2022.02.13.13.52.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:52:58 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 04/11] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. Date: Sun, 13 Feb 2022 16:51:20 -0500 Message-Id: <20220213215127.218952-5-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-machine->unthreaded, chez-machine->upstream-restriction, chez-machine->nix-system, nix-system->chez-machine): New private functions. (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private constants. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-machine->upstream-restriction'. --- gnu/packages/chez-and-racket-bootstrap.scm | 142 ++++++++++++++++++++- 1 file changed, 140 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 11d570059b..fc1da53178 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -28,7 +28,9 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -61,6 +63,134 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; Code: +(define (chez-machine->unthreaded mach) + "Given a string MACH naming a Chez Scheme machine type, returns a string +naming the unthreaded machine type for the same architecture and OS as MACH. +The returned string may share storage with MACH." + (if (eqv? #\t (string-ref mach 0)) + (substring mach 1) + mach)) +(define (chez-machine->threaded mach) + "Like @code{chez-machine->unthreaded}, but returns the threaded machine +type." + (if (eqv? #\t (string-ref mach 0)) + mach + (string-append "t" mach))) + +;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt +;; in https://github.com/racket/raco-cross. +;; For supported platforms, refer to release_notes/release_notes.stex in the +;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md +;; in https://github.com/racket/racket. +(define %nix-arch-to-chez-alist + `(("x86_64" . "a6") + ("i386" . "i3") + ("aarch64" . "arm64") + ("armhf" . "arm32") ;; Chez supports ARM v6+ + ("ppc" . "ppc32"))) +(define %nix-os-to-chez-alist + `(("w64-mingw32" . "nt") + ("darwin" . "osx") + ("linux" . "le") + ("freebsd" . "fb") + ("openbsd" . "ob") + ("netbsd" . "nb") + ("solaris" . "s2"))) + +(define (chez-machine->upstream-restriction mach) + "Given a string MACH naming a Chez Scheme machine type, returns a symbol +naming a restriction on the upstream Chez Scheme implementation compared to +the Racket variant, or @code{#f} if no such restriction exists. The +restriction is reported for the architecture--OS pair, regardless of whether +MACH specifies a threaded or an unthreaded variant. + +Possible restrictions currently include: +@itemize @bullet +@item +@code{'no-threads}: Support for native threads is not available upstream. +@item +@code{'no-support}: The upstream release doesn't claim to support this +architecture--OS combination at all. +@end itemize + +See @code{chez-machine->nix-system} for more details about acceptable values +for MACH." + (let ((mach (chez-machine->unthreaded mach))) + (cond + ((string-prefix? "arm64" mach) + 'no-support) + ((string-prefix? "arm32" mach) + (if (string-suffix? "le" mach) + 'no-threads + 'no-support)) + ((string-prefix? "ppc32" mach) + (if (string-suffix? "le" mach) + #f + 'no-support)) + (else + #f)))) + +(define (chez-machine->nix-system mach) + "Return the Nix system type corresponding to the Chez Scheme machine type +MACH. If MACH is not a string representing a known machine type, an exception +is raised. This function does not distinguish between threaded and unthreaded +variants of MACH. + +Note that this function only handles Chez Scheme machine types in the +strictest sense, not other kinds of descriptors sometimes used in place of a +Chez Scheme machine type by the Racket, such as @code{\"pb\"}, @code{#f}, or +@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type +for the host system is often still relevant.)" + (let ((mach (chez-machine->unthreaded mach))) + (let find-arch ((alist %nix-arch-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (string-prefix? chez mach) + (string-append + nix "-" (let ((mach-os (substring mach (string-length chez)))) + (let find-os ((alist %nix-os-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (equal? chez mach-os) + nix + (find-os alist))))))) + (find-arch alist))))))) + +(define* (nix-system->chez-machine #:optional (system (%current-system)) + #:key (threads? 'always)) + "Return the Chez Scheme machine type corresponding to the Nix system +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme +machine type is undefined. + +When THREADS? is @code{'always} (the default), the threaded variant of the +machine type will be returned: note that the package returned by +@code{chez-scheme-for-system} will always support native threads. When +THREADS? is @code{#f}, the unthreaded machine type will be returned. If +THREADS? is @code{'upstream} (the default), the threaded variant of the +machine type will be returned if and only if it is supported by upstream Chez +Scheme (see @code{chez-machine->upstream-restriction}). If THREADS? is any +other value, an exception is raised." + (let* ((hyphen (string-index system #\-)) + (nix-arch (substring system 0 hyphen)) + (nix-os (substring system (+ 1 hyphen))) + (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) + (chez-os (assoc-ref %nix-os-to-chez-alist nix-os)) + (mach (and chez-arch chez-os (string-append chez-arch chez-os)))) + (and mach + (match threads? + ('always + (chez-machine->threaded mach)) + (#f + mach) + ('upstream + (if (chez-machine->upstream-restriction mach) + mach + (chez-machine->threaded mach))))))) + +;; +;; Chez Scheme: +;; + (define nanopass (let ((version "1.9.2")) (origin @@ -264,8 +394,16 @@ (define* (stex-make #:optional (suffix "")) ;; We should too. It is the Chez machine type arm32le ;; (no threaded version upstream yet, though there is in ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) + (supported-systems + (delete + "armhf-linux" ;; <-- should work, but reportedly broken + (filter + (lambda (system) + (and=> (nix-system->chez-machine system) + (lambda (mach) + (not (eq? 'no-support + (chez-machine->upstream-restriction mach)))))) + %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:14 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:14 +0000 Received: from localhost ([127.0.0.1]:39061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnx-0003BN-VI for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:14 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:40878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMns-0003AZ-RX for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:09 -0500 Received: by mail-qk1-f179.google.com with SMTP id o25so12986185qkj.7 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:08 -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=71aWypGkxk0T9T1BAj0BYQ2KTsp07bosxnaKq0p+hog=; b=FmkwmFHjb9/ItUavp/6pXLxNhNJ7YHpABPAUwaDllvtF0wUnmMPV3+wz1bnd5/tQpv 5yd0jxSekqAvbZrAt6BVnig8dxYUU+aqw/iFFIUNKhTzuiEfZY3pwV5zDl6c28WUh7In 9D97hv9tV9e7P4mzK6hfV+A/tfEObqf4uztn1BJt06yogqUZPRZu9rGQTh061ZplCfY8 Gm5+XMnbZEwdTB9EcKexI29SD2OPp01zHsgzFeOTB2du0q2iXAdN1iA+dJYas5n1kVuJ zTTxvDZFeScvMMrROGV7qZzbKJi0RMYcbl8WlFaKn/cC0JL6UyQQdM0bjjD/APJi8GtU 7aew== 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=71aWypGkxk0T9T1BAj0BYQ2KTsp07bosxnaKq0p+hog=; b=INhhD4UuBZBXwVx9Lvp/qCH2Arr3v8Jv9Ge6PBVGbRZoI4YuG1+oRTyi5AKdU3abs/ PGFJFw6SEURrHe7B/8Qu8YmG0VxZa4anIovfc9m+EsyqDjbxQBXDBJh4GxpCdaGIYeIt IiMfcxgk5s3LUzyFyrA1xfQhwQoCf98BAvTVqqUvBR5qzxK9Dgzxf7HoWajyn5toHi+G jmWP+++93zgX/KtUnWNke3F8j1s9BmP1mvCCsjF94D9ZQohj341cDpMyOHl0wR08j6/L QFm40I/nH1JQ3U3rn33hDgAM8sxa33T4erfxPhuvwurHvYTpWbQ9jmt9tmu+J9vszotd djBw== X-Gm-Message-State: AOAM533qimLWMWWqYVqUZAd0YeI55p1neKW9BLTChUyrZFPGXKWqPupG dNyqEyeoUiAqd5zsmjHESXuFF6li8rYNuC4Lwos= X-Google-Smtp-Source: ABdhPJy1UQREFy4PX8SDHgi2jqgMeR3mAabO/B6xLC7rzh4pcnGUwqp3XxMRB5EJgQh3WulhGilwlw== X-Received: by 2002:a05:620a:12e7:: with SMTP id f7mr5634393qkl.612.1644789183039; Sun, 13 Feb 2022 13:53:03 -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 u21sm16311470qtw.80.2022.02.13.13.53.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:02 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 05/11] gnu: Add stex. Date: Sun, 13 Feb 2022 16:51:21 -0500 Message-Id: <20220213215127.218952-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (stex-bootstrap): New variable. (stex): Change from origin to package inheriting from 'stex-bootstrap'. (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove labels. Remove dependencies of stex-bootstrap. [inputs]: Remove labels. [arguments]: Adapt to use 'stex-bootstrap', 'search-input-file', and G-expressions. (nanopass): Make it public as a temporary workaround for Racket. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 430 ++++++++++++--------- gnu/packages/racket.scm | 5 +- 2 files changed, 258 insertions(+), 177 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index fc1da53178..945d1ce2ed 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -31,6 +31,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -191,113 +192,83 @@ (define* (nix-system->chez-machine #:optional (system (%current-system)) ;; Chez Scheme: ;; -(define nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define unbundle-chez-submodules + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))) -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) +(define (unpack-nanopass+stex) + ;; delayed resolution of `nanopass` + #~(begin + (copy-recursively #$nanopass + "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-public chez-scheme (package (name "chez-scheme") + ;; The version should match `(scheme-version-number)`. + ;; See s/cmacros.ss c. line 360. (version "9.5.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet unbundle-chez-submodules))) (build-system gnu-build-system) (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("lz4" ,lz4) - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) - (native-inputs - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) + (list + `(,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 stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* (string-append "--installprefix=" out) + #:test-target "test" + ;; TODO when we fix armhf, it may not support --threads + #:configure-flags #~'("--threads") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + #$(unpack-nanopass+stex))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) + ;; add flags which are always required: + (let ((flags (cons* (string-append "--installprefix=" #$output) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" @@ -305,90 +276,59 @@ (define src ;; and letting Chez try causes an error "--nogzip-man-pages" configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke "./configure" 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* ((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. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'install-symlink 'install-doc + (lambda* (#:key native-inputs inputs outputs + #:allow-other-keys) + (match (assoc-ref outputs "doc") + (#f + (format #t "not installing docs~%")) + (doc-prefix + (let* ((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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le @@ -412,3 +352,145 @@ (define* (stex-make #:optional (suffix "")) generates native code for each target processor, with support for x86, x86_64, and 32-bit PowerPC architectures.") (license license:asl2.0))) + +;; +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") ;; can run without compiling + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + #$(nix-system->chez-machine + (or (%current-target-system) + (%current-system)))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine "\\."))))) + (else + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is referenced in the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license license:expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (outputs '("out" "doc")) + (properties '()))) + +(define-public nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 865fdff70f..d8338bcd6f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,9 +333,8 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) "stex")) - ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) - "nanopass")))) + ("stex" ,(package-source stex)) + ("nanopass" ,nanopass))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:15 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:15 +0000 Received: from localhost ([127.0.0.1]:39063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMny-0003BS-Sh for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:15 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:40881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMnw-0003Ax-It for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:12 -0500 Received: by mail-qk1-f179.google.com with SMTP id o25so12986269qkj.7 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:12 -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=0RoPqjGuiAdlkTJfEuvvQASmSYaOTDgT7ADK6BvAjY0=; b=SNH3cAF0xRaq78IK5sHzA1dJwvRiu138+v4cv5nSV9RK7J+XCAANYeEKK91UvBFIrc zmO3+s447pjM8v+olvD0/FsjPy3iNQsCo5pQBGamtc7XKZVXBJWpqbd2pXRMeRQH07IL baiYYMa1g06KuGMPReWWpilIUXTgnU6YYCIupxuaCvMLa0OgMa45cOhy91RsUiRDvnf5 xCtW0VmgHcxzl/L7U7hWA6CY4GbYVpeinQDZ/Iwd7wPhuAIUDC+d7cuFN4E1iIMyEbgh Au1V7FooH56DXXZB0FHZataIDbN3Uitdfvzek3Lm8Ixv82M36zWBGAThMsY7/BSKr190 4QHg== 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=0RoPqjGuiAdlkTJfEuvvQASmSYaOTDgT7ADK6BvAjY0=; b=zfm32rTkeSqa76qkPxeQYZfk8VHX5dap83qkZt268uquRQprEv8WQu1OUZM7Pt2894 qtBAxzfqoW0Fgfv/YTWk9KE6+C2L2etByTuEcttMMjbIboSP9FZXTyxEMq3ysFvZ+i3u vGcdGwN9CSWqyrGYNPGvy6paxWaA0VSuaWaXfj5wAVof6TB0tpbqZSb6wNaXWUl3ZRP7 8hlc4YzyXC5LG53gkN6Sz3M0WEZyD+UytILlZTtXbz1N7o8xcZgYuJJZGMR4M+fUbw37 3biCT/q80FKbwtxV9QIxBby3lAtdOQH3GNFcE3JESa7iXGrHRdKB/NCI/mIsZqqtylyW VQOA== X-Gm-Message-State: AOAM5312Z+C42/h6yvgWNqqUk0l/fzve0mlxTwZi2L5X2TqOW7fIqj2Q M1nQP6qBuaW1mA40Iaiq4qd/y8qCna3LQDrSmak= X-Google-Smtp-Source: ABdhPJxl1oFGTbGXdsiJLScfAl5adcMTPLpqe4jpF7b/UEc7/2TkRWNrw2UUdIB/UIZ9m/oVZCYm4g== X-Received: by 2002:a05:620a:e1d:: with SMTP id y29mr4776400qkm.274.1644789187066; Sun, 13 Feb 2022 13:53:07 -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 f20sm17374305qte.14.2022.02.13.13.53.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:06 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 06/11] gnu: Add chez-nanopass. Date: Sun, 13 Feb 2022 16:51:22 -0500 Message-Id: <20220213215127.218952-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-scheme)[native-inputs]: Add it. (chez-nanopass): New variable. (unpack-nanopass+stex): Adapt accordingly. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Likewise. --- gnu/packages/chez-and-racket-bootstrap.scm | 97 ++++++++++++++++++---- gnu/packages/racket.scm | 2 +- 2 files changed, 82 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 945d1ce2ed..90fd63b5ae 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -203,12 +203,13 @@ (define unbundle-chez-submodules "lz4" "zlib")))) -(define (unpack-nanopass+stex) - ;; delayed resolution of `nanopass` +(define unpack-nanopass+stex #~(begin - (copy-recursively #$nanopass - "nanopass" - #:keep-mtime? #t) + (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 () @@ -241,7 +242,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs (list stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -261,7 +262,7 @@ (define-public chez-scheme #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex (lambda args - #$(unpack-nanopass+stex))) + #$unpack-nanopass+stex)) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -485,12 +486,76 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license license:expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d8338bcd6f..e8d016c07b 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -334,7 +334,7 @@ (define-public racket-bootstrap-chez-bootfiles racket-minimal racket-minimal-bc-3m)) ("stex" ,(package-source stex)) - ("nanopass" ,nanopass))) + ("nanopass" ,(package-source chez-nanopass)))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:21 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:21 +0000 Received: from localhost ([127.0.0.1]:39067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMo5-0003Br-D6 for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:21 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:40884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMo0-0003BF-Hs for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:17 -0500 Received: by mail-qk1-f179.google.com with SMTP id o25so12986324qkj.7 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:16 -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=CYgngiATXaLMvhaAGpIcMnIeSYTe0mOCGRZVfgJ63WI=; b=jwW6YlLJr67sTXjSSCYhaU+Ee2tKd4zfgBQZfritpRkdmyeq46bjieZWRBTLmotQnv cp9qgc24fXjD+YcrKvS7QIs1UqfyrDMjb+pLKLXCRAHYcsoftlbLbu+1KuhFMkqBkoDK WegsfAPVTBw7/Dy44TCTaYpJ8O3EtDIUYFyBm6eJpjHpKV+1LvhqJ66mWZok80gSZAiX nNuul7BohRtbMskBw3dUKEZkoovuBSUQY7PiDMem1FLO4J2ROw+GUQjmkRBhO9T7FYDa Pe46/Plk0XhElQlkUFD0lFWYj+xECM2BNLXom8HRwGU7D9pIpP3HYlIhy9cFgn1CG8gA ponA== 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=CYgngiATXaLMvhaAGpIcMnIeSYTe0mOCGRZVfgJ63WI=; b=fN5pn4s2ew1SoBzLr1xLF911K3WfudyolH8ptYU3rxyDM+4xY4U2mYYQuQDRQYKtKd 1+O291grVSovy3NImfd9B7D7FQN6Bz6+ISnVh0nsvMjCFNYpRgmW4aTMDDAe7I5jDpN7 qW4rZOmOLlqi2CcQsAzXHDINgqFdPCarPlwoiNABXhR6E8DHB8BzU0EXEbeJJzXKrfrk 43/qGxAUUDXNRN5bZ/Xf9oO7ORdJGzPtivXrLpsxfxWQDwPu/3m4TJKt7hPKfVdVcvc+ NVOsmozv+CfWQEXQcd6Sr99IID9k4tL5NjWerC4QC26CVyJkT24QH5NHOj30PdcVfKZE 61Ag== X-Gm-Message-State: AOAM530G5Rur89Amm5b3Ik2UPx+NYZIBvvud//ehGPIKW4gABvUEozL4 xysJhFXdwD2uB0azqsbnonjIfNnScGRTAd+QFXo= X-Google-Smtp-Source: ABdhPJzBsVoWBxh3noXT2CiNvW834eIn5XQKLWRzaQ01NtfwdWfJ94aYPGV2JRBPt6ErbvKyS7tkkQ== X-Received: by 2002:a05:620a:1928:: with SMTP id bj40mr5471915qkb.520.1644789191024; Sun, 13 Feb 2022 13:53:11 -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 m17sm16938970qtk.53.2022.02.13.13.53.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:10 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Sun, 13 Feb 2022 16:51:23 -0500 Message-Id: <20220213215127.218952-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This might seem a bit silly in isolation, but it makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]: Add new phase 'unpack-bootfiles'. [version, source, home-page]: Derive from 'chez-scheme-bootstrap-bootfiles'. --- gnu/packages/chez-and-racket-bootstrap.scm | 57 ++++++++++++++++++++-- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 90fd63b5ae..38708ab690 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -216,9 +216,9 @@ (define unpack-nanopass+stex ;; otherwise, it will try to download submodules (display "# to placate ../configure"))))) -(define-public chez-scheme +(define-public chez-scheme-bootstrap-bootfiles (package - (name "chez-scheme") + (name "chez-scheme-bootstrap-bootfiles") ;; The version should match `(scheme-version-number)`. ;; See s/cmacros.ss c. line 360. (version "9.5.6") @@ -230,8 +230,45 @@ (define-public chez-scheme (sha256 (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) + (file-name (git-file-name "chez-scheme" version)) (snippet unbundle-chez-submodules))) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (supported-systems + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((mach (nix-system->chez-machine system #:threads? #f))) + (or (equal? "arm32le" mach) + (and mach + (member (substring mach 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> mach) + '("le" "nt" "osx")))))) + %supported-systems)) + (home-page "https://cisco.github.io/ChezScheme/") + (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 upsream +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.") + (properties `((hidden? . #t))) + (license license:asl2.0))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version (package-version chez-scheme-bootstrap-bootfiles)) + (source (package-source chez-scheme-bootstrap-bootfiles)) (build-system gnu-build-system) (inputs (list @@ -242,7 +279,9 @@ (define-public chez-scheme ;; 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-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -263,6 +302,14 @@ (define-public chez-scheme (add-after 'unpack 'unpack-nanopass+stex (lambda args #$unpack-nanopass+stex)) + (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 (or native-inputs 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`. @@ -345,7 +392,7 @@ (define* (stex-make #:optional (suffix "")) (not (eq? 'no-support (chez-machine->upstream-restriction mach)))))) %supported-systems))) - (home-page "https://cisco.github.io/ChezScheme/") + (home-page (package-home-page chez-scheme-bootstrap-bootfiles)) (synopsis "R6RS Scheme compiler and run-time") (description "Chez Scheme is a compiler and run-time system for the language of the -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:33 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:33 +0000 Received: from localhost ([127.0.0.1]:39070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMo9-0003CD-Ps for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:33 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:40823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMo5-0003Bf-6P for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:24 -0500 Received: by mail-qt1-f178.google.com with SMTP id l14so13995327qtp.7 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:21 -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=yykw+AWD6FY/FmvVOZ3HzSxUT5NQ0nqtFL1OavGb7xs=; b=h8UTzpf8dtGAOpfIZCpuk831L6VfT5zOVsAfQM3N5ujMSGZFLBZOhMCLNztzF97VIM CQJS7JPpsRXzxq04diYKLHg13/W43qwr6YQ8goSlhqphsMPXoPHNV57s+cnysOAdeKDE dT9oJ5VsvnUAX/LHGxvXKAor3SZB4qk9ComNYGCmThjVvdgd2xm2Dm0xJKhZEPr4nfUv ITiJzIEmfc9xR38kZ1b5MvIZzwP3E4iEmPu0ZUpre0f2pZTXaY0SPYpQk6er+un5xOma nNcOcMRxylgrRwlh04yqJRHbXPuiHOzxMCF6aESU37xwL8XwpJg0XX6X5AYxASHGLI2t I42g== 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=yykw+AWD6FY/FmvVOZ3HzSxUT5NQ0nqtFL1OavGb7xs=; b=OCCZonkjN+kDkayMGkvO8L/SCBWBbmG5Od+6FSJ/G89qgutJXlZAvEZJhlMOV0xVSQ UQD3lP9sWtFV3ya3Hv/LvkPuZNp4YyV+fq18hYwKGD+9H8YvdgNHswHbilRp+9rbU+j6 bNigI/RL04wULWr3OuwewWnF5v+r2XDV7mSliIGOy+CxHzDdKdRLLqTX+bSLqoBNRbi7 E61ADQFvWSnlE+JC8YHYjQrgY7Z+2U+QxAmUV4xyQHQnk9R4JcGe/QBD3NuwgnEAUjSw wQRKYlThgf2hC2Hn9RYFdIn08UPvmyNGG/pfDPXis6Mjz9WC+fjQT9emhfBOF0862AF9 nyCQ== X-Gm-Message-State: AOAM530sNiXqfV6HAZ6KgaRTANH09HPduyNFBvSVzBO0Jw04b1e2y2CG letrBUzzKM0/tqalKaX+OB7OY+ZDTw0Tvblbc4s= X-Google-Smtp-Source: ABdhPJxAyr/uQMOTja7zoxsvBgMeD1B713d6kyK+A993vY7vRygSej2dBTBOtUwVlXsgwYTBrEg9xQ== X-Received: by 2002:ac8:5cd2:: with SMTP id s18mr7582407qta.558.1644789195068; Sun, 13 Feb 2022 13:53:15 -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 u36sm5611466qtc.42.2022.02.13.13.53.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:14 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 08/11] gnu: Add chez-scheme-for-racket. Date: Sun, 13 Feb 2022 16:51:24 -0500 Message-Id: <20220213215127.218952-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) The Racket variant of Chez Scheme can be used to support platforms that are not yet supported by upstream Chez Scheme. In the process, we also add packages for 'racket-vm-cgc', 'racket-vm-bc', and 'racket-vm-cs'. A future commit will change 'racket-minimal' to use the Racket VM implementation that best supports the target system. * gnu/packages/patches/racket-enable-scheme-backport.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cgc): (racket-vm-bc): (racket-vm-cs): (chez-scheme-for-racket-bootstrap-bootfiles): (chez-scheme-for-racket): New variables. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 489 +++++++++++++++++- .../racket-enable-scheme-backport.patch | 465 +++++++++++++++++ 3 files changed, 948 insertions(+), 7 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index 72e086d465..8ffdd15ee2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1787,6 +1787,7 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-enable-scheme-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 38708ab690..d2f78dfae2 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -34,8 +34,11 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages ncurses) #:use-module (gnu packages netpbm) @@ -62,6 +65,144 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; Putting the relevant definitions together in this module avoids having to ;; work around dependency cycles. ;; +;; Anatomy of Racket: +;; ------------------ +;; +;; The main Racket Git repository () is +;; organized broadly like this: +;; +;; . +;; ├── Makefile +;; ├── pkgs/ +;; └── racket/ +;; ├── collects/ +;; └── src/ +;; ├── configure +;; ├── Makefile.in +;; ├── bc/ +;; ├── cs/ +;; ├── ChezScheme/ +;; └── ... +;; +;; The 'racket/src/' directory contains the source of the runtime system, core +;; compiler, and primitives for the major Racket implementations: this layer +;; is called the ``Racket VM''. It is basically a normal autotools +;; project. (Even when Racket VM implementations use components implemented in +;; Racket, they are compiled in special modes to produce VM primitives.) +;; (There are or have been experimental Racket VM implementations elsewhere, +;; e.g. .) One way of thinking about the +;; bounary between the Racket VM and Racket programs is that the VM implements +;; the primitives accessed by the 'ffi/unsafe/vm' library. Another perspective +;; is that DrRacket's ``Open defining file''/``Jump to definition'' features +;; can navigate into Racket programs, including into the implementation of +;; 'racket/base', but can not jump into the implementation of the Racket VM +;; itself. A third, related perspective is that Racket code is usually +;; installed with source files alongside compiled code (though this is not +;; mandatory), whereas the Racket VM is installed only in compiled form. +;; +;; The 'racket/collects/' directory contains ``built in'' Racket libraries +;; that are not part of any package, including the implementation of +;; 'racket/base': in particular, it must contain enough to implement `raco pkg +;; install'. It is theoretically possible to use the Racket VM layer without +;; the main collections, but it is not stable or useful. +;; +;; The 'pkgs/' directory contains Racket packages that are especially closely +;; tied to the implementation of the Racket VM, including 'compiler-lib', +;; 'racket-doc', and 'racket-test'. Some of these packages depend on Racket +;; packages that are developed in other Git repositories, predominantly but +;; not exclusively under the 'racket' GitHub organization. Conversely, not all +;; of the packages developed in the main Git repository are part of the main +;; Racket distribution. (Additionally, components of the Racket VM that are +;; implemented in Racket can be installed as packages, mostly for ease of +;; development.) +;; +;; The top-level 'Makefile' is more like a directory of scripts: it has +;; convienience targets for developing Racket, and it cooperates with the +;; 'distro-build' package to assemble custom Racket distributions. 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. +;; +;; A ''minimal Racket'' installation includes two packages: 'base', which is a +;; sort of bridge between the current ``built-in'' collections and the package +;; system's model of dependencies, and 'racket-lib', which, for installations +;; that can not rely on a system package manager, pulls in the SQLite and +;; OpenSSL shared libraries as platform-specific dependencies for use by the +;; ``built-in'' collections. +;; +;; The main Racket distribution consists of installing the 'main-distribution' +;; package and all of its dependencies. +;; +;; The default mode when building Racket (or installing it with the released +;; installers) is an ``in-place build'', which produces a self-contained, +;; relocatable, roughly FHS-like directory. (Racket also supports +;; ``Unix-style'' installations, which rearrange the parts of an in-place +;; build into Racket-specific subdirectories and generally tries to work for +;; installation into an FHS-based system.) Certain tools, e.g. 'distro-build' +;; and 'raco cross', are able to work with an in-place Racket build. +;; +;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and +;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and +;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store +;; output. The function 'racket-vm-for-system' returns the recomended Racket +;; VM package for a given system. +;; +;; The file 'racket.scm' builds on these packages to define 'racket-minimal' +;; and 'racket' packages. These use Racket's support for ``layered +;; installations'', which allow an immutable base layer to be extended with +;; additional packages. They use the layer configuration directly provide +;; ready-to-install FHS-like trees, rather than relying on the built in +;; ``Unix-style install'' mechanism. +;; +;; Bootstrapping Racket: +;; --------------------- +;; +;; Here's how bootstrapping Racket works: +;; +;; - Racket BC [CGC] can be built with only a C compiler (except for +;; one caveat discussed below). +;; - 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 +;; 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. +;; +;; So, we build CGC to build 3M to build bootfiles and CS. +;; +;; (Note: since the CGC variant is basically only for bootstrapping, we +;; often use "BC" to mean "3M", consistent with `(banner)` and the +;; suffixes used on executables when more than one variant co-exists.) +;; +;; 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 +;; README file applies to all such subsystems: +;; +;; The Racket version must be practically the same as the current Racket +;; verson, although it can be the Racket BC implementation (instead of +;; the Racket CS implementation). +;; +;; Unlike Chez Scheme boot files, the files generated in "schemified" +;; are human-readable and -editable Scheme code. That provides a way +;; out of bootstrapping black holes, even without BC. +;; +;; However, other Racket subsystems implemented in Racket for Racket CS +;; use older C implementations for Racket BC, whereas the reader, expander, +;; and module system were completely replaced with the Racket implementation +;; +;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) +;; are embeded in C as a static string constant. Eventually, they are further +;; compiled by the C-implemented Racket BC bytecode and JIT compilers. +;; (On platforms where Racket BC's JIT is not supported, yet another compiler +;; instead compiles the linklets to C code, but this is not a bootstrapping +;; issue.) +;; ;; Code: (define (chez-machine->unthreaded mach) @@ -189,19 +330,19 @@ (define* (nix-system->chez-machine #:optional (system (%current-system)) (chez-machine->threaded mach))))))) ;; -;; Chez Scheme: +;; Chez auxiliary G-expressions: ;; (define unbundle-chez-submodules #~(begin (use-modules (guix build utils)) (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib")))) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))) (define unpack-nanopass+stex #~(begin @@ -216,6 +357,234 @@ (define unpack-nanopass+stex ;; otherwise, it will try to download submodules (display "# to placate ../configure"))))) +;; +;; Racket VM: +;; + +(define (racket-vm-common-configure-flags) + ;; under a lambda extraction to avoid evaluating bash-minimal too early + #~`(,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/libtool")) + => (lambda (libtool) + (list (string-append "--enable-lt=" libtool)))) + (else + '())) + ,@(cond + ((false-if-exception + (search-input-file %build-inputs "/opt/racket-vm/bin/racket")) + => (lambda (racket) + (list (string-append "--enable-racket=" racket)))) + (else + '())) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")) + "--disable-strip" + "--enable-origtree")) + +(define-public racket-vm-cgc + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (hidden-package + (package + (name "racket-vm-cgc") + (version "8.4") + ;; ^ Remember to also update the version of + ;; chez-scheme-for-racket-bootstrap-bootfiles + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racket") + (commit (string-append "v" version)))) + (sha256 + (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (file-name (git-file-name "racket" version)) + (patches (search-patches "racket-minimal-sh-via-rktio.patch" + ;; Remove by Racket 8.5: + "racket-enable-scheme-backport.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Unbundle Chez submodules. + (with-directory-excursion "racket/src/ChezScheme" + #$unbundle-chez-submodules) + ;; Unbundle libffi. + (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + (inputs (list ncurses ;; <- common to all variants (for #%terminal) + bash-minimal ;; <- common to all variants (for `system`) + libffi)) ;; <- only for BC variants + (native-inputs (list libtool)) ;; <- only for BC variants + (outputs '("out" "debug")) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) + (guix build gnu-build-system) + (guix build utils)) + #:strip-directories #~'("opt/racket-vm/bin" + "opt/racket-vm/lib") + #:phases + #~(let () + (define* ((wrap-racket-vm-outputs phase) . args) + (apply + phase + (let loop ((args args)) + (match args + ((#:outputs outputs . args) + `(#:outputs + ,(let loop ((outputs outputs)) + (match outputs + ((("out" . out) . outputs) + `(("out" . ,(string-append out "/opt/racket-vm/")) + ,@outputs)) + ((other . outputs) + (cons other (loop outputs))))) + ,@args)) + ((arg . args) + (cons arg (loop args))))))) + (modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (replace 'configure + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'configure))) + (replace 'patch-shebangs + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-shebangs))) + (replace 'validate-runpath + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'validate-runpath))) + (replace 'make-dynamic-linker-cache + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) + (replace 'patch-dot-desktop-files + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) + (home-page "https://racket-lang.org") + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. + +Racket CGC is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat))))) + +(define-public racket-vm-bc + (package + (inherit racket-vm-cgc) + (name "racket-vm-bc") + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc))) + (arguments + (substitute-keyword-arguments (package-arguments racket-vm-cgc) + ((#:configure-flags _ '()) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket BC [3M] implementation") + (description "The Racket BC (``before Chez'' or ``bytecode'') +implementation was the default before Racket 8.0. It uses a compiler written +in C targeting architecture-independent bytecode, plus a JIT compiler on most +platforms. Racket BC has a different C API and supports a slightly different +set of architectures than the current default runtime system, Racket CS (based +on ``Chez Scheme''). It is the recommended implementation for architectures +that Racket CS doesn't support. + +This package is the normal implementation of Racket BC with a precise garbage +collector, 3M (``Moving Memory Manager'')."))) + +(define-public racket-vm-cs + (package + (inherit racket-vm-bc) + (name "racket-vm-cs") + (inputs + (modify-inputs (package-inputs racket-vm-cgc) + (prepend zlib lz4) + (delete "libffi"))) + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (delete "libtool") + (prepend chez-scheme-for-racket + chez-nanopass-bootstrap + racket-vm-bc))) + (arguments + (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))))) + ((#:configure-flags _ '()) + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + (string-append "--enable-scheme=" + #$(this-package-native-input + "chez-scheme-for-racket") + "/bin/scheme") + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket CS implementation") + (description "The Racket CS implementation, which uses ``Chez Scheme'' as +its core compiler and runtime system, has been the default Racket VM +implemetation since Racket 8.0. It performs better than the Racket BC +implementation for most programs. + +Using the Racket VM packages directly is not recommended: instead, install the +@code{racket-minimal} or @code{racket} packages.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) + +;; +;; Chez Scheme: +;; + (define-public chez-scheme-bootstrap-bootfiles (package (name "chez-scheme-bootstrap-bootfiles") @@ -401,6 +770,112 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license license:asl2.0))) + +(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! + (source (package-source racket-vm-cgc)) + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) + (arguments + (substitute-keyword-arguments + (package-arguments chez-scheme-bootstrap-bootfiles) + ((#:phases those-phases #~%standard-phases) + #~(modify-phases #$those-phases + (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) + (invoke (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "rktboot/main.rkt"))))))) + (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 "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 +supported platforms.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +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.") + (properties `()) + (license license:asl2.0))) + +(define-public chez-scheme-for-racket + (package + (inherit chez-scheme) + (name "chez-scheme-for-racket") + (version (package-version chez-scheme-for-racket-bootstrap-bootfiles)) + (source (package-source racket-vm-cgc)) + (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) + #~(modify-phases #$those-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))))))) + (supported-systems (filter nix-system->chez-machine + %supported-systems)) + (home-page + (package-home-page chez-scheme-for-racket-bootstrap-bootfiles)) + (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 license:asl2.0))) + ;; ;; Chez's bootstrap dependencies: ;; diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch new file mode 100644 index 0000000000..3a5a4a3d82 --- /dev/null +++ b/gnu/packages/patches/racket-enable-scheme-backport.patch @@ -0,0 +1,465 @@ +From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 10:36:09 -0700 +Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` + +(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) + +(Fixed conflicts by dropping pbchunks and pbarch changes.) +--- + racket/src/ChezScheme/configure | 15 ++++++++++++++- + racket/src/ChezScheme/s/Mf-base | 4 ++-- + racket/src/ChezScheme/s/Mf-cross | 4 +++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 4515ffc105..0098829091 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -45,6 +45,7 @@ threads=yes + nothreads=no + temproot="" + help=no ++forceworkarea=no + gzipmanpages=yes + installowner="" + installgroup="" +@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do + --pb) + pb=yes + ;; ++ --force) ++ forceworkarea=yes ++ ;; + --installprefix=*) + installprefix=`echo $1 | sed -e 's/^--installprefix=//'` + ;; +@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then + echo " --toolprefix= prefix tool (compiler, linker, ...) names" + echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" + echo " --workarea= build directory ($w)" ++ echo " --force configure even without boot files" + echo " CC= C compiler" + echo " CPPFLAGS= C preprocessor flags" + echo " CFLAGS= C compiler flags" +@@ -721,8 +726,16 @@ case "${flagsmuni}" in + ;; + esac + ++if [ "$w" = "$m" ] ; then ++ configuringin="" ++else ++ configuringin=" in $w" ++fi ++ + if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then +- echo "Configuring for $m" ++ echo "Configuring for $m$configuringin" ++elif [ "$forceworkarea" = yes ] ; then ++ echo "Configuring for $m$configuringin despite missing boot files" + else + if [ "$m" = "" ] ; then + maybem="" +diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base +index cc6178c973..1f4a967998 100644 +--- a/racket/src/ChezScheme/s/Mf-base ++++ b/racket/src/ChezScheme/s/Mf-base +@@ -94,7 +94,7 @@ endif + # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme + # implementation + Scheme = ../bin/$m/scheme${ExeSuffix} +-export SCHEMEHEAPDIRS=../boot/%m ++export SCHEMEHEAPDIRS=../boot/$m + export CHEZSCHEMELIBDIRS=. + + # Define the libdirs separator character +@@ -691,4 +691,4 @@ reset-one: + + .PHONY: run + run: +- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) ++ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) +diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross +index d796cbb459..397af59a28 100644 +--- a/racket/src/ChezScheme/s/Mf-cross ++++ b/racket/src/ChezScheme/s/Mf-cross +@@ -43,5 +43,7 @@ x$(xm).$(m): + $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch + mv xpatch x$(xm).$(m) + ++ifneq ($(SCHEMEHEAPDIRS),:) + # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed +-nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++endif +-- +2.32.0 + + +From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 11:03:30 -0700 +Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable + +When the same Chez Scheme version as used by Racket is already +available, then `--enable-scheme=...` can supply an executable. For +cross builds, `--enable-scheme=...` can still supply a build +directory, instead, as before. + +(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) +--- + racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ + racket/src/README.txt | 30 +++++++++++--- + racket/src/configure | 8 +++- + racket/src/cs/README.txt | 6 ++- + racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- + racket/src/cs/c/configure | 24 +++++++++-- + racket/src/cs/c/configure.ac | 21 ++++++++-- + 7 files changed, 112 insertions(+), 24 deletions(-) + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index c396efc851..3998ef9ccd 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -59,6 +59,9 @@ reset: + %.boot: + (cd $(workarea) && $(MAKE) $*.boot) + ++auto.boot: ++ (cd $(workarea) && $(MAKE) $(defaultm).boot) ++ + # .bootquick to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine +diff --git a/racket/src/README.txt b/racket/src/README.txt +index 98647aebce..d77310b4a4 100644 +--- a/racket/src/README.txt ++++ b/racket/src/README.txt +@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of + ======================================================================== + + Cross-compilation requires at least two flags to `configure`: ++`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) ++`--enable-scheme-SCHEME`. ++ ++More information: + + * `--host=OS`, where OS is something like `i386-gnu-linux` to + indicate the target platform. +@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: + run `configure` again (with no arguments) in a "local" subdirectory + to create a build for the current platform. + +-An additional flag is needed for building Racket CS, unless the flag +-`--enable-racket=auto` is used: +- +- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" +- directory where Chez Scheme is built for the host system. ++ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable ++ executable that runs on the build platform; the executable must be ++ the same version as used in Racket built for the target platform. ++ ++ Supplying `--enable-scheme=DIR` is also supported in cross-build ++ mode, where DIR is a path that has a "ChezScheme" directory where ++ Chez Scheme is built for the host system. ++ ++The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are ++allowed for non-cross builds, too: ++ ++ * For Racket CS, supplying either selects a Racket or Chez Scheme ++ implementation used to create boot files to the build platform. ++ Suppling Chez Scheme is a much more direct path, but when Racket is ++ supplied, its version does not have to match the version being ++ built. ++ ++ * For Racket BC, `--enable-racket=RACKET` selects a Racket for ++ prepare C sources to cooperate with garbage collection. Its version ++ needs to be close to the one being built, and potentially exactly ++ the same version. + + Some less commonly needed `configure` flags are for Racket BC: + +diff --git a/racket/src/configure b/racket/src/configure +index c9f3ba4419..1b53ec7ce2 100755 +--- a/racket/src/configure ++++ b/racket/src/configure +@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" + use_cs=maybe + use_bc=maybe + supplied_racket=no ++supplied_scheme=no + enable_boothelp= + + # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, +@@ -34,6 +35,9 @@ for arg in $*; do + --enable-racket=*) + supplied_racket=yes + ;; ++ --enable-scheme=*) ++ supplied_scheme=yes ++ ;; + --help | -h) + echo $0: + echo see --help-bc or --help-cs, since the Racket CS build and the +@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then + fi + + if test "$use_cs" = "yes" ; then +- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then +- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly ++ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then ++ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly + exit 1 + fi + +diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt +index 2ece417b78..8e6fc57b74 100644 +--- a/racket/src/cs/README.txt ++++ b/racket/src/cs/README.txt +@@ -39,6 +39,11 @@ build: + installed in the "../ChezScheme/boot/pb" directory as described by + "../ChezScheme/BUILDING". + ++ Supplying `--enable-scheme=...` is also an option if you alerady ++ have the same version of Chez Scheme built on the current platform. ++ Another build will be created, anyway, but more quickly than ++ without Chez Scheme. ++ + * Racket is needed to generate the files in the "schemified" + directory from the sources in sibling directories like "../io". The + Racket version must be practically the same as the current Racket +@@ -48,7 +53,6 @@ build: + Unlike Chez Scheme boot files, the files generated in "schemified" + are human-readable and -editable Scheme code. That provides a way + out of bootstrapping black holes, even without BC. +- + + + ======================================================================== +diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in +index 54a644a1d9..d73993f0fc 100644 +--- a/racket/src/cs/c/Makefile.in ++++ b/racket/src/cs/c/Makefile.in +@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ + SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) + SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme + SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) +-SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_existing = @MAKE_SCHEME_SCHEME@ ++SCHEME = $(SCHEME@USE_SCHEME_MODE@) + + TARGET_MACH = @TARGET_MACH@ + SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) +@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. + @INCLUDEDEP@ @srcdir@/../../version/version.mak + + cs: +- $(MAKE) scheme@T_CROSS_MODE@ ++ $(MAKE) scheme@MAKE_SCHEME_MODE@ + $(MAKE) racket-so + cd rktio; $(MAKE) + $(MAKE) racketcs +@@ -121,9 +123,13 @@ racket-so: + + RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ + ++TARGET_MACH_built = $(TARGET_MACH) ++TARGET_MACH_existing = xc-$(TARGET_MACH) ++XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch ++ + CS_PROGS = SCHEME="$(SCHEME)" + CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ +-CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" ++CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" + PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" + + build-racket-so: +@@ -163,6 +169,15 @@ pb-bootquick: + cd $(SCHEME_WORKAREA) && $(MAKE) reset + $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) + ++scheme-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot ++ $(MAKE) mach-make ++ ++$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: ++ mkdir -p $(SCHEME_WORKAREA) ++ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" ++ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all ++ + mach-make: + $(MAKE) config-scheme + cd $(SCHEME_WORKAREA) && $(MAKE) +@@ -182,24 +197,33 @@ config-scheme: + + scheme-cross: + env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt ++ $(MAKE) finish-scheme-cross ++ ++finish-scheme-cross: + $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) + cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) + cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t +- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch ++ $(MAKE) $(XPATCH_FILE) ++ ++scheme-cross-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) ++ $(MAKE) finish-scheme-cross + + # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older +-# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files +-XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ +- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot ++# than the build- use as Racket for build; or "auto" to create +- --enable-scheme= use as host's build directory for cross ++ --enable-scheme= use as host build for cross + --enable-mach= use Chez Scheme machine type + --enable-target= cross-build for Chez Scheme machine type + --enable-portable prefer portable to host-specific +@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" + show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' + + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + show_explicitly_enabled "${enable_portable}" "portable" +@@ -4745,9 +4748,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags + + + ++ ++ ++ + + + +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 464ebe1760..aaee88156d 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev + AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) + m4_include(../ac/path_arg.m4) + AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket for build; or "auto" to create]) +-AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host's build directory for cross]) ++AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host build for cross]) + AC_ARG_ENABLE(mach, [ --enable-mach= use Chez Scheme machine type ]) + AC_ARG_ENABLE(target, [ --enable-target= cross-build for Chez Scheme machine type ]) + m4_include(../ac/portable_arg.m4) +@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" + show_explicitly_enabled "${enable_xonx}" "Unix style" + m4_include(../ac/path_show.m4) + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + m4_include(../ac/portable_show.m4) +@@ -504,9 +504,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) + AC_SUBST(CROSS_MODE) + AC_SUBST(T_CROSS_MODE) + AC_SUBST(TT_CROSS_MODE) ++AC_SUBST(MAKE_SCHEME_MODE) ++AC_SUBST(MAKE_SCHEME_SCHEME) ++AC_SUBST(USE_SCHEME_MODE) + AC_SUBST(SETUP_BOOT_MODE) + AC_SUBST(OSX) + AC_SUBST(NOT_OSX) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:33 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:33 +0000 Received: from localhost ([127.0.0.1]:39073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMoH-0003CS-Ij for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:33 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:40888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMo8-0003Bo-HU for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:24 -0500 Received: by mail-qk1-f177.google.com with SMTP id o25so12986533qkj.7 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53: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=ZRi6asVXV+QTTkm+7nvM8RjAeYcMCR/ik7tKnX79K+k=; b=D9ElHnIfUqET0Zw4Uib32IqeQb3gmR5v5cDifIOP6pU1LcUzXkv4H+NPPF4KQiPXlw ul4DRBzLOsv+d+Ld5LQ31RU85M5r86DptHV5OgCwYWq3myv7pTgtOTD4NGLjPKpVXnQd 3jDSFOYidEGIlReXyFEAzrH30j2PEKb/JPdqRG1bYdnhmdGYAEWyL4GXRlIFoSfNHl9z vU0RsATyYsDA8H8Dbk8Uzc0s/ubNoOehxbFA6pKAhc/BWBKjgv8Zl+p3hwfxMOSIaxZg /gDIGy16w8Nhvga19gxu712SYb3nLiruMnWpynLtgsAA92BS8pCe6xEWebXYEp3alGS2 Yuyw== 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=ZRi6asVXV+QTTkm+7nvM8RjAeYcMCR/ik7tKnX79K+k=; b=whkijgWgPo/PXfIuFyj9Het+xshqR62KhTi0wQrYR0N47x3OG1eh8Il42l+T2Krbej fAiWNlsyR7RtkGuPGbPmA+5lKXPiHZjUQVQh4dA3PoYqRMKxMnzUGQ+b9Y/Zt7iZ6RLC tf9CO38erUXksjzKr5iDykO4lPrOoRf2YvFekPdi+5A95DCOsX8jY1qnQ9SQ2TfISZjt KRK5Sz+r/uUYtKSOWlU5uqSwbv9YOz544ASwGev326KSDNruqSSFR2fdG2O0NsCloM+9 PYhlu4TsoBP5CPruZd5hlR8HhsmBH8kadrKEaihnsK7NkCu0I/GcNMNwUxkluGvxiZzK /B8g== X-Gm-Message-State: AOAM531LGvtdvdZJAT09sludDgOVUZCMIyXq4JRKoLuDvSDmbsDNus7P 6nSDUJN+HXVCD/g3fn0FZGpSfmElD6Lqg8shlr4= X-Google-Smtp-Source: ABdhPJydaC1tj/XqIc+8GwBmEDB0n+ZOObxcStbVA0YniesG7fdgTwrQqRT1wccnVzq41R2Ma1rEoA== X-Received: by 2002:a05:620a:44d4:: with SMTP id y20mr5774041qkp.33.1644789199035; Sun, 13 Feb 2022 13:53: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 v22sm16517456qta.60.2022.02.13.13.53.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:18 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 09/11] gnu: chez-mit: Support chez-scheme-for-racket. Date: Sun, 13 Feb 2022 16:51:25 -0500 Message-Id: <20220213215127.218952-10-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 54bbee7923..be251798c3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -355,7 +355,29 @@ (define-public chez-mit (commit (string-append "v" version)))) (sha256 (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (snippet + ;; Workaround for chez-scheme-for-racket. + ;; See: https://github.com/racket/racket/issues/4151 + #~(begin + (use-modules (guix build utils)) + (substitute* "mit/core.sls" + (("[(]import ") + "(import (only (chezscheme) import)\n") + (("[(]define string->uninterned-symbol gensym[)]") + (format #f "~s" + '(begin + (import (only (chezscheme) + meta-cond + library-exports)) + (meta-cond + ((memq 'string->uninterned-symbol + (library-exports '(chezscheme))) + (import (only (chezscheme) + string->uninterned-symbol))) + (else + (define string->uninterned-symbol + gensym))))))))))) (build-system gnu-build-system) (inputs (list chez-srfi)) ; for tests -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:34 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:34 +0000 Received: from localhost ([127.0.0.1]:39075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMoH-0003Cf-Tf for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:34 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:46820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMoC-0003C0-RE for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:29 -0500 Received: by mail-qv1-f43.google.com with SMTP id n6so13388614qvk.13 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:28 -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=zzxndLd3++TU95/ksnJc3+VlU1VVJv9zyyVyQPYh0hg=; b=kLH5CC0xtuNDih0aqSpqQMRiqpBmIJ4WinnDbf4nl53ku6q5kaZ7fNtbblb0tIOQEP Hs0zxRjspAP05bW7HyKleOENt2ShKYXxH6Vv1Phz7zm4ws1bo79YZqCLcOf4NBZsAG1y BtQbxF4FxKY0UpGqzUw8A0Xa6qKGQDpFX2gFZrIxaXfERTTTnoY5nu/WebUttm9iV0i4 jHrnoTMN0K8ob4PrrV/9waMqGfDpDmeuLa83oh52u7dX3fdif0a9Adaq/4+Yz8bGhzUH 6rouGze6wlcehlHohi9WXLn9IrSVlUmp+9W8p/rT8Xm/dTWC85Qamh0snf4FsD5aw3DI nbKA== 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=zzxndLd3++TU95/ksnJc3+VlU1VVJv9zyyVyQPYh0hg=; b=GnZHfgWbqB4DSUuKZQRr3evgWUhiKOAcYqvMUuOkuRI+Dyli4KadGv8kiKOTqo8GCX 7dacBcSEI4RUjNAYdQfK1G4fSUt3mVt7Z8joREKNe6pvREbrKUPtjgXcTJj0vAKAudQY rjKOjoO6pJ+ypP3+bY69CTKAasuRwOXS9Bp4p6oSSylXD7sCr6cyuF2+e+1gcPwr5Pn8 GcMLB07EOVXci6Pd8AkmjdHchhhJturV2EbMot1f+UGhLKwxn+EjQoErJ+PJ4GN28T6M 8SP2dMy+z78lnitC0lVzUD/4aTLDp5EUI1KBCUUOydnxD00cnbo3Kv288TLIeCGktsTC /cWg== X-Gm-Message-State: AOAM531Prkz9dJq5M6CRoYEo72FglLZtfL+D0TaJfkAWCGc8lk4tzZSw m+oycQneU5zq2o7HSOiEmihSjvHVTeVhL2PhSMQ= X-Google-Smtp-Source: ABdhPJyCR4sKTUrsFbxTFLXJZgv9fCkNgf5UsWd7wZToGnRoBlCoPs7rOeg4aOeL/oHZN9ow4gu/eg== X-Received: by 2002:ad4:5941:: with SMTP id eo1mr1220236qvb.45.1644789203080; Sun, 13 Feb 2022 13:53:23 -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 x21sm2282445qtp.67.2022.02.13.13.53.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:22 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 10/11] gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. Date: Sun, 13 Feb 2022 16:51:26 -0500 Message-Id: <20220213215127.218952-11-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-for-system): New procedure. * gnu/packages/loko.scm (loko-scheme): Use 'chez-scheme-for-system'. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise * gnu/packages/chez.scm (chez-srfi): (chez-web): (chez-sockets): (chez-matchable): (chez-irregex): (chez-fmt): (chez-mit): (chez-scmutils): Likewise. --- gnu/packages/chez-and-racket-bootstrap.scm | 13 ++++++++++++- gnu/packages/chez.scm | 16 ++++++++-------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index d2f78dfae2..669c54729d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -45,7 +45,8 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages tex) #:use-module (gnu packages xorg) #:use-module ((guix licenses) - #:prefix license:)) + #:prefix license:) + #:export (chez-scheme-for-system)) ;; Commentary: ;; @@ -205,6 +206,16 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; Code: +(define* (chez-scheme-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'chez-scheme' if it supports SYSTEM without restrictions; +'chez-scheme-racket-variant' otherwise." + (if (and=> (nix-system->chez-machine system) + chez-machine->upstream-restriction) + chez-scheme-for-racket + chez-scheme)) + (define (chez-machine->unthreaded mach) "Given a string MACH naming a Chez Scheme machine type, returns a string naming the unthreaded machine type for the same architecture and OS as MACH. diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index be251798c3..d5007e0cfd 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -74,7 +74,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -105,7 +105,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) ghostscript ;; FIXME: This package fails to build with the error: ;; mktexpk: don't know how to create bitmap font for bchr8r @@ -170,7 +170,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) chez-web (texlive-updmap.cfg (list texlive-pdftex)))) (arguments @@ -256,7 +256,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -288,7 +288,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -319,7 +319,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -382,7 +382,7 @@ (define string->uninterned-symbol (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -413,7 +413,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 02694b636a..f445ab0f25 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -451,7 +451,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index 74a649b8a1..a7ab12a0c4 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -71,7 +71,7 @@ (define-public loko-scheme #t))))) (native-inputs `(("akku" ,akku) - ("chez-scheme" ,chez-scheme) + ("chez-scheme" ,(chez-scheme-for-system)) ("struct" ,guile-struct-pack) ("laesare" ,guile-laesare) ("pfds" ,guile-pfds) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:53:41 2022 Received: (at 53878) by debbugs.gnu.org; 13 Feb 2022 21:53:41 +0000 Received: from localhost ([127.0.0.1]:39077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMoP-0003D1-Bm for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:41 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:35416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMoM-0003CY-Si for 53878@debbugs.gnu.org; Sun, 13 Feb 2022 16:53:39 -0500 Received: by mail-qk1-f172.google.com with SMTP id 200so13028879qki.2 for <53878@debbugs.gnu.org>; Sun, 13 Feb 2022 13:53:38 -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=/hZBy6HUA7KdRbSzAale2OMOdr/JyowG+AEK/cK3F+s=; b=P5iCuEc5W+u7r+y2JvEIjebfpI1eBczjYVgheFxh5+MBFiawInD1d+K857Hmbp/5lr GKx0gHRE69Zc3BB9zcVjM+5JhtPzcf0qwL+fwaurpdKLnEN6PUNKK9ugR3RYzbx2K7HC 6bTj1PkRwL1W+XBOslTVBVNEkggZmB6VsJwJ0TcQ9gwKbN7zjVcZnT8itsRFeKqSsG1Z ODXsnYNd7oU6CzEwhqbvh5goru1HwOK0UOk7ndakTINlcHVc31KDS1dGAJoZjn2V05Tp HK49yctVRCEeL5sO5CVcQ8RAr3+guT/uVbLQIRPMb94udXu2C0205cHoRVDicxb5IGd1 FF+Q== 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=/hZBy6HUA7KdRbSzAale2OMOdr/JyowG+AEK/cK3F+s=; b=JiTxK8hFZ/BLRvaKVnNzPxDsRReMxI1fqQDGm238AS+iysVhpBUPef10m+9QkQ1cQ+ 2HS5fa4mhwF1xH6K2YnFWN+MLwkAL9IJqJN8WP5dg8wGZlU5n8PXt8LKJYn/37XWiFBz zUCW2OKekBQgRP5ZsUCeTPvdnP6woGIcQZ2me3JXtB0OlvrxGn0VPzKGRKt7zPpObzRe CHLy7kALDzSyNNRxK6aKT/5kZtrHXmfzIPa9WBt6Ve7QI6yT66mjI2+IgEa0NkXodXll zb+QSU4BJZHCj+hLqXCGWCbqCTbhH53AKxKt/zHv7RgDbWRVr/yRBEC52xE11syBxp7U 0L8g== X-Gm-Message-State: AOAM533YZiUIbleodljlGubOihL8dgqUR6iXFW/XY92Hr5Xl2Gg6GXWR jR94QUmS9ccvfZYYsNzfSmEBGzmGLQnFmxv4NuI= X-Google-Smtp-Source: ABdhPJxBD4R0h9sTxbML3pDtCrRunX8QnNdlzs64vhnKSMjAK88pzS0yyxyBmcN0gJcN1f8RMLQljQ== X-Received: by 2002:a37:6393:: with SMTP id x141mr5749019qkb.197.1644789210864; Sun, 13 Feb 2022 13:53:30 -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 i12sm15592937qkn.83.2022.02.13.13.53.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:53:28 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH 11/11] gnu: racket: Update to 8.4. Date: Sun, 13 Feb 2022 16:51:27 -0500 Message-Id: <20220213215127.218952-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220213215127.218952-1-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Debbugs-Envelope-To: 53878 Cc: Liliana Marie Prikler , Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, gnu/packages/patcheches/racket-srfi-fsdg-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedure. * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.4. Rewrite to use 'racket-vm-for-system', label-less inputs, G-expressions, and Git origins for main-distribution packages. --- gnu/local.mk | 4 +- gnu/packages/chez-and-racket-bootstrap.scm | 11 +- ...acket-gui-tethered-launcher-backport.patch | 26 + .../patches/racket-srfi-fsdg-backport.patch | 41622 ++++++++++++++++ gnu/packages/racket.scm | 1551 +- 5 files changed, 42688 insertions(+), 526 deletions(-) create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backp= ort.patch create mode 100644 gnu/packages/patches/racket-srfi-fsdg-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index 8ffdd15ee2..ff72ad8565 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright =C2=A9 2020 Vinicius Monego # Copyright =C2=A9 2021 Bj=C3=B6rn H=C3=B6fling # Copyright =C2=A9 2021 Greg Hogan -# Copyright =C2=A9 2021 Philip McGrath +# Copyright =C2=A9 2021, 2022 Philip McGrath # Copyright =C2=A9 2021 Arun Isaac # Copyright =C2=A9 2021 Sharlatan Hellseher # Copyright =C2=A9 2021 Dmitry Polyakov @@ -1788,7 +1788,9 @@ dist_patch_DATA =3D \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-enable-scheme-backport.patch \ + %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ + %D%/packages/patches/racket-srfi-fsdg-backport.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez= -and-racket-bootstrap.scm index 669c54729d..89e659a397 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -46,7 +46,8 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:) - #:export (chez-scheme-for-system)) + #:export (chez-scheme-for-system + racket-vm-for-system)) =20 ;; Commentary: ;; @@ -216,6 +217,14 @@ (define* (chez-scheme-for-system #:optional chez-scheme-for-racket chez-scheme)) =20 +(define* (racket-vm-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." + (if (nix-system->chez-machine system) + racket-vm-cs + racket-vm-bc)) + (define (chez-machine->unthreaded mach) "Given a string MACH naming a Chez Scheme machine type, returns a string naming the unthreaded machine type for the same architecture and OS as MAC= H. diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.pat= ch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch new file mode 100644 index 0000000000..1e018eaa79 --- /dev/null +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -0,0 +1,26 @@ +From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Mon, 31 Jan 2022 15:31:22 -0700 +Subject: [PATCH] fix creation of tethered launchers + +Related to racket/racket#4133 + +(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) +--- + gui-lib/mred/installer.rkt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt +index b1691472..9ef06c53 100644 +--- a/gui-lib/mred/installer.rkt ++++ b/gui-lib/mred/installer.rkt +@@ -72,4 +72,5 @@ + (list "-A" (path->string (find-system-path 'addon-dir))))) +=20 + (define (config-flags) +- (list "-G" (path->string (find-config-dir)))) ++ (list "-X" (path->string (find-collects-dir)) ++ "-G" (path->string (find-config-dir)))) +--=20 +2.32.0 + diff --git a/gnu/packages/patches/racket-srfi-fsdg-backport.patch b/gnu/pac= kages/patches/racket-srfi-fsdg-backport.patch new file mode 100644 index 0000000000..75a5f46960 --- /dev/null +++ b/gnu/packages/patches/racket-srfi-fsdg-backport.patch @@ -0,0 +1,41622 @@ +From 82076308af8aeda65283ba83779302304e1a25d1 Mon Sep 17 00:00:00 2001 +From: Philip McGrath +Date: Thu, 20 Jan 2022 01:20:04 -0500 +Subject: [PATCH] Backport FSDG fix for Racket 8.4. + +This is a squashed and somewhat reduced version of commits +46e11b7, 48f8fca, and a2d0199. For detailed discussion, see + and +. +--- + srfi-doc/info.rkt | 10 +- + .../srfi/scribblings/srfi-5-doc-free.scrbl | 164 + + srfi-doc/srfi/scribblings/srfi-std/index.html | 351 +- + .../srfi/scribblings/srfi-std/racket-srfi.css | 87 + + .../srfi/scribblings/srfi-std/srfi-1.html | 2893 ++++++++++------- + .../srfi/scribblings/srfi-std/srfi-11.html | 103 +- + .../srfi/scribblings/srfi-std/srfi-13.html | 2072 +++++++----- + .../srfi/scribblings/srfi-std/srfi-14.html | 1533 +++++---- + .../srfi/scribblings/srfi-std/srfi-16.html | 101 +- + .../srfi/scribblings/srfi-std/srfi-17.html | 137 +- + .../srfi/scribblings/srfi-std/srfi-19.html | 863 ++--- + .../srfi/scribblings/srfi-std/srfi-2.html | 180 +- + .../srfi/scribblings/srfi-std/srfi-23.html | 131 +- + .../srfi/scribblings/srfi-std/srfi-25.html | 188 +- + .../srfi/scribblings/srfi-std/srfi-26.html | 408 ++- + .../srfi/scribblings/srfi-std/srfi-27.html | 695 ++-- + .../srfi/scribblings/srfi-std/srfi-28.html | 78 +- + .../srfi/scribblings/srfi-std/srfi-29.html | 88 +- + .../srfi/scribblings/srfi-std/srfi-30.html | 121 +- + .../srfi/scribblings/srfi-std/srfi-31.html | 338 +- + .../srfi/scribblings/srfi-std/srfi-34.html | 230 +- + .../srfi/scribblings/srfi-std/srfi-35.html | 222 +- + .../srfi/scribblings/srfi-std/srfi-38.html | 207 +- + .../srfi/scribblings/srfi-std/srfi-39.html | 278 +- + .../srfi/scribblings/srfi-std/srfi-4.html | 277 +- + .../srfi/scribblings/srfi-std/srfi-40.html | 232 +- + .../scribblings/srfi-std/srfi-41/srfi-41.html | 2116 ++++++------ + .../srfi/scribblings/srfi-std/srfi-42.html | 2205 +++++++------ + .../srfi/scribblings/srfi-std/srfi-43.html | 1049 +++--- + .../srfi/scribblings/srfi-std/srfi-45.html | 303 +- + .../srfi/scribblings/srfi-std/srfi-48.html | 535 +-- + .../srfi/scribblings/srfi-std/srfi-54.html | 179 +- + .../srfi/scribblings/srfi-std/srfi-57.html | 458 +-- + .../srfi/scribblings/srfi-std/srfi-59.html | 314 +- + .../srfi/scribblings/srfi-std/srfi-6.html | 156 +- + .../srfi/scribblings/srfi-std/srfi-60.html | 998 +++--- + .../srfi/scribblings/srfi-std/srfi-61.html | 64 +- + .../srfi/scribblings/srfi-std/srfi-62.html | 130 +- + .../srfi/scribblings/srfi-std/srfi-63.html | 1586 ++++----- + .../srfi/scribblings/srfi-std/srfi-64.html | 408 +-- + .../srfi/scribblings/srfi-std/srfi-66.html | 335 +- + .../srfi/scribblings/srfi-std/srfi-69.html | 346 +- + .../srfi/scribblings/srfi-std/srfi-7.html | 124 +- + .../srfi/scribblings/srfi-std/srfi-71.html | 274 +- + .../srfi/scribblings/srfi-std/srfi-74.html | 485 ++- + .../srfi/scribblings/srfi-std/srfi-78.html | 445 +-- + .../srfi/scribblings/srfi-std/srfi-8.html | 77 +- + .../srfi/scribblings/srfi-std/srfi-86.html | 202 +- + .../srfi/scribblings/srfi-std/srfi-87.html | 118 +- + .../srfi/scribblings/srfi-std/srfi-9.html | 223 +- + .../srfi/scribblings/srfi-std/srfi-98.html | 137 +- + srfi-doc/srfi/scribblings/srfi.scrbl | 70 +- + srfi-doc/srfi/scribblings/util.rkt | 17 + + srfi-lib/info.rkt | 2 + + srfi-lib/srfi/5/let.rkt | 83 +- + srfi-test/tests/srfi/5/srfi-5-test.rkt | 163 +- + srfi/info.rkt | 6 +- + 57 files changed, 14542 insertions(+), 11053 deletions(-) + create mode 100644 srfi-doc/srfi/scribblings/srfi-5-doc-free.scrbl + create mode 100644 srfi-doc/srfi/scribblings/srfi-std/racket-srfi.css + +diff --git a/srfi-doc/info.rkt b/srfi-doc/info.rkt +index 59d9611..2ce76b3 100644 +--- a/srfi-doc/info.rkt ++++ b/srfi-doc/info.rkt +@@ -2,20 +2,18 @@ +=20 + (define collection 'multi) +=20 ++(define version "1.1") ++ + (define build-deps '("mzscheme-doc" + "scheme-lib" + "base" + "scribble-lib" + "srfi-lib" + "racket-doc" +- "r5rs-doc" +- "r6rs-doc" ++ "racket-index" + "compatibility-lib")) +=20 +-(define deps '("scheme-lib" +- "base" +- "scribble-lib" +- "compatibility-lib")) ++(define deps '("base")) +=20 + (define update-implies '("srfi-lib")) +=20 +diff --git a/srfi-doc/srfi/scribblings/srfi-5-doc-free.scrbl b/srfi-doc/sr= fi/scribblings/srfi-5-doc-free.scrbl +new file mode 100644 +index 0000000..5ecf3af +--- /dev/null ++++ b/srfi-doc/srfi/scribblings/srfi-5-doc-free.scrbl +@@ -0,0 +1,164 @@ ++#lang scribble/doc ++@(require "util.rkt" ++ scribble/manual ++ scribble/example ++ scriblib/render-cond ++ scribble/core ++ scribble/html-properties ++ (for-syntax scheme/base) ++ (for-label (except-in scheme/base let) ++ srfi/5 ++ racket/stream)) ++ ++@title[#:tag "srfi-5" #:style 'unnumbered]{ ++ SRFI 5: A compatible let form with signatures and rest arguments} ++@defmodule[srfi/5] ++ ++@begin[ ++ (define-syntax-rule (defrkt rkt-let) ++ (begin ++ (require (for-label racket/base)) ++ (define rkt-let (racket let)))) ++ (defrkt rkt-let) ++ (define reference-doc ++ '(lib "scribblings/reference/reference.scrbl")) ++ (define guide-doc ++ '(lib "scribblings/guide/guide.scrbl")) ++ (define srfi-nf-doc ++ '(lib "srfi/scribblings/srfi-nf.scrbl")) ++ ] ++ ++Original specification: ++@seclink[#:indirect? #t #:doc srfi-nf-doc srfi-5-std-taglet]{SRFI 5} ++ ++For @hyperlink[srfi-license-history-url]{historical ++ reasons}, the SRFI 5 specification document has a ++@seclink[#:indirect? #t #:doc srfi-nf-doc srfi-5-license-taglet]{ ++ restrictive license} and is not included in the main Racket distribution. ++ ++The implementation in @racketmodname[srfi/5] and this ++documentation are distributed under the same ++@racket-license-link{license} as Racket: only the original ++specification document is restrictively licensed. ++ ++@defform*[[(let ([id init-expr] ...) ++ body ...+) ++ (let ([id init-expr] ...+ rest-binding) ++ body ...+) ++ (let loop-id ([id init-expr] ... maybe-rest-binding) ++ body ...+) ++ (let (loop-id [id init-expr] ... maybe-rest-binding) ++ body ...+)] ++ #:grammar ++ ([maybe-rest-binding code:blank rest-binding] ++ [rest-binding (code:line rest-id rest-init-expr ...)])]{ ++ ++ Like @rkt-let from @racketmodname[racket/base], but ++ extended to support additional variants of ++ @tech[#:doc reference-doc]{named @rkt-let}. ++ ++ As with @rkt-let from @racketmodname[racket/base], SRFI 5's ++ @racket[let] form conceptually expands to the immediate ++ application of a function to the values of the ++ @racket[init-expr]s: the @racket[id]s are bound in the ++ @racket[body]s (but not in any @racket[init-expr]s or ++ @racket[rest-init-expr]s), and @racket[loop-id], if present, ++ is bound in the @racket[body]s to the function itself, ++ allowing it to be used recursively. An @racket[id] or a ++ @racket[rest-id] can shadow @racket[loop-id], but the ++ @racket[rest-id] (if given) and all @racket[is]s much be ++ distinct. ++ ++ SRFI 5's @racket[let] adds support for a syntax like ++ @racket[define]'s @seclink[#:doc guide-doc "Function_Shorthand"]{ ++ function shorthand}, which allows the bindings to be written in a ++ syntax resembling an application of the function bound to ++ @racket[loop-id]. ++ ++ Additionally, SRFI 5's @racket[let] adds support for ++ @tech[#:doc guide-doc]{rest arguments}. If a ++ @racket[rest-id] is present, the function bound to ++ @racket[loop-id] (or the conceptual anonymous function, if ++ @racket[loop-id] is not used) will accept an unlimited ++ number of additional arguments after its required ++ by-position arguments, and the @racket[rest-id] will be ++ bound in the @racket[body]s (but not in any ++ @racket[init-expr]s or @racket[rest-init-expr]s) to a list ++ of those additional arguments. The values of the ++ @racket[rest-init-expr]s are supplied as arguments to the ++ initial, implicit application when the @racket[let] form is ++ evaluated, so the initial value bound to @racket[rest-id] is ++ @racket[(list rest-init-expr ...)]. ++ ++ @margin-note{Unlike the @racket[_kw-formals] of ++ @racket[lambda] and @racket[define] or the @racket[_formals] ++ of @racket[case-lambda], the bindings of SRFI 5's ++ @racket[let], with or without a @racket[rest-binding], are ++ always a proper (syntactic) list.} ++ ++ A @racket[rest-binding] can be used with both the ++ @racket[define]-like and the ++ @tech[#:doc reference-doc]{named-@rkt-let}--like variants of ++ @racket[let]. It is also possible to use @racket[rest-id] ++ without any @racket[loop-id]; however, as specified in the ++ grammar, at least one @racket[id]--@racket[init-expr] pair ++ is required in that case. (Otherwise, there would be an ++ ambiguity with the @racket[define]-like variant). ++ ++ @examples[ ++ #:eval (make-base-eval '(require srfi/5)) #:once ++ (code:comment "define-like bindings") ++ (define (factorial n) ++ (let (fact [n n] [acc 1]) ++ (if (zero? n) ++ acc ++ (fact (sub1 n) (* n acc))))) ++ (eval:check (factorial 5) 120) ++ (eval:check (factorial 11) 39916800) ++ (code:comment "rest arguments with named-let--like bindings") ++ (eval:check (let reverse-onto ([lst '(a b c)] ++ tail) ++ (if (null? lst) ++ tail ++ (apply reverse-onto (cdr lst) (car lst) tail))) ++ '(c b a)) ++ (eval:check (let reverse-onto ([lst '(a b c)] ++ tail 'x 'y 'z) ++ (if (null? lst) ++ tail ++ (apply reverse-onto (cdr lst) (car lst) tail))) ++ '(c b a x y z)) ++ (eval:check (let no-evens (lst 1 2 3 4 5) ++ (cond ++ [(null? lst) ++ '()] ++ [(even? (car lst)) ++ (apply no-evens (cdr lst))] ++ [else ++ (cons (car lst) (apply no-evens (cdr lst)))])) ++ '(1 3 5)) ++ (code:comment "rest arguments with define-like bindings") ++ (eval:check (let (reverse-onto [lst '(a b c)] tail) ++ (if (null? lst) ++ tail ++ (apply reverse-onto (cdr lst) (car lst) tail))) ++ '(c b a)) ++ (eval:check (let (reverse-onto [lst '(a b c)] . [tail 'x 'y 'z]) ++ (if (null? lst) ++ tail ++ (apply reverse-onto (cdr lst) (car lst) tail))) ++ '(c b a x y z)) ++ (eval:check (let (loop [continue? 0] args 'a 'a1 'a2) ++ (case continue? ++ [(0) (cons args (loop 1 'b))] ++ [(1) (cons args (loop 2 'c 'd))] ++ [else (list args)])) ++ '((a a1 a2) (b) (c d))) ++ (code:comment "rest arguments without any loop-id") ++ (eval:check (let ([x 1] ++ [y 2] ++ z 3 4 5 6 7) ++ (list* x y z)) ++ '(1 2 3 4 5 6 7)) ++ ] ++} +diff --git a/srfi-doc/srfi/scribblings/srfi-std/index.html b/srfi-doc/srfi= /scribblings/srfi-std/index.html +index 6f03f9b..c46dd8b 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/index.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/index.html +@@ -1,258 +1,113 @@ +- +- ++ ++ ++ + ++ + SRFI documents inside Racket ++ ++ + +- + +

SRFI documents inside Racket

+- +-

Scheme Requests for Implementation

+- +-

The "Scheme Requests for Implementation" (SRFI) process +- is a new approach to helping Scheme users to write portable and +- yet useful code. It is a forum for people interested in +- coordinating libraries and other additions to the Scheme language +- between implementations.

+- +-

This manual includes the original= documentation of all +- the SRFIs already ported to Racket. For more information on +- the SRFI process, please follow +- this link.

+- +- +-

Loading

+- +-

To load a SRFI with name conflicts (currently SRFIs 1, 5, 13, 17, = 19, 43, +- 45, 48, 61, 63, 69 and 87) in a module,
+- please see the note below.
+-
+- To load a SRFI, use the following form:
+-
+-     (require srfi/N)
+-
+- if you know the number of the SRFI you want to load. This is the pref= erred +- method. Alternatively, use this one:
+-
+-     (require srfi/N/NAME)
+-
+- if you know the `informative name' of the SRFI.
+-
+- N, is a number corresponding to the sub-collection that holds a parti= cular +- SRFI, and NAME is a more descriptive name we assigned to the main fil= e in +- which the SRFI is defined. For instance, to load SRFI-34 you have to = do +- either one of:
+-
+-     (require srfi/34)
+-
+- or,
+-
+-     (require srfi/34/exception)
+-
+-

+- +- +

+- NOTE on SRFIs with name conflicts +-
+- Certain SRFIs (currently SRFIs 1, 5, 13, 17, 19, 43, 45, 48, 61, 63, = 69 and +- 87) provide names which conflict with names provided by the racke= t +- language. Attempting to require one of these SRFIs in a module writte= n in +- the racket language will result in an error.
+-
+- To address this problem, the Racket implementations of these SRFIs pr= ovide a +- different module which renames the problematic exports to avoid these +- conflicts. For SRFI 1, this library is called list, and should be +- required like this:
+-
+-     (require srfi/1/list)
+-
+- which supplies the colliding names with a prefix of 's:' (e.g. "= s:map", +- "s:reverse!") and is therefore suitable for requires in a m= odule.
+-
+- For SRFI 19, this library is called time, and should be required like +- this:
+-
+-     (require srfi/19/time)
+-
+- which supplies the colliding names with a prefix of 'srfi:' (e.g. +- "srfi:date?", "srfi:date-second") and is therefor= e
+- suitable for requires in a module.
+-
++ The information that used to be on this page has moved to ++ ../index.html. +

+- +- +

+- Supported SRFIs
++ If you do nothing, you should be redirected in five seconds. +

+- +- +-

SRFI           F= ile +- name           +- Sub-collection
+- SRFI-1         list.rkt =             +- 1
+- SRFI-2         and-let.rkt&nb= sp;         +- 2
+- SRFI-4(*1)     4.rkt
+- SRFI-5         let.rkt &= nbsp;            +- 5
+- SRFI-6(+)      6.rkt
+- SRFI-7         program.rkt&nb= sp;         +- 7
+- SRFI-8         receive.rkt&nb= sp;         +- 8
+- SRFI-9         record.rkt&nbs= p;          +- 9
+- SRFI-11(+)     11.rkt
+- SRFI-13        string.rkt &nb= sp;         +- 13
+- SRFI-14        char-set.rkt &= nbsp;       +- 14
+- SRFI-16(+)     16.rkt
+- SRFI-17        set.rkt  =             +- 17
+- SRFI-19(*2)    time.rkt     &= nbsp;       +- 19
+- SRFI-23(+)     23.rkt
+- SRFI-25        array.rkt &nbs= p;          +- 25
+- SRFI-26        cut.rkt  =             +- 26
+- SRFI-27        random-bits.rkt&nbs= p;     +- 27
+- SRFI-28(+)     28.rkt
+- SRFI-29        localization.rkt&nb= sp;    +- 29
+- SRFI-30(+)     30.rkt
+- SRFI-31        rec.rkt  =             +- 31
+- SRFI-32        sort.scm  = ;          +- 32
+- SRFI-34        exception.rkt =        +- 34
+- SRFI-35        condition.rkt =        +- 35
+- SRFI-38(+)     38.rkt
+- SRFI-39(+)     39.rkt
+- SRFI-40        stream.rkt &nb= sp;         +- 40
+- SRFI-42        comprehensions.rkt&= nbsp;  +- 42
+- SRFI-43        vector-lib.rkt = ;      +- 43
+- SRFI-45(*3)    lazy.rkt     &= nbsp;       +- 45
+- SRFI-48        format.rkt &nb= sp;         +- 48
+- SRFI-54        cat.rkt  =             +- 54
+- SRFI-57        records.rkt &n= bsp;        +- 57
+- SRFI-59        vicinity.rkt &= nbsp;       +- 59
+- SRFI-60        60.rkt  &= nbsp;            +- 60
+- SRFI-61        cond.rkt  &nbs= p;          +- 61
+- SRFI-62(+)
+- SRFI-63        63.rkt  &= nbsp;            +- 63
+- SRFI-64        testing.rkt &n= bsp;        +- 64
+- SRFI-66        66.rkt  &= nbsp;            +- 66
+- SRFI-67        compare.rkt &n= bsp;        +- 67
+- SRFI-69        hash.rkt  = ;           +- 69
+- SRFI-71        letvalues.rkt =        +- 71
+- SRFI-74        74.rkt  &= nbsp;            +- 74
+- SRFI-78        check.rkt &nbs= p;          +- 78
+- SRFI-86        86.rkt  &= nbsp;            +- 86
+- SRFI-87        case.rkt  = ;           +- 87
+-

+- +- +-

Notes:

+- +- +-

+ Supported by the Racket core
+-
+- *1 The functionality is all part of racket available +- via (require ffi/unsafe), the only missing part is the i/o +- syntax.
+-
+- *2 The time module does not export its time structure +- (you have to use the time-* procedures.) It renames all +- the date-* accessors to tm:date-* so that you won't get +- errors when including this code in other modules. Care +- most be taken NOT to confuse the internal date structure +- with the Racket one, they are not the same, and all +- procedures from this library expect the former.
+-
+- *3 This port also provides promise? / srfi-45-promise?.
+-

+- +- +-

Ported SRFIs: original documents

+- +- +- +- ++ + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/racket-srfi.css b/srfi-doc= /srfi/scribblings/srfi-std/racket-srfi.css +new file mode 100644 +index 0000000..661e2cb +--- /dev/null ++++ b/srfi-doc/srfi/scribblings/srfi-std/racket-srfi.css +@@ -0,0 +1,87 @@ ++/* ++ This is a substitute for "srfi.css" from ++ https://github.com/scheme-requests-for-implementation/srfi-common ++*/ ++@import "../../scribble.css"; ++@import "../../manual-style.css"; ++@import "../../manual-racket.css"; ++/* NB doc-site.css is imported at the end of this file */ ++ ++a.eponymous { ++ /* based on upstream srfi.css */ ++ font-family: 'Fira-Mono', monospace; ++ overflow-wrap: break-word; ++ word-break: break-all; ++ word-wrap: break-word; ++} ++body > p:first-of-type { ++ /* this is the SRFI author */ ++ font-family: 'Fira', sans-serif; ++ font-size: 1.3em; ++} ++body { ++ /* like .maincolumn from manual-style.css */ ++ width: auto; ++ margin-top: 4rem; ++ margin-left: 17rem; ++ margin-right: 2rem; ++ margin-bottom: 10rem; /* to avoid fixed bottom nav bar */ ++ max-width: 700px; ++ min-width: 370px; /* below this size, code samples don't fit */ ++} ++@media (max-width:720px) { ++ /* adapt to narrow screens, like .maincolumn in manual-style.css */ ++ body { ++ margin-left: 1em; ++ margin-top: 7rem; ++ margin-bottom: 0rem; ++ } ++} ++.refpara.racket-srfi-note .refcolumn { ++ /* Overrides @media rule to put .refcolumn in the margin on wide ++ screens. This is necessary because some SRFIs (e.g. 14) include ++ inline stylesheets that interfere with the way it tries to use ++ `float`. ++ */ ++ margin: inherit; ++ float: inherit; ++ clear: inherit; ++ width: inherit; ++} ++h1 { ++ /* like h2 from manual-style.css */ ++ font-family: 'Cooper-Hewitt'; ++ font-size: 2.3rem; ++ font-weight: bold; ++ line-height: 1.2; ++ width: 90%; ++} ++h2 { ++ /* like h3 -- h8 in manual-style.css */ ++ margin-top: 2em; ++ padding-top: 0.1em; ++ margin-bottom: 0.75em; ++ font-size: 2rem; ++} ++h3, h4, h5, h6, h7, h8 { ++ border: none; ++} ++span.antispam { ++ display: none; ++} ++pre, dl, dd, ol, ul { ++ /* like p from manual-style.css */ ++ margin-bottom: 1em; ++} ++li { ++ /* slightly tighter than p */ ++ margin-bottom: 0.6em; ++} ++.srfi-plt-extension { ++ /* like the background color for .boxed (blue boxes), ++ but without the gradient */ ++ background-color: hsl(216, 78%, 95%); ++} ++ ++/* Goes last, so it can override everything. */ ++@import "../../doc-site.css"; +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-1.html b/srfi-doc/srf= i/scribblings/srfi-std/srfi-1.html +index 773c03b..f1ccc40 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-1.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-1.html +@@ -1,24 +1,41 @@ +- +- ++ ++ ++ ++ ++ + +- + +- +- +- +- ++ ++ ++ ++ + SRFI 1: List Library +=20 + + +=20 +- + +=20 + +=20 + +-

Title

+-SRFI-1: List Library +-
+- +- +-

Author

++

SRFI 1: List Library

+=20 +-Olin Shivers +- +-
+- http://www.ai.mit.edu/~= shivers/ / +- shivers@ai.mit.edu +-
++

by Olin Shivers

++

This copy of the SRFI 1 specifica= tion document ++is distributed as part of the Racket package ++srfi-doc.

= The canonical source of this document is ++https://srfi.sch= emers.org/srfi-1/srfi-1.html.

+=20 + +-

Status

+- +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion via the archive of the mailing list. +-

+-

    +-
  • Received: 1998/11/08
  • +-
  • Draft: 1998/12/22-1999/03/09
  • +-
  • Revised: several times
  • +-
  • Final: 1999/10/09
  • +-
++

Status

++ ++

This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to = srfi-1 @nospamsrfi.schemers.org= . To subscribe to the list, follow these instructions. You can access previous me= ssages via the mailing list archive.

++
    ++
  • Received: 1998-11-08
  • ++
  • Draft: 1998-12-22--1999-03-09
  • ++
  • Revised: several times
  • ++
  • Final: 1999-10-09
  • ++
  • Revised to fix errata: ++
      ++
    • 2016-08-27 (Clarify Booleans.)
    • ++
    • 2018-10-08 (Remove extra parenthesis.)
    • ++
    • 2019-10-25 (Fix broken links.)
    • ++
    • 2020-06-02 (Add note ++ about order of arguments to lset=3D.)
    • ++
    ++
  • ++
+=20 + +-

Table of contents

++

Table of contents

+=20 + +-
    +-
  • Abstract +-
  • Rationale +-
  • Procedure index +-
  • General discussion +- +-
  • The procedures +- +-
  • Acknowledgements +-
  • References & links +-
  • Copyright ++ +=20 +=20 + +-

    Abstract

    ++

    Abstract

    +

    + R5RS Scheme has an impoverished set of list-processing utilities, which is a + problem for authors of portable code. This SRFI proposes a coherent and + comprehensive set of list-processing procedures; it is accompanied by a + reference implementation of the spec. The reference implementation is ++

    +
      +-
    • portable +-
    • efficient +-
    • completely open, public-domain source ++
    • portable
    • ++
    • efficient
    • ++
    • completely open, public-domain source
    • +
    +=20 + +-

    Rationale

    ++

    Rationale

    +

    + The set of basic list and pair operations provided by R4RS/R5RS Scheme is far + from satisfactory. Because this set is so small and basic, most +@@ -220,7 +245,7 @@ implementations provide additional utilities, such as = a list-filtering + function, or a "left fold" operator, and so forth. But, of course, this + introduces incompatibilities -- different Scheme implementations provide + different sets of procedures. +- ++

    +

    + I have designed a full-featured library of procedures for list processing. + While putting this library together, I checked as many Schemes as I could= get +@@ -228,43 +253,47 @@ my hands on. (I have a fair amount of experience wit= h several of these + already.) I missed Chez -- no on-line manual that I can find -- but I hit= most + of the other big, full-featured Schemes. The complete list of list-proces= sing + systems I checked is: +-

    +- R4RS/R5RS Scheme, MIT = Scheme, Gambit, RScheme, MzScheme, slib,=20 ++

    ++
    ++ R4RS/R5RS Scheme, MIT = Scheme, Gambit, RScheme, MzScheme, slib, + Common Lisp, Bigloo, guile, T, APL and th= e SML standard basis +
    +

    + As a result, the library I am proposing is fairly rich. ++

    +

    + Following this initial design phase, this library went through several + months of discussion on the SRFI mailing lists, and was altered in light + of the ideas and suggestions put forth during this discussion. ++

    +

    + In parallel with designing this API, I have also written a reference + implementation. I have placed this source on the Net with an unencumbered, + "open" copyright. A few notes about the reference implementation: +- ++

    +
      +
    • Although I got procedure names and specs from many Schemes, I wrote t= his +- code myself. Thus, there are no entanglements.=20 ++ code myself. Thus, there are no entanglements. + Any Scheme implementor + can pick this library up with no worries about copyright problems -- = both + commercial and non-commercial systems. +=20 +-
    • The code is written for portability and should be trivial to port to ++
    • The code is written for portability and should be trivial to por= t to + any Scheme. It has only four deviations from R4RS, clearly discussed + in the comments:
        +
      • Use of an error procedure; +-
      • Use of the R5RS values and a simple receive m= acro for producing ++
      • Use of the R5RS values and a simple receive macro for producing + and consuming multiple return values; +-
      • Use of simple :optional and let-optionals = macros for optional ++
      • Use of simple :optional and let-optionals macros for optional + argument parsing and defaulting; +-
      • Use of a simple check-arg procedure for argument checki= ng. +-
      ++
    • Use of a simple check-arg procedure for argument c= hecking. ++
    +=20 +-
  • It is written for clarity and well-commented. The current source is ++
  • It is written for clarity and well-commented. The current source= is + 768 lines of source code and 826 lines of comments and white space. +=20 +-
  • It is written for efficiency. Fast paths are provided for common ++
  • ++ It is written for efficiency. Fast paths are provided for common + cases. Side-effecting procedures such as filter! avoid u= nnecessary, + redundant set-cdr!s which would thrash a generational GC= 's write barrier + and the store buffers of fast processors. Functions reuse longest com= mon +@@ -272,227 +301,243 @@ implementation. I have placed this source on the N= et with an unencumbered, + possible. Constant-space iterations are used in preference to recursi= ons; + local recursions are used in preference to consing temporary intermed= iate + data structures. +-

    ++

    ++

    + This is not to say that the implementation can't be tuned up for + a specific Scheme implementation. There are notes in comments address= ing + ways implementors can tune the reference implementation for performan= ce. +-

++

+

+ In short, I've written the reference implementation to make it as painless + as possible for an implementor -- or a regular programmer -- to adopt this + library and get good results with it. +- ++

+=20 + +-

Procedure Index

++

Procedure Index

+

+ Here is a short list of the procedures provided by the list-lib package. +-R5RS procedures are shown in=20 +-bold; +-extended R5RS=20 +- procedures, in bold italic. +-

++R5RS procedures are shown in ++bold; ++extended R5RS ++ procedures, in bold italic. ++

++
+
+-
Constructors +-
+-
+-cons list=

+-xcons cons* make-list list-tabulate=20
++
Constructors ++
++
++cons li=
st
++xcons cons* make-list list-tabulate
+ list-copy circular-=
list iota
+ 
+=20 +-
Predicates +-
+-
+-pair? null?
+-proper-list? =
circular-list? dotted-list?=20
++
Predicates ++
++
++pair? null?
++proper-list? =
circular-list? dotted-list?
+ not-pair? null-list?=

+-list=3D
++list=3D
+ 
+=20 +-
Selectors +-
+-
+-car cdr=
 ... cddadr cddddr list-ref
++
Selectors ++
++
++car cdr ... cddadr cddddr list-ref
+ first second third fourth fifth=
 sixth seventh eighth ninth tenth
+-car+cdr
++car+cdr
+ take       drop
+ take-right drop-right=

+-take!      drop-right!=20
+-split-at   split-at!=
=20
++take!      drop-right!
++split-at   split-at!
+ last last-pair
+ 
+=20 +-
Miscellaneous: length, append, concatenate, rever= se, zip & count +-
+-
+-length length+
+-append  concatenate  reverse
++
Miscellaneous: length, append, concatenate= , reverse, zip & count ++
++
++length length+
++append  concatenate  reverse
+ append! concatenate! reverse!
+ append-reverse append-reverse!
+ zip unzip1 unzip2 unzip3 unzip4=
 unzip5
+ count
+ 
+=20 +-
Fold, unfold & map +-
+-
+-map f=
or-each
+-fold       unfold       pair-fold       reduce=20
+-fold-right unfold-r=
ight pair-fold-right reduce-right=20
++
Fold, unfold & map ++
++
++map for-each
++fold       unfold       pair-fold       reduce
++fold-right unfold-r=
ight pair-fold-right reduce-right
+ append-map append-ma=
p!
+ map! pair-for-each <=
a href=3D"#filter-map">filter-map map-in-orde=
r
+ 
+=20 +-
Filtering & partitioning +-
+-
++
Filtering & partitioning ++
++
+ filter  partition  remove
+-filter! partition! <=
a href=3D"#remove!">remove!=20
++filter! partition! <=
a href=3D"#remove!">remove!
+ 
+=20 +-
Searching +-
+-
+-member memq memv
+-find find-tail=20
++
Searching ++
++
++member memq memv
++find find-tail
+ any every
+ list-index
+ take-while drop-while=
 take-while!
+ span break span! break!
+ 
+=20 +-
Deleting +-
+-
+-delete  delete-dup=
licates=20
++
Deleting ++
++
++delete  delete-dup=
licates
+ delete! delete-d=
uplicates!
+ 
+=20 +-
Association lists +-
+-
+-assoc assq assv
++
Association lists ++
++
++assoc assq assv
+ alist-cons alist-copy=

+ alist-delete ali=
st-delete!
+ 
+=20 +-
Set operations on lists +-
+-
+-lset<=3D lset=3D lset-adjoin
++
Set operations on lists ++
++
++lset<=3D lset=3D =
lset-adjoin
+ lset-union			lset-un=
ion!
+ lset-intersection		lset-intersection!
+ lset-difference		        lset-difference!
+ lset-xor			lset-xor!
+-lset-diff+intersection	        lset-diff+intersection!
++lset-diff+intersection	        =
lset-diff+intersection!
+ 
+=20 +-
Primitive side-effects +-
+-
+-set-car! set-cdr!
++
Primitive side-effects ++
++
++set-car! set-cdr!
+ 
+-
++ +
+=20 +

+ Four R4RS/R5RS list-proc= essing procedures are extended by this library in + backwards-compatible ways: +-

+- +-
map for-each=20 +- (Extended to take lists of unequal length)=20 +-
member assoc=20 +- (Extended to take an optional comparison procedure.) +-
++

++
++ ++
map for-each ++ (Extended to take lists of unequal length) ++
member assoc ++ (Extended to take an optional comparison procedure.) ++
+
+=20 +

+ The following R4RS/R5RS li= st- and pair-processing procedures are also part of + list-lib's exports, as defined by the R5RS: +-

++

++
+
+ cons pair? null?
+-car cdr ... cdddar cddddr=20
+-set-car! set-cdr!=20
++car cdr ... cdddar cddddr
++set-car! set-cdr!
+ list append reverse
+ length list-ref
+ memq memv assq assv
+ 
+
+-=20=20=20=20 ++ +

+-The remaining two R4RS/= R5RS list-processing=20 ++The remaining two R4RS/= R5RS list-processing + procedures are not part of + this library: +-

+- +-
list-tail=20 +- (renamed drop) +-
list? +- (see proper-list?, +- circular-list? and=20 ++

++
++ ++
list-tail ++ (renamed drop) ++
list? ++ (see proper-list?, ++ circular-list? and + dotted-list?) +-
++
+
+=20 + +-

General discussion

++

General discussion

+

+=20 + A set of general criteria guided the design of this library. +=20 ++

+

+=20 +-I don't require "destructive" (what I call "linear update") procedures to= =20 ++I don't require "destructive" (what I call "linear update") procedures to + alter and recycle cons cells from the argument lists. They are allowed to= , but + not required to. (And the reference implementations I have written do= + recycle the argument lists.) +=20 ++

+

+ List-filtering procedures such as filter or delete do not disorder + lists. Elements appear in the answer list in the same order as they appea= r in + the argument list. This constrains implementation, but seems like a desir= able + feature, since in many uses of lists, order matters. (In particular, + disordering an alist is definitely a bad idea.) ++

+

+ Contrariwise, although the reference implementations of the list-filtering + procedures share longest common tails between argument and answer lists, + it not is part of the spec. ++

+

+ Because lists are an inherently sequential data structure (unlike, say, + vectors), list-inspection functions such as find, find= -tail, for-each, any + and every commit to a left-to-right traversal order of their= argument list. ++

+

+ However, constructor functions, such as list-tabulate<= /code> and the mapping + procedures (append-map, append-map!, map!= , pair-for-each, filter-map, + map-in-order), do not specify the dynamic order in = which their procedural + argument is applied to its various values. ++

+

+ Predicates return useful true values wherever possible. Thus any must return + the true value produced by its predicate, and every returns= the final true + value produced by applying its predicate argument to the last element of = its + argument list. ++

+

+ Functionality is provided both in pure and linear-update (potentially + destructive) forms wherever this makes sense. ++

+

+ No special status accorded Scheme's built-in equality functions. + Any functionality provided in terms of eq?, eqv?, equal? is also + available using a client-provided equality function. ++

+

+ Proper design counts for more than backwards compatibility, but I have tr= ied, +-ceteris paribus,=20 ++ceteris paribus, + to be as backwards-compatible as possible with existing + list-processing libraries, in order to facilitate porting old code to run= as a + client of the procedures in this library. Name choices and semantics are,= for + the most part, in agreement with existing practice in many current Scheme + systems. I have indicated some incompatibilities in the following text. ++

+

+ These procedures are not "sequence generic" -- i.e., pr= ocedures that + operate on either vectors and lists. They are list-specific. I prefer to + keep the library simple and focussed. ++

+

+ I have named these procedures without a qualifying initial "list-" lexeme, + which is in keeping with the existing set of list-processing utilities in +@@ -501,9 +546,11 @@ I follow the general Scheme convention (vector-length= , string-ref) of + placing the type-name before the action when naming procedures -- so + we have list-copy and pair-for-each rather than= the perhaps + more fluid, but less consistent, copy-list or for-each= -pair. ++

+

+ I have generally followed a regular and consistent naming scheme, composi= ng + procedure names from a set of basic lexemes. ++

+=20 + +

"Linear update" procedures

+@@ -520,18 +567,21 @@ of list1 to point to list= 2, and then + empty list, in which case it would simply return list2). However, append! may + also elect to perform a pure append operation -- this is a legal definiti= on + of append!: +-
++

++
+ (define append! append)
+ 
+

+ This is why we do not call these procedures "destructive" -- because they + aren't required to be destructive. They are potentially= destructive. ++

+

+ What this means is that you may only apply linear-update procedures to + values that you know are "dead" -- values that will never be used again + in your program. This must be so, since you can't rely on the value passed + to a linear-update procedure after that procedure has been called. It + might be unchanged; it might be altered. ++

+

+ The "linear" in "linear update" doesn't mean "linear time" or "linear spa= ce" + or any sort of multiple-of-n kind of meaning. It's a fancy term that +@@ -542,6 +592,7 @@ bound to no other variable. So when you use a= variable in a variable + reference, you "use it up." Knowing that no one else has a pointer to that + value means the a system primitive is free to side-effect its arguments to + produce what is, observationally, a pure-functional result. ++

+

+ In the context of this library, "linear update" means you, the programmer, + know there are no other live references to the value passed to t= he +@@ -549,11 +600,13 @@ procedure -- after passing the value to one of these= procedures, the + value of the old pointer is indeterminate. Basically, you are licensing + the Scheme implementation to alter the data structure if it feels like + it -- you have declared you don't care either way. ++

+

+ You get no help from Scheme in checking that the values you claim are "li= near" + really are. So you better get it right. Or play it safe and use the non-! + procedures -- it doesn't do any good to compute quickly if you get the wr= ong + answer. ++

+

+ Why go to all this trouble to define the notion of "linear update" and us= e it + in a procedure spec, instead of the more common notion of a "destructive" +@@ -572,16 +625,18 @@ algorithm. Linear-update operations are easily para= llelised. Going with a + linear-update spec doesn't close off these valuable alternative implement= ation + techniques. This list library is intended as a set of low-level, basic + operators, so we don't want to exclude these possible implementations. ++

+

+ The linear-update procedures in this library are +-

++

++
+ take! drop-right! split-at! + append! concatenate! reverse! append-reverse! + append-map! map! +-filter! partition! remove!=20 ++filter! partition! remove! + take-while! span! break! + delete! alist-delete! delete-duplicates! +-lset-adjoin! lset-union! lset-intersection!=20 ++lset-adjoin! lset-union! lset-intersection! + lset-difference! lset-xor! lset-diff+intersection! +
+=20 +@@ -597,26 +652,33 @@ treat these trees as lists. Further complications en= sue from the fact that + Scheme allows side-effects to these tuples, raising the possibility of li= sts + of unbounded length, and trees of unbounded depth (that is, circular data + structures). +- ++

+

+ However, there is a simple view of the world of Scheme values that consid= ers + every value to be a list of some sort. that is, every value is either ++

+
    +-
  • a "proper list" -- a finite, nil-terminated list, such as:
    +- (a b c)
    +- ()
    +- (32)
    +-
  • a "dotted list" -- a finite, non-nil terminated list, such as:
    +- (a b c . d)
    +- (x . y)
    +- 42
    +- george
    +-
  • or a "circular list" -- an infinite, unterminated list. ++
  • ++ a "proper list" -- a finite, nil-terminated list, such as:
    ++ (a b c)
    ++ ()
    ++ (32)
    ++
  • ++
  • ++ a "dotted list" -- a finite, non-nil terminated list, such as:
    ++ (a b c . d)
    ++ (x . y)
    ++ 42
    ++ george
    ++
  • ++
  • ++ or a "circular list" -- an infinite, unterminated list. ++
  • +
+

+ Note that the zero-length dotted lists are simply all the non-null, non-p= air + values. +- ++

+

+ This view is captured by the predicates proper-list?, = dotted-list?, and + circular-list?. List-lib users should note that dotted lists= are not commonly +@@ -624,7 +686,7 @@ used, and are considered by many Scheme programmers to= be an ugly artifact of + Scheme's lack of a true list type. However, dotted lists do play a notice= able + role in the syntax of Scheme, in the "rest" parameters used by n= -ary + lambdas: (lambda (x y . rest) ...). +- ++

+

+ Dotted lists are not fully supported by list-lib. Most procedure= s are + defined only on proper lists -- that is, finite, nil-terminated lists. T= he +@@ -632,8 +694,9 @@ procedures that will also handle circular or dotted li= sts are specifically + marked. While this design decision restricts the domain of possible argum= ents + one can pass to these procedures, it has the benefit of allowing the + procedures to catch the error cases where programmers inadvertently pass +-scalar values to a list procedure by accident,=20 ++scalar values to a list procedure by accident, + e.g., by switching the arguments to a procedure call. ++

+=20 + +

Errors

+@@ -645,6 +708,7 @@ do that." They are not a guarantee that a conforming i= mplementation will + Regrettably, R5RS Scheme requires no firmer guarantee even for basic operato= rs such + as car and cdr, so there's little point in requ= iring these procedures to do + more. Here is the relevant section of the R5RS: ++

+
+

+ When speaking of an error situation, this report uses the phrase "an +@@ -654,209 +718,235 @@ more. Here is the relevant section of the ++

+ For example, it is an error for a procedure to be passed an argument + that the procedure is not explicitly specified to handle, even though + such domain errors are seldom mentioned in this report. + Implementations may extend a procedure's domain of definition to + include such arguments. +-

++

+=20 +=20 + +

Not included in this library=

+

+ The following items are not in this library: ++

+
    +
  • Sort routines +-
  • Destructuring/pattern-matching macro +-
  • Tree-processing routines +-
++
  • Destructuring/pattern-matching macro ++
  • Tree-processing routines ++
  • +

    + They should have their own SRFI specs. +-

    ++

    +=20 +=20 + +-

    The procedures

    ++

    The procedures

    +

    +=20 + In a Scheme system that has a module or package system, these procedures + should be contained in a module named "list-lib". +- ++

    ++

    + The templates given below obey the following conventions for procedure fo= rmals: ++

    + +- +-
    list=09 +- A proper (finite, nil-terminated) list +-
    clist +- A proper or circular list +-
    flist +- A finite (proper or dotted) list +-
    pair +- A pair +-
    x, y, d, a +- Any value +-
    object, value +- Any value +-
    n, i +- A natural number (an integer >=3D 0) +-
    proc +- A procedure +-
    pred +- A procedure whose return value is treated as a boolean +-
    =3D +- A boolean procedure taking two arguments +-
    ++ list ++ A proper (finite, nil-terminated) list ++ clist ++ A proper or circular list ++ flist ++ A finite (proper or dotted) list ++ pair ++ A pair ++ ++ x, y, d, a<= /var> ++ Any value ++ object, = value ++ Any value ++ n, = i ++ A natural number (an integer >=3D 0) ++ proc ++ A procedure ++ pred ++ A procedure whose return value is treated as a boolean ++ =3D ++ A boolean procedure taking two arguments ++ +=20 +

    + It is an error to pass a circular or dotted list to a procedure not + defined to accept such an argument. +- ++

    + +-

    Constructors

    +-

    ++

    Constructors

    ++ +=20 +
    +=20 + +-
    ++
    + +-cons a d -> pair +-
    ++cons a d -> pair ++ ++
    ++

    + [R5RS] +- The primitive constructor. Returns a newly allocated pair whose car = is=20 +- a and whose cdr is d.=20=20 ++ The primitive constructor. Returns a newly allocated pair whose car = is ++ a and whose cdr is d. + The pair is guaranteed to be different (in the sense of eqv?) + from every existing object. +-

    +-(cons 'a '())        =3D> (a)
    +-(cons '(a) '(b c d)) =3D> ((a) b c d)
    +-(cons "a" '(b c))    =3D> ("a" b c)
    +-(cons 'a 3)          =3D> (a . 3)
    +-(cons '(a b) 'c)     =3D> ((a b) . c)
    ++

    ++
    ++(cons 'a '())        =3D> (a)
    ++(cons '(a) '(b c d)) =3D> ((a) b c d)
    ++(cons "a" '(b c))    =3D> ("a" b c)
    ++(cons 'a 3)          =3D> (a . 3)
    ++(cons '(a b) 'c)     =3D> ((a b) . c)
    + 
    +- ++
    + +-
    ++
    + +-list object ... -> list +-
    ++list object ... -> list ++ ++
    ++

    + [R5RS] + Returns a newly allocated list of its arguments. +-

    +-(list 'a (+ 3 4) 'c) =3D>  (a 7 c)
    +-(list)               =3D>  ()
    ++

    ++
    ++(list 'a (+ 3 4) 'c) =3D>  (a 7 c)
    ++(list)               =3D>  ()
    + 
    +- ++
    + +-
    ++
    + +-xcons d a -> pair +-
    ++xcons d a -> pair ++ ++
    +
    + (lambda (d a) (cons a d))
    + 
    +- Of utility only as a value to be conveniently passed to higher-order= =20 ++

    ++ Of utility only as a value to be conveniently passed to higher-order + procedures. +- +-

    ++

    ++
    + (xcons '(b c) 'a) =3D> (a b c)
    + 
    +- ++

    + The name stands for "eXchanged CONS." +- ++

    ++
    + +- +-
    cons* elt1 elt2 ... -> object +-
    +- +- Like list,=20 ++
    cons*= elt1 elt2 ... -> object ++
    ++
    ++

    ++ Like list, + but the last argument provides the tail of the constructed list, + returning +-

    ++

    ++
    + (cons elt1 (cons elt2 (cons .= .. eltn))) +
    +- This function is called list* in Common Lisp and about=20 ++

    ++ This function is called list* in Common Lisp and about + half of the Schemes that provide it, + and cons* in the other half. +-

    ++

    ++
    + (cons* 1 2 3 4) =3D> (1 2 3 . 4)
    + (cons* 1) =3D> 1
    + 
    +- ++
    + +- +-
    make-list n [fil= l] -> list +-
    +- Returns an n-element list,=20 ++
    make-li= st n [fill] -> list ++
    ++
    ++

    ++ Returns an n-element list, + whose elements are all the value fill. + If the fill argument is not given, the elements of the lis= t may + be arbitrary values. +-

    ++

    ++
    + (make-list 4 'c) =3D> (c c c c)
    + 
    +- ++
    + +- +-
    list-tabulate n i= nit-proc -> list +-
    ++
    list= -tabulate n init-proc -> list ++
    ++
    ++

    + Returns an n-element list. Element i of the lis= t, where 0 <=3D i < n, + is produced by (init-proc i). No g= uarantee is made about the dynamic + order in which init-proc is applied to these indices. +- +-

    ++

    ++
    + (list-tabulate 4 values) =3D> (0 1 2 3)
    + 
    +- ++
    + +- +-
    list-copy flist -= > flist +-
    ++
    list-cop= y flist -> flist ++
    ++
    ++

    + Copies the spine of the argument. +-=20=20=20=20 ++

    ++
    + +- +-
    circular-list elt= 1 elt2 ... -> list +-
    ++
    circ= ular-list elt1 elt2 ... -> list ++
    ++
    ++

    + Constructs a circular list of the elements. +-

    ++

    ++
    + (circular-list 'z 'q) =3D> (z q z q z q ...)
    + 
    +- ++
    + +- +-
    iota count [start= step] -> list +-
    ++
    iota count [start step] -> list ++
    ++
    ++

    + Returns a list containing the elements +-

    ++

    ++
    + (start start+step ... start+(=
    count-1)*step)
    + 
    ++

    + The start and step parameters default to 0 and = 1, respectively. + This procedure takes its name from the APL primitive. +- +-

    ++

    ++
    + (iota 5) =3D> (0 1 2 3 4)
    + (iota 5 0 -0.1) =3D> (0 -0.1 -0.2 -0.3 -0.4)
    + 
    ++
    +
    +=20 + +@@ -864,240 +954,282 @@ defined to accept such an argument. +

    + Note: the predicates proper-list?, circular-list?, and dotted-list? + partition the entire universe of Scheme values. +- ++

    +
    + +-
    +-proper-list? x -> boolean ++
    ++proper-list? x -> boolean + +-
    ++ ++
    ++

    + Returns true iff x is a proper list -- a finite, nil-termi= nated list. ++

    +

    +- More carefully: The empty list is a proper list. A pair whose cdr is = a=20 ++ More carefully: The empty list is a proper list. A pair whose cdr is a + proper list is also a proper list: ++

    +
    + <proper-list> ::=3D ()                            (Empty proper lis=
    t)
    +               |   (cons <x> <proper-list>)      (Proper-list =
    pair)
    + 
    ++

    + Note that this definition rules out circular lists. This + function is required to detect this case and return false. ++

    +

    + Nil-terminated lists are called "proper" lists by R5RS and Common Lisp. + The opposite of proper is improper. ++

    +

    + R5RS= binds this function to the variable list?. +-

    ++

    +
    + (not (proper-list? x)) =3D (or (dotted-list? x) (ci=
    rcular-list? x))
    + 
    +- ++
    + +- +-
    circular-list? x = -> boolean +-
    ++
    ci= rcular-list? x -> boolean ++
    ++
    ++

    + True if x is a circular list. A circular list is a value s= uch that + for every n >=3D 0, cdrn(x) is a pair. ++

    +

    + Terminology: The opposite of circular is finite. ++

    +
    + (not (circular-list? x)) =3D (or (proper-list? x) (=
    dotted-list? x))
    + 
    +- ++
    + +- +-
    dotted-list? x -&= gt; boolean +-
    ++
    dott= ed-list? x -> boolean ++
    ++
    ++

    + True if x is a finite, non-nil-terminated list. That is, t= here exists +- an n >=3D 0 such that cdrn(x= ) is neither a pair nor ().=20 ++ an n >=3D 0 such that cdrn(x= ) is neither a pair nor (). + This includes +- non-pair, non-() values (e.g. symbols, numbers),=20 ++ non-pair, non-() values (e.g. symbols, numbers), + which are considered to be dotted lists of length 0. ++

    +
    + (not (dotted-list? x)) =3D (or (proper-list? x) (ci=
    rcular-list? x))
    + 
    +- ++
    + +- +-
    pair? object ->= ; boolean +-
    ++
    pair? object -> boolean ++
    ++
    ++

    + [R5RS] + Returns #t if object is a pair; otherwise, #f. +-

    +-(pair? '(a . b)) =3D>  #t
    +-(pair? '(a b c)) =3D>  #t
    +-(pair? '())      =3D>  #f
    +-(pair? '#(a b))  =3D>  #f
    +-(pair? 7)        =3D>  #f
    +-(pair? 'a)       =3D>  #f
    ++

    ++
    ++(pair? '(a . b)) =3D>  #t
    ++(pair? '(a b c)) =3D>  #t
    ++(pair? '())      =3D>  #f
    ++(pair? '#(a b))  =3D>  #f
    ++(pair? 7)        =3D>  #f
    ++(pair? 'a)       =3D>  #f
    + 
    +- ++
    + +- +-
    null? object ->= ; boolean +-
    ++
    null? object -> boolean ++
    ++
    ++

    + [R5RS] + Returns #t if object is the empty list; otherwise, #f. +- ++

    ++
    + +- +-
    null-list? list -= > boolean +-
    ++
    null-l= ist? list -> boolean ++
    ++
    ++

    + List is a proper or circular list. This procedure returns = true if + the argument is the empty list (), and false otherwise. It is an + error to pass this procedure a value which is not a proper or + circular list. +- +- This procedure is recommended as the termination condition for=20 ++

    ++

    ++ This procedure is recommended as the termination condition for + list-processing procedures that are not defined on dotted lists. +- ++

    ++
    + +-
    ++
    + +-not-pair? x -> boolean +-
    +-
    (lambda (x) (not (pair? x)))
    ++not-pair? x -> boolean ++ ++
    ++
    (lambda (x) (not (pair? x)))
    ++

    + Provided as a procedure as it can be useful as the termination condit= ion + for list-processing procedures that wish to handle all finite lists, + both proper and dotted. +- ++

    ++
    + +-
    ++
    + +-list=3D elt=3D list1 ... -&= gt; boolean +-
    ++list=3D elt=3D list1 ... = -> boolean ++ ++
    ++

    + Determines list equality, given an element-equality procedure. +- Proper list A equals proper list B=20 ++ Proper list A equals proper list B + if they are of the same length, +- and their corresponding elements are equal,=20 +- as determined by elt=3D.=20 ++ and their corresponding elements are equal, ++ as determined by elt=3D. + If the element-comparison procedure's first argument is +- from listi,=20 +- then its second argument is from listi+1,=20 ++ from listi, ++ then its second argument is from listi+1, + i.e. it is always called as + (elt=3D a b) +- for a an element of list A,=20 ++ for a an element of list A, + and b an element of list B. ++

    +

    +- In the n-ary case,=20 +- every listi is compared to=20 +- listi+1=20 +- (as opposed, for example, to comparing=20 +- list1 to every listi,=20 +- for i>1).=20 +- If there are no list arguments at all,=20 ++ In the n-ary case, ++ every listi is compared to ++ listi+1 ++ (as opposed, for example, to comparing ++ list1 to every listi, ++ for i>1). ++ If there are no list arguments at all, + list=3D simply returns true. ++

    +

    + It is an error to apply list=3D to anything except prope= r lists. + While + implementations may choose to extend it to circular lists, note that = it + cannot reasonably be extended to dotted lists, as it provides no way = to + specify an equality procedure for comparing the list terminators. ++

    +

    + Note that the dynamic order in which the elt=3D procedure = is +- applied to pairs of elements is not specified.=20 ++ applied to pairs of elements is not specified. + For example, if list=3D is applied +- to three lists, A, B, and C,=20 ++ to three lists, A, B, and C, + it may first completely compare A to B, +- then compare B to C,=20 ++ then compare B to C, + or it may compare the first elements of A and B, +- then the first elements of B and C,=20 ++ then the first elements of B and C, + then the second elements of A and B, and so for= th. ++

    +

    +- The equality procedure must be consistent with eq?.=20 ++ The equality procedure must be consistent with eq?. + That is, it must be the case that +-

    +- (eq? x y) =3D> (elt= =3D x y). ++

    ++
    ++ (eq? x y) =3D> (= elt=3D x y). +
    +- Note that this implies that two lists which are eq?=20 ++

    ++ Note that this implies that two lists which are eq? + are always list=3D, as well; implementations may exploit t= his + fact to "short-cut" the element-by-element comparisons. +-

    +-(list=3D eq?) =3D> #t       ; Trivial cases
    +-(list=3D eq? '(a)) =3D> #t
    ++

    ++
    ++(list=3D eq?) =3D> #t       ; Trivial cases
    ++(list=3D eq? '(a)) =3D> #t
    + 
    +- ++
    +
    +=20 +=20 + +-

    Selectors

    ++

    Selectors

    +
    +=20 + +- +- +-
    car pair -> v= alue +-
    cdr pair -> v= alue +-
    ++
    car pair -> value ++
    ++
    cdr pair -> value ++
    ++
    ++

    + [R5RS] + These functions return the contents of the car and cdr field of their + argument, respectively. + Note that it is an error to apply them to the empty list. +-

    +-(car '(a b c))     =3D>  a             (cdr '(a b c))     =3D>  (b c)=20=
    =20
    +-(car '((a) b c d)) =3D>  (a)	     (cdr '((a) b c d)) =3D>  (b c d)
    +-(car '(1 . 2))     =3D>  1	     (cdr '(1 . 2))     =3D>  2=20=20=20=20=20=
    =20
    +-(car '())          =3D>  *error*	     (cdr '())          =3D>  *error*
    ++

    ++
    ++(car '(a b c))     =3D>  a             (cdr '(a b c))     =3D>  (b =
    c)
    ++(car '((a) b c d)) =3D>  (a)	     (cdr '((a) b c d)) =3D>  (b c d)
    ++(car '(1 . 2))     =3D>  1	     (cdr '(1 . 2))     =3D>  2
    ++(car '())          =3D>  *error*	     (cdr '())          =3D>  *err=
    or*
    + 
    +- ++
    +=20 +=20 + +- +- +- +- +-
    caar pair -> = value +-
    cadr pair -> = value +-
    : +-
    cdddar pair ->= ; value +-
    cddddr pair ->= ; value +-
    ++
    caar<= var> pair -> value ++
    ++
    cadr<= var> pair -> value ++
    ++
    : ++
    ++
    cddadr pair -> value ++
    ++
    cdddar pair -> value ++
    ++
    cddddr pair -> value ++
    ++
    ++

    + [R5RS] + These procedures are compositions of car and cdr, + where for example caddr could be defined by +-

    =20=20=20=20
    ++

    ++
    + (define caddr (lambda (x) (car (cdr (cdr x))))).
    + 
    ++

    + Arbitrary compositions, up to four deep, are provided. There are + twenty-eight of these procedures in all. +- ++

    ++
    + +- +-
    list-ref clist i = -> value +-
    ++
    list-ref<= /code> clist i -> value ++
    ++
    ++

    + [R5RS] +- Returns the ith element of clist.=20= =20 +- (This is the same as the car of=20 ++ Returns the ith element of clist. ++ (This is the same as the car of + (drop clist i).) +- It is an error if i >=3D n,=20 ++ It is an error if i >=3D n, + where n is the length of clist. +-

    =20=20=20=20
    +-(list-ref '(a b c d) 2) =3D> c
    +-
    =20=20=20=20 +- ++

    ++
    ++(list-ref '(a b c d) 2) =3D> c
    ++
    ++
    + +-
    ++
    + +-first   pair -> obje= ct +-
    ++first   pair -> ob= ject ++
    + +-second  pair -> object +-
    ++second  pair -> object = ++
    + +-third   pair -> obje= ct +-
    ++third   pair -> ob= ject ++
    + +-fourth  pair -> object +-
    ++fourth  pair -> object = ++
    + +-fifth   pair -> obje= ct +-
    ++fifth   pair -> ob= ject ++
    + +-sixth   pair -> obje= ct +-
    ++sixth   pair -> ob= ject ++
    + +-seventh pair -> object +-
    ++seventh pair -> object ++
    + +-eighth  pair -> object +-
    ++eighth  pair -> object = ++
    + +-ninth   pair -> obje= ct +-
    ++ninth   pair -> ob= ject ++
    + +-tenth   pair -> obje= ct +-
    +- Synonyms for car, cadr, caddr,= ...=20 ++tenth   pair -> ob= ject ++
    ++ Synonyms for car, cadr, caddr,= ... +=20 +-
    ++
    + (third '(a b c d e)) =3D> c
    + 
    +=20 + +-
    ++
    + +-car+cdr pair -> [x y] +-
    ++car+cdr pair -> [x y] ++
    + The fundamental pair deconstructor: +-
    ++
    + (lambda (p) (values (car p) (cdr p)))
    + 
    + This can, of course, be implemented more efficiently by a compiler. +- ++
    + +-
    ++
    + +-take x i -> list +-
    ++take x i -> list ++
    + +-drop x i -> object +-
    +- take returns the first i elements of list x.
    ++drop x i -> object ++
    ++ take returns the first i elements of list x.
    + drop returns all but the first i elements of = list x. +-
    ++
    + (take '(a b c d e)  2) =3D> (a b)
    + (drop '(a b c d e)  2) =3D> (c d e)
    + 
    + x may be any value -- a proper, circular, or dotted list: +-
    ++
    + (take '(1 2 3 . d) 2) =3D> (1 2)
    + (drop '(1 2 3 . d) 2) =3D> (3 . d)
    + (take '(1 2 3 . d) 3) =3D> (1 2 3)
    +@@ -1186,7 +1318,7 @@ partition the entire universe of Scheme values.
    + 
    + For a legal i, take and drop par= tition the list in a manner which + can be inverted with append: +-
    ++
    + (append (take x i) (drop x i)=
    ) =3D x
    + 
    + drop is exactly equivalent to performing i cd= r operations on x; +@@ -1195,114 +1327,138 @@ partition the entire universe of Scheme values. + If the argument is a list of non-zero length, take is gu= aranteed to + return a freshly-allocated list, even in the case where the entire + list is taken, e.g. (take lis (length lis)). +- ++
    + +-
    ++
    + +-take-right flist i -> object +-
    ++take-right flist i -> object ++
    ++
    + +-drop-right flist i -> list +-
    +- take-right returns the last i elements of flist.
    ++drop-right flist i -> list ++ ++
    ++

    ++ take-right returns the last i elements of flist.
    + drop-right returns all but the last i element= s of flist. +-

    ++

    ++
    + (take-right '(a b c d e) 2) =3D> (d e)
    + (drop-right '(a b c d e) 2) =3D> (a b c)
    + 
    ++

    + The returned list may share a common tail with the argument list. ++

    +

    + flist may be any finite list, either proper or dotted: +-

    ++

    ++
    + (take-right '(1 2 3 . d) 2) =3D> (2 3 . d)
    + (drop-right '(1 2 3 . d) 2) =3D> (1)
    + (take-right '(1 2 3 . d) 0) =3D> d
    + (drop-right '(1 2 3 . d) 0) =3D> (1 2 3)
    + 
    +- For a legal i, take-right and drop-righ= t partition the list in a manner=20 ++

    ++ For a legal i, take-right and drop-righ= t partition the list in a manner + which can be inverted with append: +-

    ++

    ++
    + (append (take flist i) (drop flist =
    i)) =3D flist
    + 
    ++

    + take-right's return value is guaranteed to share a commo= n tail with flist. +=20 + If the argument is a list of non-zero length, drop-right= is guaranteed to + return a freshly-allocated list, even in the case where nothing is + dropped, e.g. (drop-right lis 0). +- ++

    ++
    + +-
    ++
    + +-take! x i -> list +-
    ++take! x i -> list ++
    ++
    + +-drop-right! flist i -> list +-
    ++drop-right! flist i -> list ++ ++
    ++

    + take! and drop-right! are "linear-update" v= ariants of take and + drop-right: the procedure is allowed, but not required, = to alter the + argument list to produce the result. +-

    ++

    + If x is circular, take! may return a shorter-= than-expected list: +-

    ++

    ++
    + (take! (circular-list 1 3 5) 8) =3D> (1 3)
    + (take! (circular-list 1 3 5) 8) =3D> (1 3 5 1 3 5 1 3)
    + 
    +- ++
    +=20 + +-
    ++
    + +-split-at  x i -> [list object]= +-
    ++split-at  x i -> [list objec= t] ++
    ++
    + +-split-at! x i -> [list object] +-
    +- split-at splits the list x=20 +- at index i, returning a list of the=20 ++split-at! x i -> [list object] ++ ++
    ++

    ++ split-at splits the list x ++ at index i, returning a list of the + first i elements, and the remaining tail. It is equivalent + to +-

    ++

    ++
    + (values (take x i) (drop x i))
    + 
    ++

    + split-at! is the linear-update variant. It is allowed, b= ut not + required, to alter the argument list to produce the result. +-

    +-(split-at '(a b c d e f g h) 3) =3D>
    ++

    ++
    ++(split-at '(a b c d e f g h) 3) =3D>
    +     (a b c)
    +     (d e f g h)
    + 
    +- ++
    +=20 + +-
    ++
    + +-last pair -> object +-
    ++last pair -> object ++
    ++
    + +-last-pair pair -> pair +-
    +- last returns the last element of the non-empty,=20 ++last-pair pair -> pair ++ ++
    ++

    ++ last returns the last element of the non-empty, + finite list pair. + last-pair returns the last pair in the non-empty, + finite list pair. +- +-

    ++

    ++
    + (last '(a b c)) =3D> c
    + (last-pair '(a b c)) =3D> (c)
    + 
    +- ++
    +
    +=20 + +@@ -1313,174 +1469,208 @@ partition the entire universe of Scheme values. + =3D=3D=3D=3D length+ + =3D=3D=3D=3D length + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D--> +-
    ++
    + +-length  list -> integer +-
    ++length  list -> integer= ++
    ++
    + +-length+ clist -> integer or #f= +-
    ++length+ clist -> integer or = #f ++ ++
    ++

    + Both length and length+ return the length o= f the argument. + It is an error to pass a value to length which is not a = proper + list (finite and nil-terminated). In particular, this means an + implementation may diverge or signal an error when length is + applied to a circular list. +-

    =20=20=20=20 ++

    ++

    + length+, on the other hand, returns #F when= applied to a circular + list. +-

    =20=20=20=20 +- The length of a proper list is a non-negative integer n su= ch that cdr=20 ++

    ++

    ++ The length of a proper list is a non-negative integer n su= ch that cdr + applied n times to the list produces the empty list. +- ++

    ++
    +=20 + +-
    ++
    + +-append  list1 ... ->= ; list +-
    ++append  list1 ... -&= gt; list ++
    ++
    + +-append! list1 ... -> lis= t +-
    ++append! list1 ... -> l= ist ++ ++
    ++

    + [R5RS] +- append returns a list consisting of the elements=20 ++ append returns a list consisting of the elements + of list1 + followed by the elements of the other list parameters. +-

    +-(append '(x) '(y))        =3D>  (x y)
    +-(append '(a) '(b c d))    =3D>  (a b c d)
    +-(append '(a (b)) '((c)))  =3D>  (a (b) (c))
    ++

    ++
    ++(append '(x) '(y))        =3D>  (x y)
    ++(append '(a) '(b c d))    =3D>  (a b c d)
    ++(append '(a (b)) '((c)))  =3D>  (a (b) (c))
    + 
    ++

    + The resulting list is always newly allocated, except that it +- shares structure with the final listi argument.= =20=20 +- This last argument may be any value at all;=20 ++ shares structure with the final listi argument. ++ This last argument may be any value at all; + an improper list results if it is not + a proper list. All other arguments must be proper lists. +-

    +-(append '(a b) '(c . d))  =3D>  (a b c . d)
    +-(append '() 'a)           =3D>  a
    +-(append '(x y))           =3D>  (x y)
    +-(append)                  =3D>  ()
    ++

    ++
    ++(append '(a b) '(c . d))  =3D>  (a b c . d)
    ++(append '() 'a)           =3D>  a
    ++(append '(x y))           =3D>  (x y)
    ++(append)                  =3D>  ()
    + 
    +- ++

    + append! is the "linear-update" variant of append + -- it is allowed, but not required, to alter cons cells in the argume= nt +- lists to construct the result list.=20 ++ lists to construct the result list. + The last argument is never altered; the result + list shares structure with this parameter. +- ++

    ++
    + +-
    ++
    + +-concatenate  list-of-lists -> = value +-
    ++concatenate  list-of-lists ->= ; value ++
    ++
    + +-concatenate! list-of-lists -> value= +-
    ++concatenate! list-of-lists -> val= ue ++ ++
    ++

    + These functions append the elements of their argument together. + That is, concatenate returns +-

    ++

    ++
    + (apply append list-of-lists)
    + 
    ++

    + or, equivalently, +-

    ++

    ++
    + (reduce-right append '() list-of-lists)
    + 
    +- ++

    + concatenate! is the linear-update variant, defined in + terms of append! instead of append. +-=20=20=20=20 ++

    +

    + Note that some Scheme implementations do not support passing more tha= n a +- certain number (e.g., 64) of arguments to an n-ary procedure= .=20=20 ++ certain number (e.g., 64) of arguments to an n-ary procedure. + In these implementations, the (apply append ...) idiom +- would fail when applied to long lists,=20 ++ would fail when applied to long lists, + but concatenate would continue to function properly. +- ++

    +

    +- As with append and append!,=20 ++ As with append and append!, + the last element of the input list may be any value at all. +- ++

    ++
    + +-
    ++
    + +-reverse  list -> list +-
    ++reverse  list -> list ++
    ++
    + +-reverse! list -> list +-
    ++reverse! list -> list ++ ++
    ++

    + [R5RS] +=20 + reverse returns a newly allocated list consisting of + the elements of list in reverse order. +-

    +-(reverse '(a b c)) =3D>  (c b a)
    ++

    ++
    ++(reverse '(a b c)) =3D>  (c b a)
    + (reverse '(a (b c) d (e (f))))
    +-    =3D>  ((e (f)) d (b c) a)
    ++    =3D>  ((e (f)) d (b c) a)
    + 
    ++

    + reverse! is the linear-update variant of reverse. +- It is permitted, but not required, to alter the argument's cons cells= =20 ++ It is permitted, but not required, to alter the argument's cons cells + to produce the reversed list. +- ++

    ++
    +=20 + +-
    ++
    + +-append-reverse  rev-head tai= l -> list +-
    ++append-reverse  rev-head t= ail -> list ++
    ++
    + +-append-reverse! rev-head tail -&g= t; list +-
    ++append-reverse! rev-head tail -= > list ++ ++
    ++

    + append-reverse returns + (append (reverse rev-head) tail). + It is provided because it is a common operation -- a common + list-processing style calls for this exact operation to transfer valu= es + accumulated in reverse order onto the front of another list, and beca= use + the implementation is significantly more efficient than the simple +- composition it replaces. (But note that this pattern of iterative=20 +- computation followed by a reverse can frequently be rewritten as a=20 +- recursion, dispensing with the reverse and append-= reverse steps, and=20 +- shifting temporary, intermediate storage from the heap to the stack,= =20 +- which is typically a win for reasons of cache locality and eager stor= age=20 ++ composition it replaces. (But note that this pattern of iterative ++ computation followed by a reverse can frequently be rewritten as a ++ recursion, dispensing with the reverse and append-= reverse steps, and ++ shifting temporary, intermediate storage from the heap to the stack, ++ which is typically a win for reasons of cache locality and eager stor= age + reclamation.) ++

    +

    + append-reverse! is just the linear-update variant -- it = is allowed, but + not required, to alter rev-head's cons cells to construct = the result. +- ++

    ++
    + +- +-
    zip clist1 clist2 ... -> list +-
    ++
    zip clist1 clist2 ... -> list ++
    ++
    +
    (lambda lists (apply map list lists))
    + 
    ++

    + If zip is passed n lists, it returns a list a= s long as the shortest + of these lists, each element of which is an n-element list= comprised + of the corresponding elements from the parameter lists. +- +-

    +-(zip '(one two three)=20
    ++

    ++
    ++(zip '(one two three)
    +      '(1 2 3)
    +      '(odd even odd even odd even odd even))
    +     =3D> ((one 1 odd) (two 2 even) (three 3 odd))
    +=20
    + (zip '(1 2 3)) =3D> ((1) (2) (3))
    + 
    ++

    + At least one of the argument lists must be finite: +-

    +-(zip '(3 1 4 1) (circular-list #f #t))=20
    +-    =3D> ((3 #f) (1 #t) (4 #f) (1 #t))
    ++

    ++
    ++(zip '(3 1 4 1) (circular-list #f #t))
    ++    =3D> ((3 #f) (1 #t) (4 #f) (1 #t))
    + 
    +- ++
    + +- +-
    unzip1 list -&= gt; list +- +-
    unzip2 list -&g= t; [list list] +- +-
    unzip3 list -&g= t; [list list list] +- +-
    unzip4 list -&g= t; [list list list list] +- +-
    unzip5 list -&g= t; [list list list list list] +-
    +- unzip1 takes a list of lists,=20 +- where every list must contain at least one element,=20 +- and returns a list containing the initial element of each such list.= =20 +- That is, it returns (map car lists).=20=20 ++
    unzip1 list -> list ++
    ++
    unzip2 list -> [list list] ++
    ++
    unzip3 list -> [list list list] ++
    ++
    unzip4 list -> [list list list list] ++
    ++
    unzip5 list -> [list list list list list] ++
    ++
    ++

    ++ unzip1 takes a list of lists, ++ where every list must contain at least one element, ++ and returns a list containing the initial element of each such list. ++ That is, it returns (map car lists). + unzip2 takes a list of lists, where every list must cont= ain at least + two elements, and returns two values: a list of the first elements, + and a list of the second elements. unzip3 does the same = for the first + three elements of the lists, and so forth. +- +-

    ++

    ++
    + (unzip2 '((1 one) (2 two) (3 three))) =3D>
    +-    (1 2 3)=20
    ++    (1 2 3)
    +     (one two three)
    + 
    +- ++
    + +-
    ++
    + +-count pred clist1 clist2 -> integer +-
    ++count pred clist1 clist2 -> integer ++ ++
    ++

    + pred is a procedure taking as many arguments as there +- are lists and returning a single value. It is applied=20 ++ are lists and returning a single value. It is applied + element-wise to the elements of the lists, and a count is + tallied of the number of elements that produce a true value. This cou= nt + is returned. count is "iterative" in that it is guarante= ed + to apply pred to the list elements in a + left-to-right order. + The counting stops when the shortest list expires. +-

    +-(count even? '(3 1 4 1 5 9 2 5 6)) =3D> 3
    +-(count < '(1 2 4 8) '(2 4 6 8 10 12 14 16)) =3D> 3
    ++

    ++
    ++(count even? '(3 1 4 1 5 9 2 5 6)) =3D> 3
    ++(count < '(1 2 4 8) '(2 4 6 8 10 12 14 16)) =3D> 3
    + 
    ++

    + At least one of the argument lists must be finite: +-

    +-(count < '(3 1 4 1) (circular-list 1 10)) =3D> 2
    ++

    ++
    ++(count < '(3 1 4 1) (circular-list 1 10)) =3D> 2
    + 
    +- ++
    + +=20 + +-

    Fold, unfold & map

    ++

    Fold, unfold & map

    +
    + +-
    ++
    + +-fold kons knil clist1 clist= 2 ... -> value +-
    +- The fundamental list iterator.=20 ++fold kons knil clist1 cli= st2 ... -> value ++ ++
    ++

    ++ The fundamental list iterator. ++

    +

    + First, consider the single list-parameter case. If clist1 =3D (e1 e2 ... = en), + then this procedure returns +-

    ++

    ++
    + (kons en ... (kons e2 (kons e1 knil)) ... ) +
    ++

    + That is, it obeys the (tail) recursion +-

    ++

    ++
    + (fold kons knil lis) =3D (fold kons=
     (kons (car lis) knil) (cdr lis=
    ))
    + (fold kons knil '()) =3D knil
    + 
    +- ++

    + Examples: +-

    ++

    ++
    + (fold + 0 lis)			; Add up the elements of LIS.
    +=20
    + (fold cons '() lis)		; Reverse LIS.
    +@@ -1581,297 +1784,357 @@ partition the entire universe of Scheme values.
    +       0
    +       lis)
    + 
    +- ++

    + If n list arguments are provided, then the kons= function must take + n+1 parameters: one element from each list, and the "seed"= or fold + state, which is initially knil. The fold operation termina= tes when + the shortest list runs out of values: +-

    ++

    ++
    + (fold cons* '() '(a b c) '(1 2 3 4 5)) =3D> (c 3 b 2 a 1)
    + 
    ++

    + At least one of the list arguments must be finite. +- ++

    ++
    + +-
    ++
    + +-fold-right kons knil clist1= clist2 ... -> value +-
    +- The fundamental list recursion operator.=20 ++fold-right kons knil clist1 clist2 ... -> value ++ ++
    +

    +- First, consider the single list-parameter case. If clist1 =3D (e1 e2 ...= en),=20 ++ The fundamental list recursion operator. ++

    ++

    ++ First, consider the single list-parameter case. If clist1 =3D (e1 e2 ...= en), + then this procedure returns +-

    ++

    ++
    + (kons e1 (kons e2 ... (kons en knil))) +
    ++

    + That is, it obeys the recursion +-

    ++

    ++
    + (fold-right kons knil lis) =3D (kon=
    s (car lis) (fold-right kons knil (c=
    dr lis)))
    + (fold-right kons knil '()) =3D knil
    + 
    +-=20=20=20=20=20=20=20=20 ++

    + Examples: +-

    ++

    ++
    + (fold-right cons '() lis)		; Copy LIS.
    +=20
    + ;; Filter the even numbers out of LIS.
    + (fold-right (lambda (x l) (if (even? x) (cons x l) l)) '() lis))
    + 
    +- ++

    + If n list arguments are provided, then the kons= function must take + n+1 parameters: one element from each list, and the "seed"= or fold + state, which is initially knil. The fold operation termina= tes when + the shortest list runs out of values: +-

    ++

    ++
    + (fold-right cons* '() '(a b c) '(1 2 3 4 5)) =3D> (a 1 b 2 c 3)
    + 
    ++

    + At least one of the list arguments must be finite. +- ++

    ++
    + +-
    ++
    + +-pair-fold kons knil clist1 = clist2 ... -> value +-
    +- Analogous to fold, but kons is applied to suc= cessive sublists of the=20 ++pair-fold kons knil clist1 clist2 ... -> value ++ ++
    ++

    ++ Analogous to fold, but kons is applied to suc= cessive sublists of the + lists, rather than successive elements -- that is, kons is= applied to the + pairs making up the lists, giving this (tail) recursion: +-

    ++

    ++
    + (pair-fold kons knil lis) =3D (let ((tai=
    l (cdr lis)))
    +                               (pair-fold kons (kons=
     lis knil) tail))
    + (pair-fold kons knil '()) =3D kni=
    l
    + 
    ++

    + For finite lists, the kons function may reliably apply + set-cdr! to the pairs it is given + without altering the sequence of execution. ++

    +

    + Example: +-

    ++

    ++
    + ;;; Destructively reverse a list.
    +-(pair-fold (lambda (pair tail) (set-cdr! pair tail) pair) '() lis))
    ++(pair-fold (lambda (pair tail) (set-cdr! pair tail) pair) '() lis)
    + 
    +- ++

    + At least one of the list arguments must be finite. +- +-=20=20=20=20 ++

    ++
    + +-
    ++
    + +-pair-fold-right kons knil clist1<= /sub> clist2 ... -> value +-
    ++pair-fold-right kons knil clist= 1 clist2 ... -> value ++ ++
    ++

    + Holds the same relationship with fold-right that p= air-fold holds with fold. + Obeys the recursion +-

    +-(pair-fold-right kons knil lis) =3D=20
    ++

    ++
    ++(pair-fold-right kons knil lis) =3D
    +     (kons lis (pair-fold-right kons knil (cdr lis)))
    + (pair-fold-right kons knil '()) =3D knil
    + 
    +-=20=20=20=20 ++

    + Example: +-

    ++

    ++
    + (pair-fold-right cons '() '(a b c)) =3D> ((a b c) (b c) (c))
    + 
    +- ++

    + At least one of the list arguments must be finite. +- ++

    ++
    + +-
    ++
    + +-reduce f ridentity list -> value +-
    +- reduce is a variant of fold.=20 ++reduce f ridentity list -> value<= /var> ++ ++
    +

    +- ridentity should be a "right identity" of the procedure f -- that is,=20 ++ reduce is a variant of fold. ++

    ++

    ++ ridentity should be a "right identity" of the procedure f -- that is, + for any value x acceptable to f, +-

    ++

    ++
    + (f x ridentity) =3D x
    + 
    +-=20=20=20=20 ++

    + reduce has the following definition: +-

    +-If list =3D (), return ridentity;
    ++

    ++
    ++If list =3D (), return ridentity;
    + Otherwise, return (fold f (car list) (cdr = list)). +
    +- ...in other words, we compute=20 ++

    ++ ...in other words, we compute + (fold f ridentity list). ++

    +

    + Note that ridentity is used only in the empty-lis= t case. + You typically use reduce when applying f is e= xpensive and you'd + like to avoid the extra application incurred when fold a= pplies + f to the head of list and the identity value, +- redundantly producing the same value passed in to f.=20 +- For example, if f involves searching a file directory or=20 +- performing a database query, this can be significant.=20 ++ redundantly producing the same value passed in to f. ++ For example, if f involves searching a file directory or ++ performing a database query, this can be significant. + In general, however, fold is useful in many contexts whe= re reduce is not + (consider the examples given in the fold definition -- o= nly one of the +- five folds uses a function with a right identity.=20 ++ five folds uses a function with a right identity. + The other four may not be performed with reduce). +- ++

    +

    + Note: MIT Scheme and Haskell flip F's arg order for their reduc= e and + fold functions. +- +-

    ++

    ++
    + ;; Take the max of a list of non-negative integers.
    + (reduce max 0 nums) ; i.e., (apply max 0 nums)
    + 
    +- ++
    + +-
    ++
    + +-reduce-right f ridentity list -> va= lue +-
    ++reduce-right f ridentity list -> = value ++ ++
    ++

    + reduce-right is the fold-right variant of reduce. + It obeys the following definition: +-

    ++

    ++
    + (reduce-right f ridentity '()) =3D ridentity
    + (reduce-right f ridentity '(e1)) =3D (f e1 ridentity) =3D e1
    + (reduce-right f ridentity '(e1 e2 ...)) =3D
    +     (f e1 (reduce f ride=
    ntity (e2 ...)))
    + 
    +- ...in other words, we compute=20 ++

    ++ ...in other words, we compute + (fold-right f ridentity list)<= /code>. +-=20=20=20=20 +-

    ++

    ++
    + ;; Append a bunch of lists together.
    + ;; I.e., (apply append list-of-lists)
    + (reduce-right append '() list-of-lists)
    + 
    +- ++
    + +-
    ++
    + +-unfold p f g seed [tail-gen] -> lis= t +-
    ++unfold p f g seed [tail-gen] -> l= ist ++ ++
    ++

    + unfold is best described by its basic recursion: +-

    +-(unfold p f g seed) =3D=20
    ++

    ++
    ++(unfold p f g seed) =3D
    +     (if (p seed) (tail-gen seed)
    +         (cons (f seed)
    +               (unfold p f g (g seed))))
    + 
    +
    +-
    p
    Determines when to stop unfolding. +-
    f
    Maps each seed value to the corresponding list ele= ment. +-
    g
    Maps each seed value to next seed value. +-
    seed
    The "state" value for the unfold. +-
    tail-gen
    Creates the tail of the list;=20 +- defaults to (lambda (x) '()) ++
    p
    ++
    Determines when to stop unfolding.
    ++
    f
    ++
    Maps each seed value to the corresponding list element.
    ++
    g
    ++
    Maps each seed value to next seed value.
    ++
    seed
    ++
    The "state" value for the unfold.
    ++
    tail-gen
    ++
    Creates the tail of the list; defaults to (lambda (x) '())
    +
    +

    + In other words, we use g to generate a sequence of seed va= lues +-

    ++

    ++
    + seed, g(seed), g2(= seed), g3(seed), ... +
    +- These seed values are mapped to list elements by f,=20 +- producing the elements of the result list in a left-to-right order.=20 ++

    ++ These seed values are mapped to list elements by f, ++ producing the elements of the result list in a left-to-right order. + P says when to stop. +- ++

    +

    +- unfold is the fundamental recursive list constructor,=20 +- just as fold-right is=20 ++ unfold is the fundamental recursive list constructor, ++ just as fold-right is + the fundamental recursive list consumer. + While unfold may seem a bit abstract + to novice functional programmers, it can be used in a number of ways: +- +-

    ++

    ++
    + ;; List of squares: 1^2 ... 10^2
    + (unfold (lambda (x) (> x 10))
    +         (lambda (x) (* x x))
    + 	(lambda (x) (+ x 1))
    + 	1)
    +-=09=09
    ++
    + (unfold null-list? car cdr lis) ; Copy a proper list.
    +=20
    + ;; Read current input port into a list of values.
    + (unfold eof-object? values (lambda (x) (read)) (read))
    +=20
    + ;; Copy a possibly non-proper list:
    +-(unfold not-pair? car cdr lis=20
    ++(unfold not-pair? car cdr lis
    +               values)
    +=20
    + ;; Append HEAD onto TAIL:
    +-(unfold null-list? car cdr head=20
    ++(unfold null-list? car cdr head
    +               (lambda (x) tail))
    + 
    +- +- Interested functional programmers may enjoy noting that=20 ++

    ++ Interested functional programmers may enjoy noting that + fold-right and unfold +- are in some sense inverses.=20 +- That is, given operations knull?, kar,=20 ++ are in some sense inverses. ++ That is, given operations knull?, kar, + kdr, kons, and knil satisfying +-

    ++

    ++
    + (kons (kar x) (kdr x)) =3D x +- and=20 ++ and + (knull? knil) =3D #t +
    ++

    + then +-

    ++

    ++
    + (fold-right kons knil (unfold knull? kar kdr x)) =3D x +
    ++

    + and +-

    ++

    ++
    + (unfold knull? kar kdr (fold-right= kons knil x)) =3D x. +
    +- ++

    + This combinator sometimes is called an "anamorphism;" when an + explicit tail-gen procedure is supplied, it is called an + "apomorphism." +- +- ++

    ++
    + +-
    ++
    + +-unfold-right p f g seed [tail] -> l= ist +-
    ++unfold-right p f g seed [tail] ->= list ++ ++
    ++

    + unfold-right constructs a list with the following loop: +-

    ++

    ++
    + (let lp ((seed seed) (lis tail))
    +   (if (p seed) lis
    +       (lp (g seed)
    +           (cons (f seed) lis))))
    + 
    +
    +-
    p
    Determines when to stop unfolding. +-
    f
    Maps each seed value to the corresponding list ele= ment. +-
    g
    Maps each seed value to next seed value. +-
    seed
    The "state" value for the unfold. +-
    tail
    list terminator; defaults to '(). ++
    p
    ++
    Determines when to stop unfolding.
    ++
    f
    ++
    Maps each seed value to the corresponding list element.
    ++
    g
    ++
    Maps each seed value to next seed value.
    ++
    seed
    ++
    The "state" value for the unfold.
    ++
    tail
    ++
    list terminator; defaults to '().
    +
    +

    + In other words, we use g to generate a sequence of seed va= lues +-

    ++

    ++
    + seed, g(seed), g2(= seed), g3(seed), ... +
    +- These seed values are mapped to list elements by f,=20 +- producing the elements of the result list in a right-to-left order.=20 ++

    ++ These seed values are mapped to list elements by f, ++ producing the elements of the result list in a right-to-left order. + P says when to stop. +- ++

    +

    +- unfold-right is the fundamental iterative list construct= or,=20 ++ unfold-right is the fundamental iterative list construct= or, + just as fold is the +- fundamental iterative list consumer.=20 ++ fundamental iterative list consumer. + While unfold-right may seem a bit abstract + to novice functional programmers, it can be used in a number of ways: +-

    ++

    ++
    + ;; List of squares: 1^2 ... 10^2
    +-(unfold-right zero?=20
    ++(unfold-right zero?
    +               (lambda (x) (* x x))
    +               (lambda (x) (- x 1))
    +               10)
    +-=09
    ++
    + ;; Reverse a proper list.
    + (unfold-right null-list? car cdr lis)
    +=20
    +@@ -1881,241 +2144,290 @@ Otherwise,    return (fold f (c=
    ar list) (cdr li
    + ;; (append-reverse rev-head tail)
    + (unfold-right null-list? car cdr rev-head tail)
    + 
    +- +- Interested functional programmers may enjoy noting that=20 ++

    ++ Interested functional programmers may enjoy noting that + fold and unfold-right +- are in some sense inverses.=20 +- That is, given operations knull?, kar,=20 ++ are in some sense inverses. ++ That is, given operations knull?, kar, + kdr, kons, and knil satisfying +-

    ++

    ++
    + (kons (kar x) (kdr x)) =3D x +- and=20 ++ and + (knull? knil) =3D #t +
    ++

    + then +-

    ++

    ++
    + (fold kons knil (unfold-right knull? kar kdr x)) =3D x +
    ++

    + and +-

    ++

    ++
    + (unfold-right knull? kar kdr (fold= kons knil x)) =3D x. +
    +- ++

    + This combinator presumably has some pretentious mathematical name; + interested readers are invited to communicate it to the author. +- ++

    ++
    + +-
    ++
    + +-map proc clist1 clist2= ... -> list +-
    +- [R5RS+] +- +- proc is a procedure taking as many arguments=20 +- as there are list arguments and returning a single value.=20=20 ++map proc clist1 clist2 ... -> list ++ ++
    ++

    ++ [R5RS+] ++ proc is a procedure taking as many arguments ++ as there are list arguments and returning a single value. + map applies proc element-wise to the elements +- of the lists and returns a list of the results,=20 +- in order.=20=20 +- The dynamic order in which proc=20 ++ of the lists and returns a list of the results, ++ in order. ++ The dynamic order in which proc + is applied to the elements of the lists is unspecified. +-=20=20=20=20 +-

    +-(map cadr '((a b) (d e) (g h))) =3D>  (b e h)
    ++

    ++
    ++(map cadr '((a b) (d e) (g h))) =3D>  (b e h)
    +=20
    + (map (lambda (n) (expt n n))
    +      '(1 2 3 4 5))
    +-    =3D>  (1 4 27 256 3125)
    ++    =3D>  (1 4 27 256 3125)
    +=20
    +-(map + '(1 2 3) '(4 5 6)) =3D>  (5 7 9)
    ++(map + '(1 2 3) '(4 5 6)) =3D>  (5 7 9)
    +=20
    + (let ((count 0))
    +   (map (lambda (ignored)
    +          (set! count (+ count 1))
    +          count)
    +-       '(a b))) =3D>  (1 2) or (2 1)
    ++       '(a b))) =3D>  (1 2) or (2 1)
    + 
    +- +- This procedure is extended from its=20 ++

    ++ This procedure is extended from its + R5RS= +- specification to allow the arguments to be of unequal length;=20 +- it terminates when the shortest list runs out.=20 ++ specification to allow the arguments to be of unequal length; ++ it terminates when the shortest list runs out. ++

    +

    + At least one of the argument lists must be finite: +-

    +-(map + '(3 1 4 1) (circular-list 1 0)) =3D> (4 1 5 1)
    ++

    ++
    ++(map + '(3 1 4 1) (circular-list 1 0)) =3D> (4 1 5 1)
    + 
    +- ++
    + +-
    ++
    + +-for-each proc clist1 clist<= sub>2 ... -> unspecified +-
    ++for-each proc clist1 clis= t2 ... -> unspecified ++ ++
    ++

    + [R5RS+] +- +- The arguments to for-each are like the arguments to=20 ++

    ++

    ++ The arguments to for-each are like the arguments to + map, but + for-each calls proc for its side effects rat= her +- than for its values.=20=20 +- Unlike map, for-each is guaranteed to call= =20 ++ than for its values. ++ Unlike map, for-each is guaranteed to call + proc on the elements of the lists in order from the first +- element(s) to the last,=20 ++ element(s) to the last, + and the value returned by for-each is unspecified. +-

    ++

    ++
    + (let ((v (make-vector 5)))
    +   (for-each (lambda (i)
    +               (vector-set! v i (* i i)))
    +             '(0 1 2 3 4))
    +-  v)  =3D>  #(0 1 4 9 16)
    ++  v)  =3D>  #(0 1 4 9 16)
    + 
    +-=20=20=20=20 ++

    + This procedure is extended from its + R5RS= +- specification to allow the arguments to be of unequal length;=20 +- it terminates when the shortest list runs out.=20 ++ specification to allow the arguments to be of unequal length; ++ it terminates when the shortest list runs out. ++

    +

    + At least one of the argument lists must be finite. +- ++

    ++
    + +-
    ++
    + +-append-map  f clist1 clist2 ... -> value +-
    ++append-map  f clist1<= /sub> clist2 ... -> value ++
    ++
    + +-append-map! f clist1 c= list2 ... -> value +-
    +- Equivalent to=20 +-
    ++append-map! f clist1= clist2 ... -> value ++ ++
    ++

    ++ Equivalent to ++

    ++
    + (apply append (map f clist1 clist<= sub>2 ...)) +
    ++

    + and +-

    ++

    ++
    + (apply append! (map f clist1 clist<= sub>2 ...)) +
    +- ++

    + Map f over the elements of the lists, just as in the map function. + However, the results of the applications are appended together to + make the final result. append-map uses append to append the results + together; append-map! uses append!. ++

    +

    + The dynamic order in which the various applications of f a= re made is + not specified. ++

    +

    + Example: +-

    ++

    ++
    + (append-map! (lambda (x) (list x (- x))) '(1 3 8))
    +     =3D> (1 -1 3 -3 8 -8)
    + 
    +- ++

    + At least one of the list arguments must be finite. +- ++

    ++
    + +-
    ++
    + +-map! f list1 clist2 ... -> list +-
    +- Linear-update variant of map -- map! is all= owed, but not required, to=20 ++map! f list1 clist2<= /sub> ... -> list ++ ++
    ++

    ++ Linear-update variant of map -- map! is all= owed, but not required, to + alter the cons cells of list1 to construct the = result list. ++

    +

    + The dynamic order in which the various applications of f a= re made is + not specified. +-=20=20=20=20 ++

    ++

    + In the n-ary case, clist2, clist3, ... must have at least as many + elements as list1. +- ++

    ++
    + +-
    ++
    + +-map-in-order f clist1<= /sub> clist2 ... -> list +-
    ++map-in-order f clist= 1 clist2 ... -> list ++ ++
    ++

    + A variant of the map procedure that guarantees to apply = f across + the elements of the listi arguments in a left-t= o-right order. This + is useful for mapping procedures that both have side effects and + return useful values. ++

    +

    + At least one of the list arguments must be finite. +- ++

    ++
    + +-
    ++
    + +-pair-for-each f clist1 clis= t2 ... -> unspecific +-
    ++pair-for-each f clist1 cl= ist2 ... -> unspecific ++ ++
    ++

    + Like for-each, but f is applied to successive= sublists of the argument + lists. That is, f is applied to the cons cells of the list= s, rather + than the lists' elements. These applications occur in left-to-right + order. ++

    +

    + The f procedure may reliably apply set-cdr! t= o the pairs it is given + without altering the sequence of execution. +- +-

    ++

    ++
    + (pair-for-each (lambda (pair) (display pair) (newline)) '(a b c)) =3D=3D&=
    gt;
    +     (a b c)
    +     (b c)
    +     (c)
    + 
    +- ++

    + At least one of the list arguments must be finite. +- ++

    ++
    + +-
    ++
    + +-filter-map f clist1 clist2 ... -> list +-
    ++filter-map f clist1 clist= 2 ... -> list ++ ++
    ++

    + Like map, but only true values are saved. +-

    ++

    ++
    + (filter-map (lambda (x) (and (number? x) (* x x))) '(a 1 b 3 c 7))
    +     =3D> (1 9 49)
    + 
    ++

    + The dynamic order in which the various applications of f a= re made is + not specified. ++

    +

    + At least one of the list arguments must be finite. ++

    ++
    +
    +=20 + +-

    Filtering & partitioning ++

    Filtering & partitioning

    +
    +=20 + +-
    ++
    + +-filter pred list -> list +-
    ++filter pred list -> list ++ ++
    ++

    + Return all the elements of list that satisfy predicate pred. + The list is not disordered -- elements that appear in the result list + occur in the same order as they occur in the argument list. + The returned list may share a common tail with the argument list. + The dynamic order in which the various applications of pred are made is + not specified. +-=20=20=20=20 +-

    ++

    ++
    + (filter even? '(0 7 8 8 43 -4)) =3D> (0 8 8 -4)
    + 
    +- ++
    + +-
    ++
    + +-partition pred list -> [list list]<= /var> +-
    ++partition pred list -> [list list= ] ++ ++
    ++

    + Partitions the elements of list with predicate pred, and returns two + values: the list of in-elements and the list of out-elements. + The list is not disordered -- elements occur in the result lists +@@ -2123,71 +2435,88 @@ Otherwise, return (fold f (car= list) (cdr li + The dynamic order in which the various applications of pred are made is + not specified. One of the returned lists may share a common tail with= the + argument list. +- +-

    +-(partition symbol? '(one 2 3 four five 6)) =3D>=20
    ++

    ++
    ++(partition symbol? '(one 2 3 four five 6)) =3D>
    +     (one four five)
    +     (2 3 6)
    + 
    +- ++
    + +-
    ++
    + +-remove pred list -> list +-
    ++remove pred list -> list ++ ++
    ++

    + Returns list without the elements that satisfy predicate <= var>pred: +-

    ++

    ++
    + (lambda (pred list) (filter (lambda (x) (not (pred x))) list))
    + 
    ++

    + The list is not disordered -- elements that appear in the result list + occur in the same order as they occur in the argument list. + The returned list may share a common tail with the argument list. +- The dynamic order in which the various applications of pred are made is=20 ++ The dynamic order in which the various applications of pred are made is + not specified. +-=20=20=20=20 +-

    ++

    ++
    + (remove even? '(0 7 8 8 43 -4)) =3D> (7 43)
    + 
    +- ++
    + +-
    ++
    + +-filter!    pred li= st -> list +-
    ++filter!    pred = list -> list ++
    ++
    + +-partition! pred list -> [list = list] +-
    ++partition! pred list -> [lis= t list] ++
    ++
    + +-remove!    pred li= st -> list +-
    ++remove!    pred = list -> list ++ ++
    ++

    + Linear-update variants of filter, partition= and remove. + These procedures are allowed, but not required, to alter the cons cel= ls + in the argument list to construct the result lists. +- ++

    ++
    +
    +=20 + +-

    Searching

    +-

    ++

    Searching

    +=20 ++

    + The following procedures all search lists for a leftmost element satisfyi= ng + some criteria. This means they do not always examine the entire list; thu= s, + there is no efficient way for them to reliably detect and signal an error= when + passed a dotted or circular list. Here are the general rules describing h= ow + these procedures work when applied to different kinds of lists: ++

    +=20 +
    +-
    Proper lists:=20 +-
    The standard, canonical behavior happens in this case. +- +-
    Dotted lists:=20 +-
    It is an error to pass these procedures a dotted list ++
    Proper lists: ++
    ++
    ++

    ++ The standard, canonical behavior happens in this case. ++

    ++
    ++
    Dotted lists: ++
    ++
    ++

    ++ It is an error to pass these procedures a dotted list + that does not contain an element satisfying the search + criteria. That is, it is an error if the procedure has + to search all the way to the end of the dotted list. +@@ -2200,23 +2529,31 @@ these procedures work when applied to different ki= nds of lists: + which is compliant with this SRFI may not rely on any + particular behavior. Future SRFI's may refine SRFI-1 + to define specific behavior in this case. +-

    ++

    ++

    + In brief, SRFI-1 compliant code may not pass a dotted + list argument to these procedures. +- +-

    Circular lists:=20 +-
    It is an error to pass these procedures a circular list ++

    ++
    ++
    Circular lists: ++
    ++
    ++

    ++ It is an error to pass these procedures a circular list + that does not contain an element satisfying the search +- criteria. Note that the procedure is not required to=20 ++ criteria. Note that the procedure is not required to + detect this case; it may simply diverge. It is, however, + acceptable to search a circular list if the search = is + successful -- that is, if the list contains an ele= ment + satisfying the search criteria. ++

    ++
    +
    +

    + Here are some examples, using the find and any = procedures as canonical + representatives: +-

    ++

    ++
    + ;; Proper list -- success
    + (find even? '(1 2 3))	=3D> 2
    + (any  even? '(1 2 3))	=3D> #t
    +@@ -2230,7 +2567,7 @@ representatives:
    + (any  even? '(1 3 . x))	=3D> error
    +=20
    + ;; The dotted list contains an element satisfying the search.
    +-;; This case is not specified -- it could be success, an error,=20
    ++;; This case is not specified -- it could be success, an error,
    + ;; or some third possibility.
    + (find even? '(1 2 . x))	=3D> error/undefined
    + (any  even? '(1 2 . x))	=3D> error/undefined ; success, error or other.
    +@@ -2248,17 +2585,19 @@ representatives:
    + 
    +-
    ++
    + +-find pred clist -> value +-
    ++find pred clist -> value ++ ++
    ++

    + Return the first element of clist that satisfies predicate= pred; + false if no element does. +- +-

    ++

    ++
    + (find even? '(3 1 4 1 5 9)) =3D> 4
    + 
    +- ++

    + Note that find has an ambiguity in its lookup semantics = -- if find + returns #f, you cannot tell (in general) if it found a <= code>#f element + that satisfied pred, or if it did not find any element at = all. In +@@ -2267,145 +2606,168 @@ representatives: + guaranteed to have an element satisfying pred. However, in= cases + where this ambiguity can arise, you should use find-tail= instead of + find -- find-tail has no such ambiguity: +-

    ++

    ++
    + (cond ((find-tail pred lis) =3D> (lambda (pair) ...)) ; Handle (CAR PA=
    IR)
    +       (else ...)) ; Search failed.
    + 
    +- ++
    + +-
    ++
    + +-find-tail pred clist -> pair or fal= se +-
    ++find-tail pred clist -> pair or f= alse ++ ++
    ++

    + Return the first pair of clist whose car satisfies pr= ed. If no pair does, + return false. ++

    +

    + find-tail can be viewed as a general-predicate variant o= f the member + function. ++

    +

    +- Examples:=20 +-

    ++    Examples:
    ++

    ++
    + (find-tail even? '(3 1 37 -8 -5 0 0)) =3D> (-8 -5 0 0)
    + (find-tail even? '(3 1 37 -5)) =3D> #f
    +=20
    + ;; MEMBER X LIS:
    + (find-tail (lambda (elt) (equal? x elt)) lis)
    + 
    +- ++

    + In the circular-list case, this procedure "rotates" the list. +- ++

    +

    +- Find-tail is essentially drop-while,=20 +- where the sense of the predicate is inverted:=20 ++ Find-tail is essentially drop-while, ++ where the sense of the predicate is inverted: + Find-tail searches until it finds an element satisfying +- the predicate; drop-while searches until it finds an=20 ++ the predicate; drop-while searches until it finds an + element that doesn't satisfy the predicate. +- ++

    ++
    + +-
    ++
    + +-take-while  pred clist -> list= +-
    ++take-while  pred clist -> li= st ++
    ++
    + +-take-while! pred clist -> list +-
    +- ++take-while! pred clist -> list ++ ++
    ++

    + Returns the longest initial prefix of clist whose elements all + satisfy the predicate pred. +- ++

    +

    + Take-while! is the linear-update variant. It is allowed, but= not + required, to alter the argument list to produce the result. +- +-

    +-(take-while even? '(2 18 3 10 22 9)) =3D> (2 18)
    ++

    ++
    ++(take-while even? '(2 18 3 10 22 9)) =3D> (2 18)
    + 
    +- ++
    + +-
    ++
    + +-drop-while pred clist -> list +-
    ++drop-while pred clist -> list ++ ++
    ++

    + Drops the longest initial prefix of clist whose elements all + satisfy the predicate pred, and returns the rest of the list. +- +-

    +-(drop-while even? '(2 18 3 10 22 9)) =3D> (3 10 22 9)
    ++

    ++
    ++(drop-while even? '(2 18 3 10 22 9)) =3D> (3 10 22 9)
    + 
    ++

    + The circular-list case may be viewed as "rotating" the list. +- ++

    ++
    +=20 + +-
    ++
    + +-span   pred clist -> [lis= t clist] +-
    ++span   pred clist -> [l= ist clist] ++
    ++
    + +-span!  pred list  -> [lis= t list] +-
    ++span!  pred list  -> [l= ist list] ++
    ++
    + +-break  pred clist -> [list cli= st] +-
    ++break  pred clist -> [list c= list] ++
    ++
    + +-break! pred list  -> [list lis= t] +-
    +- ++break! pred list  -> [list l= ist] ++ ++
    ++

    + Span splits the list into the longest initial prefix whose +-elements all satisfy pred, and the remaining tail.=20 +-Break inverts the sense of the predicate:=20 ++elements all satisfy pred, and the remaining tail. ++Break inverts the sense of the predicate: + the tail commences with the first element of the input list + that satisfies the predicate. +- ++

    +

    +-In other words:=20 +-span finds the initial span of elements=20 +-satisfying pred,=20 +-and break breaks the list at the first element satisfying=20 ++In other words: ++span finds the intial span of elements ++satisfying pred, ++and break breaks the list at the first element satisfying + pred. +- ++

    +

    +-Span is equivalent to=20 +-

    +-(values (take-while pred clist)=20
    ++Span is equivalent to
    ++

    ++
    ++(values (take-while pred clist)
    +         (drop-while pred clist))
    + 
    +- +

    +-Span! and break! are the linear-update variants= .=20 +-They are allowed, but not required,=20 ++Span! and break! are the linear-update variants. ++They are allowed, but not required, + to alter the argument list to produce the result. +- +-

    +-(span even? '(2 18 3 10 22 9)) =3D>
    ++

    ++
    ++(span even? '(2 18 3 10 22 9)) =3D>
    +   (2 18)
    +   (3 10 22 9)
    +=20
    +-(break even? '(3 1 4 1 5 9)) =3D>
    ++(break even? '(3 1 4 1 5 9)) =3D>
    +   (3 1)
    +   (4 1 5 9)
    + 
    +- ++
    +=20 + +-
    ++
    + +-any pred clist1 clist2= ... -> value +-
    ++any pred clist1 clist2 ... -> value ++ ++
    ++

    + Applies the predicate across the lists, returning true if the predica= te + returns true on any application. ++

    +

    + If there are n list arguments clist1= ... clistn, then pred must be a +- procedure taking n arguments and returning a boolean resul= t. ++ procedure taking n arguments ++ and returning a single value, interpreted as a boolean (that is, ++ #f means false, and any other value means true). ++

    +

    + any applies pred to the first elements of the= clisti parameters. + If this application returns a true value, any immediatel= y returns +@@ -2413,37 +2775,45 @@ to alter the argument list to produce the result. + elements of the clisti parameters, then the thi= rd, and so forth. + The iteration stops when a true value is produced or one of the lists= runs + out of values; in +- the latter case, any returns #f.=20 ++ the latter case, any returns #f. + The application of pred to the last element of the + lists is a tail call. ++

    +

    + Note the difference between find and any --= find returns the element + that satisfied the predicate; any returns the true value= that the + predicate produced. ++

    +

    + Like every, any's name does not end with a = question mark -- this is to + indicate that it does not return a simple boolean (#t or= #f), but a + general value. +- +-

    ++

    ++
    + (any integer? '(a 3 b 2.7))   =3D> #t
    + (any integer? '(a 3.1 b 2.7)) =3D> #f
    + (any < '(3 1 4 1 5)
    +        '(2 7 1 8 2)) =3D> #t
    + 
    +- ++
    + +-
    ++
    + +-every pred clist1 clist2 ... -> value +-
    ++every pred clist1 clist2 ... -> value ++ ++
    ++

    + Applies the predicate across the lists, returning true if the predica= te + returns true on every application. ++

    +

    + If there are n list arguments clist1= ... clistn, then pred must be a +- procedure taking n arguments and returning a boolean resul= t. ++ procedure taking n arguments ++ and returning a single value, interpreted as a boolean (that is, ++ #f means false, and any other value means true). ++

    +

    + every applies pred to the first elements of t= he clisti parameters. + If this application returns false, every immediately ret= urns false. +@@ -2451,27 +2821,36 @@ to alter the argument list to produce the result. + clisti parameters, then the third, and so forth= . The iteration stops + when a false value is produced or one of the lists runs out of values. + In the latter case, every returns +- the true value produced by its final application of pred.= =20 +- The application of pred to the last element of the lists=20 ++ the true value produced by its final application of pred. ++ The application of pred to the last element of the lists + is a tail call. ++

    +

    + If one of the clisti has no elements, eve= ry simply returns #t. ++

    +

    + Like any, every's name does not end with a = question mark -- this is to + indicate that it does not return a simple boolean (#t or= #f), but a + general value. +- ++

    ++
    + +-
    ++
    + +-list-index pred clist1 clis= t2 ... -> integer or false +-
    ++list-index pred clist1 cl= ist2 ... -> integer or false ++ ++
    ++

    + Return the index of the leftmost element that satisfies pred. ++

    +

    + If there are n list arguments clist1= ... clistn, then pred must be a +- function taking n arguments and returning a boolean result. ++ function taking n arguments ++ and returning a single value, interpreted as a boolean (that is, ++ #f means false, and any other value means true). ++

    +

    + list-index applies pred to the first elements= of the clisti parameters. + If this application returns true, list-index immediately= returns zero. +@@ -2479,139 +2858,154 @@ to alter the argument list to produce the result. + clisti parameters, then the third, and so forth= . When it finds a tuple of + list elements that cause pred to return true, it stops and= returns the + zero-based index of that position in the lists. ++

    +

    + The iteration stops when one of the lists runs out of values; in this + case, list-index returns #f. +- +-

    ++

    ++
    + (list-index even? '(3 1 4 1 5 9)) =3D> 2
    + (list-index < '(3 1 4 1 5 9 2 5 6) '(2 7 1 8 2)) =3D> 1
    + (list-index =3D '(3 1 4 1 5 9 2 5 6) '(2 7 1 8 2)) =3D> #f
    + 
    +- ++
    + +-
    ++
    + +-member x list [=3D] -> list +-
    ++member x list [=3D] -> list ++
    ++
    + +-memq x list -> list +-
    ++memq x list -> list ++
    ++
    + +-memv x list -> list +-
    +- [R5RS+] +- ++memv x list -> list ++ ++
    ++

    ++ [R5RS+] + These procedures return the first sublist of list whose ca= r is +- x, where the sublists of list are the=20 +- non-empty lists returned by=20 ++ x, where the sublists of list are the ++ non-empty lists returned by + (drop list i) +- for i less than the length of list.=20=20 ++ for i less than the length of list. + If x does +- not occur in list, then #f is returned.=20=20 ++ not occur in list, then #f is returned. + memq uses eq? to compare x +- with the elements of list,=20 ++ with the elements of list, + while memv uses eqv?, and + member uses equal?. +- +-

    +-    (memq 'a '(a b c))          =3D>  (a b c)
    +-    (memq 'b '(a b c))          =3D>  (b c)
    +-    (memq 'a '(b c d))          =3D>  #f
    +-    (memq (list 'a) '(b (a) c)) =3D>  #f
    ++

    ++
    ++    (memq 'a '(a b c))          =3D>  (a b c)
    ++    (memq 'b '(a b c))          =3D>  (b c)
    ++    (memq 'a '(b c d))          =3D>  #f
    ++    (memq (list 'a) '(b (a) c)) =3D>  #f
    +     (member (list 'a)
    +-            '(b (a) c))         =3D>  ((a) c)
    +-    (memq 101 '(100 101 102))   =3D>  *unspecified*
    +-    (memv 101 '(100 101 102))   =3D>  (101 102)
    ++            '(b (a) c))         =3D>  ((a) c)
    ++    (memq 101 '(100 101 102))   =3D>  *unspecified*
    ++    (memv 101 '(100 101 102))   =3D>  (101 102)
    + 
    +- +- member is extended from its=20 ++

    ++ member is extended from its + R5RS= + definition to allow the client to pass in +- an optional equality procedure =3D used to compare keys.=20 ++ an optional equality procedure =3D used to compare keys. +=20 ++

    +

    + The comparison procedure is used to compare the elements ei= of list + to the key x in this way: +-

    ++

    ++
    + (=3D x ei) ; list is (E1 ... En) +
    ++

    + That is, the first argument is always x, and the second ar= gument is + one of the list elements. Thus one can reliably find the first element + of list that is greater than five with + (member 5 list <) +- ++

    +

    + Note that fully general list searching may be performed with + the find-tail and find procedures, e.g.= +-

    ++

    ++
    + (find-tail even? list) ; Find the first elt with an even key.
    + 
    +- ++
    + +=20 + +-

    Deletion

    +-

    ++

    Deletion

    +=20 +
    + +-
    ++
    + +-delete  x list [=3D] -> l= ist +-
    ++delete  x list [=3D] ->= list ++
    ++
    + +-delete! x list [=3D] -> list +-
    ++delete! x list [=3D] -> list= ++ ++
    ++

    + delete uses the comparison procedure =3D, which defaults= to equal?, to find + all elements of list that are equal to x, and d= eletes them from list. The + dynamic order in which the various applications of =3D are= made is not + specified. +- ++

    +

    + The list is not disordered -- elements that appear in the result list + occur in the same order as they occur in the argument list. + The result may share a common tail with the argument list. +- ++

    +

    + Note that fully general element deletion can be performed with the remove + and remove! procedures, e.g.: +-

    ++

    ++
    + ;; Delete all the even elements from LIS:
    + (remove even? lis)
    + 
    +- ++

    + The comparison procedure is used in this way: + (=3D x ei). +- That is, x is always the first argument,=20 ++ That is, x is always the first argument, + and a list element is always the + second argument. The comparison procedure will be used to compare each + element of list exactly once; the order in which it is app= lied to the + various ei is not specified. Thus, one can rel= iably remove all the + numbers greater than five from a list with + (delete 5 list <) +- ++

    +

    + delete! is the linear-update variant of delete. + It is allowed, but not required, to alter the cons cells in +- its argument list to construct the result.=20=20=20=20 +- ++ its argument list to construct the result. ++

    ++
    + +-
    ++
    + +-delete-duplicates  list [=3D= ] -> list +-
    ++delete-duplicates  list [= =3D] -> list ++
    ++
    + +-delete-duplicates! list [=3D] -&g= t; list +-
    ++delete-duplicates! list [=3D] -= > list ++ ++
    ++

    + delete-duplicates removes duplicate elements from the + list argument. + If there are multiple equal elements in the argument list, the result= list +@@ -2619,19 +3013,22 @@ to alter the argument list to produce the result. + The order of these surviving elements is the same as in the original + list -- delete-duplicates does not disorder the list (he= nce it is useful + for "cleaning up" association lists). ++

    +

    + The =3D parameter is used to compare the elements of the l= ist; it defaults +- to equal?. If x comes before y in = list, then the comparison is performed=20 ++ to equal?. If x comes before y in = list, then the comparison is performed + (=3D x y). +- The comparison procedure will be used to compare each pair of element= s in=20 +- list no more than once;=20 ++ The comparison procedure will be used to compare each pair of element= s in ++ list no more than once; + the order in which it is applied to the various pairs is not specifie= d. ++

    +

    + Implementations of delete-duplicates + are allowed to share common tails + between argument and result lists -- for example, if the list argument + contains only unique elements, it may simply return exactly + this list. ++

    +

    + Be aware that, in general, delete-duplicates + runs in time O(n2) for n-element lists. +@@ -2639,12 +3036,13 @@ to alter the argument list to produce the result. + the list to bring equal elements together, then using a linear-time + algorithm to remove equal elements. Alternatively, one can use algori= thms + based on element-marking, with linear-time results. +- ++

    +

    + delete-duplicates! is the linear-update variant of delete-duplicates; it + is allowed, but not required, to alter the cons cells in its argument + list to construct the result. +-

    ++

    ++
    + (delete-duplicates '(a b a c a b c z)) =3D> (a b c z)
    +=20
    + ;; Clean up an alist:
    +@@ -2652,124 +3050,143 @@ to alter the argument list to produce the result.
    +                    (lambda (x y) (eq? (car x) (car y))))
    +     =3D> ((a . 3) (b . 7) (c . 1))
    + 
    ++
    +
    +=20 + +-

    Association lists

    ++

    Association lists

    +

    + An "association list" (or "alist") is a list of pairs. The car of each pa= ir + contains a key value, and the cdr contains the associated data value. The= y can + be used to construct simple look-up tables in Scheme. Note that associati= on + lists are probably inappropriate for performance-critical use on large da= ta; + in these cases, hash tables or some other alternative should be employed. +- ++

    +
    + +-
    ++
    + +-assoc key alist [=3D] -> pair or #f= +-
    ++assoc key alist [=3D] -> pair or = #f ++
    ++
    + +-assq key alist -> pair or #f +-
    ++assq key alist -> pair or #f ++
    ++
    + +-assv key alist -> pair or #f +-
    +- +- [R5RS+] +- alist must be an association list -- a list of pairs.=20=20 ++assv key alist -> pair or #f ++ ++
    ++

    ++ [R5RS+] ++ alist must be an association list -- a list of pairs. + These procedures +- find the first pair in alist whose car field is key,=20 +- and returns that pair.=20=20 +- If no pair in alist has key as its car,=20 +- then #f is returned.=20=20 +- assq uses eq? to compare key=20 +- with the car fields of the pairs in alist,=20 +- while assv uses eqv?=20 ++ find the first pair in alist whose car field is key, ++ and returns that pair. ++ If no pair in alist has key as its car, ++ then #f is returned. ++ assq uses eq? to compare key ++ with the car fields of the pairs in alist, ++ while assv uses eqv? + and assoc uses equal?. +-

    ++

    ++
    + (define e '((a 1) (b 2) (c 3)))
    +-(assq 'a e)                            =3D>  (a 1)
    +-(assq 'b e)                            =3D>  (b 2)
    +-(assq 'd e)                            =3D>  #f
    +-(assq (list 'a) '(((a)) ((b)) ((c))))  =3D>  #f
    +-(assoc (list 'a) '(((a)) ((b)) ((c)))) =3D>  ((a))
    +-(assq 5 '((2 3) (5 7) (11 13)))	   =3D>  *unspecified*
    +-(assv 5 '((2 3) (5 7) (11 13)))	   =3D>  (5 7)
    ++(assq 'a e)                            =3D>  (a 1)
    ++(assq 'b e)                            =3D>  (b 2)
    ++(assq 'd e)                            =3D>  #f
    ++(assq (list 'a) '(((a)) ((b)) ((c))))  =3D>  #f
    ++(assoc (list 'a) '(((a)) ((b)) ((c)))) =3D>  ((a))
    ++(assq 5 '((2 3) (5 7) (11 13)))	   =3D>  *unspecified*
    ++(assv 5 '((2 3) (5 7) (11 13)))	   =3D>  (5 7)
    + 
    +- +- assoc is extended from its=20 +-
    R5RS= =20 ++

    ++ assoc is extended from its ++ R5RS= + definition to allow the client to pass in + an optional equality procedure =3D used to compare keys. +- ++

    +

    + The comparison procedure is used to compare the elements ei= of list + to the key parameter in this way: +-

    ++

    ++
    + (=3D key (car ei)) ; list is (E1 ... En) +
    +- That is, the first argument is always key,=20 +- and the second argument is one of the list elements.=20 ++

    ++ That is, the first argument is always key, ++ and the second argument is one of the list elements. + Thus one can reliably find the first entry + of alist whose key is greater than five with + (assoc 5 alist <) +-=20=20=20=20=20 ++

    +

    + Note that fully general alist searching may be performed with + the find-tail and find procedures, e.g.= +-

    ++

    ++
    + ;; Look up the first association in alist with an even key:
    + (find (lambda (a) (even? (car a))) alist)
    + 
    +- ++
    +=20 + +-
    ++
    + +-alist-cons key datum alist -> alist= +-
    ++alist-cons key datum alist -> ali= st ++ ++
    +
    + (lambda (key datum alist) (cons (cons key datum) alist))
    + 
    ++

    + Cons a new alist entry mapping key -> datum = onto alist. +- ++

    ++
    + +-
    ++
    + +-alist-copy alist -> alist +-
    ++alist-copy alist -> alist ++ ++
    ++

    + Make a fresh copy of alist. This means copying each pair t= hat + forms an association as well as the spine of the list, i.e. ++

    +
    + (lambda (a) (map (lambda (elt) (cons (car elt) (cdr elt))) a))
    + 
    +- ++
    + +-
    ++
    + +-alist-delete  key alist [=3D= ] -> alist +-
    ++alist-delete  key alist [= =3D] -> alist ++
    ++
    + +-alist-delete! key alist [=3D] -&g= t; alist +-
    +- alist-delete deletes all associations from alist with the given key,=20 +- using key-comparison procedure =3D, which defaults to equal?.=20 +- The dynamic order in which the various applications of =3D= are made is not=20 +- specified.=20 ++alist-delete! key alist [=3D] -= > alist ++ ++
    ++

    ++ alist-delete deletes all associations from alist with the given key, ++ using key-comparison procedure =3D, which defaults to equal?. ++ The dynamic order in which the various applications of =3D= are made is not ++ specified. ++

    +

    + Return values may share common tails with the alist argume= nt. + The alist is not disordered -- elements that appear in the result ali= st + occur in the same order as they occur in the argument alist. ++

    +

    + The comparison procedure is used to compare the element keys ki of alist's + entries to the key parameter in this way: +@@ -2777,366 +3194,427 @@ in these cases, hash tables or some other altern= ative should be employed. + Thus, one can reliably remove all entries of alist whose k= ey is greater + than five with + (alist-delete 5 alist <) ++

    +

    + alist-delete! is the linear-update variant of alis= t-delete. + It is allowed, but not required, + to alter cons cells from the alist parameter to construct = the result. +- ++

    ++
    +
    +=20 +- + +-

    Set operations on lists

    ++

    Set operations on lists

    +

    + These procedures implement operations on sets represented as lists of ele= ments. +-They all take an =3D argument used to compare elements of list= s.=20 +-This equality procedure is required to be consistent with eq?.=20 ++They all take an =3D argument used to compare elements of list= s. ++This equality procedure is required to be consistent with eq?. + That is, it must be the case that +-

    +- (eq? x y) =3D> (=3D= x y). ++

    ++
    ++ (eq? x y) =3D> (= =3D x y). +
    ++

    + Note that this implies, in turn, that two lists that are eq?= are + also set-equal by any legal comparison procedure. This allows for + constant-time determination of set operations on eq? lists. +- ++

    +

    +-Be aware that these procedures typically run in time=20 +-O(n * m)=20 +-for n- and m-element list arguments.=20=20 ++Be aware that these procedures typically run in time ++O(n * m) ++for n- and m-element list arguments. + Performance-critical applications + operating upon large sets will probably wish to use other data + structures and algorithms. +- ++

    +
    + +-
    +- +-lset<=3D =3D list1 ... -= > boolean +-
    ++
    ++ ++lset<=3D =3D list1 ...= -> boolean ++
    ++
    ++

    + Returns true iff every listi is a subset of listi+1, using =3D for +- the element-equality procedure.=20 ++ the element-equality procedure. + List A is a subset of list B if every +- element in A is equal to some element of B.=20 +- When performing an element comparison,=20 ++ element in A is equal to some element of B. ++ When performing an element comparison, + the =3D procedure's first argument is an element + of A; its second, an element of B. +-

    ++

    ++
    + (lset<=3D eq? '(a) '(a b a) '(a b c c)) =3D> #t
    +=20
    +-(lset<=3D eq?) =3D> #t             ; Trivial cases
    +-(lset<=3D eq? '(a)) =3D> #t
    ++(lset<=3D eq?) =3D> #t             ; Trivial cases
    ++(lset<=3D eq? '(a)) =3D> #t
    + 
    +- ++
    + +-
    ++
    + +-lset=3D =3D list1 list= 2 ... -> boolean +-
    ++lset=3D =3D list1 list2 ... -> boolean ++ ++
    ++

    + Returns true iff every listi is set-equal to listi+1, using =3D for + the element-equality procedure. "Set-equal" simply means that + listi is a subset of listi+1, and listi+1 is a subset of listi= . + The =3D procedure's first argument is an element of l= isti; its second is an element of + listi+1. +-

    ++

    ++
    + (lset=3D eq? '(b e a) '(a e b) '(e e b a)) =3D> #t
    +=20
    +-(lset=3D eq?) =3D> #t               ; Trivial cases
    +-(lset=3D eq? '(a)) =3D> #t
    ++(lset=3D eq?) =3D> #t               ; Trivial cases
    ++(lset=3D eq? '(a)) =3D> #t
    + 
    +=20 ++

    ++Note added on 2020-06-02: ++The reference (sample) implementation ++had a bug that reversed the arguments to =3D. The ++implementation has been corrected to match the text above. ++

    ++
    + +-
    ++
    + +-lset-adjoin =3D list elt1 .= .. -> list +-
    +- Adds the elti elements not already in the list = parameter to the=20 ++lset-adjoin =3D list elt1= ... -> list ++ ++
    ++

    ++ Adds the elti elements not already in the list = parameter to the + result list. The result shares a common tail with the list parameter. + The new elements are added to the front of the list, but no guarantees + are made about their order. The =3D parameter is an equali= ty procedure +- used to determine if an elti is already a membe= r of list. Its first=20 ++ used to determine if an elti is already a membe= r of list. Its first + argument is an element of list; its second is one of the <= var>elti. ++

    +

    + The list parameter is always a suffix of the result -- even if the li= st + parameter contains repeated elements, these are not reduced. +-

    ++

    ++
    + (lset-adjoin eq? '(a b c d c e) 'a 'e 'i 'o 'u) =3D> (u o i a b c d c =
    e)
    + 
    +- ++
    + +-
    ++
    + +-lset-union =3D list1 ... -&= gt; list +-
    ++lset-union =3D list1 ... = -> list ++ ++
    ++

    + Returns the union of the lists, using =3D for the element-= equality + procedure. ++

    +

    + The union of lists A and B is constructed as fo= llows: ++

    +
      +-
    • If A is the empty list,=20 ++
    • If A is the empty list, + the answer is B (or a copy of B). +-
    • Otherwise, the result is initialised to be list A= =20 ++
    • Otherwise, the result is initialised to be list A<= /var> + (or a copy of A). +-
    • Proceed through the elements of list B=20 ++
    • Proceed through the elements of list B + in a left-to-right order. +- If b is such an element of B,=20 +- compare every element r of the current result lis= t=20 +- to b:=20 +- (=3D r b).=20 +- If all comparisons fail,=20 ++ If b is such an element of B, ++ compare every element r of the current result list ++ to b: ++ (=3D r b). ++ If all comparisons fail, + b is consed onto the front of the result. +-
    ++ ++

    + However, there is no guarantee that =3D will be applied to every pair +- of arguments from A and B.=20 +- In particular, if A is eq? to B,=20 ++ of arguments from A and B. ++ In particular, if A is eq? to B, + the operation may immediately terminate. +- ++

    +

    + In the n-ary case, the two-argument list-union operation is simply + folded across the argument lists. +- +-

    +-(lset-union eq? '(a b c d e) '(a e i o u)) =3D>=20
    ++

    ++
    ++(lset-union eq? '(a b c d e) '(a e i o u)) =3D>
    +     (u o i a b c d e)
    +=20
    + ;; Repeated elements in LIST1 are preserved.
    +-(lset-union eq? '(a a c) '(x a x)) =3D> (x a a c)
    ++(lset-union eq? '(a a c) '(x a x)) =3D> (x a a c)
    +=20
    + ;; Trivial cases
    +-(lset-union eq?) =3D> ()
    +-(lset-union eq? '(a b c)) =3D> (a b c)
    ++(lset-union eq?) =3D> ()
    ++(lset-union eq? '(a b c)) =3D> (a b c)
    + 
    +- ++
    + +-
    ++
    + +-lset-intersection =3D list1= list2 ... -> list +-
    +- Returns the intersection of the lists,=20 ++lset-intersection =3D list1 list2 ... -> list ++ ++
    ++

    ++ Returns the intersection of the lists, + using =3D for the element-equality procedure. ++

    +

    + The intersection of lists A and B +- is comprised of every element of A that is =3D= =20 +- to some element of B:=20 +- (=3D a b),=20 ++ is comprised of every element of A that is =3D ++ to some element of B: ++ (=3D a b), + for a in A, and b in B. +- Note this implies that an element which appears in B=20 ++ Note this implies that an element which appears in B + and multiple times in list A + will also appear multiple times in the result. ++

    +

    + The order in which elements appear in the result is the same as +- they appear in list1 --=20 +- that is, lset-intersection essentially filters=20 +- list1,=20 +- without disarranging element order.=20 ++ they appear in list1 -- ++ that is, lset-intersection essentially filters ++ list1, ++ without disarranging element order. + The result may + share a common tail with list1. ++

    +

    + In the n-ary case, the two-argument list-intersection operation is si= mply + folded across the argument lists. However, the dynamic order in which= the +- applications of =3D are made is not specified.=20 ++ applications of =3D are made is not specified. + The procedure may check an +- element of list1 for membership=20 ++ element of list1 for membership + in every other list before proceeding to +- consider the next element of list1,=20 ++ consider the next element of list1, + or it may completely intersect list1 +- and list2=20 +- before proceeding to list3,=20 ++ and list2 ++ before proceeding to list3, + or it may go about its work in some third order. +- +-

    ++

    ++
    + (lset-intersection eq? '(a b c d e) '(a e i o u)) =3D> (a e)
    +=20
    + ;; Repeated elements in LIST1 are preserved.
    +-(lset-intersection eq? '(a x y a) '(x a x z)) =3D> '(a x a)
    ++(lset-intersection eq? '(a x y a) '(x a x z)) =3D> '(a x a)
    +=20
    +-(lset-intersection eq? '(a b c)) =3D> (a b c)     ; Trivial case
    ++(lset-intersection eq? '(a b c)) =3D> (a b c)     ; Trivial case
    + 
    +- ++
    + +-
    ++
    + +-lset-difference =3D list1 l= ist2 ... -> list +-
    ++lset-difference =3D list1= list2 ... -> list ++ ++
    ++

    + Returns the difference of the lists, using =3D for the ele= ment-equality + procedure -- all the elements of list1 that are= not + =3D to any element from one of the +- other listi parameters.=20 ++ other listi parameters. ++

    +

    +- The =3D procedure's first argument is=20 +- always an element of list1;=20 ++ The =3D procedure's first argument is ++ always an element of list1; + its second is an element of one of the other listi. +- Elements that are repeated multiple times in the=20 +- list1 parameter=20 +- will occur multiple times in the result.=20 ++ Elements that are repeated multiple times in the ++ list1 parameter ++ will occur multiple times in the result. +=20 + The order in which elements appear in the result is the same as +- they appear in list1 --=20 ++ they appear in list1 -- + that is, lset-difference essentially +- filters list1, without disarranging element ord= er.=20 +- The result may share a common tail with list1.= =20 ++ filters list1, without disarranging element ord= er. ++ The result may share a common tail with list1. +=20 + The dynamic order in which the applications of =3D are mad= e is not +- specified.=20 ++ specified. + The procedure may check an element of list1 + for membership in every other list before proceeding to consider the + next element of list1, +- or it may completely compute the difference of=20 ++ or it may completely compute the difference of + list1 and list2 before +- proceeding to list3,=20 ++ proceeding to list3, + or it may go about its work in some third order. +- +-

    ++

    ++
    + (lset-difference eq? '(a b c d e) '(a e i o u)) =3D> (b c d)
    +=20
    +-(lset-difference eq? '(a b c)) =3D> (a b c) ; Trivial case
    ++(lset-difference eq? '(a b c)) =3D> (a b c) ; Trivial case
    + 
    +- ++
    + +-
    ++
    + +-lset-xor =3D list1 ... ->= ; list +-
    +- Returns the exclusive-or of the sets,=20 +- using =3D for the element-equality procedure.=20 ++lset-xor =3D list1 ... -&= gt; list ++ ++
    ++

    ++ Returns the exclusive-or of the sets, ++ using =3D for the element-equality procedure. + If there are exactly two lists, this is all the elements + that appear in exactly one of the two lists. The operation is associa= tive, + and thus extends to the n-ary case -- the elements that appear in an + odd number of the lists. The result may share a common tail with any = of + the listi parameters. ++

    +

    +- More precisely, for two lists A and B,=20 ++ More precisely, for two lists A and B, + A xor B is a list of ++

    +
      +
    • every element a of A + such that there is no element b of B + such that (=3D a b), and +-
    • every element b of B=20 ++
    • every element b of B + such that there is no element a of A + such that (=3D b a). +-
    ++ ++

    + However, an implementation is allowed to assume that =3D is + symmetric -- that is, that +-

    +- (=3D a b) =3D>=20 ++

    ++
    ++ (=3D a b) =3D> + (=3D b a). +
    +- This means, for example, that if a comparison=20 ++

    ++ This means, for example, that if a comparison + (=3D a b) produces +- true for some a in A=20 ++ true for some a in A + and b in B, + both a and b may be removed from + inclusion in the result. ++

    +

    + In the n-ary case, the binary-xor operation is simply folded across + the lists. +- +-

    ++

    ++
    + (lset-xor eq? '(a b c d e) '(a e i o u)) =3D> (d c b i o u)
    +=20
    + ;; Trivial cases.
    +-(lset-xor eq?) =3D> ()
    +-(lset-xor eq? '(a b c d e)) =3D> (a b c d e)
    ++(lset-xor eq?) =3D> ()
    ++(lset-xor eq? '(a b c d e)) =3D> (a b c d e)
    + 
    +- ++
    +=20 + +-
    ++
    + +-lset-diff+intersection =3D list1<= /sub> list2 ... -> [list list] +-
    ++lset-diff+intersection =3D list= 1 list2 ... -> [list list] ++ ++
    ++

    + Returns two values -- the difference and the intersection of the list= s. +- Is equivalent to=20 +-

    ++    Is equivalent to
    ++

    ++
    + (values (lset-difference =3D list1 =
    list2 ...)
    +         (lset-intersection =3D list1
    +                              (lset-union =3D list2 ...)))
    + 
    ++

    + but can be implemented more efficiently. ++

    +

    + The =3D procedure's first argument is an element of l= ist1; its second + is an element of one of the other listi. ++

    +

    +- Either of the answer lists may share a=20 ++ Either of the answer lists may share a + common tail with list1. + This operation essentially partitions list1. +- ++

    ++
    + +-
    ++
    + +-lset-union!      &nb= sp;      =3D list1 ...= -> list +-
    ++lset-union!      &= nbsp;      =3D list1 .= .. -> list ++
    ++
    + +-lset-intersection!     &n= bsp;=3D list1 list2 ... -> list +-
    ++lset-intersection!     =  =3D list1 list2 ... -> list ++
    ++
    + +-lset-difference!     &nbs= p;  =3D list1 list2 ... -> l= ist +-
    ++lset-difference!     &n= bsp;  =3D list1 list2 ... ->= list ++
    ++
    + +-lset-xor!       = ;        =3D list1= ... -> list +-
    ++lset-xor!      &nb= sp;        =3D list1 ... -> list ++
    ++
    + +-lset-diff+intersection! =3D list<= sub>1 list2 ... -> [list list] +-
    ++lset-diff+intersection! =3D lis= t1 list2 ... -> [list list] ++ ++
    ++

    + These are linear-update variants. They are allowed, but not required, + to use the cons cells in their first list parameter to construct their +- answer. lset-union! is permitted to recycle cons cells f= rom any=20 ++ answer. lset-union! is permitted to recycle cons cells f= rom any + of its list arguments. ++

    ++
    +
    +=20 + +-

    Primitive side-effects

    ++

    Primitive side-effects

    +

    +-These two procedures are the primitive,=20 +-R5RS=20 ++These two procedures are the primitive, ++R5RS + side-effect operations on pairs. +- ++

    +
    + +-
    ++
    + +-set-car! pair object -> unspecified= +-
    ++set-car! pair object -> unspecifi= ed ++
    ++
    + +-set-cdr! pair object -> unspecified= +-
    ++set-cdr! pair object -> unspecifi= ed ++ ++
    ++

    + [R5RS] + These procedures store object in the car and cdr field + of pair, respectively. + The value returned is unspecified. +-

    ++

    ++
    + (define (f) (list 'not-a-constant-list))
    + (define (g) '(constant-list))
    +-(set-car! (f) 3) =3D>  *unspecified*
    +-(set-car! (g) 3) =3D>  *error*
    ++(set-car! (f) 3) =3D>  *unspecified*
    ++(set-car! (g) 3) =3D>  *error*
    + 
    ++
    +
    +=20 + +-

    Acknowledgements

    ++

    Acknowledgements

    +

    + The design of this library benefited greatly from the feedback provided d= uring + the SRFI discuss= ion phase. Among those contributing thoughtful commentary and +@@ -3149,77 +3627,80 @@ Kelsey, Donovan Kolbly, Shriram Krishnamurthi, Dav= e Mason, Jussi Piitulainen, + David Pokorny, Duncan Smith, Mike Sperber, Maciej Stachowiak, Harvey J. S= tein, + John David Stone, and Joerg F. Wittenberger. I am grateful to them for th= eir + assistance. ++

    +

    + I am also grateful the authors, implementors and documentors of all the s= ystems + mentioned in the rationale. Aubrey Jaffer and Kent Pitman should be noted +-for their work in producing Web-accessible versions of the R5RS and=20 ++for their work in producing Web-accessible versions of the R5RS and + Common Lisp spec, which was a tremendous aid. ++

    +

    + This is not to imply that these individuals necessarily endorse the final +-results, of course.=20 +- ++results, of course. ++

    +=20 + +-

    References & links

    +-

    ++

    References & links

    +=20 +
    +-
    This document, in HTML: +-
    +- http://srfi.schemers.org/srfi-1/srfi-1.html ++
    This document, in HTML: ++
    ++ https://srfi.schemers.org/srfi-1/srfi-1.html +=20 +-
    Source code for the reference implementation: +-
    +- http://srfi.schemers.org/srfi-1/srfi-1-reference.scm ++
    Source code for the reference implementation: ++
    ++ https://srfi.schemers.org/srfi-1/srfi-1-reference.scm +=20 +-
    Archive of SRFI-1 discussion-list email: +-
    +- http://srfi.schemers.org/srfi-1/mail-archive/maillist.html ++
    Archive of SRFI-1 discussion-list email: ++
    ++ https://srfi-email.schemers.org/srfi-1 ++ ++
    SRFI web site: ++
    ++ https://srfi.schemers.org/ ++
    +=20 +-
    SRFI web site: +-
    +- http://srfi.schemers.org/ +- +=20 +-

    +=20 +

    +-
    [CommonLisp]
    +-
    Common Lisp: the Language
    +-Guy L. Steele Jr. (editor).
    +-Digital Press, Maynard, Mass., second edition 1990.
    +-Available at +-http://www.elwood.com/alu/table/references.htm#cltl2. ++
    [CommonLisp]
    ++
    ++

    ++Common Lisp: the Language
    ++Guy L. Steele Jr. (editor).
    ++Digital Press, Maynard, Mass., second edition 1990.
    ++(Wikip= edia entry) ++

    +

    +- + The Common Lisp "HyperSpec," produced by Kent Pitman, is essentially + the ANSI spec for Common Lisp: +- +-http://www.harlequin.com/education/books/HyperSpec/. +- +-

    [R5RS]
    +-
    Revised5 report on the algorithmic language Scheme.
    +- R. Kelsey, W. Clinger, J. Rees (editors).
    +- Higher-Order and Symbolic Computation, Vol. 11, No. 1, September, 199= 8.
    +- and ACM SIGPLAN Notices, Vol. 33, No. 9, October, 1998.
    ++http://www.lispworks.com/documentation/HyperSpec/Front/index.htm ++

    ++
    ++
    [R5RS]
    ++
    Revised5 report on the algorithmic language Scheme.
    ++ R. Kelsey, W. Clinger, J. Rees (editors).
    ++ Higher-Order and Symbolic Computation, Vol. 11, No. 1, September, 199= 8.
    ++ and ACM SIGPLAN Notices, Vol. 33, No. 9, October, 1998.
    + Available at + http://www.schemers.org/Documents/Standards/. +- ++
    +
    +=20 +=20 +=20 ++ + +-

    Copyright

    ++

    Copyright

    +

    +- + Certain portions of this document -- the specific, marked segments of text + describing the R5RS procedures -- were adapted with permission from the R= 5RS + report. ++

    +

    +-=20=20=20=20 +-All other text is copyright (C) Olin Shivers (1998, 1999).=20 +-All Rights Reserved.=20 ++All other text is copyright (C) Olin Shivers (1998, 1999). ++All Rights Reserved. ++

    +

    + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -3242,5 +3723,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH= ETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

    ++
    ++
    Editor: Michael Sperber
    + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-11.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-11.html +index 987edd5..f100a02 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-11.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-11.html +@@ -1,55 +1,74 @@ +- +- ++ ++ + ++ ++ + SRFI 11: Syntax for receiving multiple values ++ ++ ++ + +=20 + +=20 +-

    Title

    ++

    SRFI 11: Syntax for receiving multiple values

    +=20 +-SRFI 11: Syntax for receiving multiple values ++

    by Lars T Hansen

    ++

    This copy of the SRFI 11 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

    = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-11/srfi-11.html.

    +=20 +-

    Author

    ++

    Status

    +=20 +-Lars T Hansen ++

    This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 11@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

    ++
      ++
    • Received: 1999-09-10 ++
    • Draft: 1999-09-14--1999-11-12 ++
    • Revised: 1999-11-01 ++
    • Revised: 2000-03-15 ++
    • Final: 2000-03-15 ++
    +=20 +-

    Status

    +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status=20 +-that a SRFI can hold, see here. +-You can access the discussion via the archive of=20 +-the mailing list. +-

      +-
    • Received: 1999/09/10 +-
    • Draft: 1999/09/14-1999/11/12 +-
    • Revised: 1999/11/01 +-
    • Revised: 2000/03/15 +-
    • Final: 2000/03/15 +-
    +- +-

    Abstract

    ++

    Abstract

    +=20 + The SRFI introduces syntactic forms LET-VALUES and LET*-VALUES that bind = the values of + expressions that return multiple values. +=20 +-

    Issues

    ++

    Issues

    +=20 + None. +=20 +-

    Rationale

    ++

    Rationale

    +=20 + LET-VALUES and LET*-VALUES reduce the clutter of the CALL-WITH-VALUES not= ation for + receiving multiple values. +=20 +=20 +-

    Specification

    ++

    Specification

    +=20 +
    +-
    ++
    + (LET-VALUES ((<formals> <expression>) ...) <body>)<= /tt> +-
    Syntax ++
    Syntax ++
    +
    +-

    Each <formals> should be a formal arguments list as for a LAMBDA= =20 ++

    Each <formals> should be a formal arguments list as for a LAMBDA + expression, cf section 4.1.4 of the R5RS.

    +=20 +

    The <expression>s are evaluated in the current environment, the= =20 +@@ -64,7 +83,6 @@ receiving multiple values. + error for an <expression> to return a number of values that does + not match its corresponding <formals>.

    +=20 +-

    +

    +              (let-values (((a b . c) (values 1 2 3 4)))
    +                (list a b c))            --> (1 2 (3 4))
    +@@ -74,13 +92,13 @@ receiving multiple values.
    +                             ((x y) (values a b)))
    +                  (list a b x y)))       --> (x y a b)
    + 
    +-

    +- +-
    ++
    ++
    + (LET*-VALUES ((<formals> <expression>) ...) <body>)= +-
    Syntax ++
    Syntax ++
    +
    +-

    Each <formals> should be a formal arguments list as for a LAMBDA= =20 ++

    Each <formals> should be a formal arguments list as for a LAMBDA + expression, cf section 4.1.4 of the R5RS.

    +=20 +

    LET*-VALUES is similar to LET-VALUES, but the bindings are performed +@@ -89,26 +107,25 @@ receiving multiple values. + expression to the right of the binding. Thus the second binding is do= ne in + an environment in which the first binding is visible, and so on.

    +=20 +-

    +

    +              (let ((a 'a) (b 'b) (x 'x) (y 'y))
    +                (let*-values (((a b) (values x y))
    +                              ((x y) (values a b)))
    +                  (list a b x y)))       --> (x y x y)
    + 
    +-

    ++
    + +=20 +-

    Implementation

    +=20 ++

    Implementation

    ++

    + The following implementation is written in R5RS Scheme. It is not + compatible with the IEEE Scheme standard because the IEEE standard does + not contain the high-level macro system. +- ++

    +

    The implementation assumes that some top-level names defined by the + R5RS are bound to their original values. +- +-

    ++

    +
    + ;; This code is in the public domain.
    +=20
    +@@ -148,9 +165,8 @@ R5RS are bound to their original values.
    +        (let*-values (?binding1 ...) ?body0 ?body1 ...)))))
    + 
    +=20 +-

    Copyright

    ++

    Copyright

    +

    Copyright (C) Lars T Hansen (1999). All Rights Reserved.

    +- +

    + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -173,12 +189,11 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH= ETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

    +- +-
    +-
    Editor: Mi= ke Sperber
    ++
    ++
    Editor: Mike Sperber
    + + +-Last modified: Tue Sep 28 10:59:57 MST 2004 ++Last modified: Sun Jan 28 13:40:20 MET 2007 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-13.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-13.html +index 2f744dc..b519905 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-13.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-13.html +@@ -1,22 +1,39 @@ +- ++ ++ ++ ++ ++ + +- + +- +- +- +- ++ + SRFI 13: String Libraries +- ++ ++ ++ + + +=20 +- + +=20 + +=20 + +-

    Title

    ++

    SRFI 13: String Libraries

    +=20 +-
    SRFI 13: String Libraries
    ++

    by Olin Shivers

    ++

    This copy of the SRFI 13 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

    = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-13/srfi-13.html.

    +=20 +- +-

    Author

    +- +-Olin Shivers +- +-

    Status

    +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion via the archive of the mailing list. +-

      +-
    • Received: 1999/10/17 +-
    • Draft: 1999/10/18-1999/12/16 +-
    • Revised: 1999/10/31 +-
    • Revised: 1999/11/13 +-
    • Revised: 1999/11/22 +-
    • Revised: 2000/04/30 +-
    • Revised: 2000/06/09 +-
    • Revised: 2000/12/23 +-
    +- +-

    Table of contents

    ++

    Status

    ++ ++

    This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 13@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

    ++
      ++
    • Received: 1999-10-17 ++
    • Draft: 1999-10-18--1999-12-16 ++
    • Revised: 1999-10-31 ++
    • Revised: 1999-11-13 ++
    • Revised: 1999-11-22 ++
    • Revised: 2000-04-30 ++
    • Revised: 2000-06-09 ++
    • Revised: 2000-12-23 ++
    ++ ++

    Table of contents

    +=20 + +- ++ ++
  • Procedure specification + ++ ++
  • Low-level procedures + +- ++
  • Knuth-Morris-Pratt searching ++
  • ++ +=20 +-
  • Reference implementation +-
  • Acknowledgements +-
  • References & Links +-
  • Copyright +- ++
  • Reference implementation ++
  • Acknowledgements ++
  • References & Links ++
  • Copyright ++
  • +=20 + +-

    Abstract

    ++

    Abstract

    +

    +=20 + R5RS + Scheme has an impoverished set of string-processing utilities, which is a +-problem for authors of portable code. This SRFI proposes a coherent and comprehensive set of ++problem for authors of portable code. ++This SRFI propos= es ++a coherent and comprehensive set of + string-processing procedures; it is accompanied by a reference implementa= tion + of the spec. The reference implementation is ++

    +
      +
    • portable +-
    • efficient +-
    • open source +-
    ++
  • efficient ++
  • open source ++
  • +

    + The routines in this SRFI are backwards-compatible with the string-proces= sing + routines of + R5RS. +- ++

    + +-

    Procedure Index

    ++

    Procedure Index

    +

    + Here is a list of the procedures provided by the string-lib=20 + and string-lib-internals packages. + R5RS + procedures are shown in=20 +-bold; ++bold; + extended R5R= S +=20 +- procedures, in bold italic. +-

    ++ procedures, in bold italic. ++

    ++
    +
    +-
    Predicates +-
    +-
    +-string? string-null?=20
    ++
    Predicates ++
    ++
    ++string? string-null?=20
    + string-every string=
    -any
    + 
    +=20 +-
    Constructors +-
    +-
    +-make-string string string-tabulate=
    
    ++
    Constructors ++
    ++
    ++make-string string string-tabulat=
    e
    + 
    +=20 +-
    List & string conversion +-
    +-
    +-string->list=
     list->string
    +-reverse-list->string string-join
    ++
    List & string conversion ++
    ++
    ++string->list list->string
    ++reverse-list->string string-join
    + 
    +=20 +-
    Selection +-
    +-
    +-string-length
    ++
    Selection ++
    ++
    ++string-length
    + string-ref
    +-string-copy
    +-substring/shared
    ++string-copy
    ++substring/shared
    + string-copy!=20
    + string-take s=
    tring-take-right
    + string-drop s=
    tring-drop-right
    +@@ -288,24 +310,24 @@ extended =
    R5RSstring-trim s=
    tring-trim-right string-trim-both=20
    + 
    +=20 +-
    Modification +-
    +-
    +-string-set! <=
    span class=3Dr5rs-procx>string-fill!
    ++
    Modification ++
    ++
    ++string-set!=
     string-fill!
    + 
    +=20 +-
    Comparison +-
    +-
    ++
    Comparison ++
    ++
    + string-compare string-compare-ci
    +-">string<>     strin=
    g=3D    string<    ">str=
    ing>    string<=3D    =3D">string>=3D
    +-">string-ci<>  string-ci=3D string-ci< ">string-ci> string-ci<=3D =
    =3D">string-ci>=3D
    ++string<>     s=
    tring=3D    string<    string>    string<=3D    string>=3D
    ++string-ci<>  string-ci=3D string-ci< string-ci> string-ci=
    <=3D string-ci>=3D
    + string-hash  str=
    ing-hash-ci
    + 
    +=20 +-
    Prefixes & suffixes +-
    +-
    ++
    Prefixes & suffixes ++
    ++
    + string-prefix-length    string-suffix-length
    + string-prefix-length-ci string-suffix-length-ci
    +=20
    +@@ -313,65 +335,65 @@ extended =
    R5RSstring-prefix-ci? string-suffix-ci?=20
    + 
    +=20 +-
    Searching +-
    +-
    ++
    Searching ++
    ++
    + string-index string-index-right
    + string-skip  =
    string-skip-right=20
    + string-count=20
    + string-contains string-contains-ci
    + 
    +=20 +-
    Alphabetic case mapping +-
    +-
    ++
    Alphabetic case mapping ++
    ++
    + string-titlecase  string-upcase  string-downcase
    + string-titlecase! string-upcase! string-downcase!
    + 
    +=20 +-
    Reverse & append +-
    +-
    ++
    Reverse & append ++
    ++
    + string-reverse string-reverse!
    +-string-append
    ++string-append
    + string-concatenate
    +-string-concatenate/shared string-append/shared
    +-string-concatenate-reverse string-concatenate-reverse/sha=
    red
    ++string-concatenate/shared string-append/shared
    ++string-concatenate-reverse string-concatenate-reverse/s=
    hared
    + 
    +=20 +-
    Fold, unfold & map +-
    +-
    ++
    Fold, unfold & map ++
    ++
    + string-map      stri=
    ng-map!
    + string-fold     string-fold-right
    + string-unfold   string-unfold-right
    + string-for-each string-for-each-index
    + 
    +=20 +-
    Replicate & rotate +-
    +-
    ++
    Replicate & rotate ++
    ++
    + xsubstring string-=
    xcopy!
    + 
    +=20 +-
    Miscellaneous: insertion, parsing +-
    +-
    ++
    Miscellaneous: insertion, parsing ++
    ++
    + string-replace string-tokenize
    + 
    +=20 +-
    Filtering & deleting +-
    +-
    ++
    Filtering & deleting ++
    ++
    + string-filter s=
    tring-delete=20
    + 
    +=20 +-
    Low-level procedures +-
    +-
    +-string-parse-start+end
    +-string-parse-final-start+end
    +-let-string-start+end
    ++
    Low-level procedures ++
    ++
    ++string-parse-start+end
    ++string-parse-final-start+end<=
    /a>
    ++let-string-start+end
    +=20
    + check-substring-spec
    + substring-spec-ok?
    +@@ -379,35 +401,34 @@ extended =
    R5RSmake-kmp-restart-vector kmp-step string-k=
    mp-partial-search
    + 
    +=20 +-
    ++ +
    +=20 + +-

    Rationale

    ++

    Rationale

    +

    +- + This SRFI defines two libraries that provide a rich set of operations for + manipulating strings. These are frequently useful for scripting and other + text-manipulation applications. The library's design was influenced by the + string libraries found in MIT Scheme, Gambit, RScheme, MzScheme, slib, Co= mmon + Lisp, Bigloo, guile, Chez, APL, Java, and the SML standard basis. ++

    +

    +- + All procedures involving character comparison are available in + both case-sensitive and case-insensitive forms. ++

    +

    +- + All functionality is available in substring and full-string forms. +- ++

    + +-

    Strings are code-point sequences<= /a>

    ++

    Strings are code-point sequences

    +

    + This SRFI considers strings simply to be a sequence of "code points" or + character encodings. Operations such as comparison or reversal are always= done + code point by code point. See the comments below on super-ASCII character + types for implications that follow. ++

    +

    +- + It's entirely possible that a legal string might not be a sensible "text" + sequence. For example, consider a string comprised entirely of zero-width + Unicode accent characters with no preceding base character to modify -- +@@ -415,11 +436,10 @@ this is a legal string, albeit one that does not mak= e a great deal of sense + when interpreted as a sequence of natural-language text. The routines in + this SRFI do not handle these "text" concerns; they restrict themselves + to the underlying view of strings as merely a sequence of "code points." +- ++

    + +-

    String operations are locale- and context-indep= endent

    ++

    String operations are locale- and context-independen= t

    +

    +- + This SRFI defines string operations that are locale- and context-independ= ent. + While it is certainly important to have a locale-sensitive comparison or + collation procedure when processing text, it is also important to have a = suite +@@ -427,14 +447,13 @@ of operations that are reliably invariant for basic = string processing --- + otherwise, a change of locale could cause data structures such as hash ta= bles, + b-trees, symbol tables, directories of filenames, etc.=20 + to become corrupted. +- ++

    +

    + Locale- and context-sensitive text operations, such as collation, are + explicitly deferred to a subsequent, companion "text" SRFI. +- ++

    + +-

    Internationalisation & super-ASCII character = types

    +- ++

    Internationalisation & super-ASCII character types=

    +

    + The major issue confronting this SRFI is the existence of super-ASCII + character encodings, such as eight-bit Latin-1 or 16- and 32-bit Unicode.= It +@@ -443,13 +462,13 @@ implementations based on at least these three standa= rd encodings. + Unfortunately, this places strong limitations on the API design. Here are + some relevant issues. Be warned that life in a super-ASCII world is + significantly more complex; there are no easy answers for many of these i= ssues. +- ++

    + +-

    Case mapping and case-folding

    ++

    Case mapping and case-folding

    +=20 +

    + Upper- and lower-casing characters is complex in super-ASCII encodings. +- ++

    +
      +
    • Some characters case-map to more than one character. For example, + the Latin-1 German eszet character upper-cases to "SS."=20 +@@ -458,20 +477,22 @@ Upper- and lower-casing characters is complex in sup= er-ASCII encodings. + R5RS function char-upcase i= s not well-defined,=20 + since it is defined to produce a (single) character result.=20 +=20 +-
    • It means that an in-place string-upcase! procedure ca= nnot be reliably ++
    • It means that an in-place string-upcase! procedu= re cannot be reliably + defined, since the original string may not be long enough to contain + the result -- an N-character string might upcase to a 2N-character re= sult. +=20 +-
    • It means that case-insensitive string-matching or searching is qui= te ++
    • It means that case-insensitive string-matching or searching i= s quite + tricky. For example, an n-character string s might match a= 2N-character + string s'. +-
    ++ +=20 ++ +
  • Some characters case-map in different ways depending upon their surr= ounding + context. For example, the Unicode Greek capital sigma character downcas= es + differently depending upon whether or not it is the final character in a + word. Again, this spells trouble for the simple R5RS char-downcase function. +=20 ++
  • +
  • Unicode defines three cases: lowercase, uppercase and titlecase. The + distinction between uppercase and titlecase arises in the presence of + Unicode's compound characters. For example, Unicode has a single charac= ter +@@ -479,18 +500,22 @@ Upper- and lower-casing characters is complex in sup= er-ASCII encodings. + the compound character "DZ", while titlecasing (or, as Americans say, + capitalizing) it produces compound character "Dz". +=20 ++
  • +
  • Turkish actually has different case-mappings from other languages. ++
  • + +=20 +

    +-The Unicode Consortium's web site +-

    ++ The Unicode Consortium's web site ++

    ++ +-

    ++

    + has detailed discussions of the issues. See in particular technical report + 21 on case mappings +-

    ++

    ++ +=20 +@@ -498,24 +523,26 @@ has detailed discussions of the issues. See in parti= cular technical report + SRFI 13 makes no attempt to deal with these issues; it uses a simple 1-1 + locale- and context-independent case-mapping, specifically Unicode's 1-1 + case-mappings given in +-
    ++

    ++ +-

    ++

    + The format of this file is explained in +-

    ++

    ++ +-

    ++

    + Note that this means that German eszet upper-cases to itself, not "SS". +=20 +-

    ++

    + Case-mapping and case-folding operations in SRFI 13 are locale-independen= t so + that shifting locales won't wreck hash tables, b-trees, symbol tables, etc. +- ++

    +=20 + +-

    String equality & string normalisation

    ++

    String equality & string normalisation

    +=20 +

    + Comparing strings for equality is complicated because in some cases Unico= de +@@ -526,31 +553,32 @@ an acute accent. There is a single Unicode character= for this. However, + Unicode also allows one to represent this with a two-character sequence: = the + "e" character followed by a zero-width acute-accent character. As another + example, Unicode provides some Asian characters in "narrow" and "full" wi= dths. +- ++

    +

    + There are multiple ways we might want to compare strings for equality. In + (roughly) decreasing order of precision, +- ++

    +
      +
    • we might want a precise comparison of the actual encoding, so that + <e-acute> would not compare equal to <e, acute>. +- +-
    • We might want a "normalised" comparison, where these two sequences=20 ++
    • ++
    • We might want a "normalised" comparison, where these two sequences + would compare equal. +- ++
    • +
    • We might want an even more-permissive normalisation, where visually-= distinct + properties of "the same" character would be ignored. For example, we mi= ght + want narrow/full-width versions of the same Asian character to compare = equal. +- ++
    • +
    • We might want comparisons that are insensitive to accents and diacri= tical + marks. +- ++
    • +
    • We might want comparisons that are case-insensitive. +- ++
    • +
    • We might want comparisons that are insensitive to several of the abo= ve + properties. +- ++
    • +
    • We might want ways to "normalise" strings into various canonical for= ms. ++
    • +
    +=20 +

    +@@ -559,24 +587,26 @@ simply based upon comparing the encoding values used= for the characters. + Accent-insensitive and other types of comparison are not provided; only + a simple form of case-insensitive comparison is provided, which uses the + 1-1 case mappings specified by Unicode in +-

    ++

    ++ +-

    ++

    + These are adequate for "program" or "systems" use of strings (e.g., to=20 + manipulate program identifiers and operating-system filenames). +- ++

    + +-

    String inequality

    ++

    String inequality

    +=20 +

    + Above and beyond the issues arising in string-equality, when we attempt + to order strings there are even further considerations. +- ++

    +
      +
    • French orders accents with right-to-left significance -- the reverse= of + the significance of the characters. +=20 ++
    • +
    • Case-insensitive ordering is not well defined by simple "code-point" + considerations, even for simple ASCII: there are punctuation characters + between the ASCII's upper-case range of letters and its lower-case range +@@ -584,8 +614,10 @@ to order strings there are even further consideration= s. + Does left-bracket compare less-than or greater-than "a" in a + case-insensitive comparison?=20 +=20 ++
    • +
    • The German eszet character should sort as if it were the pair of + letters "ss". ++
    • +
    +=20 +

    +@@ -596,9 +628,9 @@ can be overlaid by additional domain- or language-spec= ific rules. Again, + this SRFI does not address these issues. SRFI 13 string ordering is stric= tly + based upon a character-by-character comparison of the values used for + representing the string. +- ++

    + +-

    Naming conventions

    ++

    Naming conventions

    +=20 +

    + This library contains a large number of procedures, but they follow +@@ -608,22 +640,25 @@ in a regular way that exposes the structure and rela= tionships between the + procedures. This should help the programmer to recall or reconstitute the= name + of the particular procedure that he needs when writing his own code. In + particular +- ++

    +
      +
    • Procedures whose names end in "-ci" are case-insensitive variant= s. +=20 ++
    • +
    • Procedures whose names end in "!" are side-effecting variants. + What values these procedures return is usually not specified. +=20 ++
    • +
    • The order of common parameters is consistent across the + different procedures. +=20 ++
    • +
    • Left/right/both directionality: + Procedures that have left/right directional variants + use the following convention: +-
      +- +- ++
      ++
      Direction
      ++ + + + +@@ -635,10 +670,11 @@ particular + This is a general convention that was established in SRFI 1. + The value of a convention is proportional to the extent of its=20 + use. ++ + +=20=20=20=20=20=20=20 + +-

      Shared storage

      ++

      Shared storage

      +=20 +

      + Some Scheme implementations, e.g. guile and T, provide ways to c= onstruct +@@ -651,12 +687,12 @@ property of these substrings -- the application assu= mes that if the underlying + storage is mutated, then all strings sharing that storage will show the + change. However, shared-text substrings are not a common feature; most S= cheme + implementations do not provide them. +- ++

      +

      + SRFI 13 takes a middle ground with respect to shared-text substrings. In + particular, a Scheme implementation does not need to have shared-text + substrings in order to implement this SRFI. +- ++

      +

      + There is an additional form of storage sharing enabled by some SRFI 13 + procedures, even without the benefit of shared-text substrings. In=20 +@@ -665,40 +701,44 @@ of the strings that was passed in as a parameter. Fo= r example, when + constructing a substring with the substring/shared procedure= , if the + requested substring is the entire string, the procedure is permitted + simply to return the original value. That is, +-

      ++

      ++
      + (eq? s (substring/shared s 0 (string-length s))) =3D> true or false
      + 
      +-

      ++

      + whereas the = R5RS=20 + substring function is required to allocate a fresh copy +-

      ++

      ++
      + (eq? s (substring s 0 (string-length s))) =3D> false.
      + 
      +

      + In keeping with SRFI 13's general approach to sharing, compliant + implementations are allowed, but not required, to provide this kind of + sharing. Hence, procedures may not rely upon sharing in these ca= ses. +-

      ++

      ++

      + Most procedures that permit results to share storage with inputs have + equivalent procedures that require allocating fresh storage for results.= =20 + If an application wishes to be sure a new, fresh string is allocated, the= n=20 + these "pure" procedures should be used. +-

      +-
      Direction  Suffix
      left-to-rightnone
      +- ++

      ++
      ++
      Fresh copy guaranteed
      ++ + + + + + + +- ++ + +- ++ + =20 + + ++ + + + +@@ -719,16 +759,16 @@ without this consideration -- if we had cheap shared= -text substrings, all the + start/end index parameters would vanish. However, since SRFI 13 does not + require implementations to provide shared-text substrings, the extended + API is provided. +- ++

      + +-

      R4RS/R5RS procedures

      ++

      R4RS/R5RS procedures

      +=20 +

      + The R4RS and R5RS reports define 22 string procedures. The string-lib + package includes 8 of these exactly as defined, 3 in an extended, + backwards-compatible way, and drops the remaining 11 (whose functionality + is available via other bindings). +- ++

      +

      + The 8 procedures provided exactly as documented in the reports are + string?, +@@ -739,7 +779,7 @@ The 8 procedures provided exactly as documented in the= reports are + string-set!, + string-append, and + list->string. +- ++

      +

      + The eleven functions not included are + string=3D?, string-ci=3D?, +@@ -749,37 +789,44 @@ The eleven functions not included are + string>=3D?, string-ci>=3D?, and + substring. + The string-lib package provides alternate bindings and extended functiona= lity. +- ++

      +

      + Additionally, the three extended procedures are +-

      ++

      ++
      + string-fill! s char [start end] -> unspecified
      + string->list s [start end] -> char-list
      + string-copy  s [start end] -> string
      + 
      +-

      ++

      + They are uniformly extended to take optional start/end parameters specify= ing + substring ranges. +- ++

      + +-

      Extra-SRFI recommendations

      ++

      Extra-SRFI recommendations

      +=20 +

      + This SRFI recommends the following +- ++

      +
        +-
      • A SRFI be defined for shared-text substrings, allowing programs to ++
      • ++

        ++ A SRFI be defined for shared-text substrings, allowing programs to + be written that actually rely on the shared-storage properties of these= data + structures. +- +-

      • A SRFI be defined for manipulating Unicode text -- various normalisa= tion ++

        ++
      • ++
      • ++

        ++ A SRFI be defined for manipulating Unicode text -- various normalisat= ion + operations, collation, searching, etc. Collation operations mi= ght be + parameterised by a "collation" structure representing collation rules + for a particular locale or language. Alternatively, a data structure + specifying collation rules could be activated with dynamic scope by + special procedures, possibly overridden by allowing collation rules + to be optional arguments to procedures that need to order strings, = e.g. +-

        ++    

        ++
        + (with-locale* denmark-locale
        +   (lambda ()=20
        +     (f x)
        +@@ -792,28 +839,32 @@ This SRFI recommends the following
        +=20
        + (set-locale! denmark-locale)
        + 
        +- +-
      • A SRFI be defined for manipulating characters that is portable across ++
      • ++
      • ++

        ++ A SRFI be defined for manipulating characters that is portable acro= ss + at least ASCII, Latin-1 and Unicode.=20 +- +-

          ++

          ++
            +
          • For backwards-compatibility, char-upcase and ch= ar-downcase should=20 + be defined to use the 1-1 locale- and context-insensitive case + mappings given by Unicode's UnicodeData.txt table. +-=20=20 ++
          • +
          • numeric codes for standard functions that map between characters a= nd + integers should be required to use the Unicode/Latin-1/ASCII mapping.= This + allows programmers to write portable code. +- ++
          • +
          • char-titlecase be added to char-upcase a= nd char-downcase. +- ++
          • +
          • char-titlecase? be added to char-upcase?= and char-downcase?. +- ++
          • +
          • Title/up/down-case functions be added to the character-processing = suite + which allow 1->n case maps by returning immutable, + possibly-multi-character strings instead of single characters. These = case + mappings need not be locale- or context-sensitive. +-
          ++ ++
        ++
      • +
      +=20 +

      +@@ -821,75 +872,83 @@ This SRFI recommends the following + requiring a Unicode/Latin-1/ASCII interface to integer/char mapping + functions does not imply anything about the actual underlying encodings= of + characters. +- ++

      +=20 + +-

      Procedure Specification

      ++

      Procedure Specification

      +=20 +

      + In the following procedure specifications: ++

      +
        +
      • An s parameter is a string. +- ++
      • +
      • A char parameter is a character. +- +-
      • Start and end parameters are half-open str= ing indices specifying=20 ++
      • ++
      • Start and end parameters are half-open str= ing indices specifying + a substring within a string parameter; when optional, they default + to 0 and the length of the string, respectively. When specified, it + must be the case that 0 <=3D start <=3D end=20 + <=3D (string-length s), for + the corresponding parameter s. They typically restrict a= procedure's + action to the indicated substring. +- +-
      • A pred parameter is a unary character predicate proce= dure, returning=20 ++
      • ++
      • A pred parameter is a unary character predicate proce= dure, returning + a true/false value when applied to a character. +- ++
      • +
      • A char/char-set/pred parameter is a value used to sel= ect/search + for a character in a string. If it is a character, it is used in + an equality test; if it is a character set, it is used as a + membership test; if it is a procedure, it is applied to the=20 + characters as a test predicate. +- ++
      • +
      • An i parameter is an exact non-negative integer speci= fying an index + into a string. +-=20=20=20=20 ++
      • +
      • Len and nchars parameters are exact non-ne= gative integers specifying a + length of a string or some number of characters. +- ++
      • +
      • An obj parameter may be any value at all. ++
      • +
      +-

      ++

      + Passing values to procedures with these parameters that do not satisfy th= ese + types is an error. +- ++

      +

      + Parameters given in square brackets are optional. Unless otherwise noted = in the + text describing the procedure, any prefix of these optional parameters may + be supplied, from zero arguments to the full list. When a procedure retur= ns + multiple values, this is shown by listing the return values in square + brackets, as well. So, for example, the procedure with signature +-

      +-halts? f [x init-store] -> [boolean integer]
      ++

      ++
      ++halts? f [x init-store] -> [boolean integer]
      + 
      ++

      + would take one (f), two (f, x)=20 + or three (f, x, init-store) input parame= ters,=20 + and return two values, a boolean and an integer. +- ++

      +

      + A parameter followed by "..." means zero-or-more elements.=20 + So the procedure with the signature +-

      +-sum-squares x ...  -> number
      ++

      ++
      ++sum-squares x ...  -> number
      + 
      ++

      + takes zero or more arguments (x ...),=20 + while the procedure with signature +-

      +-spell-check doc dict1 dict2 ... -> =
      string-list
      ++

      ++
      ++spell-check doc dict1 dict2 ... -> string-list
      + 
      ++

      + takes two required parameters=20 + (doc and dict1)=20 + and zero or more optional parameters (dict2 ...). +- ++

      +

      + If a procedure is said to return "unspecified," this means that nothing at + all is said about what the procedure returns. Such a procedure is not even +@@ -901,176 +960,207 @@ Note that in + R5RS= , + this restricts such a procedure to returning a single value;=20 + non-R5RS systems may not even provide this restriction. +- ++

      + +-

      Main procedures

      ++

      Main procedures

      +=20 +

      + In a Scheme system that has a module or package system, these procedures + should be contained in a module named "string-lib". +- ++

      + +-

      Predicates

      ++

      Predicates

      +=20 +
      + +-
      ++
      + +-string? obj -> boolean +-
      ++string? obj -> boolean ++ ++
      ++

      + [R5RS] + Returns #t if obj is a string, otherwise returns = #f. +- ++

      ++
      + +-
      ++
      + +-string-null? s -> boolean +-
      ++string-null? s -> boolean ++ ++
      + Is s the empty string? +
      +=20 + +-
      ++
      + + +-string-every char/char-set/pred s [sta= rt end] -> value +-
      string-any char/= char-set/pred s [start end] -> value +-
      ++string-every char/char-set/pred s [s= tart end] -> value ++ ++
      string-any c= har/char-set/pred s [start end] -> value ++
      ++
      ++

      + Checks to see if the given criteria is true of every / any character = in s, + proceeding from left (index start) to right (index en= d). +- ++

      +

      + If char/char-set/pred is a character, it is tested for equ= ality with + the elements of s. +- ++

      +

      + If char/char-set/pred is a character set, the elements of = s are tested + for membership in the set. +- ++

      +

      + If char/char-set/pred is a predicate procedure, it is appl= ied to the=20 + elements of s. The predicate is "witness-generating:" +- ++

      +
        +
      • If string-any returns true, the returned true val= ue is the one produced + by the application of the predicate. +-=20=20=20=20 ++
      • +
      • If string-every returns true, the returned true v= alue is the one +- produced by the final application of the predicate to s[end].=20 ++ produced by the final application of the predicate to s[end-1].=20 + If string-every is applied to an empty sequence of c= haracters,=20 + it simply returns #t. ++
      • +
      ++

      + If string-every or string-any apply the p= redicate to the final element + of the selected sequence (i.e., s[end-1]), that final application is a + tail call. +- ++

      +

      + The names of these procedures do not end with a question mark -- this= is to + indicate that, in the predicate case, they do not return a simple boo= lean + (#t or #f), but a general value. ++

      ++
      +
      +=20 +=20 + +-

      Constructors

      ++

      Constructors

      +=20 +
      + +-
      ++
      + +-make-string len [char] -> string +-
      ++make-string len [char] -> string<= /var> ++ ++
      ++

      + [R5RS<= /abbr>] + make-string returns a newly allocated string of length len. If + char is given, then all elements of the string are initializ= ed + to char, otherwise the contents of the string are unspecifie= d. +- ++

      ++
      + +-
      ++
      + +-string char1 ... -> string<= /var> +-
      ++string char1 ... -> st= ring ++ ++
      ++

      + [R5RS<= /abbr>] + Returns a newly allocated string composed of the argument characters. +-=20=20=20=20 ++

      ++
      + +-
      ++
      + +-string-tabulate proc len -> string +-
      +- Proc is an integer->char procedure. Construct a string of = size len ++string-tabulate proc len -> strin= g ++ ++
      ++

      ++ Proc is an integer->char procedure. Construct a string = of size len + by applying proc to each index to produce the correspondin= g string + element. The order in which proc is applied to the indices= is not + specified. +- ++

      ++
      +
      +=20 + +-

      List & string conversion

      ++

      List & string conversion

      +=20 +
      +=20 + +-
      ++
      + + +-string->list s [start end] -> char-= list +-
      list->string = char-list -> string +-
      ++string->list s [start end] -> = char-list ++ ++
      list->string char-list -> string ++
      ++
      ++

      + [R5RS+] +- string->list returns a newly allocated list of the chara= cters +- that make up the given string. list->string returns a n= ewly ++ string->list returns a newly allocated list of the ch= aracters ++ that make up the given string. list->string returns = a newly + allocated string formed from the characters in the list char-lis= t, +- which must be a list of characters. string->list and list->string=20 ++ which must be a list of characters. string->list and = list->string=20 + are inverses so far as equal? is concerned. +- +-

      +- string->list is extended from the R5RS definition to take o= ptional ++

      ++

      ++ string->list is extended from the R5RS definition to tak= e optional + start/end arguments. +- ++

      ++
      + +-
      ++
      + +-reverse-list->string char-list -> s= tring +-
      +- An efficient implementation of (compose list->string reverse): +-
      +-(reverse-list->string '(#\a #\B #\c)) -> "cBa"
      ++reverse-list->string char-list -&=
      gt; string
      ++
      ++
      ++

      ++ An efficient implementation of (compose list->string reverse= ): ++

      ++
      ++(reverse-list->string '(#\a #\B #\c)) -> "cBa"
      + 
      ++

      + This is a common idiom in the epilog of string-processing loops + that accumulate an answer in a reverse-order list. (See also + string-concatenate-reverse for the "chunked" variant.) +- ++

      ++
      + +-
      ++
      + +-string-join string-list [delimiter gra= mmar] -> string +-
      ++string-join string-list [delimiter g= rammar] -> string ++ ++
      ++

      + This procedure is a simple unparser --- it pastes strings together us= ing + the delimiter string.=20 +- +-

      ++

      ++

      + The grammar argument is a symbol that determines how the d= elimiter is + used, and defaults to 'infix. +-=20=20=20=20 ++

      +
        +
      • 'infix means an infix or separator grammar:=20 + insert the delimiter +@@ -1079,20 +1169,25 @@ Returns #t if obj is a str= ing, otherwise returns # + grammar is ambiguous. Is it an empty list, or a list of one eleme= nt, + the empty string? +=20=20=20=20=20 +-
      • 'strict-infix means the same as 'infix,=20 ++
      • ++
      • 'strict-infix means the same as 'infix, + but will raise an error if given an empty list. +=20=20=20=20=20 ++
      • +
      • 'suffix means a suffix or terminator grammar:=20 + insert the delimiter + after every list element. This grammar has no ambiguities. +=20 ++
      • +
      • 'prefix means a prefix grammar: insert the delimi= ter + before every list element. This grammar has no ambiguities. ++
      • +
      +- ++

      + The delimiter is the string used to delimit elements; it defaults to + a single space " ". +-

      ++

      ++
      + (string-join '("foo" "bar" "baz") ":")         =3D> "foo:bar:baz"
      + (string-join '("foo" "bar" "baz") ":" 'suffix) =3D> "foo:bar:baz:"
      +=20
      +@@ -1104,103 +1199,124 @@ Returns #t if obj is a s=
      tring, otherwise returns #
      + (string-join '()   ":" 'suffix) =3D> ""
      + (string-join '("") ":" 'suffix) =3D> ":"
      + 
      ++
      +
      +=20 +=20 + +-

      Selection

      ++

      Selection

      +=20 +
      + +-
      ++
      + +-string-length s -> integer +-
      ++string-length s -> integer ++ ++
      ++

      + [R5RS<= /abbr>] + Returns the number of characters in the string s. +- ++

      ++
      + +-
      ++
      + +-string-ref s i -> char +-
      ++string-ref s i -> char ++ ++
      ++

      + [R5RS<= /abbr>] + Returns character s[i] using zero-origin indexing. + I must be a valid index of s.=20=20 +- ++

      ++
      + +-
      ++
      + + +-string-copy s [start end] -> stri= ng +-
      substring/shared= s start [end] -> string +-
      ++string-copy s [start end] ->= string ++ ++
      substring/shared<= var> s start [end] -> string ++
      ++
      ++

      + [R5RS+] + substring/shared returns a string whose contents are the= characters of s + beginning with index start (inclusive) and ending with ind= ex end + (exclusive). It differs from the R5RS substring in two ways: ++

      +
        +
      • The end parameter is optional, not required. ++
      • +
      • substring/shared may return a value that shares m= emory with s or + is eq? to s. ++
      • +
      +- +-

      ++

      + string-copy is extended from its R5RS definition by the add= ition of + its optional start/end parameters. In contrast to su= bstring/shared, + it is guaranteed to produce a freshly-allocated string. +- +-

      ++

      ++

      + Use string-copy when you want to indicate explicitly in = your code that you + wish to allocate new storage; use substring/shared when = you don't care if=20 + you get a fresh copy or share storage with the original string. +-

      ++

      ++
      + (string-copy "Beta substitution") =3D> "Beta substitution"
      + (string-copy "Beta substitution" 1 10)=20
      +     =3D> "eta subst"
      + (string-copy "Beta substitution" 5) =3D> "substitution"
      + 
      +- ++
      + +-
      ++
      + +-string-copy! target tstart s [start en= d] -> unspecified +-
      ++string-copy! target tstart s [start = end] -> unspecified ++ ++
      ++

      + Copy the sequence of characters from index range [start,end) in + string s to string target, beginning at index <= var>tstart. The characters=20 + are copied left-to-right or right-to-left as needed -- the copy is + guaranteed to work, even if target and s are th= e same string. +- ++

      +

      + It is an error if the copy operation runs off the end of the target + string, e.g. +-

      ++    

      ++
      + (string-copy! (string-copy "Microsoft") 0
      +               "Regional Microsoft Operating Companies") =3D> error=
      
      + 
      +- ++
      +=20 + +-
      ++
      + + + + +-string-take s nchars -> string +-
      string-drop s nc= hars -> string +-
      string-take-right s nchars -> string +-
      string-drop-right s nchars -> string +-
      ++string-take s nchars -> string ++ ++
      string-drop = s nchars -> string ++
      ++
      string-take-right= s nchars -> string ++
      ++
      string-drop-right= s nchars -> string ++
      ++
      ++

      + string-take returns the first nchars of = s;=20 + string-drop returns all but the first nchars = of s. + string-take-right returns the last nchars of = s; +@@ -1208,133 +1324,157 @@ Returns #t if obj is a s= tring, otherwise returns # + If these procedures produce the entire string, they may return either + s or a copy of s; in some implementations, prop= er substrings may share + memory with s. +-

      ++

      ++
      + (string-take "Pete Szilagyi" 6) =3D> "Pete S"
      + (string-drop "Pete Szilagyi" 6) =3D> "zilagyi"
      +=20
      + (string-take-right "Beta rules" 5) =3D> "rules"
      + (string-drop-right "Beta rules" 5) =3D> "Beta "
      + 
      +- ++

      + It is an error to take or drop more characters than are in the string: +-

      ++

      ++
      + (string-take "foo" 37) =3D> error
      + 
      +- ++
      + +-
      ++
      + + +-string-pad s len [char start end= ] -> string +-
      string-pad-right= s len [char start end] -> string +-
      ++string-pad s len [char start e= nd] -> string ++ ++
      string-pad-right<= var> s len [char start end] -> string ++
      ++
      ++

      + Build a string of length len comprised of s pad= ded on the left (right) + by as many occurrences of the character char as needed. If= s has more + than len chars, it is truncated on the left (right) to len= gth len. Char + defaults to #\space. +- +-

      ++

      ++

      + If len <=3D end-start, the return= ed value is allowed to share storage + with s, or be exactly s (if len =3D = end-start). +-

      ++

      ++
      + (string-pad     "325" 5) =3D> "  325"
      + (string-pad   "71325" 5) =3D> "71325"
      + (string-pad "8871325" 5) =3D> "71325"
      + 
      +- ++
      + +-
      ++
      + + + +-string-trim       s [char/char-set/pred start end] -> string +-
      string-trim-right s [char/char-set/pred start end] -> string +-
      string-trim-both  s [char/char-set/pred start end] -> string +-
      ++string-trim      <= /code> s [char/char-set/pred start end] -> string ++ ++
      string-trim-right= s [char/char-set/pred start end] -> string ++
      ++
      string-trim-both  s [char/char-set/pred start end] -> string ++
      ++
      ++

      + Trim s by skipping over all characters on the left / on th= e right / + on both sides that satisfy the second parameter char/char-set/pr= ed: +-

        ++

        ++
          +
        • if it is a character char, characters equal to char are trimmed; ++
        • +
        • if it is a char set cs, characters contained in <= var>cs are trimmed; ++
        • +
        • if it is a predicate pred, it is a test predicate= that is applied + to the characters in s; a character causing it to re= turn true + is skipped. +-
        ++ ++
      ++

      + Char/char-set/pred defaults to the character set cha= r-set:whitespace + defined in SRFI 14. +- +-

      ++

      ++

      + If no trimming occurs, these functions may return either s= or a copy of s; + in some implementations, proper substrings may share memory with s. +- +-

      ++

      ++
      + (string-trim-both "  The outlook wasn't brilliant,  \n\r")
      +     =3D> "The outlook wasn't brilliant,"
      + 
      ++
      +
      +=20 +=20 + +-

      Modification

      ++

      Modification

      +=20 +
      +=20 + +-
      ++
      + +-string-set! s i char -> unspecified = +-
      ++string-set! s i char -> unspecifi= ed ++ ++
      ++

      + [R5RS<= /abbr>] + I must be a valid index of s. string-set!<= /code> stores char in + element i of s. Constant string literals appearin= g in code are=20 + immutable; it is an error to use them in a string-set!. +- +-

      ++

      ++
      + (define (f) (make-string 3 #\*))
      + (define (g) "***")
      + (string-set! (f) 0 #\?)                =3D=3D>  unspecified
      + (string-set! (g) 0 #\?)                =3D=3D>  error
      +-(string-set! (symbol->string 'immutable)
      ++(string-set! (symbol->string 'immutable)
      +              3
      +              #\?)                      =3D=3D>  error
      + 
      +- ++
      + +-
      ++
      + +-string-fill! s char [start end] -> uns= pecified +-
      ++string-fill! s char [start end] ->= ; unspecified ++ ++
      ++

      + [R5RS+] + Stores char in every element of s. +- +-

      ++

      ++

      + string-fill is extended from the R5RS definition to take op= tional + start/end arguments. +- ++

      ++
      +
      +=20 + +-

      Comparison

      ++

      Comparison

      +=20 +
      +=20 + +-
      ++
      + + +-string-compare    s1 s2= proc< proc=3D proc> [start1 end1 start2 end2] -> values +-
      string-compare-ci s1 s2 proc< proc=3D proc> [start1 end1 start2 end2] -> values +-
      ++string-compare    s1 = s2 proc< proc=3D proc> [start1 end1 start2 end2] -> values ++ ++
      string-compare-ci= s1 s2 proc< proc=3D proc> [start1 end1 start2 end2] -> value= s ++
      ++
      ++

      + Apply proc<, proc=3D, or proc> + to the mismatch index, depending + upon whether s1 is less than, equal to, or greater than s= 2. +@@ -1342,156 +1482,182 @@ The "mismatch index" is the largest index i= such that for + every 0 <=3D j < i,=20 + s1[j] =3D s2[j] + -- that is, i is the first position that doesn't match. +- ++

      +

      + string-compare-ci is the case-insensitive variant. Case-inse= nsitive + comparison is done by case-folding characters with the operation +-

      ++

      ++
      + (char-downcase (char-upcase c))
      + 
      ++

      + where the two case-mapping operations are assumed to be 1-1, locale- and + context-insensitive, and compatible with the 1-1 case mappings specified + by Unicode's UnicodeData.txt table: +-

      ++

      ++ +- +

      + The optional start/end indices restrict the comparison to the indicated + substrings of s1 and s2. The mismatch index is alwa= ys an index into s1; + in the case of proc=3D, it is always end1;=20 + we observe the protocol + in this redundant case for uniformity. +- +-

      ++

      ++
      + (string-compare "The cat in the hat" "abcdefgh"=20
      +                 values values values
      +                 4 6         ; Select "ca"=20
      +                 2 4)        ; & "cd"
      +     =3D> 5    ; Index of S1's "a"
      + 
      +- ++

      + Comparison is simply done on individual code-points of the string.=20 + True text collation is not handled by this SRFI. +- ++

      ++
      + +-
      ++
      + +-"> +- +-"> +- +-=3D"> +-string=3D  s1 s2 [start1 end1 sta= rt2 end2] -> boolean +-
      string<> s= 1 s2 [start1 end1 start2 end2] -> boolean +-
      string< = s1 s2 [start1 end1 start2 end2] -> boolean +-
      string> = s1 s2 [start1 end1 start2 end2] -> boolean +-
      string<=3D s1= s2 [start1 end1 start2 end2] -> boolean +-
      string>=3D s1= s2 [start1 end1 start2 end2] -> boolean +-
      ++ ++ ++ ++ ++ ++string=3D  s1 s2 [start1 end1 s= tart2 end2] -> boolean ++ ++
      string<> s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string< <= var> s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string> <= var> s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string<=3D s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string>=3D s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      ++

      + These procedures are the lexicographic extensions to strings of the + corresponding orderings on characters. For example, string<= is the + lexicographic ordering on strings induced by the ordering char&= lt;? on + characters. If two strings differ in length but are the same up to=20 + the length of the shorter string, the shorter string is considered to= =20 + be lexicographically less than the longer string. +- +-

      ++

      ++

      + The optional start/end indices restrict the comparison to the indicat= ed + substrings of s1 and s2.=20 +- +-

      ++

      ++

      + Comparison is simply done on individual code-points of the string.=20 + True text collation is not handled by this SRFI. +- ++

      ++
      + +-
      ++
      + +-"> +- +-"> +- +-=3D"> +-string-ci=3D  s1 s2 [start1 end1 = start2 end2] -> boolean +-
      string-ci<> s1 s2 [start1 end1 start2 end2] -> boolean +-
      string-ci<  s1 s2 [start1 end1 start2 end2] -> boolean +-
      string-ci>  s1 s2 [start1 end1 start2 end2] -> boolean +-
      string-ci<=3D= s1 s2 [start1 end1 start2 end2] -> boolean +-
      string-ci>=3D= s1 s2 [start1 end1 start2 end2] -> boolean +-
      ++ ++ ++ ++ ++ ++string-ci=3D  s1 s2 [start1 end= 1 start2 end2] -> boolean ++ ++
      string-ci<>= s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string-ci<  s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string-ci>  s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string-ci<=3D<= var> s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string-ci>=3D<= var> s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      ++

      + Case-insensitive variants. +- +-

      ++

      ++

      + Case-insensitive comparison is done by case-folding characters with=20 + the operation +-

      ++

      ++
      + (char-downcase (char-upcase c))
      + 
      ++

      + where the two case-mapping operations are assumed to be 1-1, locale- = and + context-insensitive, and compatible with the 1-1 case mappings specif= ied + by Unicode's UnicodeData.txt table: +-

      + +-
      ++
      + + +-string-hash    s [bound= start end] -> integer +-
      string-hash-ci s= [bound start end] -> integer +-
      ++string-hash    s [bou= nd start end] -> integer ++ ++
      string-hash-ci s [bound start end] -> integer ++
      ++
      ++

      + Compute a hash value for the string s.=20 + Bound is a non-negative + exact integer specifying the range of the hash function. A positive + value restricts the return value to the range [0,bound). +- ++

      +

      + If bound is either zero or not given, the implementation may u= se + an implementation-specific default value, chosen to be as large as + is efficiently practical. For instance, the default range might be chosen + for a given implementation to map all strings into the range of + integers that can be represented with a single machine word. +- ++

      +

      + The optional start/end indices restrict the hash operation to the=20 + indicated substring of s. +- ++

      +

      + string-hash-ci is the case-insensitive variant. Case-insensi= tive + comparison is done by case-folding characters with the operation +-

      ++

      ++
      + (char-downcase (char-upcase c))
      + 
      ++

      + where the two case-mapping operations are assumed to be 1-1, locale- and + context-insensitive, and compatible with the 1-1 case mappings specified + by Unicode's UnicodeData.txt table: +-

      ++

      ++ +- +

      + Invariants: +-

      +-(<=3D 0 (string-hash s b) (- b 1)) ; When B > 0.
      ++

      ++
      ++(<=3D 0 (string-hash s b) (- b 1)) ; When B > 0.
      + (string=3D    s1 s2)  =3D>  (=3D (string-hash s1 b)    (string-hash s2=
       b))
      + (string-ci=3D s1 s2)  =3D>  (=3D (string-hash-ci s1 b) (string-hash-ci=
       s2 b))
      + 
      +- +

      + A legal but nonetheless discouraged implementation: +-

      ++

      ++
      + (define (string-hash    s . other-args) 1)
      + (define (string-hash-ci s . other-args) 1)
      + 
      +- +

      + Rationale: allowing the user to specify an explicit bound simplifies = user + code by removing the mod operation that typically accompanies every h= ash +@@ -1502,231 +1668,274 @@ A legal but nonetheless discouraged implementati= on: + intermediate values never overflow into bignum integers, allowing the + implementor to provide a fixnum-specific "fast path" for computing the + common cases very rapidly. +- +- ++

      ++
      +
      +=20 + +-

      Prefixes & suffixes

      ++

      Prefixes & suffixes

      +=20 +
      + +-
      ++
      + + + + +-string-prefix-length   = s1 s2 [start1 end1 start2 end2] -> integer +-
      string-suffix-length &n= bsp;  s1 s2 [start1 end1 start2 end2] -> integer +-
      string-prefix-length-ci s1 s2 [start1 end1 start2 end2] -> integer +-
      string-suffix-length-ci s1 s2 [start1 end1 start2 end2] -> integer +-
      ++string-prefix-length    s1 s2 [start1 end1 start2 end2] -> integer ++ ++
      string-suffix-length&nbs= p;   s1 s2 [start1 end1 start2 end2] -> integer ++
      ++
      string-prefix-length-ci<= /code> s1 s2 [start1 end1 start2 end2] -> integer ++
      ++
      string-suffix-length-ci<= /code> s1 s2 [start1 end1 start2 end2] -> integer ++
      ++
      ++

      + Return the length of the longest common prefix/suffix of the two strings. + For prefixes, this is equivalent to the "mismatch index" for the strings + (modulo the starti index offsets). +- ++

      +

      + The optional start/end indices restrict the comparison to the indicated + substrings of s1 and s2. +- ++

      +

      + string-prefix-length-ci and string-suffix-length-ci are the + case-insensitive variants. Case-insensitive comparison is done by + case-folding characters with the operation +-

      ++

      ++
      + (char-downcase (char-upcase c))
      + 
      ++

      + where the two case-mapping operations are assumed to be 1-1, locale- and + context-insensitive, and compatible with the 1-1 case mappings specified + by Unicode's UnicodeData.txt table: +-

      ++

      ++ ++

      + Comparison is simply done on individual code-points of the string.=20 +- ++

      ++
      + +-
      ++
      + + + + +-string-prefix?    s1 s2= [start1 end1 start2 end2] -> boolean +-
      string-suffix?  &n= bsp; s1 s2 [start1 end1 start2 end2] -> boolean +-
      string-prefix-ci? s1 s2 [start1 end1 start2 end2] -> boolean +-
      string-suffix-ci? s1 s2 [start1 end1 start2 end2] -> boolean +-
      ++string-prefix?    s1 = s2 [start1 end1 start2 end2] -> boolean ++ ++
      string-suffix? &nbs= p;  s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string-prefix-ci?= s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      string-suffix-ci?= s1 s2 [start1 end1 start2 end2] -> boolean ++
      ++
      ++

      + Is s1 a prefix/suffix of s2? +- ++

      +

      + The optional start/end indices restrict the comparison to the indicated + substrings of s1 and s2. +- ++

      +

      + string-prefix-ci? and string-suffix-ci? are the= case-insensitive variants. + Case-insensitive comparison is done by case-folding characters with the + operation +-

      ++

      ++
      + (char-downcase (char-upcase c))
      + 
      ++

      + where the two case-mapping operations are assumed to be 1-1, locale- and + context-insensitive, and compatible with the 1-1 case mappings specified + by Unicode's UnicodeData.txt table: +-

      ++

      ++ +- +

      + Comparison is simply done on individual code-points of the string.=20 +- ++

      ++
      +
      +=20 + +-

      Searching

      ++

      Searching

      +=20 +
      +=20 + +-
      ++
      + + + + +-string-index s char/char-set/pre= d [start end] -> integer or #f +-
      string-index-right s char/char-set/pred [start end] -> integer or #f +-
      string-skip s ch= ar/char-set/pred [start end] -> integer or #f +-
      string-skip-right s char/char-set/pred [start end] -> integer or #f +-
      ++string-index s char/char-set/p= red [start end] -> integer or #f ++ ++
      string-index-right s char/char-set/pred [start end] -> integer or #f ++
      ++
      string-skip = s char/char-set/pred [start end] -> integer or #f ++
      ++
      string-skip-right= s char/char-set/pred [start end] -> integer or #f ++
      ++
      ++

      + string-index (string-index-right) searches thro= ugh the string from the=20 + left (right), returning the index of the first occurrence of a character= =20 + which ++

      +
        +
      • equals char/char-set/pred (if it is a character); ++
      • +
      • is in char/char-set/pred (if it is a character set); ++
      • +
      • satisfies the predicate char/char-set/pred (if it is = a procedure). ++
      • +
      ++

      + If no match is found, the functions return false. +- ++

      +

      + The start and end parameters specify the beginning = and end indices of + the search; the search includes the start index, but not the end index. + Be careful of "fencepost" considerations: when searching right-to-left,=20 + the first index considered is +-

      ++

      ++
      + end-1 +
      ++

      + whereas when searching left-to-right, the first index considered is +-

      ++

      ++
      + start +
      ++

      + That is, the start/end indices describe a same half-open interval + [start,end) in these procedures that they do + in all the other SRFI 13 procedures. +- ++

      +

      + The skip functions are similar, but use the complement of the criteria: + they search for the first char that doesn't satisfy the test. E.g.,=20 + to skip over initial whitespace, say +-

      ++

      ++
      + (cond ((string-skip s char-set:whitespace) =3D>
      +        (lambda (i) ...)) ; s[i] is not whitespace.
      +       ...)
      + 
      +- ++
      + +-
      ++
      + +-string-count s char/char-set/pred [sta= rt end] -> integer +-
      ++string-count s char/char-set/pred [s= tart end] -> integer ++ ++
      ++

      + Return a count of the number of characters in s that satis= fy the + char/char-set/pred argument. If this argument is a procedu= re,=20 + it is applied to the character as a predicate; if it is a character s= et,=20 + the character is tested for membership; if it is a character, it is=20 + used in an equality test. +- ++

      ++
      + +-
      ++
      + + +-string-contains    s1 s= 2 [start1 end1 start2 end2] -> integer or false +-
      string-contains-ci s1 s2 [start1 end1 start2 end2] -> integer or false +-
      ++string-contains    s1= s2 [start1 end1 start2 end2] -> integer or false ++ ++
      string-contains-ci s1 s2 [start1 end1 start2 end2] -> integer or false ++
      ++
      ++

      + Does string s1 contain string s2? +- ++

      +

      + Return the index in s1 where s2 occurs as a substri= ng, or false. + The optional start/end indices restrict the operation to the + indicated substrings. +- ++

      +

      + The returned index is in the range [start1,end1).=20 + A successful match must lie entirely in the=20 + [start1,end1) range of s1. +- +-

      +-

      ++

      ++
      + (string-contains "eek -- what a geek." "ee"
      +                  12 18) ; Searches "a geek"
      +     =3D> 15
      + 
      +- +

      + string-contains-ci is the case-insensitive variant. Case-ins= ensitive + comparison is done by case-folding characters with the operation +-

      ++

      ++
      + (char-downcase (char-upcase c))
      + 
      ++

      + where the two case-mapping operations are assumed to be 1-1, locale- and + context-insensitive, and compatible with the 1-1 case mappings specified + by Unicode's UnicodeData.txt table: +-

      ++

      ++ +- +

      + Comparison is simply done on individual code-points of the string.=20 +- ++

      +

      + The names of these procedures do not end with a question mark -- this is = to + indicate that they do not return a simple boolean (#t or #f). Rather, + they return either false (#f) or an exact non-negative integ= er. +- ++

      ++
      +
      +=20 ++ + +-

      Alphabetic case mapping

      ++

      Alphabetic case mapping

      +=20 +
      +=20 + +-
      ++
      + + +-string-titlecase  s [start end] -= > string +-
      string-titlecase! s [start end] -> unspecified +-
      ++string-titlecase  s [start end]= -> string ++ ++
      string-titlecase!= s [start end] -> unspecified ++
      ++
      ++

      + For every character c in the selected range of s,=20 + if c is preceded by a cased character, it is downcased;=20 + otherwise it is titlecased. +- ++

      +

      + string-titlecase returns the result string and does not alte= r its s + parameter. string-titlecase! is the in-place side-effecting = variant. +- +-

      +-

      ++

      ++
      + (string-titlecase "--capitalize tHIS sentence.") =3D>
      +   "--Capitalize This Sentence."
      +=20
      +@@ -1736,70 +1945,80 @@ parameter. string-titlecase! is the i=
      n-place side-effecting variant
      + (string-titlecase "3com makes routers.") =3D>
      +   "3Com Makes Routers."
      + 
      +- +

      + Note that if a start index is specified, then the character + preceding s[start] has no effect on the titlecase d= ecision for + character s[start]: +-

      ++

      ++
      + (string-titlecase "greasy fried chicken" 2) =3D> "Easy Fried Chicken"
      + 
      +- +

      + Titlecase and cased information must be compatible with the Unicode + specification. +- ++

      ++
      + +-
      ++
      + + + + +-string-upcase  s [start end] -> s= tring +-
      string-upcase! s= [start end] -> unspecified +-
      string-downcase = s [start end] -> string +-
      string-downcase!= s [start end] -> unspecified +-
      ++string-upcase  s [start end] -&= gt; string ++ ++
      string-upcase! s [start end] -> unspecified ++
      ++
      string-downcase  s [start end] -> string ++
      ++
      string-downcase!<= var> s [start end] -> unspecified ++
      ++
      ++

      + Raise or lower the case of the alphabetic characters in the string. +- +-

      ++

      ++

      + string-upcase and string-downcase return th= e result string and do not + alter their s parameter. string-upcase! and <= code>string-downcase! are the +- in-place side-effecting variants.=20=20=20=20 +- +-

      ++ in-place side-effecting variants. ++

      ++

      + These procedures use the locale- and context-insensitive 1-1 case map= pings + defined by Unicode's UnicodeData.txt table: +-

      +
      +=20 ++ + +-

      Reverse & append

      ++

      Reverse & append

      +=20 +
      +=20 + +-
      ++
      + + +-string-reverse  s [start end] -> = string +-
      string-reverse! = s [start end] -> unspecified +-
      ++string-reverse  s [start end] -= > string ++ ++
      string-reverse! s [start end] -> unspecified ++
      ++
      ++

      + Reverse the string. +- ++

      +

      + string-reverse returns the result string=20 + and does not alter its s parameter.=20 + string-reverse! is the in-place side-effecting variant. +- +-

      ++

      ++
      + (string-reverse "Able was I ere I saw elba.")=20
      +     =3D> ".able was I ere I saw elbA"
      +=20
      +@@ -1810,49 +2029,58 @@ and does not alter its s parameter.
      +     (string-reverse! s i)
      +     (string-reverse! s)))
      + 
      +- +

      + Unicode note: Reversing a string simply reverses the sequence of + code-points it contains. So a zero-width accent character a=20 + coming after a base character b in string s=20 + would come out before b in the reversed result. +- ++

      ++
      + +-
      ++
      + +-string-append s1 ... -> str= ing +-
      ++string-append s1 ... ->= ; string ++ ++
      ++

      + [R5RS<= /abbr>] + Returns a newly allocated string whose characters form the + concatenation of the given strings. +- ++

      ++
      + +-
      ++
      + +-string-concatenate string-list -> stri= ng +-
      ++string-concatenate string-list ->= string ++ ++
      ++

      + Append the elements of string-list together into a singl= e string. + Guaranteed to return a freshly allocated string. +- +-

      ++

      ++

      + Note that the (apply string-append string-list) + idiom is + not robust for long lists of strings, as some Scheme implementations + limit the number of arguments that may be passed to an n-ary procedur= e. +- ++

      ++
      + +-
      ++
      + + +-string-concatenate/shared string-list = -> string +-
      string-append/shared<= var> s1 ... -> string +-
      ++string-concatenate/shared string-lis= t -> string ++ ++
      string-append/shared s1 ... -> string ++
      ++
      ++

      + These two procedures are variants of string-concatenate= =20 + and string-append + that are permitted to return results that share storage with their +@@ -1860,122 +2088,146 @@ would come out before b in t= he reversed result. + In particular, if string-append/shared is applied to jus= t=20 + one argument, it may return exactly that argument,=20 + whereas string-append is required to allocate a fresh st= ring. +- ++

      ++
      + +-
      ++
      + + +-string-concatenate-reverse stri= ng-list [final-string end] -> string +-
      string-concatenate-reverse/s= hared string-list [final-string end] -> string +-
      ++string-concatenate-reverse st= ring-list [final-string end] -> string ++ ++
      string-concatenate-rever= se/shared string-list [final-string end] -> string ++
      ++
      ++

      + With no optional arguments, these functions are equivalent to +-

      ++

      ++
      + (string-concatenate (reverse string-list))
      + 
      ++

      + and +-

      ++

      ++
      + (string-concatenate/shared (reverse string-list))
      + 
      ++

      + respectively. +- ++

      +

      + If the optional argument final-string is specified, it is cons= ed + onto the beginning of string-list + before performing the list-reverse and string-concatenate operations. +- +

      ++

      + If the optional argument end is given,=20 + only the first end characters + of final-string are added to the string list, thus producing +-

      ++

      ++
      + (string-concatenate=20
      +   (reverse (cons (substring/shared final-string 0 end)
      +                  string-list)))
      + 
      ++

      + E.g. +-

      ++

      ++
      + (string-concatenate-reverse '(" must be" "Hello, I") " going.XXXX" 7)
      +   =3D> "Hello, I must be going."
      + 
      +- +

      + This procedure is useful in the construction of procedures that=20 + accumulate character data into lists of string buffers, and wish to + convert the accumulated data into a single string when done. +- ++

      +

      + Unicode note: Reversing a string simply reverses the sequence of + code-points it contains.=20 + So a zero-width accent character ac coming after + a base character bc in string s would come out=20 + before bc in the reversed result. +- ++

      ++
      +
      +=20 ++ + +-

      Fold, unfold & map

      ++

      Fold, unfold & map

      +=20 +
      +=20 + +-
      ++
      + + +-string-map  proc s [start end] ->= string +-
      string-map! proc= s [start end] -> unspecified +-
      +- Proc is a char->char procedure; it is mapped over s. +-=20=20=20=20 +-

      ++string-map  proc s [start end] = -> string ++ ++

      string-map! = proc s [start end] -> unspecified ++
      ++
      ++

      ++ Proc is a char->char procedure; it is mapped over = s. ++

      ++

      + string-map returns the result string and does not alter = its s parameter. + string-map! is the in-place side-effecting variant. +- +-

      ++

      ++

      + Note: The order in which proc is applied to the elements of + s is not specified. +- ++

      ++
      + +-
      ++
      + + +-string-fold kons knil s [start e= nd] -> value +-
      string-fold-right kons knil s [start end] -> value +-
      ++string-fold kons knil s [start= end] -> value ++ ++
      string-fold-right= kons knil s [start end] -> value ++
      ++
      ++

      + These are the fundamental iterators for strings. +- ++

      +

      + The left-fold operator maps the kons procedure across the + string from left to right +-

      ++

      ++
      + (... (kons s[2] (kons s[1] (<=
      var>kons s[0] knil))))
      + 
      ++

      + In other words, string-fold obeys the (tail) recursion +-

      ++

      ++
      + (string-fold kons knil s start end) =3D
      +     (string-fold kons (kons s[start=
      ] knil) start+1 end)
      + 
      +- +

      + The right-fold operator maps the kons procedure across the + string from right to left +-

      ++

      ++
      + (kons s[0] (... (kons s[=
      end-3] (kons s[end-2] (kons s[end-1] knil)))))
      + 
      ++

      + obeying the (tail) recursion +-

      ++

      ++
      + (string-fold-right kons knil s star=
      t end) =3D
      +     (string-fold-right kons (kons s[end-1] knil) start end-1)
      + 
      +-=20=20=20=20 +

      + Examples:=20 +-

      ++

      ++
      + ;;; Convert a string to a list of chars.
      + (string-fold-right cons '() s)
      +=20
      +@@ -2001,39 +2253,46 @@ Examples:
      +                0 s)
      +   ans)
      + 
      +- +

      + The right-fold combinator is sometimes called a "catamorphism." +- ++

      ++
      + +-
      ++
      + +-string-unfold p f g seed [base make-fi= nal] -> string +-
      ++string-unfold p f g seed [base make-= final] -> string ++ ++
      ++

      + This is a fundamental constructor for strings.=20 ++

      +
        +
      • G is used to generate a series of "seed" values from the = initial seed: +-
        ++
        + seed, (g seed), (g2<= /var> seed), (g3 seed), ... +
        ++
      • +
      • P tells us when to stop -- when it returns true when appl= ied to one=20 + of these seed values. ++
      • +
      • F maps each seed value to the corresponding character=20 + in the result string. These chars are assembled into the + string in a left-to-right order. ++
      • +
      • Base is the optional initial/leftmost portion of the cons= tructed string; + it defaults to the empty string "". ++
      • +
      • Make-final is applied to the terminal seed value (on whic= h p returns + true) to produce the final/rightmost portion of the constructed string. + It defaults to (lambda (x) ""). ++
      • +
      +- +

      + More precisely, the following (simple, inefficient) definitions hold: +- +-

      ++

      ++
      + ;;; Iterative
      + (define (string-unfold p f g seed base make-final)
      +   (let lp ((seed seed) (ans base))
      +@@ -2053,18 +2312,20 @@ More precisely, the following (simple, inefficient=
      ) definitions hold:
      + string-unfold is a fairly powerful string constructor -- you=
       can use it to
      + convert a list to a string, read a port into a string, reverse a string,
      + copy a string, and so forth. Examples:
      +-
      +-(port->string p) =3D (string-unfold eof-object? values
      ++

      ++
      ++(port->string p) =3D (string-unfold eof-object? values
      +                                   (lambda (x) (read-char p))
      +                                   (read-char p))
      +=20
      +-(list->string lis) =3D (string-unfold null? car cdr lis)
      ++(list->string lis) =3D (string-unfold null? car cdr lis)
      +=20
      + (string-tabulate f size) =3D (string-unfold (lambda (i) (=3D i size)) f a=
      dd1 0)
      + 
      +

      + To map f over a list lis, producing a string: +-

      ++

      ++
      + (string-unfold null? (compose f car) cdr lis)
      + 
      +

      +@@ -2072,56 +2333,70 @@ Interested functional programmers may enjoy noting= that + string-fold-right=20 + and string-unfold are in some sense inverses. That is, given= operations=20 + knull?, kar, kdr, kons, and <= var>knil satisfying +-

      ++

      ++
      + (kons (kar x) (kdr x)) =3D x  and (=
      knull? knil) =3D #t
      + 
      ++

      + then +-

      ++

      ++
      + (string-fold-right kons knil (string-unfold kn=
      ull? kar kdr x)) =3D x
      + 
      ++

      + and +-

      ++

      ++
      + (string-unfold knull? kar kdr (string-fo=
      ld-right kons knil s)) =3D s.
      + 
      +- ++

      + The final string constructed does not share storage with either base= + or the value produced by make-final. +- ++

      +

      + This combinator sometimes is called an "anamorphism." +- ++

      +

      + Note: implementations should take care that runtime stack limits do not + cause overflow when constructing large (e.g., megabyte) strings = with + string-unfold. +- ++

      ++
      +=20 + +-
      ++
      + +-string-unfold-right p f g seed [base m= ake-final] -> string +-
      +- This is a fundamental constructor for strings.=20 ++string-unfold-right p f g seed [base= make-final] -> string ++ ++
      ++

      ++ This is a fundamental constructor for strings. ++

      +
        +
      • G is used to generate a series of "seed" values from = the initial seed: + seed, (g seed), (g2 seed), (g3 seed), ... ++
      • +
      • P tells us when to stop -- when it returns true when = applied to one=20 + of these seed values. ++
      • +
      • F maps each seed value to the corresponding character= =20 + in the result string. These chars are assembled into the + string in a right-to-left order. ++
      • +
      • Base is the optional initial/rightmost portion of the= constructed string; + it defaults to the empty string "". ++
      • +
      • Make-final is applied to the terminal seed value (on = which P returns + true) to produce the final/leftmost portion of the constructed stri= ng. + It defaults to (lambda (x) ""). ++
      • +
      +- +-

      ++

      + More precisely, the following (simple, inefficient) definitions hold: +-

      ++

      ++
      + ;;; Iterative
      + (define (string-unfold-right p f g seed base make-final)
      +   (let lp ((seed seed) (ans base))
      +@@ -2137,56 +2412,70 @@ cause overflow when constructing large (e.g., megabyte) strings with
      +                                       (string (f seed)))))
      +                  base))
      + 
      ++

      + Interested functional programmers may enjoy noting that=20 + string-fold + and string-unfold-right are in some sense inverses.=20 + That is, given operations knull?, kar, kdr= , kons, and knil satisfying +-

      ++

      ++
      + (kons (kar x) (kdr x)) =3D x and (knull? knil<= /var>) =3D #t +
      ++

      + then +-

      ++

      ++
      + (string-fold kons knil (string-unfold-right kn=
      ull? kar kdr x)) =3D x
      + 
      ++

      + and +-

      ++

      ++
      + (string-unfold-right knull? kar kdr (str=
      ing-fold kons knil s)) =3D s.
      + 
      +- ++

      + The final string constructed does not share storage with either = base + or the value produced by make-final. +- +-

      ++

      ++

      + Note: implementations should take care that runtime stack limits do n= ot + cause overflow when constructing large (e.g., megabyte) stri= ngs with + string-unfold-right. +- ++

      ++
      +=20 + +-
      ++
      + +-string-for-each proc s [start end] ->= unspecified +-
      ++string-for-each proc s [start end] = -> unspecified ++ ++
      ++

      + Apply proc to each character in s. + string-for-each is required to iterate from start to end + in increasing order. +- ++

      ++
      + +-
      ++
      + +-string-for-each-index proc s [start en= d] -> unspecified +-
      ++string-for-each-index proc s [start = end] -> unspecified ++ ++
      ++

      + Apply proc to each index of s, in order. The option= al start/end + pairs restrict the endpoints of the loop. This is simply a + method of looping over a string that is guaranteed to be safe + and correct. +- ++

      ++

      + Example: +-

      ++

      ++
      + (let* ((len (string-length s))
      +        (ans (make-string len)))
      +   (string-for-each-index
      +@@ -2194,109 +2483,127 @@ Example:
      +       s)
      +   ans)
      + 
      +- ++
      +
      +=20 ++ + +-

      Replicate & rotate

      ++

      Replicate & rotate

      +=20 +
      +=20 + +-
      ++
      + +-xsubstring s from [to start end] -> st= ring +-
      ++xsubstring s from [to start end] -&g= t; string ++ ++
      ++

      + This is the "extended substring" procedure that implements replicated + copying of a substring of some string. +- +-

      ++

      ++

      + S is a string; start and end are opt= ional arguments that demarcate + a substring of s, defaulting to 0 and the length of s= (i.e., the whole + string). Replicate this substring up and down index space, in both the + positive and negative directions. For example, if s =3D "a= bcdefg", start=3D3,=20 + and end=3D6, then we have the conceptual bidirectionally-i= nfinite string +-

      ++

      ++
      +
      Fresh copy guaranteedSharing permitted
      string-copysubstring/shared
      string-copystring-take string-take-right
      string-copystring-drop string-drop-right
      string-drop string-drop-right
      string-concatenatestring-concatenate/shared
      string-concatenate/shared
      string-appendstring-append/shared
      string-concatenate-reverse +- string-concatenate-reverse/shared
      string-concatenate-reverse/shared
      string-pad string-pad-right
      +- +- +- +- ++ ++f ++ ++= <= td>+2 +
      ... d e f d e f d e f <= td>d e f d e f d e f d ... +-
      ... -9 -8 -7 -6 -5 -4 -3 -2 -1 <= td>0 +1 +2 +3 +4 +5 +6 +7 +8 += 9 ... +-
      ... d e f d e f d e f d e d e f d e f= d ... ++
      ... -9 -8 -7 -6 -5 -4 -3 -2 -1 0 +1 +3 +4 +5 +6 +7 +8 +9 ... ++
      +
      +- ++

      + xsubstring returns the substring of this string beginnin= g at index from, + and ending at to=20 + (which defaults to from+(end-start)). +- +-

      ++

      ++

      + You can use xsubstring to perform a variety of tasks: ++

      +
        +
      • To rotate a string left: (xsubstring "abcdef" 2) = =3D> "cdefab" ++
      • +
      • To rotate a string right: (xsubstring "abcdef" -2) = =3D> "efabcd" ++
      • +
      • To replicate a string: (xsubstring "abc" 0 7) = =3D> "abcabca" ++
      • +
      +- +-

      +- Note that=20 ++

      ++ Note that ++

      +
        +
      • The from/to indices give a half-open ran= ge -- the characters from + index from up to, but not including, index to. ++
      • +
      • The from/to indices are not in terms of = the index space for string s. + They are in terms of the replicated index space of the substring + defined by s, start, and end. ++
      • +
      +- +-

      ++

      + It is an error if start=3Dend -- although this = is allowed by special + dispensation when from=3Dto. +- ++

      ++ + +-
      ++
      + +-string-xcopy! target tstart s sfrom [s= to start end] -> unspecified +-
      ++string-xcopy! target tstart s sfrom = [sto start end] -> unspecified ++ ++
      ++

      + Exactly the same as xsubstring, but the extracted text i= s written + into the string target starting at index tstart. + This operation is not defined if (eq? target s<= /var>) + or these two arguments + share storage -- you cannot copy a string on top of itself. +- ++

      ++
      + +=20 ++ + +-

      Miscellaneous: insertion, parsing

      ++

      Miscellaneous: insertion, parsing

      +=20 +
      +=20 + +-
      ++
      + +-string-replace s1 s2 start1 end1 [star= t2 end2] -> string +-
      ++string-replace s1 s2 start1 end1 [st= art2 end2] -> string ++ ++
      ++

      + Returns +-

      ++

      ++
      + (string-append (substring/shared s1 0 start1)
      +                (substring/shared s2 start2 end=
      2)
      +                (substring/shared s1 end1 (string-le=
      ngth s1)))
      + 
      +- ++

      + That is, the segment of characters in s1 from start1<= /var> to end1 + is replaced by the segment of characters in s2 from s= tart2 to end2. + If start1=3Dend1, this simply splices the = s2 characters into s1 at the + specified index. +- +-

      ++

      ++

      + Examples: +-

      ++

      ++
      + (string-replace "The TCL programmer endured daily ridicule."
      +                 "another miserable perl drone" 4 7 8 22 ) =3D>
      +     "The miserable perl programmer endured daily ridicule."
      +@@ -2309,74 +2616,82 @@ Example:
      + (string-insert "It's easy to code it up in Scheme." 5 "really ") =3D>
      +     "It's really easy to code it up in Scheme."
      + 
      +- ++
      + +-
      ++
      + +-string-tokenize s [token-set start end= ] -> list +-
      ++string-tokenize s [token-set start e= nd] -> list ++ ++
      ++

      + Split the string s into a list of substrings, where each su= bstring is + a maximal non-empty contiguous sequence of characters from the charact= er set + token-set. ++

      +
        +
      • token-set defaults to char-set:graphic=20 + (see SRFI 14=20 + for more on character sets and char-set:graphic). +-
      • If start or end indices are provided, t= hey restrict=20 ++
      • ++
      • If start or end indices are provided, t= hey restrict + string-tokenize to operating on the indicated subst= ring of s. ++
      • +
      +- +-

      ++

      + This function provides a minimal parsing facility for simple applicat= ions. + More sophisticated parsers that handle quoting and backslash effects = can + easily be constructed using regular-expression systems; be careful not + to use string-tokenize in contexts where more serious pa= rsing is needed. +- +-

      ++

      ++
      + (string-tokenize "Help make programs run, run, RUN!") =3D>
      +   ("Help" "make" "programs" "run," "run," "RUN!")
      + 
      +- ++
      +
      +=20 + +-

      Filtering & deleting

      ++

      Filtering & deleting

      +=20 +
      +=20 + +-
      ++
      + + +-string-filter char/char-set/pred s [st= art end] -> string +-
      string-delete ch= ar/char-set/pred s [start end] -> string +-
      ++string-filter char/char-set/pred s [= start end] -> string ++ ++
      string-delete char/char-set/pred s [start end] -> string ++
      ++
      ++

      + Filter the string s, retaining only those characters that + satisfy / do not satisfy the char/char-set/pred argument. = If + this argument is a procedure, it is applied to the character + as a predicate; if it is a char-set, the character is tested + for membership; if it is a character, it is used in an equality test. +- +-

      ++

      ++

      + If the string is unaltered by the filtering operation, these + functions may return either s or a copy of s. +- +- ++

      ++
      +
      +=20 ++ + +-

      Low-level procedures

      ++

      Low-level procedures

      +

      + The following procedures are useful for writing other string-processing + functions. In a Scheme system that has a module or package system, these + procedures should be contained in a module named "string-lib-internals". +- ++

      + +-

      Start/end optional-argument parsing & checki= ng utilities

      ++

      Start/end optional-argument parsing & checking ut= ilities

      +=20 +=20 +
      +@@ -2384,99 +2699,118 @@ procedures should be contained in a module named = "string-lib-internals". + +-
      ++
      + + +-string-parse-start+end proc s args -> = [rest start end] +-
      string-parse-final-start+end= proc s args -> [start end] +-
      ++string-parse-start+end proc s args -= > [rest start end] ++ ++
      string-parse-final-start= +end proc s args -> [start end] ++
      ++
      ++

      + string-parse-start+end may be used to parse a pair of op= tional start/end=20 + arguments from an argument list, defaulting them to 0 and the length = of=20 + some string s, respectively. Let the length of string s be slen. +-

        ++

        ++
          +
        • If args =3D (), the function returns=20 + (values '() 0 slen) ++
        • +
        • If args =3D (i), i is checked t= o ensure it is an exact integer, and + that 0 <=3D i <=3D slen.=20 + Returns (values (cdr args) i slen<= /var>). ++
        • +
        • If args =3D (i j ...),=20 + i and j are checked to ensure they are exa= ct + integers, and that 0 <=3D i <=3D j <= =3D + slen.=20 + Returns (values (cddr args) i j). +-
        +- +-

        ++ ++

      ++

      + If any of the checks fail, an error condition is raised, and pro= c is used + as part of the error condition -- it should be the client procedure w= hose + argument list string-parse-start+end is parsing. +-=20=20=20=20 +-

      ++

      ++

      + string-parse-final-start+end is exactly the same, except= that the args list + passed to it is required to be of length two or less; if it is longer, + an error condition is raised. It may be used when the optional s= tart/end=20 + parameters are final arguments to the procedure. +- +-

      ++

      ++

      + Note that in all cases, these functions ensure that s is a= string + (by necessity, since all cases apply string-length to s either to + default end or to bounds-check it). +- +-

      ++

      ++ ++
      + +-let-string-start+end (start end [rest]= ) proc-exp s-exp args-exp body ... -> value(s) +-
      +- ++let-string-start+end (start end [res= t]) proc-exp s-exp args-exp body ... -> value(s) ++ ++
      ++

      + [Syntax] ++

      ++

      + Syntactic sugar for an application of string-parse-start+end or + string-parse-final-start+end. +-=20=20=20=20=20=20 +-

      ++

      ++

      + If a rest variable is given, the form is equivalent to +-

      ++

      ++
      + (call-with-values
      +     (lambda () (string-parse-start+end proc-exp s-exp args-exp))
      +   (lambda (rest start end) body ...))
      + 
      +-=20=20=20=20=20=20=20=20 +-

      ++

      + If no rest variable is given, the form is equivalent to +-

      ++

      ++
      + (call-with-values
      +     (lambda () (string-parse-final-start+end proc-exp s-e=
      xp args-exp))
      +   (lambda (start end) body ...))
      + 
      +- ++
      + +-
      ++
      + + +-check-substring-spec proc s start end = -> unspecified +-
      substring-spec-ok? s start end -> boolean +-
      ++check-substring-spec proc s start en= d -> unspecified ++ ++
      substring-spec-ok? s start end -> boolean ++
      ++
      ++

      + Check values s, start and end to ens= ure they specify a valid substring. + This means that s is a string, start and e= nd are exact integers, and=20 + 0 <=3D start <=3D end <=3D=20 + (string-length s) +- +-

      ++

      ++

      + If the values are not proper ++

      +
        +
      • check-substring-spec raises an error condition.= proc is used + as part of the error condition, and should be the procedure who= se=20 + parameters we are checking. ++
      • +
      • substring-spec-ok? returns false. ++
      • +
      ++

      + Otherwise, substring-spec-ok? returns true, and ch= eck-substring-spec + simply returns (what it returns is not specified). +- ++

      ++
      +
      +=20 +=20 + +-

      Knuth-Morris-Pratt searching

      ++

      Knuth-Morris-Pratt searching

      +

      + The Knuth-Morris-Pratt string-search algorithm is a method of rapidly sca= nning + a sequence of text for the occurrence of some fixed string. It has the +@@ -2487,7 +2821,7 @@ the initialisation and searching phases of the algor= ithm for general use. They + also support searching through sequences of text that arrive in buffered + chunks, in that intermediate search state can be carried across applicati= ons + of the search loop from the end of one buffer application to the next. +- ++

      +

      + A second critical property of KMP search is that it requires the allocati= on of + auxiliary memory proportional to the length of the pattern, but const= ant +@@ -2495,22 +2829,24 @@ in the size of the character type. Alternate searc= hing algorithms frequently + require the construction of a table with an entry for every possible + character -- which can be prohibitively expensive in a 16- or 32-bit char= acter + representation. +- ++

      +
      + +-
      ++
      + +-make-kmp-restart-vector s [c=3D start = end] -> integer-vector +-
      ++make-kmp-restart-vector s [c=3D star= t end] -> integer-vector ++ ++
      ++

      + Build a Knuth-Morris-Pratt "restart vector," which is useful for quickly + searching character sequences for the occurrence of string s (= or the + substring of s demarcated by the optional start/end= parameters, if + provided). C=3D is a character-equality function used to const= ruct the + restart vector. It defaults to char=3D?; use char-ci= =3D? instead for + case-folded string search. +- ++

      +

      + The definition of the restart vector rv for string s is: + If we have matched chars 0..i-1 of s against some s= earch string ss, and +@@ -2519,13 +2855,13 @@ match ss[k]. + If rv[i] =3D -1,=20 + then punt ss[k] completely, and move on to + ss[k+1] and s[0]. +- ++

      +

      + In other words, if you have matched the first i chars of = s, but + the i+1'th char doesn't match,=20 + rv[i] tells you what the next-longest + prefix of s is that you have matched. +- ++

      +

      + The following string-search function shows how a restart vector is used to + search. Note the attractive feature of the search process: it is "on +@@ -2534,8 +2870,8 @@ data. It simply consumes characters one-at-a-time un= til declaring a complete + match or reaching the end of the sequence. Thus, it can be easily adapted= to + search other character sequences (such as ports) that do not provide rand= om + access to their contents. +- +-

      ++

      ++
      + (define (find-substring pattern source start end)
      +   (let ((plen (string-length pattern))
      +         (rv (make-kmp-restart-vector pattern)))
      +@@ -2558,7 +2894,6 @@ access to their contents.
      +                          (lp (+ si 1)  0   (- sj 1)  plen)  ; Punt.
      +                          (lp si        pi  sj        (- plen pi))))))))))
      + 
      +- +

      + The optional start/end parameters restrict the restart vector = to the + indicated substring of pat; rv is end - = start elements long. If start > 0, +@@ -2568,23 +2903,26 @@ pattern element pat[i + start]. + Elements of rv are themselves indices + that range just over [0, end-start),=20 + not [start, end). +- ++

      +

      + Rationale: the actual value of rv is "position independent" --= it + does not depend on where in the pat string the pattern occurs,= but + only on the actual characters comprising the pattern. +- ++

      ++
      + +-
      ++
      + +-kmp-step pat rv c i c=3D p-start -> in= teger +-
      ++kmp-step pat rv c i c=3D p-start -&g= t; integer ++ ++
      ++

      + This function encapsulates the work performed by one step of the + KMP string search; it can be used to scan strings, input ports, + or other on-line character sources for fixed strings.=20 +- ++

      +

      + Pat is the non-empty string specifying the text for which we a= re searching. + Rv is the Knuth-Morris-Pratt restart vector for the pattern,=20 +@@ -2593,7 +2931,7 @@ The pattern begins at pat[p-start], and is + (string-length rv) characters long. + C=3D is the character-equality function used to construct the + restart vector, typically char=3D? or char-ci=3D?. +- ++

      +

      + Suppose the pattern is N characters in length:=20 + pat[p-start, p-start + n). +@@ -2604,19 +2942,20 @@ We have already matched i characters: + returns the new i value -- that is, how much of the pattern we= have + matched, including character c.=20 + When i reaches n, the entire pattern has been match= ed. +- ++

      +

      + Thus a typical search loop looks like this: +-

      ++

      ++
      + (let lp ((i 0))
      +   (or (=3D i n)                           ; Win -- #t
      +       (and (not (end-of-stream))        ; Lose -- #f
      +            (lp (kmp-step pat rv (get-next-character) i char=3D? 0)))))
      + 
      +- +

      + Example: +-

      ++

      ++
      + ;; Read chars from IPORT until we find string PAT or hit EOF.
      + (define (port-skip pat iport)
      +   (let* ((rv (make-kmp-restart-vector pat))
      +@@ -2628,10 +2967,10 @@ Example:
      +                 (lp (kmp-step pat rv c i char=3D? 0) ; Continue
      +                     (+ nchars 1))))))))
      + 
      +- +

      + This procedure could be defined as follows: +-

      ++

      ++
      + (define (kmp-step pat rv c i c=3D p-start)
      +   (let lp ((i i))
      +     (if (c=3D c (string-ref pat (+ i p-start)))     ; Match =3D>
      +@@ -2640,27 +2979,29 @@ This procedure could be defined as follows:
      +           (if (=3D i -1) 0                          ; Can't back up more.
      +               (lp i)))))))                        ; Keep going.
      + 
      +- +

      + Rationale: this procedure takes no optional arguments because it + is intended as an inner-loop primitive and we do not want any + run-time penalty for optional-argument parsing and defaulting, + nor do we wish barriers to procedure integration/inlining. +- ++

      ++
      + +-
      ++
      + +-string-kmp-partial-search pat rv s i [= c=3D p-start s-start s-end] -> integer +-
      ++string-kmp-partial-search pat rv s i= [c=3D p-start s-start s-end] -> integer ++ ++
      ++

      + Applies kmp-step across s;=20 + optional s-start/s-end bounds parameters=20 + restrict search to a substring of s.=20 + The pattern is (vector-length rv) characters long= ;=20 + optional p-start index indicates non-zero start of pattern=20 + in pat. +- ++

      +

      + Suppose plen =3D (vector-length rv) + is the length of the pattern. +@@ -2668,38 +3009,41 @@ is the length of the pattern. + (that is, 0 <=3D i < plen) + indicating how much of the pattern has already been matched.=20 + (This means the pattern must be non-empty -- plen > 0.) +- ++

      +
        +
      • On success, returns -j,=20 + where j is the index in s bounding + the end of the pattern -- e.g., a value that could be= used as=20 + the end parameter in a call to substring/shared. +- +-
      • On continue, returns the current search state i'=20 ++
      • ++
      • On continue, returns the current search state i' + (an index into rv) + when the search reached the end of the string. This is a non-negative + integer. ++
      • +
      +- ++

      + Hence: ++

      +
        +
      • A negative return value indicates success, and says + where in the string the match occured. +- ++
      • +
      • A non-negative return value provides the i to use for + continued search in a following string. ++
      • +
      +- +

      + This utility is designed to allow searching for occurrences of a fixed + string that might extend across multiple buffers of text. This is + why, for example, we do not provide the index of the start of the + match on success -- it may have occurred in a previous buffer. +- ++

      +

      + To search a character sequence that arrives in "chunks," write a + loop of this form: +-

      ++

      ++
      + (let lp ((i 0))
      +   (and (not (end-of-data?))             ; Lose -- return #f.
      +        (let* ((buf (get-next-chunk))    ; Get or fill up the buffer.
      +@@ -2707,9 +3051,11 @@ loop of this form:
      +          (if (< i 0) (- i)              ; Win -- return end index.
      +              (lp i)))))                 ; Keep looking.
      + 
      ++

      + Modulo start/end optional-argument parsing, this procedure could + be defined as follows: +-

      ++

      ++
      + (define (string-kmp-partial-search pat rv s i c=3D p-start s-start s-end)
      +   (let ((patlen (vector-length rv)))
      +     (let lp ((si s-start)       ; An index into S.
      +@@ -2720,39 +3066,41 @@ be defined as follows:
      +                       (kmp-step pat rv (string-ref s si)
      +                                 vi c=3D p-start)))))))
      + 
      ++
      +
      +=20 + +-

      Reference implementation

      ++

      Reference implementation

      +=20 +

      + This SRFI comes with a reference implementation. It can be found at: +-

      +- http://srfi.= schemers.org/srfi-13/srfi-13.scm ++

      ++ +-

      ++

      + I have placed this source on the Net with an unencumbered, "open" copyrig= ht. + The prefix/suffix and comparison routines in this code had (extremely dis= tant) + origins in MIT Scheme's string lib, and were substantially reworked by my= self. + Being derived from that code, they are covered by the MIT Scheme copyrigh= t, + which is a generic BSD-style open-source copyright. See the source file f= or + details. +- ++

      +

      + The KMP string-search code was influenced by implementations written by + Stephen Bevan, Brian Denheyer and Will Fitzgerald. However, this version = was + written from scratch by myself. +- ++

      +

      + The remainder of the code was written by myself for scsh or for this SRFI= ; I + have placed this code under the scsh copyright, which is also a generic + BSD-style open-source copyright. +- ++

      +

      + The code is written for portability and should be straightforward to port= to + any Scheme. The source comments contains detailed notes describing the no= n-R5RS + dependencies. +- ++

      +

      + The library is written for clarity and well-commented; the current source= is + approximately 1000 lines of source code and 1000 lines of comments and wh= ite +@@ -2760,15 +3108,15 @@ space. It is also written for efficiency. Fast pat= hs are provided for common + cases. This is not to say that the implementation can't be tuned up for a + specific Scheme implementation. There are notes in the comments addressing + ways implementors can tune the reference implementation for performance. +- ++

      +

      + In short, I've written the reference implementation to make it as painless + as possible for an implementor -- or a regular programmer -- to adopt this + library and get good results with it. +- ++

      +=20 + +-

      Acknowledgements

      ++

      Acknowledgements

      +=20 +

      + The design of this library benefited greatly from the feedback provided d= uring +@@ -2782,137 +3130,175 @@ Kiselyov, Bengt Kleberg, Donovan Kolbly, Bruce K= orb, Shriram Krishnamurthi, + Bruce Lewis, Tom Lord, Brad Lucier, Dave Mason, David Rush, Klaus Schilli= ng, + Jonathan Sobel, Mike Sperber, Mikael Staldal, Vladimir Tsyshevsky, Donald + Welsh, and Mike Wilson. I am grateful to them for their assistance. +- ++

      +

      + I am also grateful the authors, implementors and documentors of all the s= ystems + mentioned in the introduction. Aubrey Jaffer and Kent Pitman should be no= ted + for their work in producing Web-accessible versions of the R5RS and Common + Lisp spec, which was a tremendous aid. +- ++

      +

      + This is not to imply that these individuals necessarily endorse the final + results, of course.=20 +- ++

      +

      + During this document's long development period, great patience was exhibi= ted + by Mike Sperber, who is the editor for the SRFI, and by Hillary Sullivan, + who is not. +- ++

      + +-

      References & links

      ++

      References & links

      +=20 +
      +=20 +-
      [Case-map] ++
      [Case-map] ++
      +
      +- Case mappings.
      +- Unicode Technical Report 21.
      ++

      ++ Case mappings.
      ++ Unicode Technical Report 21.
      + http://www.u= nicode.org/unicode/reports/tr21/ +- +-

      [CommonLisp]
      +-
      Common Lisp: the Language.
      +-Guy L. Steele Jr. (editor).
      +-Digital Press, Maynard, Mass., second edition 1990.
      ++

      ++
      ++
      [CommonLisp] ++
      ++
      ++

      ++Common Lisp: the Language.
      ++Guy L. Steele Jr. (editor).
      ++Digital Press, Maynard, Mass., second edition 1990.
      + Available at + http://www.elwood.com/alu/table/references.htm#cltl2. ++

      +

      +- + The Common Lisp "HyperSpec," produced by Kent Pitman, is essentially + the ANSI spec for Common Lisp: +- +-http://www.harlequin.com/education/books/HyperSpec/. +- +-

      [Java] ++ ++http://www.lispworks.com/documentation/HyperSpec/Front/index.htm. ++

      ++ ++
      [Java] ++
      +
      +- The following URLs provide documentation on relevant Java classes. ++

      ++ The following URLs provide documentation on relevant Java classes. +=20 + http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Chara= cter.html +-
      ++
      + http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.h= tml +-
      ++
      + http://java.sun.com/products/jdk/1.2/docs/api/java/lang/St= ringBuffer.html +-
      ++
      + http://java.sun.com/products/jdk/1.2/docs/api/java/text/Collat= or.html +-
      ++
      + http://java.sun.com/products/jdk/1.2/docs/api/java/text= /package-summary.html +- +-

      [MIT-Scheme] ++

      ++ ++
      [MIT-Scheme] ++
      +
      ++

      + http://www.s= wiss.ai.mit.edu/projects/scheme/ +- +-

      [R5RS]
      +-
      Revised5 report on the algorithmic language Scheme.
      +- R. Kelsey, W. Clinger, J. Rees (editors).
      +- Higher-Order and Symbolic Computation, Vol. 11, No. 1, September, 199= 8.
      +- and ACM SIGPLAN Notices, Vol. 33, No. 9, October, 1998.
      ++

      ++
      ++
      [R5RS] ++
      ++
      ++

      ++ Revised5 report on the algorithmic language Scheme.
      ++ R. Kelsey, W. Clinger, J. Rees (editors).
      ++ Higher-Order and Symbolic Computation, Vol. 11, No. 1, September, 199= 8.
      ++ and ACM SIGPLAN Notices, Vol. 33, No. 9, October, 1998.
      + Available at + http://www.schemers.org/Documents/Standards/. +- +-

      [SRFI]
      ++

      ++ ++
      [SRFI] ++
      +
      +- The SRFI web site.
      +- http://srfi.schemers.org/ +- +-
      [SRFI-13]
      ++

      ++ The SRFI web site.
      ++ http://srfi.schemers.org/ ++

      ++ ++
      [SRFI-13] ++
      +
      +- SRFI-13: String libraries.
      +- http://srfi.schemers.or= g/srfi-13/ +- ++

      ++ SRFI-13: String libraries.
      ++ http://srfi.schemers.org/srfi-13/ ++

      +
      =20=20=20=20 +
      + This document, in HTML: +-
      +- http://srfi.schemers.org/srfi-13/srfi-13.html ++ ++
      ++ https://srfi.schemers.org/srfi-13/srfi-13.html +=20 ++
      +
      + This document, in plain text format: +-
      +- http://srfi.schemers.org/srfi-13/srfi-13.txt ++ ++
      ++ https://srfi.schemers.org/srfi-13/srfi-13.txt +=20 ++
      +
      Source code for the reference implementation: ++
      +
      +- +- http://srfi.schemers.org/srfi-13/srfi-13.scm ++ ++ https://srfi.schemers.org/srfi-13/srfi-13.scm +=20 ++
      +
      Scheme 48 module specification, with typings: ++
      +
      +- +- http://srfi.schemers.org/srfi-13/srfi-13-s48-module.scm ++ ++ https://srfi.schemers.org/srfi-13/srfi-13-s48-module.scm ++
      +
      +
      +=20 +-
      [SRFI-14] ++
      [SRFI-14] ++
      +
      +- SRFI-14: Character-set library.
      +- http://srfi.schemers.or= g/srfi-14/
      ++

      ++ SRFI-14: Character-set library.
      ++ http://srfi.schemers.org/srfi-14/
      + The SRFI 14 char-set library defines a character-set data type, + which is used by some procedures in this library. +- +-

      [Unicode] ++

      ++ ++
      [Unicode] ++
      +
      + http://www.unicode.org/ +- +-
      [UnicodeData] ++ ++
      [UnicodeData] ++
      +
      +- The Unicode character database.
      ++

      ++ The Unicode character database.
      + ftp:= //ftp.unicode.org/Public/UNIDATA/UnicodeData.txt +-
      ++
      + ftp= ://ftp.unicode.org/Public/UNIDATA/UnicodeData.html +- ++

      ++
      +
      +=20 ++ + +-

      Copyright

      ++

      Copyright

      +=20 +

      + Certain portions of this document -- the specific, marked segments of text + describing the R5RS procedures -- were adapted with permission from the R5RS + report. +-=20=20=20=20 ++

      +

      + All other text is copyright (C) Olin Shivers (1998, 1999, 2000).=20 + All Rights Reserved.=20 +- ++

      +

      + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -2935,11 +3321,10 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, = WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

      +- ++
      ++
      Editor: Michael Sperber
      + +- +- +- ++ +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-14.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-14.html +index 4167ab3..f42fc23 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-14.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-14.html +@@ -1,5 +1,23 @@ +- ++ ++ ++ ++ ++ + +- + +- +- +- +- ++ + SRFI 14: Character-set Library +- ++ ++ ++ + + +- +- + +- + +- + +-

      Title

      ++

      SRFI 14: Character-set Library

      +=20 +-
      SRFI 14: Character-set Library
      ++

      by Olin Shivers

      ++

      This copy of the SRFI 14 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

      = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-14/srfi-14.html.

      +=20 +- +-

      Author

      +- +-Olin Shivers +- +-

      Status

      +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion via the archive of the mailing list. +-

        +-
      • Received: 1999/10/17 +-
      • Draft: 1999/10/30-1999/12/30 +-
      • Revised: 2000/04/30 +-
      • Revised: 2000/04/30 +-
      • Revised: 2000/06/09 +-
      • Revised: 2000/12/23 +-
      ++

      Status

      ++ ++

      This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 14@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

      ++
        ++
      • Received: 1999-10-17
      • ++
      • Draft: 1999-10-30--1999-12-30
      • ++
      • Revised: 2000-04-30
      • ++
      • Revised: 2000-04-30
      • ++
      • Revised: 2000-06-09
      • ++
      • Revised: 2000-12-23
      • ++
      • Post-finalization notes: ++
          ++
        • ++ 2019-12-09 (In a ++ separate document, ++ added notes by John Cowan on relevant changes to Unicode ++ since publication of this SRFI. The author of SRFI 14, Olin Shive= rs, ++ has not yet expressed an opinion on the notes.) ++
        • ++
        ++
      • ++
      ++ +=20 + +-

      Table of contents

      ++

      Table of contents

      +=20 + +-
        +-
      • Abstract +-
      • Variable index +-
      • Rationale +- +- +-
      • Specification +- +- +-
      • Unicode, Latin-1 and ASCII definitio= ns of the standard character sets +-
      • Reference implementation +-
      • Acknowledgements +-
      • References & Links +-
      • Copyright ++ +=20 + +-

        Abstract

        ++

        Abstract

        +

        +- + The ability to efficiently represent and manipulate sets of characters is= an + unglamorous but very useful capability for text-processing code -- one th= at + tends to pop up in the definitions of other libraries. Hence it is usefu= l to + specify a general substrate for this functionality early. This SRFI defi= nes a + general library that provides this functionality.=20 +- ++

        ++

        + It is accompanied by a reference implementation for the spec. The referen= ce + implementation is fairly efficient, straightforwardly portable, and has a + "free software" copyright. The implementation is tuned for "small" 7 or 8 +@@ -216,90 +263,97 @@ bit character types, such as ASCII or Latin-1; the d= ata structures and + algorithms would have to be altered for larger 16 or 32 bit character typ= es + such as Unicode -- however, the specs have been carefully designed with t= hese + larger character types in mind. +- ++

        ++

        + Several forthcoming SRFIs can be defined in terms of this one: ++

        +
          +-
        • string library +-
        • delimited input procedures (e.g., read-line) +-
        • regular expressions ++
        • string library
        • ++
        • delimited input procedures (e.g., read-line)<= /li> ++
        • regular expressions
        • +
        +=20 +- + +-

        Variable Index

        ++

        Variable Index

        +

        + Here is the complete set of bindings -- procedural and otherwise -- + exported by this library. In a Scheme system that has a module or package= =20 + system, these procedures should be contained in a module named "char-set-= lib". +- +-

        ++

        ++
        +
        +-
        Predicates & comparison +-
        +-
        +-char-set? char-set=
        =3D char-set<=3D char-set-hash
        ++
        Predicates & comparison ++
        ++
        ++
        ++char-set? char-set=
        =3D char-set<=3D char-set-hash
        + 
        +- +-
        Iterating over character sets +-
        +-
        ++
        ++
        Iterating over character sets ++
        ++
        ++
        + char-set-cursor char-set-ref char-set-cursor-next end-of-char-set?=20
        + char-set-fold char-set-unfold char-set-unfold!
        + char-set-for-each char-set-map
        + 
        +- +-
        Creating character sets +-
        +-
        ++
        ++
        Creating character sets ++
        ++
        ++
        + char-set-copy char-s=
        et
        +=20
        +-char-set">list->char-set  char-=
        set">string->char-set
        +-char-set!">list->char-set! char=
        -set!">string->char-set!
        ++list->char-set  string->char-set
        ++list->char-set! string->char-set!
        +=20=20=20=20=20
        +-char-set-filter  =
        char-set">ucs-range->char-set 
        +-char-set-filter! char-set!">ucs-range->char-se=
        t!
        ++char-set-filter  ucs-range->char-set 
        ++char-set-filter! ucs-range->ch=
        ar-set!
        +=20
        +-char-set">->char-set
        ++->char-set
        + 
        +- +-
        Querying character sets +-
        +-
        +-list">char-set->list stri=
        ng">char-set->string
        ++
        ++
        Querying character sets ++
        ++
        ++
        ++char-set->list char-set->string
        + char-set-size =
        char-set-count char-set-contains?
        + char-set-every =
        char-set-any
        + 
        +- +-
        Character-set algebra +-
        +-
        ++
        ++
        Character-set algebra ++
        ++
        ++
        + char-set-adjoin  char-set-delete
        + char-set-adjoin! char-set-delete!
        +=20
        + char-set-complement  char-set-union  char-se=
        t-intersection
        + char-set-complement! char-set-union! char=
        -set-intersection!
        +=20
        +-char-set-difference  char-set-xor  char-s=
        et-diff+intersection
        +-char-set-difference! char-set-xor! cha=
        r-set-diff+intersection!
        ++char-set-difference  char-set-xor  char=
        -set-diff+intersection
        ++char-set-difference! char-set-xor! c=
        har-set-diff+intersection!
        + 
        +- +-
        Standard character sets +-
        +-
        +-char-set:lower-case  char-set:upper-case  char-set:title-case
        +-char-set:letter      char-set:digit       char-s=
        et:letter+digit
        +-char-set:graphic     char-set:printing    char=
        -set:whitespace
        +-char-set:iso-control char-set:punctuation c=
        har-set:symbol
        +-char-set:hex-digit   char-set:blank       char-set:a=
        scii
        +-char-set:empty       char-set:full
        ++
        ++
        Standard character sets ++
        ++
        ++
        ++char-set:lower-case  char-set:upper-case  char-set:title-case
        ++char-set:letter      char-set:digit       char-set:letter+digit
        ++char-set:graphic     char-set:printing    char-set:whitespace
        ++char-set:iso-control char-set:punctuation char-set:symbol
        ++char-set:hex-digit   char-set:blank       char=
        -set:ascii
        ++char-set:empty       char-set:full
        + 
        +=20 ++
        +
        +
        +=20 + +-

        Rationale

        ++

        Rationale

        +=20 +

        + The ability to efficiently manipulate sets of characters is quite +@@ -307,16 +361,16 @@ useful for text-processing code. Encapsulating this = functionality in + a general, efficiently implemented library can assist all such code. + This library defines a new data structure to represent these sets, called + a "char-set." The char-set type is distinct from all other types. +- ++

        +

        + This library is designed to be portable across implementations that use + different character types and representations, especially ASCII, Latin-1 + and Unicode. Some effort has been made to preserve compatibility with Java + in the Unicode case (see the definition of char-set:whitespace for the + single real deviation). +- ++

        + +-

        Linear-update operations

        ++

        Linear-update operations

        +=20 +

        + The procedures of this SRFI, by default, are "pure functional" -- they do= not +@@ -327,39 +381,43 @@ to construct their result. An implementation may leg= ally implement these + procedures as pure, side-effect-free functions, or it may implement them = using + side effects, depending upon the details of what is the most efficient or + simple to implement in terms of the underlying representation. +- ++

        +

        + The linear-update routines all have names ending with "!". +- ++

        +

        + Clients of these procedures may not rely upon these procedures w= orking by + side effect. For example, this is not guaranteed to work: +-

        ++

        ++
        + (let* ((cs1 (char-set #\a #\b #\c))      ; cs1 =3D {a,b,c}.
        +        (cs2 (char-set-adjoin! cs1 #\d))) ; Add d to {a,b,c}.
        +   cs1) ; Could be either {a,b,c} or {a,b,c,d}.
        + 
        +-

        ++

        + However, this is well-defined: +-

        ++

        ++
        + (let ((cs (char-set #\a #\b #\c)))
        +   (char-set-adjoin! cs #\d)) ; Add d to {a,b,c}.
        + 
        +- +

        + So clients of these procedures write in a functional style, but must + additionally be sure that, when the procedure is called, there are no oth= er + live pointers to the potentially-modified character set (hence the term + "linear update"). +- ++

        +

        + There are two benefits to this convention: ++

        +
          +
        • Implementations are free to provide the most efficient possible + implementation, either functional or side-effecting. ++
        • +
        • Programmers may nonetheless continue to assume that character sets + are purely functional data structures: they may be reliably shared + without needing to be copied, uniquified, and so forth. ++
        • +
        +=20 +

        +@@ -369,136 +427,151 @@ be represented in an ASCII Scheme with 4 32-bit wo= rds. Pure set-algebra + operations on such a representation are very fast and efficient. Programm= ers + who code using linear-update operations are guaranteed the system will + provide the best implementation across multiple platforms. +- ++

        +

        + In practice, these procedures are most useful for efficiently constructing + character sets in a side-effecting manner, in some limited local context,= =20 + before passing the character set outside the local construction scope to = be + used in a functional manner. +- ++

        +

        + Scheme provides no assistance in checking the linearity of the potentially + side-effected parameters passed to these functions --- there's no linear + type checker or run-time mechanism for detecting violations. (But + sophisticated programming environments, such as DrScheme, might help.) +- ++

        + +-

        Extra-SRFI recommendations

        ++

        Extra-SRFI recommendations

        +

        + Users are cautioned that the R5RS predicates=20 +-

        +-char-alphabetic?
        +-char-numeric?
        +-char-whitespace?
        +-char-upper-case?
        +-char-lower-case?
        ++

        ++
        ++char-alphabetic?
        ++char-numeric?
        ++char-whitespace?
        ++char-upper-case?
        ++char-lower-case?
        +
        +
        +-

        ++

        + may or may not be in agreement with the SRFI 14 base character sets +-

        ++

        ++
        + +-char-set:letter
        +-char-set:digit
        +-char-set:whitespace
        +-char-set:upper-case
        +-char-set:lower-case
        ++char-set:letter
        ++char-set:digit
        ++char-set:whitespace
        ++char-set:upper-case
        ++char-set:lower-case
        +
        +
        +-

        ++

        + Implementors are strongly encouraged to bring these predicates into + agreement with the base character sets of this SRFI; not to do so risks + major confusion. +- ++

        +=20 + +-

        Specification

        ++

        Specification

        +

        + In the following procedure specifications: ++

        +
          +
        • A cs parameter is a character set. +- ++
        • +
        • An s parameter is a string. +- ++
        • +
        • A char parameter is a character. +- ++
        • +
        • A char-list parameter is a list of characters. +- +-
        • A pred parameter is a unary character predicate proce= dure, returning=20 ++
        • ++
        • A pred parameter is a unary character predicate proce= dure, returning + a true/false value when applied to a character. +- ++
        • +
        • An obj parameter may be any value at all. ++
        • +
        +=20 +

        + Passing values to procedures with these parameters that do not satisfy th= ese + types is an error. +- ++

        +

        + Unless otherwise noted in the specification of a procedure, procedures + always return character sets that are distinct (from the point of view + of the linear-update operations) from the parameter character sets. For + example, char-set-adjoin is guaranteed to provide a fresh ch= aracter set, + even if it is not given any character parameters. +- ++

        +

        + Parameters given in square brackets are optional. Unless otherwise noted = in the + text describing the procedure, any prefix of these optional parameters may + be supplied, from zero arguments to the full list. When a procedure retur= ns + multiple values, this is shown by listing the return values in square + brackets, as well. So, for example, the procedure with signature +-

        +-halts? f [x init-store] -> [boolean integer]
        ++

        ++
        ++halts? f [x init-store] -> [boolean integer]
        + 
        ++

        + would take one (f), two (f, x)=20 + or three (f, x, init-store) input parame= ters,=20 + and return two values, a boolean and an integer. +- ++

        +

        + A parameter followed by "..." means zero-or-more elements.=20 + So the procedure with the signature +-

        +-sum-squares x ...  -> number
        ++

        ++
        ++sum-squares x ...  -> number
        + 
        ++

        + takes zero or more arguments (x ...),=20 + while the procedure with signature +-

        +-spell-check doc dict1 dict2 ... -> =
        string-list
        ++

        ++
        ++spell-check doc dict1 dict2 ... -> string-list
        + 
        ++

        + takes two required parameters=20 + (doc and dict1)=20 + and zero or more optional parameters (dict2 ...). +- ++

        +=20 + +-

        General procedures

        ++

        General procedures

        +
        +=20 + +-
        ++
        + +-char-set? obj -> boolean +-
        +- ++char-set? obj -> boolean ++ ++
        ++

        + Is the object obj a character set? +- ++

        ++
        + +-
        ++
        + +-char-set=3D cs1 ... -> bool= ean +-
        ++char-set=3D cs1 ... ->= boolean ++ ++
        ++

        + Are the character sets equal? ++

        +

        + Boundary cases: +-

        +-(char-set=3D) =3D> true
        +-(char-set=3D cs) =3D> true
        ++

        ++
        ++(char-set=3D) =3D> true
        ++(char-set=3D cs) =3D> true
        + 
        +- +

        + Rationale: transitive binary relations are generally extended to n-ary + relations in Scheme, which enables clearer, more concise code to be +@@ -506,15 +579,17 @@ and zero or more optional parameters (dict= 2 ...). + certainly not arise in first-order uses of such relations, they may w= ell + arise in higher-order cases or macro-generated code.=20 + E.g., consider +-

        ++

        ++
        + (apply char-set=3D cset-list)
        + 
        +-

        ++

        + This is well-defined if the list is empty or a singleton list. Hence + we extend these relations to any number of arguments. Implementors + have reported actual uses of n-ary relations in higher-order cases + allowing for fewer than two arguments. The way of Scheme is to handle= the + general case; we provide the fully general extension. ++

        +

        + A counter-argument to this extension is that=20 + R5RS= 's +@@ -523,63 +598,69 @@ and zero or more optional parameters (dict= 2 ...). + require at least two arguments, hence + this decision is a break with the prior convention -- although it is + at least one that is backwards-compatible. +- ++

        ++
        + +-
        +- +-char-set<=3D cs1 ... -> boo= lean +-
        ++
        ++ ++char-set<=3D cs1 ... -= > boolean ++
        ++
        ++

        + Returns true if every character set csi is=20 + a subset of character set csi+1. +- ++

        +

        + Boundary cases: +-

        +-(char-set<=3D) =3D> true
        +-(char-set<=3D cs) =3D> true
        ++

        ++
        ++(char-set<=3D) =3D> true
        ++(char-set<=3D cs) =3D> true
        + 
        +

        + Rationale: See char-set=3D for discussion of zero- and one-a= rgument + applications. Consider testing a list of char-sets for monotonicity +-with=20 +-

        +-(apply char-set<=3D cset-list)
        ++with
        ++

        ++
        ++(apply char-set<=3D cset-list)
        + 
        +- ++
        + +-
        ++
        + +-char-set-hash cs [bound] -> integer +-
        ++char-set-hash cs [bound] -> integ= er ++ ++
        ++

        + Compute a hash value for the character set cs.=20 + Bound is a non-negative + exact integer specifying the range of the hash function. A positive + value restricts the return value to the range [0,bound). +- +-

        ++

        ++

        + If bound is either zero or not given, the implementation m= ay use + an implementation-specific default value, chosen to be as large as + is efficiently practical. For instance, the default range might be ch= osen + for a given implementation to map all strings into the range of + integers that can be represented with a single machine word. +- +- +-

        ++

        ++

        + Invariant: +-

        +-(char-set=3D cs1 cs2) =3D> (=3D (char-set-hash cs1 b) (char-set-hash cs2 b))
        ++

        ++
        ++(char-set=3D cs1 cs2) =3D> (=3D (char-set-hash c=
        s1 b) (char-set-hash cs2 b))
        + 
        +- +-

        ++

        + A legal but nonetheless discouraged implementation: +-

        ++

        ++
        + (define (char-set-hash cs . maybe-bound) 1)
        + 
        +- +

        + Rationale: allowing the user to specify an explicit bound simplifies = user + code by removing the mod operation that typically accompanies every h= ash +@@ -590,29 +671,31 @@ with + intermediate values never overflow into bignum integers, allowing the + implementor to provide a fixnum-specific "fast path" for computing the + common cases very rapidly. +- ++

        ++
        +
        +=20 + +-

        Iterating over character sets

        ++

        Iterating over character sets

        +=20 +
        + +-
        +- +- +- +- +-char-set-cursor cset -> cursor +-
        +-char-set-ref cset cursor -> char +-
        +-char-set-cursor-next cset cursor -> cu= rsor +-
        +-end-of-char-set? cursor -> boolean +-
        ++
        ++char-set-cursor cset -> cursor ++
        ++
        ++char-set-ref cset cursor -> char<= /var> ++
        ++
        ++char-set-cursor-next cset cursor -&g= t; cursor ++
        ++
        ++end-of-char-set? cursor -> boolea= n ++
        ++
        ++

        + Cursors are a low-level facility for iterating over the characters in= a + set. A cursor is a value that indexes a character in a char set. + char-set-cursor produces a new cursor for a given char s= et.=20 +@@ -624,28 +707,29 @@ with + answers true to end-of-char-set?.=20 + It is an error to pass such a cursor to char-set-ref or = to + char-set-cursor-next. +- ++

        +

        + A cursor value may not be used in conjunction with a different charac= ter + set; if it is passed to char-set-ref or=20 + char-set-cursor-next with + a character set other than the one used to create it, the results and + effects are undefined. +- ++

        +

        + Cursor values are not necessarily distinct from other types.= =20 + They may be + integers, linked lists, records, procedures or other values. This lic= ense + is granted to allow cursors to be very "lightweight" values suitable = for + tight iteration, even in fairly simple implementations. +- ++

        +

        + Note that these primitives are necessary to export an iteration facil= ity + for char sets to loop macros. +- ++

        +

        + Example: +-

        ++

        ++
        + (define cs (char-set #\G #\a #\T #\e #\c #\h))
        +=20
        + ;; Collect elts of CS into a list.
        +@@ -653,16 +737,15 @@ with
        +   (if (end-of-char-set? cur) ans
        +       (lp (char-set-cursor-next cs cur)
        +           (cons (char-set-ref cs cur) ans))))
        +-  =3D> (#\G #\T #\a #\c #\e #\h)
        ++  =3D> (#\G #\T #\a #\c #\e #\h)
        +=20
        + ;; Equivalently, using a list unfold (from SRFI 1):
        + (unfold-right end-of-char-set?=20
        +               (curry char-set-ref cs)
        + 	      (curry char-set-cursor-next cs)
        + 	      (char-set-cursor cs))
        +-  =3D> (#\G #\T #\a #\c #\e #\h)
        ++  =3D> (#\G #\T #\a #\c #\e #\h)
        + 
        +- +

        + Rationale: Note that the cursor API's four functions "fit" the functi= onal + protocol used by the unfolders provided by the list, string and char-= set +@@ -674,26 +757,31 @@ with + character set, then this function returned false instead of the chara= cter + value, and another end-of-char-set cursor. In this way, the other thr= ee + functions of the current API were combined together. +- ++

        ++
        + +-
        ++
        + +-char-set-fold kons knil cs -> object +-
        ++char-set-fold kons knil cs -> obj= ect ++ ++
        ++

        + This is the fundamental iterator for character sets. Applies the fun= ction + kons across the character set cs using initial = state value knil. That is, + if cs is the empty set, the procedure returns knil. Otherwise, some + element c of cs is chosen;=20 + let cs' be the remaining, unchosen characters. + The procedure returns +-

        ++

        ++
        + (char-set-fold kons (kons c knil) cs')
        + 
        +-

        ++

        + Examples: +-

        ++

        ++
        + ;; CHAR-SET-MEMBERS
        + (lambda (cs) (char-set-fold cons '() cs))
        +=20
        +@@ -705,34 +793,39 @@ with
        +   (char-set-fold (lambda (c i) (if (vowel? c) (+ i 1) i))
        +                  0 cs))
        + 
        ++
        +=20 + +-
        +- +- +-char-set-unfold  f p g seed [base= -cs] -> char-set +-
        char-set-unfold!= f p g seed base-cs -> char-set +-
        ++
        ++char-set-unfold  f p g seed [ba= se-cs] -> char-set ++
        ++
        = char-set-unfold! f p g seed base-cs -> char-set ++
        ++
        ++

        + This is a fundamental constructor for char-sets.=20 ++

        +
          +
        • G is used to generate a series of "seed" values from = the initial seed: + seed, (g seed), (g2 seed), (g3 seed), ... +-
        • P tells us when to stop -- when it returns true when = applied to one=20 ++
        • ++
        • P tells us when to stop -- when it returns true when = applied to one + of these seed values. ++
        • +
        • F maps each seed value to a character. These characte= rs are added + to the base character set base-cs to form the result; base-cs defaults to + the empty set. char-set-unfold! adds the characters to= base-cs in a=20 + linear-update -- it is allowed, but not required, to side-effect + and use base-cs's storage to construct the result. ++
        • +
        +- +-

        ++

        + More precisely, the following definitions hold, ignoring the + optional-argument issues: +- +-

        ++

        ++
        + (define (char-set-unfold p f g seed base-cs)=20
        +   (char-set-unfold! p f g seed (char-set-copy base-cs)))
        +=20
        +@@ -742,31 +835,34 @@ with
        +             (lp (g seed)                                ; Loop on (G SEED=
        ).
        +                 (char-set-adjoin! cs (f seed))))))      ; Add (F SEED) to=
         set.
        + 
        +- ++

        + (Note that the actual implementation may be more efficient.) +- +-

        ++

        ++

        + Examples: +-

        =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
        =20=20=20=20=20=20=20=20=20=20
        +-(port->char-set p) =3D (char-set-unfold eof-object? values
        ++

        ++
        =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
        =20=20=20=20=20=20=20=20=20=20
        ++(port->char-set p) =3D (char-set-unfold eof-object? values
        +                                       (lambda (x) (read-char p))
        +                                       (read-char p))
        +=20
        +-(list->char-set lis) =3D (char-set-unfold null? car cdr lis)
        ++(list->char-set lis) =3D (char-set-unfold null? car cdr lis)
        + 
        ++
        + +-
        +- +-char-set-for-each proc cs -> unspecifi= ed +-
        ++
        ++char-set-for-each proc cs -> unsp= ecified ++
        ++
        ++

        + Apply procedure proc to each character in the character se= t cs. + Note that the order in which proc is applied to the charac= ters in the + set is not specified, and may even change from one procedure applicat= ion + to another. +- +-

        ++

        ++

        + Nothing at all is specified about the value returned by this procedur= e; it + is not even required to be consistent from call to call. It is simply + required to be a value (or values) that may be passed to a command +@@ -776,123 +872,137 @@ with + R5RS= , + this restricts the procedure to returning a single value;=20 + non-R5RS systems may not even provide this restriction. +- ++

        ++
        + +-
        +- +-char-set-map proc cs -> char-set +-
        +- proc is a char->char procedure. Apply it to all the charac= ters in ++
        ++char-set-map proc cs -> char-set<= /var> ++
        ++
        ++

        ++ proc is a char->char procedure. Apply it to all the cha= racters in + the char-set cs, and collect the results into a new charac= ter set. +- +-

        +- Essentially lifts proc from a char->char procedure to a ch= ar-set -> ++

        ++

        ++ Essentially lifts proc from a char->char procedure to a= char-set -> + char-set procedure. +- +-

        ++

        ++

        + Example: +-

        ++

        ++
        + (char-set-map char-downcase cset)
        + 
        ++
        +
        +=20 +- + +-

        Creating character sets

        ++

        Creating character sets

        +
        +=20 + +-
        +- +-char-set-copy cs -> char-set +-
        ++
        ++char-set-copy cs -> char-set ++
        ++
        ++

        + Returns a copy of the character set cs. "Copy" means that= if either the + input parameter or the result value of this procedure is passed to on= e of + the linear-update procedures described below, the other character set= is + guaranteed not to be altered.=20=20 +- +-

        ++

        ++

        + A system that provides pure-functional implementations of the + linear-operator suite could implement this procedure as the identity + function -- so copies are not guaranteed to be distinct by <= code>eq?. +- ++

        ++
        + +-
        +- +-char-set char1 ... -> char-= set +-
        ++
        ++char-set char1 ... -> = char-set ++
        ++
        ++

        + Return a character set containing the given characters. +- ++

        ++
        + +-
        +-char-set"> +-char-set!"> +-list->char-set  char-list [base-c= s] -> char-set +-
        list->char-set! = char-list base-cs -> char-set +-
        ++
        ++list->char-set  char-list [b= ase-cs] -> char-set ++
        ++
        list->char-set! char-list base-cs -> char-set ++
        ++
        ++

        + Return a character set containing the characters in the list of + characters char-list. +- +-

        ++

        ++

        + If character set base-cs is provided, the characters from = char-list +- are added to it. list->char-set! is allowed, but not req= uired, ++ are added to it. list->char-set! is allowed, but not = required, + to side-effect and reuse the storage in base-cs;=20 +- list->char-set produces a fresh character set. +- ++ list->char-set produces a fresh character set. ++

        ++
        + +-
        +-char-set"> +-char-set!"> +-string->char-set  s [base-cs] -> = char-set +-
        string->char-set! s base-cs -> char-set +-
        +- ++
        ++ ++ ++string->char-set  s [base-cs= ] -> char-set ++
        ++
        string->char-set! s base-cs -> char-set ++
        ++
        ++

        + Return a character set containing the characters in the string s= . +- +-

        ++

        ++

        + If character set base-cs is provided, the characters from = s are added to +- it. string->char-set! is allowed, but not required, to s= ide-effect and +- reuse the storage in base-cs; string->char-set produces a fresh character ++ it. string->char-set! is allowed, but not required, t= o side-effect and ++ reuse the storage in base-cs; string->char-set produces a fresh character + set. +- ++

        ++
        + +-
        ++
        + + +-char-set-filter  pred cs [base-cs= ] -> char-set +-
        char-set-filter!= pred cs base-cs -> char-set +-
        +- ++char-set-filter  pred cs [base-= cs] -> char-set ++ ++
        char-set-filter!<= var> pred cs base-cs -> char-set ++
        ++
        ++

        + Returns a character set containing every character c=20 + in cs such that (pred c)=20 + returns true. +- ++

        +

        + If character set base-cs is provided, the characters speci= fied=20 + by pred are added to it.=20 + char-set-filter! is allowed, but not required, + to side-effect and reuse the storage in base-cs;=20 + char-set-filter produces a fresh character set. +- ++

        +

        + An implementation may not save away a reference to pred and + invoke it after char-set-filter or=20 + char-set-filter! returns -- that is, "lazy," + on-demand implementations are not allowed, as pred may have + external dependencies on mutable data or have other side-effects. +- ++

        +

        + Rationale: This procedure provides a means of converting a character + predicate into its equivalent character set; the cs parame= ter +@@ -900,52 +1010,56 @@ with + be aware that filtering a character set such as char-set:full + could be a very expensive operation in an implementation that provide= d an + extremely large character type, such as 32-bit Unicode. An earlier dr= aft +- of this library provided a simple predicate->char-set ++ of this library provided a simple predicate->char-set + procedure, which was rejected in favor of char-set-filter for + this reason. +- ++

        ++
        +=20 + +-
        +-char-set"> +-char-set!"> +-ucs-range->char-set  lower upper = [error? base-cs] -> char-set +-
        ucs-range->char-set!<= var> lower upper error? base-cs -> char-set +-
        ++
        ++ ++ ++ucs-range->char-set  lower u= pper [error? base-cs] -> char-set ++
        ++
        ucs-range->char-set!<= /code> lower upper error? base-cs -> char-set ++
        ++
        ++

        + Lower and upper are exact non-negative integers= ;=20 +- lower <=3D upper. +- +-

        ++ lower <=3D upper. ++

        ++

        + Returns a character set containing every character whose ISO/IEC 10646 + UCS-4 code lies in the half-open range [lower,upper). +- ++

        +
          +
        • If the requested range includes unassigned UCS values, these are + silently ignored (the current UCS specification has "holes" in the + space of assigned codes). +-=20=20=20=20 ++
        • +
        • If the requested range includes "private" or "user space" codes,= these + are handled in an implementation-specific manner; however, a UCS- or + Unicode-based Scheme implementation should pass them through + transparently. +-=20=20=20=20 ++
        • +
        • If any code from the requested range specifies a valid, assigned + UCS character that has no corresponding representative in the + implementation's character type, then (1) an error is raised if error? + is true, and (2) the code is ignored if error? is false = (the default). + This might happen, for example, if the implementation uses ASCII + characters, and the requested range includes non-ASCII characters. ++
        • +
        +- +-

        ++

        + If character set base-cs is provided, the characters speci= fied by the +- range are added to it. ucs-range->char-set! is allowed, = but not required, ++ range are added to it. ucs-range->char-set! is allowe= d, but not required, + to side-effect and reuse the storage in base-cs;=20 +- ucs-range->char-set produces a fresh character set. +- +-

        ++ ucs-range->char-set produces a fresh character set. ++

        ++

        + Note that ASCII codes are a subset of the Latin-1 codes, which are in= turn + a subset of the 16-bit Unicode codes, which are themselves a subset o= f the + 32-bit UCS-4 codes. We commit to a specific encoding in this routine, +@@ -954,14 +1068,17 @@ with + implementation may use EBCDIC or SHIFT-JIS to encode characters; it m= ust + simply map the UCS characters from the given range into the native + representation when possible, and report errors when not possible. +- ++

        ++
        + +-
        +-char-set"> +-->char-set x -> char-set +-
        ++
        ++ ++->char-set x -> char-set ++
        ++
        ++

        + Coerces x into a char-set.=20 + X may be a string, character or + char-set. A string is converted to the set of its constituent charact= ers; +@@ -969,76 +1086,94 @@ with + as-is. + This procedure is intended for use by other procedures that want to=20 + provide "user-friendly," wide-spectrum interfaces to their clients. +- ++

        ++
        +
        +- + +-

        Querying character sets

        ++

        Querying character sets

        +
        +=20 + +-
        ++
        + +-char-set-size cs -> integer +-
        ++char-set-size cs -> integer ++ ++
        ++

        + Returns the number of elements in character set cs. +- ++

        ++
        + +-
        ++
        + +-char-set-count pred cs -> integer +-
        ++char-set-count pred cs -> integer= ++ ++
        ++

        + Apply pred to the chars of character set cs, an= d return the number + of chars that caused the predicate to return true. +- ++

        ++
        + +-
        +-list"> +-char-set->list cs -> character-list +-
        ++
        ++ ++char-set->list cs -> character= -list ++
        ++
        ++

        + This procedure returns a list of the members of character set cs= . + The order in which cs's characters appear in the list is n= ot defined, + and may be different from one call to another. +- ++

        ++
        + +-
        +-string"> +-char-set->string cs -> string +-
        ++
        ++ ++char-set->string cs -> string<= /var> ++
        ++
        ++

        + This procedure returns a string containing the members of character s= et cs. + The order in which cs's characters appear in the string is= not defined, + and may be different from one call to another. +- ++

        ++
        + +-
        ++
        + +-char-set-contains? cs char -> boolean<= /var> +-
        ++char-set-contains? cs char -> boo= lean ++ ++
        ++

        + This procedure tests char for membership in character set = cs. +- +-

        ++

        ++

        + The MIT Scheme character-set package called this procedure + char-set-member?, but the argument order isn't consistent = with the name. +- ++

        ++
        + +-
        ++
        + + +-char-set-every pred cs -> boolean +-
        char-set-any   pred cs -> boolean +-
        ++char-set-every pred cs -> boolean= ++ ++
        char-set-any  = pred cs -> boolean ++
        ++
        ++

        + The char-set-every procedure returns true if predicate <= var>pred + returns true of every character in the character set cs. + Likewise, char-set-any applies pred to every = character in +@@ -1046,169 +1181,171 @@ with + If no character produces a true value, it returns false. + The order in which these procedures sequence through the elements of + cs is not specified. +- +-

        ++

        ++

        + Note that if you need to determine the actual character on which a=20 + predicate returns true, use char-set-any and arrange for= the predicate=20 + to return the character parameter as its true value, e.g. +-

        ++

        ++
        + (char-set-any (lambda (c) (and (char-upper-case? c) c))=20
        +               cs)
        + 
        ++
        +
        +- + +-

        Character-set algebra

        ++

        Character-set algebra

        +
        +=20 + +-
        ++
        + + +-char-set-adjoin cs char1 ..= . -> char-set +-
        char-set-delete = cs char1 ... -> char-set +-
        ++char-set-adjoin cs char1 = ... -> char-set ++ ++
        char-set-delete cs char1 ... -> char-set ++
        ++
        ++

        + Add/delete the chari characters to/from charact= er set cs. +- ++

        ++
        + +-
        ++
        + + +-char-set-adjoin! cs char1 .= .. -> char-set +-
        char-set-delete!= cs char1 ... -> char-set +-
        +- ++char-set-adjoin! cs char1= ... -> char-set ++ ++
        char-set-delete!<= var> cs char1 ... -> char-set ++
        ++
        ++

        + Linear-update variants. These procedures are allowed, but not + required, to side-effect their first parameter. +- ++

        ++
        + +-
        ++
        + + + + + + +-char-set-complement cs = -> char-set +-
        char-set-union c= s1 ... -> char-set +-
        char-set-intersection= cs1 ... -> char-set +-
        char-set-difference cs1 cs2 ... -> char-set +-
        char-set-xor cs<= sub>1 ... -> char-set +-
        char-set-diff+intersection cs1 cs2 ... -> [char-set char-set] +-
        ++char-set-complement cs = -> char-set ++ ++
        char-set-union cs1 ... -> char-set ++
        ++
        char-set-intersection cs1 ... -> char-set ++
        ++
        char-set-difference cs1 cs2 ... -> char-set ++
        ++
        char-set-xor= cs1 ... -> char-set ++
        ++
        char-set-diff+intersecti= on cs1 cs2 ... -> [char-set char-set]<= /var> ++
        ++
        ++

        + These procedures implement set complement, union, intersection, + difference, and exclusive-or for character sets. The union, intersect= ion + and xor operations are n-ary. The difference function is also n-ary, + associates to the left (that is, it computes the difference between + its first argument and the union of all the other arguments), + and requires at least one argument. +- +-

        ++

        ++

        + Boundary cases: +-

        +-(char-set-union) =3D> char-set:empty
        +-(char-set-intersection) =3D> char-set:full
        +-(char-set-xor) =3D> char-set:empty
        +-(char-set-difference cs) =3D> cs
        ++

        ++
        ++(char-set-union) =3D> char-set:empty
        ++(char-set-intersection) =3D> char-set:full
        ++(char-set-xor) =3D> char-set:empty
        ++(char-set-difference cs) =3D> cs
        + 
        +- +-

        ++

        + char-set-diff+intersection returns both the difference a= nd the + intersection of the arguments -- it partitions its first parameter. + It is equivalent to=20 +-

        ++

        ++
        + (values (char-set-difference cs1 cs2 ...)
        +         (char-set-intersection cs1 (char-set-union =
        cs2 ...)))
        + 
        ++

        + but can be implemented more efficiently. +- ++

        +

        + Programmers should be aware that char-set-complement cou= ld potentially + be a very expensive operation in Scheme implementations that provide + a very large character type, such as 32-bit Unicode. If this is a + possibility, sets can be complimented with respect to a smaller + universe using char-set-difference. +- +- ++

        ++
        + +-
        +- +- +- +- +- +- +-char-set-complement! cs = -> char-set +-
        char-set-union! = cs1 cs2 ... -> char-set +-
        char-set-intersection! cs1 cs2 ... -> char-set +-
        char-set-difference!<= var> cs1 cs2 ... -> char-set +-
        char-set-xor! c= s1 cs2 ... -> char-set +-
        char-set-diff+intersection!<= /code> cs1 cs2 cs3 ... -> [char-set = char-set] +-
        ++
        ++char-set-complement! cs = -> char-set ++
        ++
        c= har-set-union! cs1 cs2 ... = -> char-set ++
        ++
        char-set-intersection! cs1 cs2 ...= -> char-set ++
        ++
        char-set-difference! cs1 cs2 ... = -> char-set ++
        ++
        cha= r-set-xor! cs1 cs2 ... = -> char-set ++
        ++
        char-set-diff+intersection! cs1 cs2= cs3 ... -> [char-set char-set] ++
        ++
        ++

        + These are linear-update variants of the set-algebra functions. + They are allowed, but not required, to side-effect their first (requi= red) + parameter. +- +-

        ++

        ++

        + char-set-diff+intersection! is allowed to side-effect bo= th + of its two required parameters, cs1 + and cs2. ++

        ++
        +
        +=20 + +-

        Standard character sets

        ++

        Standard character sets

        +

        + Several character sets are predefined for convenience: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-

        +- +-= +-= +-= +- +- +- +- +- +- +- +- +- +- +- +- +- +- ++

        ++
        ++
        char-set:lower-case Lower-case letters
        char-set:upper-case Upper-case letters
        char-set:title-case Title-case letters
        char-set:letter Letters
        char-set:digit Digits
        char-set:letter+digit Letters and digits
        char-set:graphic Printing characters except= spaces
        char-set:printing Printing characters inclu= ding spaces
        char-set:whitespace Whitespace characters <= /td>
        char-set:iso-control The ISO control charac= ters
        char-set:punctuation Punctuation characters=
        char-set:symbol Symbol characters
        char-set:hex-digit A hexadecimal digit: 0-9= , A-F, a-f
        char-set:blank Blank characters -- horizont= al whitespace
        char-set:ascii All characters in the ASCII = set.
        char-set:empty Empty set
        char-set:full All characters
        ++= ++= ++= ++ ++ ++ ++ ++ ++= ++ ++ ++ ++A hexadecimal digit: 0-9, A-F, a-f ++ ++ ++ ++ +
        char-set:lower-case Lower-case letters
        char-set:upper-case Upper-case letters
        char-set:title-case Title-case letters
        char-set:letter Lett= ers
        char-set:digit Digits=
        char-set:letter+digit <= /td>Letters and digits
        char-set:graphic Pr= inting characters except spaces
        char-set:printing = Printing characters including spaces
        char-set:whitespace Whitespace characters
        char-set:iso-control The ISO control characters
        char-set:punctuation Punctuation characters
        char-set:symbol Symb= ol characters
        char-set:hex-digit
        char-set:blank Blank = characters -- horizontal whitespace
        char-set:ascii All ch= aracters in the ASCII set.
        char-set:empty Empty = set
        char-set:full All char= acters
        +
        +- +

        + Note that there may be characters in char-set:letter that ar= e neither upper or + lower case---this might occur in implementations that use a character type +@@ -1216,8 +1353,9 @@ richer than ASCII, such as Unicode. A "graphic chara= cter" is one that would + put ink on your page. While the exact composition of these sets may vary + depending upon the character type provided by the underlying Scheme syste= m, + here are the definitions for some of the sets in an ASCII implementation: +-

        +- ++

        ++
        ++
        + + + +@@ -1232,76 +1370,93 @@ here are the definitions for some of the sets in a= n ASCII implementation: + +
        char-set:lower-case a-z
        char-set:upper-case A-Z
        char-set:letter A-Z and a-z
        char-set:iso-control ASCII 0-31 and 127
        +
        +- +

        + Note that the existence of the char-set:ascii set implies th= at the underlying + character set is required to be at least as rich as ASCII (including + ASCII's control characters). +- ++

        +

        + Rationale: The name choices reflect a shift from the older "alphabetic/nu= meric" + terms found in=20 + R5RS + and Posix to newer, Unicode-influenced "letter/digit" lexemes. +- ++

        + +-

        +- Unicode, Latin-1 and ASCII definitions of the standard character sets= +-

        ++

        ++ Unicode, Latin-1 and ASCII definitions of the standard character sets ++

        +

        + In Unicode Scheme implementations, the base character sets are compatible= with +-Java's Unicode specifications. For ASCII or Latin-1, we simply restrict t= he ++Java's Unicode specifications. ++ ++

        ++

        For ASCII or Latin-1, we simply restrict the + Unicode set specifications to their first 128 or 256 codes, respectively. + Scheme implementations that are not based on ASCII, Latin-1 or Unicode sh= ould + attempt to preserve the sense or spirit of these definitions. +- ++

        +

        + The following descriptions frequently make reference to the "Unicode char= acter + database." This is a file, available at URL +-

        ++

        ++ +-

        ++

        + Each line contains a description of a Unicode character. The first + semicolon-delimited field of the line gives the hex value of the characte= r's + code; the second field gives the name of the character, and the third fie= ld + gives a two-letter category. Other fields give simple 1-1 case-mappings f= or + the character and other information; see +-

        ++

        ++ +-

        ++

        + for further description of the file's format. Note in particular the +-two-letter category specified in the third field, which is referenced ++two-letter category specified in the the third field, which is referenced + frequently in the descriptions below. +- ++

        + +-

        char-set:lower-case

        ++

        char-set:lower-case

        +

        + For Unicode, we follow Java's specification: a character is lowercase if ++

        +
          +-
        • it is not in the range [U+2000,U+2FFF], and +-
        • the Unicode attribute table does not give a lowercase mapping for it= , and +-
        • at least one of the following is true: +-
            +-
          • the Unicode attribute table gives a mapping to uppercase=20 +- for the character, or +-
          • the name for the character in the Unicode attribute table contains ++
          • it is not in the range [U+2000,U+2FFF], and ++
          • ++
          • the Unicode attribute table does not give a lowercase mapping for = it, and ++
          • ++
          • at least one of the following is true: ++
              ++
            • the Unicode attribute table gives a mapping to uppercase ++ for the character, or ++
            • ++
            • the name for the character in the Unicode attribute table cont= ains + the words "SMALL LETTER" or "SMALL LIGATURE". +-
            ++
          • ++
          ++
        • +
        +=20 +

        + The lower-case ASCII characters are=20 +-

        ++

        ++
        + abcdefghijklmnopqrstuvwxyz +
        +-

        ++

        + Latin-1 adds another 33 lower-case characters to the ASCII set: +-

        +- ++

        ++
        ++
        + + + +@@ -1337,38 +1492,41 @@ Latin-1 adds another 33 lower-case characters to t= he ASCII set: + +
        00B5 MICRO SIGN
        00DF LATIN SMALL LETTER SHARP S
        00E0 LATIN SMALL LETTER A WITH GRAVE
        00FF LATIN SMALL LETTER Y WITH DIAERESIS
        +
        +-

        ++

        + Note that three of these have no corresponding Latin-1 upper-case charact= er: +-

        +- ++

        ++
        ++
        + + + +
        00B5 MICRO SIGN
        00DF LATIN SMALL LETTER SHARP S
        00FF LATIN SMALL LETTER Y WITH DIAERESIS
        +
        +-

        ++

        + (The compatibility micro character uppercases to the non-Latin-1 Greek ca= pital + mu; the German sharp s character uppercases to the pair of characters "SS= ," + and the capital y-with-diaeresis is non-Latin-1.) +- ++

        +

        + (Note that the Java spec for lowercase characters given at +-

        ++

        ++ +-

        ++

        + is inconsistent. U+00B5 MICRO SIGN fulfills the requirements for a lower-= case + character (as of Unicode 3.0), but is not given in the numeric list of + lower-case character codes.) +- ++

        +

        + (Note that the Java spec for isLowerCase() given at +-

        ++

        ++ +-

        ++

        + gives three mutually inconsistent definitions of "lower case." The first = is + the definition used in this SRFI. Following text says "A character is + considered to be lowercase if and only if it is specified to be lowercase= by +@@ -1377,33 +1535,41 @@ file)." The former spec excludes U+00AA FEMININE O= RDINAL INDICATOR and + U+00BA MASCULINE ORDINAL INDICATOR; the later spec includes them. Finally, + the spec enumerates a list of characters in the Latin-1 subset; this list + excludes U+00B5 MICRO SIGN, which is included in both of the previous spe= cs.)=20 +- ++

        + +-

        char-set:upper-case

        ++

        char-set:upper-case

        +

        + For Unicode, we follow Java's specification: a character is uppercase if ++

        +
          +-
        • it is not in the range [U+2000,U+2FFF], and +-
        • the Unicode attribute table does not give an uppercase mapping for it ++
        • it is not in the range [U+2000,U+2FFF], and ++
        • ++
        • the Unicode attribute table does not give an uppercase mapping for= it + (this excludes titlecase characters), and +-
        • at least one of the following is true: +-
            +-
          • the Unicode attribute table gives a mapping to lowercase=20 ++
          • ++
          • at least one of the following is true: ++
              ++
            • the Unicode attribute table gives a mapping to lowercase + for the character, or +-
            • the name for the character in the Unicode attribute table contains ++
            • ++
            • the name for the character in the Unicode attribute table cont= ains + the words "CAPITAL LETTER" or "CAPITAL LIGATURE". +-
            ++
          • ++
          ++
        • +
        +=20 +

        + The upper-case ASCII characters are=20 +-

        ++

        ++
        + ABCDEFGHIJKLMNOPQRSTUVWXYZ +
        +-

        ++

        + Latin-1 adds another 30 upper-case characters to the ASCII set: +-

        +- ++

        ++
        ++
        + + + +@@ -1437,109 +1603,112 @@ Latin-1 adds another 30 upper-case characters to= the ASCII set: +
        00C0 LATIN CAPITAL LETTER A WITH GRAVE
        00C1 LATIN CAPITAL LETTER A WITH ACUTE
        00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
        +
        + +-

        char-set:title-case

        ++

        char-set:title-case

        +

        + In Unicode, a character is titlecase if it has the category Lt in + the character attribute database. There are very few of these characters; + here is the entire 31-character list as of Unicode 3.0: +-

        +- +-
        01C5 LATIN CAPITAL LETTER D WITH SMALL LETTER Z = WITH CARON ++

        ++
        ++ ++ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +
        01C5 LATIN CAPITAL LETTER D WITH SMAL= L LETTER Z WITH CARON +
        01C8 LATIN CAPITAL LETTER L WITH SMALL LETTER J ++
        01C8 LATIN CAPITAL LETTER L WITH SMAL= L LETTER J +
        01CB LATIN CAPITAL LETTER N WITH SMALL LETTER J ++
        01CB LATIN CAPITAL LETTER N WITH SMAL= L LETTER J +
        01F2 LATIN CAPITAL LETTER D WITH SMALL LETTER Z ++
        01F2 LATIN CAPITAL LETTER D WITH SMAL= L LETTER Z +
        1F88 GREEK CAPITAL LETTER ALPHA WITH PSILI AND P= ROSGEGRAMMENI ++
        1F88 GREEK CAPITAL LETTER ALPHA WITH = PSILI AND PROSGEGRAMMENI +
        1F89 GREEK CAPITAL LETTER ALPHA WITH DASIA AND P= ROSGEGRAMMENI ++
        1F89 GREEK CAPITAL LETTER ALPHA WITH = DASIA AND PROSGEGRAMMENI +
        1F8A GREEK CAPITAL LETTER ALPHA WITH PSILI AND VA= RIA AND PROSGEGRAMMENI ++
        1F8A GREEK CAPITAL LETTER ALPHA WITH P= SILI AND VARIA AND PROSGEGRAMMENI +
        1F8B GREEK CAPITAL LETTER ALPHA WITH DASIA AND V= ARIA AND PROSGEGRAMMENI ++
        1F8B GREEK CAPITAL LETTER ALPHA WITH = DASIA AND VARIA AND PROSGEGRAMMENI +
        1F8C GREEK CAPITAL LETTER ALPHA WITH PSILI AND O= XIA AND PROSGEGRAMMENI ++
        1F8C GREEK CAPITAL LETTER ALPHA WITH = PSILI AND OXIA AND PROSGEGRAMMENI +
        1F8D GREEK CAPITAL LETTER ALPHA WITH DASIA AND O= XIA AND PROSGEGRAMMENI ++
        1F8D GREEK CAPITAL LETTER ALPHA WITH = DASIA AND OXIA AND PROSGEGRAMMENI +
        1F8E GREEK CAPITAL LETTER ALPHA WITH PSILI AND P= ERISPOMENI AND PROSGEGRAMMENI ++
        1F8E GREEK CAPITAL LETTER ALPHA WITH = PSILI AND PERISPOMENI AND PROSGEGRAMMENI +
        1F8F GREEK CAPITAL LETTER ALPHA WITH DASIA AND P= ERISPOMENI AND PROSGEGRAMMENI ++
        1F8F GREEK CAPITAL LETTER ALPHA WITH = DASIA AND PERISPOMENI AND PROSGEGRAMMENI +
        1F98 GREEK CAPITAL LETTER ETA WITH PSILI AND PRO= SGEGRAMMENI ++
        1F98 GREEK CAPITAL LETTER ETA WITH PS= ILI AND PROSGEGRAMMENI +
        1F99 GREEK CAPITAL LETTER ETA WITH DASIA AND PRO= SGEGRAMMENI ++
        1F99 GREEK CAPITAL LETTER ETA WITH DA= SIA AND PROSGEGRAMMENI +
        1F9A GREEK CAPITAL LETTER ETA WITH PSILI AND VAR= IA AND PROSGEGRAMMENI ++
        1F9A GREEK CAPITAL LETTER ETA WITH PS= ILI AND VARIA AND PROSGEGRAMMENI +
        1F9B GREEK CAPITAL LETTER ETA WITH DASIA AND VAR= IA AND PROSGEGRAMMENI ++
        1F9B GREEK CAPITAL LETTER ETA WITH DA= SIA AND VARIA AND PROSGEGRAMMENI +
        1F9C GREEK CAPITAL LETTER ETA WITH PSILI AND OXI= A AND PROSGEGRAMMENI ++
        1F9C GREEK CAPITAL LETTER ETA WITH PS= ILI AND OXIA AND PROSGEGRAMMENI +
        1F9D GREEK CAPITAL LETTER ETA WITH DASIA AND OXI= A AND PROSGEGRAMMENI ++
        1F9D GREEK CAPITAL LETTER ETA WITH DA= SIA AND OXIA AND PROSGEGRAMMENI +
        1F9E GREEK CAPITAL LETTER ETA WITH PSILI AND PER= ISPOMENI AND PROSGEGRAMMENI ++
        1F9E GREEK CAPITAL LETTER ETA WITH PS= ILI AND PERISPOMENI AND PROSGEGRAMMENI +
        1F9F GREEK CAPITAL LETTER ETA WITH DASIA AND PER= ISPOMENI AND PROSGEGRAMMENI ++
        1F9F GREEK CAPITAL LETTER ETA WITH DA= SIA AND PERISPOMENI AND PROSGEGRAMMENI +
        1FA8 GREEK CAPITAL LETTER OMEGA WITH PSILI AND P= ROSGEGRAMMENI ++
        1FA8 GREEK CAPITAL LETTER OMEGA WITH = PSILI AND PROSGEGRAMMENI +
        1FA9 GREEK CAPITAL LETTER OMEGA WITH DASIA AND P= ROSGEGRAMMENI ++
        1FA9 GREEK CAPITAL LETTER OMEGA WITH = DASIA AND PROSGEGRAMMENI +
        1FAA GREEK CAPITAL LETTER OMEGA WITH PSILI AND V= ARIA AND PROSGEGRAMMENI ++
        1FAA GREEK CAPITAL LETTER OMEGA WITH = PSILI AND VARIA AND PROSGEGRAMMENI +
        1FAB GREEK CAPITAL LETTER OMEGA WITH DASIA AND V= ARIA AND PROSGEGRAMMENI ++
        1FAB GREEK CAPITAL LETTER OMEGA WITH = DASIA AND VARIA AND PROSGEGRAMMENI +
        1FAC GREEK CAPITAL LETTER OMEGA WITH PSILI AND O= XIA AND PROSGEGRAMMENI ++
        1FAC GREEK CAPITAL LETTER OMEGA WITH = PSILI AND OXIA AND PROSGEGRAMMENI +
        1FAD GREEK CAPITAL LETTER OMEGA WITH DASIA AND O= XIA AND PROSGEGRAMMENI ++
        1FAD GREEK CAPITAL LETTER OMEGA WITH = DASIA AND OXIA AND PROSGEGRAMMENI +
        1FAE GREEK CAPITAL LETTER OMEGA WITH PSILI AND P= ERISPOMENI AND PROSGEGRAMMENI ++
        1FAE GREEK CAPITAL LETTER OMEGA WITH = PSILI AND PERISPOMENI AND PROSGEGRAMMENI +
        1FAF GREEK CAPITAL LETTER OMEGA WITH DASIA AND P= ERISPOMENI AND PROSGEGRAMMENI ++
        1FAF GREEK CAPITAL LETTER OMEGA WITH = DASIA AND PERISPOMENI AND PROSGEGRAMMENI +
        1FBC GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMM= ENI ++
        1FBC GREEK CAPITAL LETTER ALPHA WITH = PROSGEGRAMMENI +
        1FCC GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI ++
        1FCC GREEK CAPITAL LETTER ETA WITH PR= OSGEGRAMMENI +
        1FFC GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMM= ENI ++
        1FFC GREEK CAPITAL LETTER OMEGA WITH = PROSGEGRAMMENI +
        +
        +

        + There are no ASCII or Latin-1 titlecase characters. +- ++

        +=20 + +-

        char-set:letter

        ++

        char-set:letter

        +

        + In Unicode, a letter is any character with one of the letter categories + (Lu, Ll, Lt, Lm, Lo) in the Unicode character database.=20 +- ++

        +

        + There are 52 ASCII letters +-

        +- abcdefghijklmnopqrstuvwxyz
        +- ABCDEFGHIJKLMNOPQRSTUVWXYZ
        ++

        ++
        ++ abcdefghijklmnopqrstuvwxyz
        ++ ABCDEFGHIJKLMNOPQRSTUVWXYZ
        +
        +

        + There are 117 Latin-1 letters. These are the 115 characters that are + members of the Latin-1 char-set:lower-case and char-se= t:upper-case sets,=20 + plus +-

        +- ++

        ++
        ++
        + + +
        00AA FEMININE ORDINAL INDICATOR
        00BA MASCULINE ORDINAL INDICATOR
        +
        +-

        ++

        + (These two letters are considered lower-case by Unicode, but not by + Java or SRFI 14.) +- ++

        + +-

        char-set:digit

        ++

        char-set:digit

        +=20 +

        + In Unicode, a character is a digit if it has the category Nd in +@@ -1547,26 +1716,27 @@ the character attribute database. In Latin-1 and A= SCII, the only + such characters are 0123456789. In Unicode, there are other digit + characters in other code blocks, such as Gujarati digits and Tibetan + digits. +- ++

        +=20 + +-

        char-set:hex-digit

        ++

        char-set:hex-digit

        +

        + The only hex digits are 0123456789abcdefABCDEF. +- ++

        +=20 + +-

        char-set:letter+digit

        ++

        char-set:letter+digit

        +

        + The union of char-set:letter and char-set:digit. +- ++

        + +-

        char-set:graphic

        ++

        char-set:graphic

        +

        + A graphic character is one that would put ink on paper. The ASCII and Lat= in-1 + graphic characters are the members of +-

        +- ++

        ++
        ++
        + + + +@@ -1575,30 +1745,38 @@ graphic characters are the members of + +=20 + +-

        char-set:printing

        ++

        char-set:printing

        +

        + A printing character is one that would occupy space when printed, i.e= ., + a graphic character or a space character. char-set:printing = is the union + of char-set:whitespace and char-set:graphic. +- ++

        + +-

        char-set:whitespace

        ++

        char-set:whitespace

        +

        + In Unicode, a whitespace character is either ++

        +
          +
        • a character with one of the space, line, or paragraph separator ca= tegories + (Zs, Zl or Zp) of the Unicode character database. ++
        • +
        • U+0009 Horizontal tabulation (\t control-I) ++
        • +
        • U+000A Line feed (\n control-J) ++
        • +
        • U+000B Vertical tabulation (\v control-K) ++
        • +
        • U+000C Form feed (\f control-L) ++
        • +
        • U+000D Carriage return (\r control-M) ++
        • +
        +=20 +

        + There are 24 whitespace characters in Unicode 3.0: +-

        +-
        char-set:letter
        char-set:digit
        char-set:punctuation
        ++

        ++
        ++
        + = + + +@@ -1630,11 +1808,12 @@ The ASCII whitespace characters are the first six = characters in the above list + -- line feed, horizontal tabulation, vertical tabulation, form feed, carr= iage + return, and space. These are also exactly the characters recognised by the + Posix isspace() procedure. Latin-1 adds the no-break space. +- ++

        +

        + Note: Java's isWhitespace() method is incompatible, including +-

        +-
        0009 HORIZONTAL TABULATION \t control-I
        000A LINE FEED \n control-J
        000B VERTICAL TABULATION \v control-K
        ++

        ++
        ++
        + + + +@@ -1642,10 +1821,11 @@ Note: Java's isWhitespace() method is= incompatible, including + +
        0009 HORIZONTAL TABULATION (\t control-I)
        001C FILE SEPARATOR (control-\)
        001D GROUP SEPARATOR (control-])
        001F UNIT SEPARATOR (control-_)
        +
        +-

        ++

        + and excluding +-

        +- ++

        ++
        ++
        + +
        00A0 NO-BREAK SPACE
        +
        +@@ -1654,67 +1834,71 @@ Java's excluding the no-break space means that tok= enizers can simply break + character streams at "whitespace" boundaries. However, the exclusion intr= oduces + exceptions in other places, e.g. char-set:printing = is no longer simply the + union of char-set:graphic and char-set:whitespace. +- ++

        +=20 + +-

        char-set:iso-control

        ++

        char-set:iso-control

        +

        + The ISO control characters are the Unicode/Latin-1 characters in the rang= es + [U+0000,U+001F] and [U+007F,U+009F]. +- ++

        +

        + ASCII restricts this set to the characters in the range [U+0000,U+001F]=20 + plus the character U+007F. +- ++

        +

        + Note that Unicode defines other control characters which do not belong to= this + set (hence the qualifying prefix "iso-" in the name). This restriction is + compatible with the Java IsISOControl() method. +- ++

        +=20 + +-

        char-set:punctuation

        ++

        char-set:punctuation

        +

        + In Unicode, a punctuation character is any character that has one of the + punctuation categories in the Unicode character database (Pc, Pd, Ps, + Pe, Pi, Pf, or Po.) +- ++

        +

        + ASCII has 23 punctuation characters: +-

        ++

        ++
        + !"#%&'()*,-./:;?@[\]_{}
        + 
        +

        + Latin-1 adds six more: +-

        +- ++

        ++
        ++
        +
        00A1 INVERTED EXCLAMATION MARK +-
        00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +-
        00AD SOFT HYPHEN +-
        00B7 MIDDLE DOT +-
        00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +-
        00BF INVERTED QUESTION MARK +-
        ++
        00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MA= RK ++
        00AD SOFT HYPHEN ++
        00B7 MIDDLE DOT ++
        00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION M= ARK ++
        00BF INVERTED QUESTION MARK ++
        +
        +=20 +

        +-Note that the nine ASCII characters $+<=3D>^`|~ are not<= /em> ++Note that the nine ASCII characters $+<=3D>^`|~ are not + punctuation. They are "symbols." +- ++

        +=20 + +-

        char-set:symbol

        ++

        char-set:symbol

        +

        + In Unicode, a symbol is any character that has one of the symbol categori= es + in the Unicode character database (Sm, Sc, Sk, or So). There + are nine ASCII symbol characters: +-

        ++

        ++
        + $+<=3D>^`|~
        + 
        +

        + Latin-1 adds 18 more: +-

        +- ++

        ++
        ++
        + + + +@@ -1737,20 +1921,24 @@ Latin-1 adds 18 more: + +=20 + +-

        char-set:blank

        ++

        char-set:blank

        +=20 +

        + Blank chars are horizontal whitespace. In Unicode, a blank character is e= ither ++

        +
          +
        • a character with the space separator category (Zs) in the Unicode= =20 + character database. ++
        • +
        • U+0009 Horizontal tabulation (\t control-I) ++
        • +
        +=20 +

        + There are eighteen blank characters in Unicode 3.0: +-

        +-
        00A2 CENT SIGN
        00A3 POUND SIGN
        00A4 CURRENCY SIGN
        ++

        ++
        ++
        + + + +@@ -1774,21 +1962,22 @@ There are eighteen blank characters in Unicode 3.0: +

        + The ASCII blank characters are the first two characters above -- + horizontal tab and space. Latin-1 adds the no-break space. +- ++

        +

        + Java doesn't have the concept of "blank" characters, so there are no + compatibility issues. +- ++

        +=20 + +-

        Reference implementation

        ++

        Reference implementation

        +

        + This SRFI comes with a reference implementation. It resides at: +-

        +- +-http://srfi.schemers.org/srfi-14/srfi-14.scm ++

        ++ +-

        ++

        + I have placed this source on the Net with an unencumbered, "open" copyrig= ht. + Some of the code in the reference implementation bears a distant family + relation to the MIT Scheme implementation, and being derived from that co= de, +@@ -1797,37 +1986,45 @@ open-source copyright -- see the source file for d= etails). The remainder of + the code was written by myself for scsh or for this SRFI; I have placed t= his + code under the scsh copyright, which is also a generic BSD-style open-sou= rce + copyright. +- ++

        +

        + The code is written for portability and should be simple to port to + any Scheme. It has only the following deviations from R4RS, clearly + discussed in the comments: ++

        +
          +
        • an error procedure; ++
        • +
        • the R5RS values procedure for producing multiple retu= rn values; ++
        • +
        • a simple check-arg procedure for argument checking; ++
        • +
        • let-optionals* and :optional macros for = for parsing, checking and defaulting + optional arguments from rest lists; ++
        • +
        • The SRFI-19 define-record-type form; ++
        • +
        • bitwise-and for the hash function; +-
        • %latin1->char and %char->latin1. ++
        • ++
        • %latin1->char and %char->latin1. ++
        • +
        +=20 +

        + The library is written for clarity and well-commented; the current source= is + about 375 lines of source code and 375 lines of comments and white space. + It is also written for efficiency. Fast paths are provided for common cas= es. +- ++

        +

        + This is not to say that the implementation can't be tuned up for + a specific Scheme implementation. There are notes in comments addressing + ways implementors can tune the reference implementation for performance. +- ++

        +

        + In short, I've written the reference implementation to make it as painless + as possible for an implementor -- or a regular programmer -- to adopt this + library and get good results with it. +- ++

        +

        + The code uses a rather simple-minded, inefficient representation for + ASCII/Latin-1 char-sets -- a 256-character string. The character whose co= de is +@@ -1836,15 +2033,15 @@ not in the set if s[i] =3D ASCII 0 (nul= ). + A much faster and denser representation would be 16 or 32 bytes worth + of bit string. A portable implementation using bit sets awaits standards = for + bitwise logical-ops and byte vectors. +- ++

        +

        + "Large" character types, such as Unicode, should use a sparse representat= ion, + taking care that the Latin-1 subset continues to be represented with a + dense 32-byte bit set. +- ++

        +=20 + +-

        Acknowledgements

        ++

        Acknowledgements

        +

        + The design of this library benefited greatly from the feedback provided d= uring + the SRFI discussion phase. Among those contributing thoughtful commentary= and +@@ -1857,114 +2054,127 @@ Kiselyov, Bengt Kleberg, Donovan Kolbly, Bruce K= orb, Shriram Krishnamurthi, + Bruce Lewis, Tom Lord, Brad Lucier, Dave Mason, David Rush, Klaus Schilli= ng, + Jonathan Sobel, Mike Sperber, Mikael Staldal, Vladimir Tsyshevsky, Donald + Welsh, and Mike Wilson. I am grateful to them for their assistance. +- ++

        +

        + I am also grateful the authors, implementors and documentors of all the + systems mentioned in the introduction. Aubrey Jaffer should be noted for = his + work in producing Web-accessible versions of the R5RS spec, which was a + tremendous aid. +- ++

        +

        + This is not to imply that these individuals necessarily endorse the final + results, of course.=20 +- ++

        +

        + During this document's long development period, great patience was exhibi= ted + by Mike Sperber, who is the editor for the SRFI, and by Hillary Sullivan, + who is not. +- ++

        + +-

        References & links

        ++

        References & links

        +=20 +
        +-
        [Java] ++
        [Java] ++
        +
        +- The following URLs provide documentation on relevant Java classes. ++ The following URLs provide documentation on relevant Java classes. +=20 + http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Chara= cter.html +-
        ++
        + http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.h= tml +-
        ++
        + http://java.sun.com/products/jdk/1.2/docs/api/java/lang/St= ringBuffer.html +-
        ++
        + http://java.sun.com/products/jdk/1.2/docs/api/java/text/Collat= or.html +-
        ++
        + http://java.sun.com/products/jdk/1.2/docs/api/java/text= /package-summary.html +=20 +-
        [MIT-Scheme] ++ ++
        [MIT-Scheme] ++
        +
        + http://www.s= wiss.ai.mit.edu/projects/scheme/ +=20 +-
        [R5RS]
        +-
        Revised5 report on the algorithmic language Scheme.
        +- R. Kelsey, W. Clinger, J. Rees (editors).
        +- Higher-Order and Symbolic Computation, Vol. 11, No. 1, September, 199= 8.
        +- and ACM SIGPLAN Notices, Vol. 33, No. 9, October, 1998.
        ++
        ++
        [R5RS]
        ++
        Revised5 report on the algorithmic language Scheme.
        ++ R. Kelsey, W. Clinger, J. Rees (editors).
        ++ Higher-Order and Symbolic Computation, Vol. 11, No. 1, September, 199= 8.
        ++ and ACM SIGPLAN Notices, Vol. 33, No. 9, October, 1998.
        + Available at + http://www.schemers.org/Documents/Standards/. +=20 +-
        [SRFI]
        ++ ++
        [SRFI]
        +
        +- The SRFI web site.
        +- http://srfi.schemers.org/ ++ The SRFI web site.
        ++ http://srfi.schemers.org/ +=20 +-
        [SRFI-14]
        ++ ++
        [SRFI-14]
        +
        +- SRFI-14: String libraries.
        +- http://srfi.schemers.or= g/srfi-14/ +- ++ SRFI-14: String libraries.
        ++ http://srfi.schemers.org/srfi-14/ +
        =20=20=20=20 +
        + This document, in HTML: +-
        +- http://srfi.schemers.org/srfi-14/srfi-14.html +- ++ ++
        ++ https://srfi.schemers.org/srfi-14/srfi-14.html ++
        +
        + This document, in plain text format: +-
        +- http://srfi.schemers.org/srfi-14/srfi-14.txt +- ++ ++
        ++ https://srfi.schemers.org/srfi-14/srfi-14.txt ++
        +
        Source code for the reference implementation: ++
        +
        +- +- http://srfi.schemers.org/srfi-14/srfi-14.scm +- ++ ++ https://srfi.schemers.org/srfi-14/srfi-14.scm ++
        +
        Scheme 48 module specification, with typings: ++
        +
        +- +- http://srfi.schemers.org/srfi-14/srfi-14-s48-module.scm +- ++ ++ https://srfi.schemers.org/srfi-14/srfi-14-s48-module.scm ++
        +
        Regression-test suite: +-
        +- http://srfi.schemers.org/srfi-14/srfi-14-tests.scm +- ++ ++
        ++ https://srfi.schemers.org/srfi-14/srfi-14-tests.scm ++
        +
        +
        +=20 +-
        [Unicode] ++
        [Unicode] ++
        +
        + http://www.unicode.org/ +- +-
        [UnicodeData] ++ ++
        [UnicodeData] ++
        +
        +- The Unicode character database.
        ++ The Unicode character database.
        + ftp:= //ftp.unicode.org/Public/UNIDATA/UnicodeData.txt +-
        ++
        + ftp= ://ftp.unicode.org/Public/UNIDATA/UnicodeData.html ++
        +
        +=20 + +-

        Copyright

        ++

        Copyright

        +=20 +

        + Certain portions of this document -- the specific, marked segments of text + describing the R5RS procedures -- were adapted with permission from the R5RS + report. +-=20=20=20=20 ++

        +

        + All other text is copyright (C) Olin Shivers (1998, 1999, 2000).=20 + All Rights Reserved.=20 +- ++

        +

        + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -1987,10 +2197,10 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, = WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +- ++
        ++
        Editor: Michael Sperber
        + +- +- ++ +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-16.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-16.html +index a335320..81f4963 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-16.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-16.html +@@ -1,57 +1,78 @@ +- +- ++ ++ + ++ ++ + SRFI 16: Syntax for procedures of variable arity ++ ++ + +=20 + +=20 +-

        Title

        ++

        SRFI 16: Syntax for procedures of variable arity.

        +=20 +-SRFI 16: Syntax for procedures of variable arity. ++

        by Lars T Hansen

        ++

        This copy of the SRFI 16 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-16/srfi-16.html.

        +=20 +-

        Author

        ++

        Status

        +=20 +-Lars T Hansen +- +-

        Status

        +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion via the archive of the mailing list. +-

          +-
        • Received: 1999/11/01 +-
        • Draft: 1999/11/06-2000/01/07 +-
        • Final: 2000/03/10 +-
        +- +-

        Abstract

        ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 16@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

        ++
          ++
        • Received: 1999-11-01
        • ++
        • Draft: 1999-11-06--2000-01-07
        • ++
        • Final: 2000-03-10
        • ++
        +=20 ++

        Abstract

        ++

        + CASE-LAMBDA, a syntax for procedures with a variable number of arguments, + is introduced. ++

        +=20 +-

        Rationale

        +- ++

        Rationale

        ++

        + CASE-LAMBDA reduces the clutter of procedures that execute different + code depending on the number of arguments they were passed; it is=20 + a pattern-matching mechanism that matches on the number of arguments. + CASE-LAMBDA is available in some Scheme systems. +- ++

        +

        While CASE-LAMBDA can be implemented as a macro using only facilities + available in R5RS Scheme, it admits considerable implementation-specific + optimization. ++

        +=20 +- +-

        Specification

        ++

        Specification

        +=20 +
        +-
        ++
        + (CASE-LAMBDA <clause> ...) +-
        Syntax ++
        Syntax ++
        +
        +-

        Each <clause> should have the form (<formals> <body>= ), where=20 ++

        Each <clause> should have the form (<formals> <body>= ), where + <formals> is a formal arguments list as for LAMBDA, cf section + 4.1.4 of the R5RS. Each <body> is a <tail-body>, cf secti= on + 3.5 of the R5RS. +- ++

        +

        A CASE-LAMBDA expression evaluates to a procedure that accepts + a variable number of arguments and is lexically scoped in the + same manner as procedures resulting from LAMBDA expressions.=20=20 +@@ -63,10 +84,10 @@ optimization. + locations, the <body> is evaluated in the extended environment, + and the results of <body> are returned as the results of the=20 + procedure call. +- ++

        +

        It is an error for the arguments not to agree with the <formals> + of any <clause>. +- ++

        +
        +              (define plus
        +                (case-lambda=20
        +@@ -85,23 +106,26 @@ optimization.
        +                ((a b) (* a b)))
        +               1 2 3)                    --> error
        + 
        ++
        +
        +=20 +-

        Implementation

        +- ++

        Implementation

        ++

        + The following implementation is written in R5RS Scheme. It is not + compatible with the IEEE Scheme standard because the IEEE standard does + not contain the high-level macro system. +- ++

        +

        The implementation assumes that some top-level names defined by the + R5RS are bound to their original values. +- +-

        ++

        +
        + ;; This code is in the public domain.
        +=20
        + (define-syntax case-lambda
        +   (syntax-rules ()
        ++    ((case-lambda)
        ++     (lambda args
        ++       (error "CASE-LAMBDA without any clauses.")))
        +     ((case-lambda=20
        +       (?a1 ?e1 ...)=20
        +       ?clause1 ...)
        +@@ -135,15 +159,14 @@ R5RS are bound to their original values.
        +       ?clause1 ...))
        +     ((case-lambda "IMPROPER" ?args ?l ?k ?al (?ar ?e1 ...)=20
        +       ?clause1 ...)
        +-     (if (>=3D ?l ?k)
        ++     (if (>=3D ?l ?k)
        +          (apply (lambda ?al ?e1 ...) ?args)
        +          (case-lambda "CLAUSE" ?args ?l=20
        +            ?clause1 ...)))))
        + 
        +=20 +-

        Copyright

        ++

        Copyright

        +

        Copyright (C) Lars T Hansen (1999). All Rights Reserved.

        +- +

        + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -167,11 +190,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        +-
        Editor: Mike Sp= erber
        ++
        ++
        Editor: Mike Sperber
        + + +-Last modified: Mon Apr 19 20:38:48 CEST 2004 ++Last modified: Fri Sep 18 18:34:31 MST 2009 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-17.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-17.html +index dc06d9d..e21b0b6 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-17.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-17.html +@@ -1,41 +1,63 @@ +- +- ++ ++ + ++ ++ + SRFI 17: Generalized set! ++ ++ ++ + +=20 + +=20 +-

        Title

        +- +-SRFI 17: Generalized set! +- +-

        Author

        ++

        SRFI 17: Generalized set!

        +=20 +-Per Bothner ++

        by Per Bothner

        ++

        This copy of the SRFI 17 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-17/srfi-17.html.

        +=20 +-

        Status

        ++

        Status

        +=20 +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion via the archive of the mailing list. +-

          +-
        • Received: 1999/12/08 +-
        • Draft: 2000/01/16-2000/03/17 +-
        • Revised: 2000/04/28 +-
        • Final: 2000/07/24 +-
        +- +-

        Abstract

        ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 17@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

        ++
          ++
        • Received: 1999-12-08
        • ++
        • Draft: 2000-01-16--2000-03-17
        • ++
        • Revised: 2000-04-28
        • ++
        • Final: 2000-07-24
        • ++
        +=20 ++

        Abstract

        ++

        + This is a proposal to allow procedure calls that evaluate + to the "value of a location" to be used to set + the value of the location, when used as the first + operand of set!. + For example: ++

        +
        + (set! (car x) (car y))
        + 
        ++

        + becomes equivalent to ++

        +
        + (set-car! x (car y))
        + 
        +@@ -49,14 +71,16 @@ which can be used in setf and some other = special forms. + However, the Common Lisp concept is based on the idea of + compile-time recognition of special "location-producing" functions; + this does not seem to be in the "spirit of Scheme". ++

        +

        + This SRFI proposes an extension of set! + so that it provides similar functionality as Common Lisp's setf, + except that the updater is associated with a procedure value, + rather than a name. ++

        +=20 +-

        Rationale

        +- ++

        Rationale

        ++

        + There is ample precedent for general "lvalues" on the + left-hand side of an assignment. This includes most statically + typed languages, and many dynamically typed languages (including APL +@@ -66,6 +90,7 @@ Another is that it becomes visually clearer which expres= sion is the new value, + and which are parameters. Also, the visual consistency between + an expression evaluated for its value and one evaluated to yield + a location seems natural to people. ++

        +

        + For most languages, the set of lvalue-producing operators is limited + (typically array indexing and field selection). Some languages have +@@ -77,19 +102,21 @@ mutable variables are first-class "cells", and access= ing the + contents of a cell requires an explicit operator. This is also not + compatible with Scheme. Instead we need to stick to the model + where using a variable in most contexts means using its value, +-but referring to a variable in certain lvalue contexts (lhs of ++but refering to a variable in certain lvalue contexts (lhs of + assignment) refers to its actual location. Sticking to this model + for general "lvalue expressions" in set! means + that "evaluation" must be done differently from normal + evaluation when in an "lvalue context". That is what this proposal does. ++

        +

        + This is a controversial issue. This srfi does not wish to imply that + all Scheme implementations should support this feature; it only + requests that implementations that do implement + generalized set! should be compatible with this srfi. ++

        +=20 +-

        Specification

        +- ++

        Specification

        ++

        + The special form set! is extended so the first operand + can be a procedure application, and not just a variable. + The procedure is typically one that extracts a component from +@@ -97,10 +124,13 @@ some data structure. Informally, when the procedure = is called + in the first operand of set!, it causes the corresponding + component to be replaced by the second operand. + For example, ++

        +
        + (set (vector-ref x i) v)
        + 
        ++

        + would be equivalent to: ++

        +
        + (vector-set! x i v)
        + 
        +@@ -109,12 +139,16 @@ Each procedure that may be used as the first operand= to set! + must have a corresponding "setter" procedure. + The builtin procedure setter takes a procedure and returns t= he + corresponding setter procedure. ++

        +

        + We define: ++

        +
        + (set! (proc arg ...) value)
        + 
        ++

        + as: ++

        +
        + ((setter proc) arg ... value)
        + 
        +@@ -124,9 +158,11 @@ the existing Scheme convention for setter procedures,= where + the new value is given last. For example we can define + (setter car) to be set-car!. + An alternative definition would be: ++

        +
        + ((setter proc) value arg ...) ;; Not the actual definition.
        + 
        ++

        + This definition would work better when you consider + procedures that take a variable number of arguments. + This is because it is straight-forward to add one extra +@@ -135,10 +171,12 @@ argument to the end of an argument list that has + a "rest" parameter, then things get more messy. + However, consistency with the existing new-value-last convention + seems more valuable. ++

        +=20 +-

        Standard setters

        +- ++

        Standard setters

        ++

        + The following standard procedures have pre-defined setters: ++

        +
        + (set! (car x) v) =3D=3D (set-car! x v)
        + (set! (cdr x) v) =3D=3D (set-cdr! x v)
        +@@ -161,20 +199,23 @@ One useful addition:
        + variable-length mutable strings.)
        + -->
        +=20
        +-

        Setting setters; properties

        +- ++

        Setting setters; properties

        ++

        + A setter procedure is a special case of the concept of procedures having + associated properties. Other properties might include + the procedures's name or usage documentation. + As a hypothetical example (i.e. not part of this SRFI), + we can use the Common Lisp documentation function, + where for example: ++

        +
        + (documentation sqrt)
        + 
        ++

        + returns the "documentation string" (if defined) for sqrt. + Such properties should also be settable using generalized set!. + For example: ++

        +
        + (set! (documentation sqrt) "Calculates the square root.")
        + 
        +@@ -184,19 +225,24 @@ This SRFI does + not propose a general "procedure properties" feature, but it + should be compatible with it. It does specify the special case + for the setter property. This is defined such that: ++

        +
        + (set! (setter proc) setter)
        + 
        ++

        + sets the setter procedure associated with proc + to setter. + For example, we can assume ++

        +
        + (set! (setter car) set-car!)
        + 
        ++

        + has been executed by the Scheme prologue. ++

        +=20 +-

        Efficiency Issues

        +- ++

        Efficiency Issues

        ++

        + If (set! (foo ..) ...) is to be the preferred idiom, + we want to make ((setter foo) ...) as efficient + as (set-foo! ...). +@@ -216,32 +262,42 @@ compilation more difficult. However, the next secti= on does define + a way to inherently tie a setter to a procedure, which does reduce + the problem of inlining generalized set! to the + standard inlining problem. ++

        +=20 +-

        getter-with-setter

        ++

        getter-with-setter

        +

        The function getter-with-setter can be used + to define a procedure with associated properties.=20 +-Specifically: ++Specifically: ++

        +
        + (getter-with-setter getter setter)
        + 
        ++

        + This evaluates to a new anonymous procedure which when=20 + applied invokes getter, and whose setter is setter. + It is an error for a program to subsequently try to modify + the setter of the resulting compound. ++

        +

        + For example, we could define: ++

        +
        + (define car (getter-with-setter %primitive-car %primitive-set-car!))
        + (define set-car! %primitive-set-car!)
        + 
        ++

        + The advantage of this approach that whenever a compiler can inline + car, it can also inline (setter car). ++

        +=20 +-

        Implementation

        +- +-Here = is a sample implementation ++

        Implementation

        ++

        ++Here= is a sample implementation + for Twobit. +-

        Here is a sample definition of getter-with-setter: ++

        ++

        ++Here is a sample definition of getter-with-setter: ++

        +
        + (define (getter-with-setter get set)
        +   (let ((proc (lambda args (apply get args))))
        +@@ -249,9 +305,8 @@ for Twobit.
        +     proc))
        + 
        +=20 +-

        Copyright

        ++

        Copyright

        +

        Copyright (C) Per Bothner (1999, 2000). All Rights Reserved.

        +- +

        + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -275,11 +330,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        +-
        Editor: Mike Sp= erber
        ++
        ++
        Editor: Mike Sperber
        + + +-Last modified: Mon Jul 24 12:00:06 MST 2000 ++Last modified: Fri Sep 18 17:00:11 MST 2009 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-19.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-19.html +index b2a612e..c7acadd 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-19.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-19.html +@@ -1,13 +1,32 @@ +- +- ++ ++ + ++ ++ + SRFI 19: Time Data Types and Procedures +- ++ ++ ++ ++ + + +- +- + +=20 + +=20 +-

        Title

        +- +-SRFI 19: Time Data Types and Procedures +- +-

        Author

        +- +-Will Fitzgerald +- +-

        Status

        ++

        SRFI 19: Time Data Types and Procedures

        +=20 +-

        This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. You can +-access the discussion via +-the archive of the mailing list. ++

        by Will Fitzgerald

        ++

        This copy of the SRFI 19 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-19/srfi-19.html.

        +=20 ++

        Status

        +=20 +-
          +-
        • Draft: 2000-02-28 to 2000-08-28
        • +-
        • Final: 2000-08-31
        • +-
        • Fixed reference implementation: 2003-02-28
        • +-
        • Documentation bug for ~D fixed: 2003-05-30
        • +-
        • Various Documentation bugs fixed: 2004-03-15
        • +-
        +- +-

        Abstract

        +- +-Points in time are represented a the number of seconds (with ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 19@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

        ++
          ++
        • Draft: 2000-02-28 to 2000-08-28
        • ++
        • Final: 2000-08-31
        • ++
        • Revised to fix errata: ++
            ++
          • 2003-02-28 (Fixed reference implementation.)
          • ++
          • 2003-05-30 (Fixed documentation bug for ~D.)
          • ++
          • 2004-03-15 (Fixed various documentation bugs.)
          • ++
          • 2017-05-05 (Fixed definition of Julian Day and Modified Julian Da= y.)
          • ++
          • 2019-6-11 (Fixed week number definitions in Table 1. Note that t= his was an incompatible change to the API.)
        ++ ++

        Abstract

        ++

        ++Points in time are represented as the number of seconds (with + nanosecond precision) since "the epoch," a zero point in time. Several + standard variants are defined, including UTC (universal coordinated + time), TAI (international atomic time), and monotonic time. A point in ti= me can also be +@@ -160,45 +177,49 @@ routines are provided. The procedure CURRENT-TIME qu= eries the current + time in a specified variant, with a system-dependent + resolution. Procedures for time arithmetic and time comparisons are + also provided.=20 +- +-

        A date is a representation of a point in time in the Gregorian ++

        ++

        ++A date is a representation of a point in time in the Gregorian + calendar, a 24 hour clock (with nanosecond precision) and a + time zone offset from UTC. Procedures for=20 + converting between time and dates are provided, as well as for reading + and writing string representations of dates. ++

        +=20 +-

        Issues

        [None currently] +- ++

        Issues

        ++

        [None currently]

        +=20 +-

        Rationale

        +=20 ++

        Rationale

        ++

        + R5RS Scheme does not provide standard data types for time. This + SRFI addresses this lack by specifying data types for time and + associated procedures. ++

        +=20 +- +-

        Specification

        ++

        Specification

        +=20 +

        A Time object, which is distinct from all existing types, + defines a point in time or a time duration in some standard time +-system. The standard time systems are: +- ++system. The standard time systems are: ++

        +
          +
        • Universal Coordinated Time (UTC), +-
        • International Atomic Time (TAI), +-
        • monotonic time (a monotonically increasing point in time from some ++
        • International Atomic Time (TAI), ++
        • monotonic time (a monotonically increasing point in time from = some + epoch, which is implementation-dependent),=20 +-
        • CPU time in current thread (implementation dependent), +-
        • CPU time in current process (implementation dependent), +-
        • Time duration. +-
        +- ++
      • CPU time in current thread (implementation dependent), ++
      • CPU time in current process (implementation dependent), ++
      • Time duration. ++
      • ++

        + Implementations are required to implement UTC, monotonic time, CPU + time in current process, and time duration. Implementations are + allowed to create extensions (for example, amount of time spent in + garbage collection). +- +-

        A time object consists of three components:= =20 ++

        ++

        A time object consists of three compone= nts: ++

        +
          +
        • Time type, a symbol representing the time system + representation used. The constants TIME-TAI, +@@ -207,100 +228,110 @@ garbage collection). + TIME-DURATION must be provided for these + symbols. Implementations should provide constants for time type + extensions.=20=20 +-
        • Second, an integer representing the number ++
        • Second, an integer representing the number + of whole seconds from "the epoch."=20=20 +-
        • Nanosecond, an ++
        • Nanosecond, an + integer of the number of nanoseconds in the fractional + portion. Although a time object has nanosecond precision, clocks + may have a lower resolution. +-
        ++ +=20 +-

        A Date object, which is distinct fro= m all existing ++

        A Date object, which is distinct from all exi= sting + types, represents a point in time as represented by the Gregorian + calendar as well as by a time zone. Dates are immutable. A date + consists of the following components: +-=20=20 ++

        +
          +
        • Nanosecond, an integer between 0 and 9,999,999, inclusive. +-
        • Second, an integer 0 and 60, inclusive,=20 ++
        • ++
        • Second, an integer 0 and 60, inclusive, + (60 represents a leap second) ++
        • +
        • Minute, an integer between 0 and 59, inclusive, ++
        • +
        • Hour, an integer between 0 and 23, inclusive, ++
        • +
        • Day, an integer between 0 and 31, inclusive, the upper limit d= epending + on the month and year of the point in time, ++
        • +
        • Month, an integer between 1 and 12, inclusive; in which 1 means + January, 2 February, and so on. ++
        • +
        • Year, an integer representing the year. ++
        • +
        • Time zone, an integer representing the number of seconds east = of GMT for this timezone. ++
        • +
        ++

        ++A Julian Day represents a point in time as a real number of days=20 ++since -4713-11-24T12:00:00Z (midday UT on 24 November 4714 BC in the=20 ++proleptic Gregorian calendar (1 January 4713 BC in the proleptic Julian = calendar)). ++

        ++

        ++A Modified Julian Day represents a point in time as a real number = of ++days since 1858-11-17T00:00:00Z (midnight UT on 17 November AD 1858). ++

        +=20 +-

        A Julian Day represents a point in time as a real number +-of days since -4714-11-24T12:00:00Z (November 24, -4714 at noon, +-UTC). +- +-

        A Modified Julian Day represents a point in time as a +-real number of days since 1858-11-17T00:00:00Z (November 17, +-1858 at midnight, UTC). +- +-

        Constants

        +-

        The following constants are required:=20 +- +-

        +-
        t= ime-duration=20 +-
        Symbol representing Time duration. +-
        = time-monotonic +-
        Symbol representing monotonic time. +-
        ti= me-process +-
        Symbol representing time spent in current process. +-
        time-t= ai +-
        Symbol representing TAI time. +-
        tim= e-thread +-
        Symbol representing time spent in current thread. +-
        time-u= tc +-
        Symbol representting UTC time. +-
        +-

        Current time and clock resolution

        +-

        The following procedures are required: +- +-

        +-
        cu= rrent-date [tz-offset] -> date +-
        Date corresponding to the current UTC time.=20 +-
        current-julian-day -> jdn +-
        Current Julian Day. +-
        current-modified-julian-day -> mjdn +-
        Current Modified Julian Day. +-
        cu= rrent-time [time-type] -> time +-
        Current time, of type time-type syste= m, which defaults to TIME-UTC. +-
        time-resolution [time-type] -> integer +-
        Clock resolution, in nanoseconds, of the system cl= ock of type type time-type system, which defaults to TIM= E-UTC. +-
        +-

        Time object and accessors

        +-

        The following procedures are required: +-

        +-
        make-= time type nanosecond second -> time +-
        Creates a time object. +-
        time? object -> boolean +-
        #t if object is a time object, otherw= ise, #f. +-
        time-= type time -> time-type +-
        Time type. +-
        time-nanosecond time -> integer +-
        Time nanosecond. +-
        tim= e-second time -> integer +-
        Time second. +-
        = set-time-type! time time-type +-
        Changes time type. Note: This changes the semantic= s of the time object. To convert a time to another ++

        Constants

        ++

        The following constants are required: ++

        ++
        ++
        ti= me-duration ++
        Symbol representing Time duration. ++
        time-monotonic ++
        Symbol representing monotonic time. ++
        time-process ++
        Symbol representing time spent in current p= rocess. ++
        ti= me-tai ++
        Symbol representing TAI time. ++
        time-thread ++
        Symbol representing time spent in current t= hread. ++
        ti= me-utc ++
        Symbol representing UTC time. ++
        ++

        Current time and clock resolution

        ++

        The following procedures are required: ++

        ++
        ++
        cur= rent-date [tz-offset] -> date ++
        Date corresponding to the current UTC time.= =20 ++
        current-julian-day -> jdn ++
        Current Julian Day. ++
        current-modified-julian-day -> mjdn ++
        Current Modified Julian Day. ++
        current-time [time-type] -> time ++
        Current time, of type time-type system, which defaults to TIME-UTC. ++
        time-resolution [time-type] -> integer ++
        Clock resolution, in nanoseconds, of the sy= stem clock of type type time-type system, which defaults to TIME-UTC. ++
        ++

        Time object and accessors

        ++

        The following procedures are required: ++

        ++
        ++
        make-t= ime type nanosecond second -> time ++
        Creates a time object. ++
        time= ? object -> boolean ++
        #t if object is a time object,= otherwise, #f. ++
        t= ime-type time -> time-type ++
        Time type. ++
        time-nanosecond time -> integer ++
        Time nanosecond. ++
        time-second time -> integer ++
        Time second. ++
        set-time-type! time time-type ++
        Changes time type. Note: This changes the s= emantics of the time object. To convert a time to another + system of representation, use one of the conversion = procedures. +-
        set-time-nanosecond! time integer +-
        Changes time nanosecond. +-
        set-time-second! time integer +-
        Changes time second. +-
        copy-= time time1 -> time2 +-
        Creates a new time object, with the same time type= , nanosecond, and second as time1. +-
        ++
        set-time-nanosecond! time integer ++
        Changes time nanosecond. ++
        set-time-second! time integer ++
        Changes time second. ++
        c= opy-time time1 -> time2 ++
        Creates a new time object, with the same ti= me type, nanosecond, and second as time1. ++
        +=20 +-

        Time comparison procedures

        ++

        Time comparison procedures

        +=20 +-

        All of the time comparison procedures require the time objects to ++

        All of the time comparison procedures require the time objects to + be of the same type. It is an error to use these procedures on time + objects of different types. For the point-in-time measurements (e.g., + TIME-TAI and TIME-UTC), the semantics are +@@ -308,243 +339,259 @@ described in plain text. For durations, (e.g., + TIME-DURATION, TIME-CPU, the semantics are + described in parentheses. +=20 +-

        The following procedures are required: +-

        +-
        time= <=3D? time1 time2 -> boolean +-
        #t if time1 is before or a= t (less than or equal to) time2, #f otherwise.=20 +-
        time<= ;? time1 time2 -> boolean +-
        #t if time1 is before (les= s than) time2, #f otherwise.=20 +-
        time= =3D? time1 time2 -> boolean +-
        #t if time1 at (equal) time2, #f otherwise.=20 +-
        =3D-p">time= >=3D? time1 time2 -> boolean +-
        #t if time1 is at or after= (greater than or equal to) time2, #f otherwise.=20 +-
        -p">time>= ;? time1 time2 -> boolean +-
        #t if time1 is after (grea= ter than) time2, #f otherwise.=20 +-
        +- +-

        Time arithmetic procedures

        +- +-

        The following procedures are required. +-

        +-
        time-difference time1 time2 -> time-duration +-
        The TIME-DURATION between time1<= /VAR> and time2. It is an error if time1 and tim= e2 are of different time types. A new time object is created. +-
        time-difference! time1 time2 -> time-duration<= /VAR> +-
        The TIME-DURATION between time1<= /VAR> and time2. It is an error if time1 and tim= e2 are of different time types. Time1 may be used to creat= e the resulting TIME-DURATION object. +-
        ad= d-duration time1 time-duration -> time +-
        The time resulting from adding time-duration<= /VAR> to time1, which is a time object of the same time type as= time1. A new time object is created. +-
        a= dd-duration! time1 time-duration -> time +-
        The time resulting from adding time-duration<= /VAR> to time1, which is a time object of the same time type as= time1. Time1 may used to create the resulting time = object. +-
        subtract-duration time1 time-duration -> time= +-
        The time resulting from subtracting time-dura= tion to time1, which is a time object of the same time ty= pe as time1. A new time object is created. +-
        subtract-duration! time1 time-duration -> ti= me +-
        The time resulting from subtracting time-dura= tion to time1, which is a time object of the same time ty= pe as time1. Time1 may used to create the resulting = time object. +-
        +- +-

        Date object and accessors

        +- +-

        Date objects are immutable once created. The following procedures are = required. +-

        +- +-
        make-= date nanosecond second minute hour day month year zone-offs= et -> date +-
        Creates a date object. +-
        date? date -> boolean +-
        #t if object is a time object, otherw= ise, #f. +-
        date-nanosecond date -> integer +-
        Date nanosecond. +-
        dat= e-second date -> integer +-
        Date second. +-
        dat= e-minute date -> integer +-
        Date minute. +-
        date-= hour date -> integer +-
        Date hour. +-
        date-d= ay date -> integer +-
        Date day. +-
        date= -month date -> integer +-
        Date month. +-
        date-= year date -> integer +-
        Date year. +-
        date-zone-offset date -> integer +-
        Date time zone offset. +-
        d= ate-year-day date -> integer +-
        The ordinal day of the year of this date. January = 1 is 1, etc. +-
        d= ate-week-day date -> integer +-
        The day of the week of this date, where Sunday=3D0= , Monday=3D1, etc. +-
        date-week-number date day-of-week-starting-week -> = integer +-
        The ordinal week of the year which holds this date= , ignoring a first partial week. 'Day-of-week-starting-week' is the integer= corresponding to the day of the week which is to be considered the first d= ay of the week (Sunday=3D0, Monday=3D1, etc.). +-
        +- +-

        Time/Date/Julian Day/Modified Julian Day Converters

        ++

        The following procedures are required: ++

        ++
        ++
        ti= me<=3D? time1 time2 -> boolean ++
        #t if time1 is befo= re or at (less than or equal to) time2, #f otherwis= e.=20 ++
        = time<? time1 time2 -> boolean ++
        #t if time1 is befo= re (less than) time2, #f otherwise.=20 ++
        t= ime=3D? time1 time2 -> boolean ++
        #t if time1 at (equ= al) time2, #f otherwise.=20 ++
        time>=3D? time1 time2 -> boolean ++
        #t if time1 is at o= r after (greater than or equal to) time2, #f otherw= ise.=20 ++
        = time>? time1 time2 -> boolean ++
        #t if time1 is afte= r (greater than) time2, #f otherwise.=20 ++
        ++ ++

        Time arithmetic procedures

        ++ ++

        The following procedures are required. ++

        ++
        ++
        = time-difference time1 time2 -> time-duration ++
        The TIME-DURATION between time1 and time2. It is an error if time1 and <= var>time2 are of different time types. A new time object is created. ++
        time-difference! time1 time2 -> time-durati= on ++
        The TIME-DURATION between time1 and time2. It is an error if time1 and <= var>time2 are of different time types. Time1 may be used t= o create the resulting TIME-DURATION object. ++
        add-duration time1 time-duration -> time ++
        The time resulting from adding time-du= ration to time1, which is a time object of the same time = type as time1. A new time object is created. ++
        add-duration! time1 time-duration -> time ++
        The time resulting from adding time-du= ration to time1, which is a time object of the same time = type as time1. Time1 may used to create the resultin= g time object. ++
        subtract-duration time1 time-duration -> t= ime ++
        The time resulting from subtracting ti= me-duration to time1, which is a time object of the same = time type as time1. A new time object is created. ++
        subtract-duration! time1 time-duration -> time ++
        The time resulting from subtracting ti= me-duration to time1, which is a time object of the same = time type as time1. Time1 may used to create the res= ulting time object. ++
        ++ ++

        Date object and accessors

        ++ ++

        Date objects are immutable once created. The following procedures are = required. ++

        ++
        ++
        make-d= ate nanosecond second minute hour day month year zone-offset -> date ++
        Creates a date object. ++
        date= ? date -> boolean ++
        #t if object is a time object,= otherwise, #f. ++
        date-nanosecond date -> integer ++
        Date nanosecond. ++
        date-second date -> integer ++
        Date second. ++
        date-minute date -> integer ++
        Date minute. ++
        d= ate-hour date -> integer ++
        Date hour. ++
        da= te-day date -> integer ++
        Date day. ++
        = date-month date -> integer ++
        Date month. ++
        d= ate-year date -> integer ++
        Date year. ++
        date-zone-offset date -> integer ++
        Date time zone offset. ++
        date-year-day date -> integer ++
        The ordinal day of the year of this date. J= anuary 1 is 1, etc. ++
        date-week-day date -> integer ++
        The day of the week of this date, where Sun= day=3D0, Monday=3D1, etc. ++
        date-week-number date day-of-week-starting-week -&g= t; integer ++
        The ordinal week of the year which holds th= is date, ignoring a first partial week. 'Day-of-week-starting-week' is the = integer corresponding to the day of the week which is to be considered the = first day of the week (Sunday=3D0, Monday=3D1, etc.). ++
        ++ ++

        Time/Date/Julian Day/Modified Julian Day Converters

        +=20 + The following conversion procedures are required. +-
        +-
        julian-day= ">date->julian-day date -> jd +-
        Convert date to Julian Day. +-
        modified-j= ulian-day">date->modified-julian-day date -> mjd= +-
        Convert date to Modified Julian Day. +-
        time-monot= onic">date->time-monotonic date -> time-monotoni= c +-
        Convert date to monotonic time. +-
        time-tai">= date->time-tai date -> time-tai +-
        Convert date to TAI time. +-
        time-utc">= date->time-utc date -> time-utc +-
        Convert date to UTC time. +-
        date= ">julian-day->date jd [tz-offset] -> date +-
        Convert Julian Day to date, , using time zone offs= et, which defaults to the local time zone. +-
        time= -monotonic">julian-day->time-monotonic jd -> tim= e-monotonic +-
        Convert Julian Day to monotonic time. +-
        time= -tai">julian-day->time-tai jd -> time-tai +-
        Convert Julian Day to TAI time. +-
        time= -utc">julian-day->time-utc jd -> time-utc +-
        Convert Julian Day to UTC time. +-
        date">modified-julian-day->date mjd [tz-off= set] -> date +-
        Convert Modified Julian Day to date, using time zo= ne offset, which defaults to the local time zone. +-
        time-monotonic">modified-julian-day->time-monotonic mj= d -> time-monotonic +-
        Convert Modified Julian Day to monotonic time. +-
        time-tai">modified-julian-day->time-tai mjd -> <= VAR>time-tai +-
        Convert Modified Julian Day to TAI time. +-
        time-utc">modified-julian-day->time-utc mjd -> <= VAR>time-utc +-
        Convert Modified Julian Day to UTC time. +-
        = date">time-monotonic->date time-monotonic [tz-of= fset] -> date +-
        Convert monotonic time to date, using time zone of= fset, which defaults to the local time zone. +-
        = julian-day">time-monotonic->julian-day time-monotonic= -> jd +-
        Convert monotonic time to Julian Day. +-
        = modified-julian-day">time-monotonic->modified-julian-day ti= me-monotonic -> mjd +-
        Convert monotonic time to Modified Julian Day. +-
        = time-tai">time-monotonic->time-tai time-monotonic -> = time-tai +-
        Convert monotonic time to TAI time. +-
        = time-tai!">time-monotonic->time-tai! time-monotonic -= > time-tai +-
        Convert monotonic time to TAI time. The time struc= ture may be reused. +-
        = time-utc">time-monotonic->time-utc time-monotonic -> = time-utc +-
        Convert monotonic time to UTC time. +-
        = time-utc!">time-monotonic->time-utc! time-monotonic -= > time-utc +-
        Convert monotonic time to UTC time. The time stru= cture may be reused. +-
        date">= time-tai->date time-tai [tz-offset] -> date +-
        Convert TAI time to date, using time zone offset, = which defaults to the local time zone. +-
        julian= -day">time-tai->julian-day time-tai -> jd +-
        Convert TAI time to Julian Day. +-
        modifi= ed-julian-day">time-tai->modified-julian-day time-tai= -> mjd +-
        Convert TAI time to Modified Julian Day. +-
        time-m= onotonic">time-tai->time-monotonic time-tai -> t= ime-monotonic +-
        Convert TAI time to monotonic time. +-
        time-m= onotonic!">time-tai->time-monotonic! time-tai -> time-monotonic +-
        Convert TAI time to monotonic time. The time struc= ture may be reused. +-
        time-u= tc">time-tai->time-utc time-tai -> time-utc +-
        Convert TAI time to monotonic time. +-
        time-u= tc!">time-tai->time-utc! time-tai -> time-utc +-
        Convert TAI time to monotonic time. The time struc= ture may be reused. +-
        date">= time-utc->date time-utc [tz-offset] -> time-utc<= /VAR> +-
        Convert UTC time to date, using time zone offset, = which defaults to the local time zone. +-
        julian= -day">time-utc->julian-day time-utc -> jd +-
        Convert UTC time to Julian Day +-
        modifi= ed-julian-day">time-utc->modified-julian-day time-utc= -> mjd +-
        Convert UTC time to Modified Julian Day. +-
        time-m= onotonic">time-utc->time-monotonic time-utc -> t= ime-monotonic +-
        Convert UTC time to monotonic time. +-
        time-m= onotonic!">time-utc->time-monotonic! time-utc -> time-monotonic +-
        Convert UTC time to monotonic time. The time struc= ture may be reused. +-
        time-t= ai">time-utc->time-tai time-utc -> time-tai +-
        Convert UTC time to TAI time. +-
        time-t= ai!">time-utc->time-tai! time-utc -> time-tai +-
        Convert UTC time to TAI time. The time structure m= ay be reused. +-
        +- +-

        Date to String/String to Date Converters

        ++
        ++
        date->julian-day date -> jd ++
        Convert date to Julian Day. ++
        date->modified-julian-day date ->= mjd ++
        Convert date to Modified Julian Day. ++
        date->time-monotonic date -> tim= e-monotonic ++
        Convert date to monotonic time. ++
        date->time-tai date -> time-tai ++
        Convert date to TAI time. ++
        date->time-utc date -> time-utc ++
        Convert date to UTC time. ++
        julian-day->date jd [tz-offset] -= > date ++
        Convert Julian Day to date, , using time zo= ne offset, which defaults to the local time zone. ++
        julian-day->time-monotonic jd ->= time-monotonic ++
        Convert Julian Day to monotonic time. ++
        julian-day->time-tai jd -> time-= tai ++
        Convert Julian Day to TAI time. ++
        julian-day->time-utc jd -> time-= utc ++
        Convert Julian Day to UTC time. ++
        modified-julian-day->date mjd [= tz-offset] -> date ++
        Convert Modified Julian Day to date, using = time zone offset, which defaults to the local time zone. ++
        modified-julian-day->time-monotonic <= var>mjd -> time-monotonic ++
        Convert Modified Julian Day to monotonic ti= me. ++
        modified-julian-day->time-tai mjd -> time-tai ++
        Convert Modified Julian Day to TAI time. ++
        modified-julian-day->time-utc mjd -> time-utc ++
        Convert Modified Julian Day to UTC time. ++
        time-monotonic->date time-monotonic [tz-offset] -> date ++
        Convert monotonic time to date, using time = zone offset, which defaults to the local time zone. ++
        time-monotonic->julian-day time-monotonic= -> jd ++
        Convert monotonic time to Julian Day. ++
        time-monotonic->modified-julian-day <= var>time-monotonic -> mjd ++
        Convert monotonic time to Modified Julian D= ay. ++
        time-monotonic->time-tai time-monotonic -> time-tai ++
        Convert monotonic time to TAI time. ++
        time-monotonic->time-tai! time-monotonic -> time-tai ++
        Convert monotonic time to TAI time. The tim= e structure may be reused. ++
        time-monotonic->time-utc time-monotonic -> time-utc ++
        Convert monotonic time to UTC time. ++
        time-monotonic->time-utc! time-monotonic -> time-utc ++
        Convert monotonic time to UTC time. The ti= me structure may be reused. ++
        time-tai->date time-tai [tz-offset] -> = date ++
        Convert TAI time to date, using time zone o= ffset, which defaults to the local time zone. ++
        time-tai->julian-day time-tai -> jd ++
        Convert TAI time to Julian Day. ++
        time-tai->modified-julian-day time-tai= -> mjd ++
        Convert TAI time to Modified Julian Day. ++
        time-tai->time-monotonic time-tai -&g= t; time-monotonic ++
        Convert TAI time to monotonic time. ++
        time-tai->time-monotonic! time-tai -= > time-monotonic ++
        Convert TAI time to monotonic time. The tim= e structure may be reused. ++
        time-tai->time-utc time-tai -> time= -utc ++
        Convert TAI time to monotonic time. ++
        time-tai->time-utc! time-tai -> = time-utc ++
        Convert TAI time to monotonic time. The tim= e structure may be reused. ++
        time-utc->date time-utc [tz-offset] -> = time-utc ++
        Convert UTC time to date, using time zone o= ffset, which defaults to the local time zone. ++
        time-utc->julian-day time-utc -> jd ++
        Convert UTC time to Julian Day ++
        time-utc->modified-julian-day time-utc= -> mjd ++
        Convert UTC time to Modified Julian Day. ++
        time-utc->time-monotonic time-utc -&g= t; time-monotonic ++
        Convert UTC time to monotonic time. ++
        time-utc->time-monotonic! time-utc -= > time-monotonic ++
        Convert UTC time to monotonic time. The tim= e structure may be reused. ++
        time-utc->time-tai time-utc -> time= -tai ++
        Convert UTC time to TAI time. ++
        time-utc->time-tai! time-utc -> = time-tai ++
        Convert UTC time to TAI time. The time stru= cture may be reused. ++
        ++ ++

        Date to String/String to Date Converters

        +=20 + These procedures provide conversion to and from strings. They are require= d. The specification below describes a 'locale;' the + specification of locales is beyond this SRFI. +=20 +-
        +-
        string">da= te->string date [format-string] -> st= ring +-
        Converts a date to a string, using the format stri= ng. The format string is copied as is; except +-escape characters (indicated by the tilde) are replaced with specific con= versions. Table 1 lists the required conversion specifiers; +-implementations are free to extend this list. +-
        date">st= ring->date input-string template-string -> date<= /VAR> +-
        Converts an input string to a date, using the temp= late string. The input string must match the template +-sting as is; except escape characters (indicate by the tilde) indicate sp= ecial converters which (1) move to the next character in the input string f= ulfilling a criterion; (2) read a value, and (3) act on this value in some = way. Table 2 lists the required=20 +-converters; implementations are free to extend this list. +-
        +- +-

        PLT-specific extensions

        +- +-

        The ~? wildcard is specific to the PLT implementation of = string->date: it parses 1 and 2 digit years like ~y and 3 and 4 digit years like ~Y.

        +- +-
        0009 HORIZONTAL TABULATION \t control-I <= /td>
        0020 SPACE Zs
        00A0 NO-BREAK SPACE Zs
        STRING conversion = specifiers"> +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-<= /TR> +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-

        ChConversion

        ~~a literal ~
        ~alocale's abbre= viated weekday name (Sun...Sat)
        ~Alocale's full = weekday name (Sunday...Saturday)
        ~blocale's abbre= viate month name (Jan...Dec)
        ~Blocale's full = month day (January...December)
        ~clocale's date = and time (e.g., "Fri Jul 14 20:28:42-0400 2000")
        ~dday of month, = zero padded (01...31)
        ~Ddate (mm/dd/yy= )
        ~eday of month, = blank padded ( 1...31)
        ~fseconds+fracti= onal seconds, using locale's decimal separator (e.g. 5.2).
        ~hsame as ~b
        ~Hhour, zero pad= ded, 24-hour clock (00...23)
        ~Ihour, zero pad= ded, 12-hour clock (01...12)
        ~jday of year, z= ero padded
        ~khour, blank pa= dded, 24-hour clock (00...23)
        ~lhour, blank pa= dded, 12-hour clock (01...12)
        ~mmonth, zero pa= dded (01...12)
        ~Mminute, zero p= added (00...59)
        ~nnew line
        ~Nnanosecond, ze= ro padded
        ~plocale's AM or= PM
        ~rtime, 12 hour = clock, same as "~I:~M:~S ~p"
        ~snumber of full= seconds since "the epoch" (in UTC)
        ~Ssecond, zero p= added (00...60)
        ~thorizontal tab=
        ~Ttime, 24 hour = clock, same as "~H:~M:~S"
        ~Uweek number = of year with Sunday as first day of week (00...53)
        ~Vweek number of= year with Monday as first day of week (01...52)
        ~w day of week (= 0...6)
        ~Wweek number = of year with Monday as first day of week (01...52)
        ~xweek number = of year with Monday as first day of week (00...53)
        ~Xlocale's date = representation, for example: "07/31/00"
        ~ylast two digit= s of year (00...99)
        ~Yyear
        ~ztime zone in R= FC-822 style
        ~Zsymbol time zo= ne (not-implemented)
        ~1ISO-8601 year-= month-day format
        ~2ISO-8601 hour-= minute-second-timezone format
        ~3ISO-8601 hour-= minute-second format
        ~4ISO-8601 year-= month-day-hour-minute-second-timezone format
        ~5ISO-8601 year-= month-day-hour-minute-second format

        Table 1: DATE->STRING conversion speci= fiers

        +- +-

        +-DATE conversion = specifiers"> +- +- +- +-<= /TR> +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-= +- +- +- +-

        ChSkip toReadSet

        ~~anyread literal ~nothing
        ~achar-alphabeti= c?abbreviated weekday in localenothing
        ~Achar-alphabeti= c?full weekday in localenothi= ng
        ~bchar-alphabeti= c?abbreviated month name in localenothing
        ~Bchar-alphabeti= c?full month name in localeno= thing
        ~dchar-numeric?<= /TD>day of monthdate-day
        ~eanyday of month, blank paddeddate-day=
        ~hchar-alphabeti= c?same as ~bnothing
        ~Hchar-numeric?<= /TD>hourdate-hour
        ~kanyhour, blank paddeddate-hour=
        ~mchar-numeric?<= /TD>monthdate-month
        ~Mchar-numeric?<= /TD>minutedate-minute=
        ~Schar-numeric?<= /TD>seconddate-second=
        ~yany2-digit yeardate-year withi= n 50 years
        ~Ychar-numeric?<= /TD>yeardate-year
        ~zanytime zonedate-zone-offset
        ~?char-numeric?<= /TD>2-digit or 4-digit year (PLT-specific extension)date-year

        Table 2: STRING->DATE conversion speci= fiers

        +- +-

        Implementation

        ++
        ++
        = date->string date [format-string] -> string ++
        ++
        ++

        ++ Converts a date to a string, using the format string. The format st= ring ++ is copied as is; except escape characters (indicated by the tilde) = are ++ replaced with specific conversions. Table 1 lists the required ++ conversion specifiers; implementations are free to extend this list. ++

        ++
        ++
        = string->date input-string template-string -> d= ate ++
        ++
        ++

        ++ Converts an input string to a date, using the template string. The = input ++ string must match the template sting as is; except escape characters ++ (indicate by the tilde) indicate special converters which (1) move = to ++ the next character in the input string fulfilling a criterion; (2) = read ++ a value, and (3) act on this value in some way. Table 2 lists the ++ required converters; implementations are free to extend this list. ++

        ++

        PLT-specific extension: The ~? wildcard is ++specific to the PLT implementation of string->date: ++it parses 1 and 2 digit years like ~y and 3 and 4 ++digit years like ~Y.

        ++
        ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++<= /tr> ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++

        ChConversion

        ~~a literal ~
        ~alocale's abbre= viated weekday name (Sun...Sat)
        ~Alocale's full = weekday name (Sunday...Saturday)
        ~blocale's abbre= viate month name (Jan...Dec)
        ~Blocale's full = month day (January...December)
        ~clocale's date = and time (e.g., "Fri Jul 14 20:28:42-0400 2000")
        ~dday of month, = zero padded (01...31)
        ~Ddate (mm/dd/yy= )
        ~eday of month, = blank padded ( 1...31)
        ~fseconds+fracti= onal seconds, using locale's decimal separator (e.g. 5.2).
        ~hsame as ~b
        ~Hhour, zero pad= ded, 24-hour clock (00...23)
        ~Ihour, zero pad= ded, 12-hour clock (01...12)
        ~jday of year, z= ero padded
        ~khour, blank pa= dded, 24-hour clock ( 0...23)
        ~lhour, blank pa= dded, 12-hour clock ( 1...12)
        ~mmonth, zero pa= dded (01...12)
        ~Mminute, zero p= added (00...59)
        ~nnew line
        ~Nnanosecond, ze= ro padded
        ~plocale's AM or= PM
        ~rtime, 12 hour = clock, same as "~I:~M:~S ~p"
        ~snumber of full= seconds since "the epoch" (in UTC)
        ~Ssecond, zero p= added (00...60)
        ~thorizontal tab=
        ~Ttime, 24 hour = clock, same as "~H:~M:~S"
        ~Uweek number = of year with Sunday as first day of week (00...53)
        ~VISO 8601 week = number of the year with Monday as first day of week (01..53)[1]
        ~w day of week (= 0...6)
        ~Wweek number = of year with Monday as first day of week (01...52)
        ~xlocale's date = representation[1]
        ~Xlocale's time = representation[1]
        ~ylast two digit= s of year (00...99)
        ~Yyear
        ~ztime zone in R= FC-822 style
        ~Zsymbol time zo= ne (not-implemented)
        ~1ISO-8601 year-= month-day format
        ~2ISO-8601 hour-= minute-second-timezone format
        ~3ISO-8601 hour-= minute-second format
        ~4ISO-8601 year-= month-day-hour-minute-second-timezone format
        ~5ISO-8601 year-= month-day-hour-minute-second format

        Table 1: DATE->STRING conversion sp= ecifiers

        ++ ++

        [1] Th= ese lines were changed as part of a fix to errata on 2009-06-11.

        ++ ++ ++ ++ ++ ++<= /tr> ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++char-numeric?<= /tr> ++ ++ ++ ++

        ChSkip toReadSet

        ~~anyread literal ~nothing
        ~achar-alphabeti= c?abbreviated weekday in localenothing
        ~Achar-alphabeti= c?full weekday in localenothi= ng
        ~bchar-alphabeti= c?abbreviated month name in localenothing
        ~Bchar-alphabeti= c?full month name in localeno= thing
        ~dchar-numeric?<= /td>day of monthdate-day
        ~eanyday of month, blank paddeddate-day=
        ~hchar-alphabeti= c?same as ~bnothing
        ~Hchar-numeric?<= /td>hourdate-hour
        ~kanyhour, blank paddeddate-hour=
        ~mchar-numeric?<= /td>monthdate-month
        ~Mchar-numeric?<= /td>minutedate-minute=
        ~Schar-numeric?<= /td>seconddate-second=
        ~yany2-digit yeardate-year withi= n 50 years
        ~Ychar-numeric?<= /td>yeardate-year
        ~zanytime zonedate-zone-offset
        ~?2-digit or 4-digit year = (PLT-specific extension)date-year

        Table 2: STRING->DATE conversion sp= ecifiers

        ++ ++

        Implementation

        +=20 + This SRFI cannot be written in completely standard Scheme. In + particular, there must be some system-independent method of finding +@@ -553,34 +600,31 @@ the values for CURRENT-TIME. The GNU C = function, +=20 +

        The difference between TAI and UTC is not determinate, and + implementations must provide some method for getting TAI. A procedure +-is provided in the accompany implmentation for reading the leap second ++is provided in the accompany implementation for reading the leap second + table provided by the Time Service of the US Naval Observatory +-(available at ftp://maia.usno.navy.m= il/ser7/tai-utc.dat).=20 +- +-

        The accompanying implementation assumes SRFI 6 Basic String Ports. +-The accompanying implementation also assumes an error +-procedure. The accompanying implementation also assumes SRFI 8 RECEIVE: Binding to ++(available at ftp:/= /maia.usno.navy.mil/ser7/tai-utc.dat). ++ ++

        The accompanying implementation assumes SR= FI 6 Basic String Ports. ++The accompanying implementation also assumes an error ++procedure. The accompanying implementation also assumes SRFI 8 RECEIVE: Binding to + multiple values. which is easy to implement with the following + syntax: +- +- +-

        ++

        ++
        + (define-syntax receive
        +   (syntax-rules ()
        +     ((receive formals expression body ...)
        +      (call-with-values (lambda () expression)
        +                        (lambda formals body ...)))))
        +-
        +-
        +- +-

        Note that it contains TAI-UTC.DAT reader. ++

        +=20 +-

        The accompany= ing=20 ++

        ++Note that it contains TAI-UTC.DAT reader. ++

        ++

        ++The accompanying + implementation is written in MzScheme. MzScheme provides the procedu= re=20 +-current-seconds, which returns the number of seconds (UTC) ++current-seconds, which returns the number of seconds (UTC) + since 1970-01-01T00:00:00Z+00:00, and + current-milliseconds, which is a monotonic time + clock. Combining these provides an implementation of +@@ -590,46 +634,51 @@ UTC are resolved through a leap second table. Accord= ing to the + International Earth Rotation Service, there will be no leap second in + December, 2000. Thus, the leap second table is guaranteed to be + correct through June, 2000.=20 +- +-

        Also, MzScheme (as of version 102, I believe) provides a method for ++

        ++

        ++Also, MzScheme (as of version 102, I believe) provides a method for + returning the current time zone offset, via its SECONDS->DATE and +-CURRENT-DATE procedures.=20 +- +-

        MzScheme's DEFINE-STRUCT was used to define the time +-and date objects. SRFI 9, Defining Record ++CURRENT-DATE procedures. ++

        ++

        ++MzScheme's DEFINE-STRUCT was used to define the time ++and date objects. SRFI 9, Defining Record + Types, could be used instead. +- +-

        Procedures meant to be used internally have names beginning with ++

        ++

        ++Procedures meant to be used internally have names beginning with + TM:. Locale-related constants and procedures have + locale in their name; if a 'locale' SRFI is ever written, + it might be good to use that code instead. ++

        ++

        ++From this, the rest of the implementation was built. ++

        ++

        ++There is also a test suite. ++

        +=20 +-

        From this, the rest of the implementation was built.=20 +- +-

        There is also a test suite. +- +-

        Acknowledgements

        +- +-Claus T=C3=B8ndering's Frequently Asked Questions about calendars was a very ++

        Acknowledgements

        ++

        ++Claus ++T=C3=B8ndering's = Frequently Asked Questions about calendars was a very + useful resource. The implementation of Julian Day, Modified Julian +-Day, and Year Day comes from his FAQ. Markus Kuhn has a useful +-description of the ISO Standard 8601 for +-Date/Time notation; The W3 Consortium also has a useful Note. +- +-

        Mike Sperber, Marc Feely, Dave Mason, and "Prfnoff" all made useful ++Day, and Year Day comes from his FAQ. Markus Kuhn has a useful ++description of the ISO= Standard 8601 for ++Date/Time notation; The W3 Consortium also has a useful Note. ++

        ++

        ++Mike Sperber, Marc Feeley, Dave Mason, and "Prfnoff" all made useful + comments on previous versions of this draft. Thanks to Shriram=20 + Krishnamurthi for his editing help. +- +-

        The DATE->STRING procedure uses a format string, based on ++

        ++

        ++The DATE->STRING procedure uses a format string, based on + GNU C's date procedure, as well as scsh's + FORMAT-DATE procedure.=20 ++

        +=20 +- +-

        Copyright

        ++

        Copyright

        +=20 +

        Copyright (C) Neodesic Corporation (2000). All Rights Reserved.

        +=20 +@@ -656,11 +705,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        ++
        +=20 +-
        Editor: Shrira= m=20 +-Krishnamurthi
        ++
        Editor: Shriram=20 ++Krishnamurthi
        + Last=20 +-modified by the author:
        (display (date->string (current-date 0) +-"~4")): 2004-03-15T02:21:15Z +- ++modified by the author:
        (display (date->string (current-dat= e 0) ++"~4")): 2017-05-05T21:42:17Z ++ +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-2.html b/srfi-doc/srf= i/scribblings/srfi-std/srfi-2.html +index 18b6ba7..3c51824 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-2.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-2.html +@@ -1,38 +1,70 @@ +- +- +- SRFI 2: AND-LET*: an AND with local bindings, a guarded LE= T* special form ++ ++ ++ ++ ++ ++ SRFI 2: AND-LET*: an AND with local bindings, a guarded LET* s= pecial form ++ ++ ++ ++ +=20 + +-

        Title

        +- +-SRFI-2: AND-LET*: an AND with local bindings, a guarded LET* special form +- +-

        Author

        +- +-Oleg Kiselyov +- +-

        Status

        +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion on this SRFI via the archive of the mailing lis= t. +-

          +-
        • Received: 1998/12/28 +-
        • Revised: 1999/02/09 +-
        • Draft: 1998/12/28-1999/02/28 +-
        • Final: 1999/03/01 +-
        +- +-

        Abstract

        +- +-

        Like an ordinary AND, an AND-LET* special form evaluates its arguments= -- ++

        SRFI 2: AND-LET*: an AND with local bindings, a guarded LET* special = form

        ++ ++

        by Oleg Kiselyov

        ++

        This copy of the SRFI 2 specifica= tion document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.sch= emers.org/srfi-2/srfi-2.html.

        ++ ++

        Status

        ++ ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-2= @nospamsrfi.schemers.org. To su= bscribe to the list, follow these instructions. You can access previous messages v= ia the mailing list arch= ive.

        ++
          ++
        • Received: 1998-12-28 ++
        • Revised: 1999-02-09 ++
        • Draft: 1998-12-28--1999-02-28 ++
        • Final: 1999-03-01 ++
        • Revised to fix errata: ++
            ++
          • 2020-06-08 (Fixed: Variables bound by AND-LET* needn't ++ be unique. This requirement was based on the mistaken ++ impression that LET* imposed that requirement, which it ++ doesn't. Also, updated link to sample implementation to ++ point to a more recent version by Oleg.)
          • ++
          • 2020-10-26 (Clarified what is meant by BODY in (and-let* ++ (CLAWS) BODY).)
        • ++
        ++ ++

        Abstract

        ++ ++

        Like an ordinary AND, an AND-LET* special form evaluates its arguments= -- + expressions -- one after another in order, till the first one that + yields #f. Unlike AND, however, a non-#f result of one expression can + be bound to a fresh variable and used in the subsequent expressions. + AND-LET* is a cross-breed between LET* and AND. ++

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 +-

        In case of an ordinary AND formed of proper boolean expressions:
        +-(AND E1 E2 ...)
        ++

        In case of an ordinary AND formed of proper boolean expressions:
        ++(AND E1 E2 ...)
        + expression E2, if it gets to be evaluated, knows that E1 has returned + non-#f. Moreover, E2 knows exactly what the result of E1 was -- #t -- + which E2 can use to its advantage. If E1 however is an extended +@@ -44,8 +76,8 @@ not an #f, and throws it away. If E2 needs it, it has to= compute that + value anew. This proposed AND-LET* special form lets constituent + expressions get hold of the results of already evaluated expressions, + without re-doing their work. +- +-

        AND-LET* can be thought of as a combination of LET* and AND, or a ++

        ++

        AND-LET* can be thought of as a combination of LET* and AND, or a + generalization of COND's send operator =3D>. An AND-LET* form can also= be + considered a sequence of guarded expressions. In a regular program, + forms may produce results, bind them to variables and let other forms +@@ -53,21 +85,23 @@ use these results. AND-LET* differs in that it checks = to make sure that + every produced result "makes sense" (that is, not an #f). The first + "failure" triggers the guard and aborts the rest of the sequence + (which presumably would not make any sense to execute anyway). +- ++

        ++

        + Examples: +-

        ++

        ++
        + (AND-LET* ((my-list (compute-list)) ((not (null? my-list))))
        +-          (do-something my-list))
        ++    (do-something my-list))
        +=20
        + (define (look-up key alist)
        +   (and-let* ((x (assq key alist))) (cdr x)))
        +=20
        + (or
        +-  (and-let* ((c (read-char))
        +-    ((not (eof-object? c))))
        +-    (string-set! some-str i c)=20=20
        +-    (set! i (+ 1 i)))
        +-  (begin (do-process-eof)))
        ++ (and-let* ((c (read-char))
        ++            ((not (eof-object? c))))
        ++     (string-set! some-str i c)
        ++   (set! i (+ 1 i)))
        ++ (begin (do-process-eof)))
        +=20
        + 			; A more realistic example
        +                         ; Parse the 'timestamp' ::=3D 'token1' 'token2'
        +@@ -88,47 +122,48 @@ Examples:
        +                    (string-ref token2 2) (string-ref token2 3))))
        +              ((positive? timestamp)))
        +            timestamp))
        +-
        +- +-

        ++

        ++

        + AND-LET* is also similar to an "anaphoric AND" LISP macro [Rob Warnock, + comp.lang.scheme, 26 Feb 1998 09:06:43 GMT, Message-ID: + 6d3bb3$3804h@fido.asd.sgi.com]. AND-LET* allows however more than one + intermediate result, each of which continues to be bound through the + rest of the form. ++

        +=20 ++

        Specification

        +=20 +-

        Specification

        +- +-

        Syntax and Informal Semantics

        ++

        Syntax and Informal Semantics

        +=20 +-
        ++
        + AND-LET* (CLAWS) BODY
        +=20
        + CLAWS ::=3D '() | (cons CLAW CLAWS)
        + CLAW  ::=3D  (VARIABLE EXPRESSION) | (EXPRESSION) |
        +            BOUND-VARIABLE
        +-
        ++
        +=20 +-
          +-
        • The CLAWS are evaluated in the strict left-to-right order +-
        • For each CLAW, the EXPRESSION part is evaluated first (or BOUND-VARIA= BLE is looked up) +-
        • If the result is #f, AND-LET* immediately returns #f +-
        • Otherwise, if the CLAW is of the form (VARIABLE EXPRESSION) ++
            ++
          • The CLAWS are evaluated in the strict left-to-right order ++
          • For each CLAW, the EXPRESSION part is evaluated first (or BOUND-= VARIABLE is looked up) ++
          • If the result is #f, AND-LET* immediately returns #f ++
          • Otherwise, if the CLAW is of the form (VARIABLE EXPRESSION) + the EXPRESSION's value is bound to a freshly made VARIABLE +-
          • The VARIABLE is available for the rest of the CLAWS , and the BODY +-
          • As usual, all VARIABLEs must be unique (like in let*) +-
          ++
        • The VARIABLE is available for the rest of the CLAWS , and the BO= DY ++
        • As usual, all VARIABLEs must be unique (like in let*) ++
        • BODY is a body as in a LET* form.
        • ++ ++
        +=20 +-

        Formal (Denotational) Semantics

        ++

        Formal (Denotational) Semantics

        +=20 +-
        ++
        + eval[ (AND-LET* (CLAW1 ...) BODY), env] =3D
        +    eval_claw[ CLAW1, env ] andalso
        +    eval[ (AND-LET* ( ...) BODY), ext_claw_env[CLAW1, env]]
        +=20
        + eval[ (AND-LET* (CLAW) ), env] =3D eval_claw[ CLAW, env ]
        +-eval[ (AND-LET* () FORM1 ...), env] =3D eval[ (BEGIN FORM1 ...), env ]
        ++eval[ (AND-LET* () FORM1 ...), env] =3D eval[ (LET* () FORM1 ...), env ]
        + eval[ (AND-LET* () ), env] =3D #t
        +=20
        + eval_claw[ BOUND-VARIABLE, env ] =3D
        +@@ -144,21 +179,15 @@ ext_claw_env[ (EXPRESSION), env ] =3D
        + ext_claw_env[ (VARIABLE EXPRESSION), env ] =3D
        +    extend-env[ env-after-eval[ EXPRESSION, env ],
        +               VARIABLE boundto eval[ EXPRESSION, env ]]
        +-
        +- +-

        Implementation

        ++
        ++

        Implementation

        +=20 +-

        The full implementation plus the validation code are available here (which is a = copy of +- +-http://pobox.com/~oleg/ftp/Scheme/vland.scm). +- +-

        This is an implementation of AND-LET* as a (Gambit) low-level macro th= at +-re-writes AND-LET* as a "tree" of AND and LET forms. A validation code is +-also presented, which verifies not only that everything works as +-expected, but also that AND-LET* finds syntax errors where expected. +- +-

        Copyright

        ++

        A full sample implementation is available at http://okmij.org/ftp/= Scheme/lib/myenv-chez.scm. The test suite is at http://okmij.org/ftp/= Scheme/tests/vland.scm. ++

        ++

        Copyright

        ++

        + Copyright (C) Oleg Kiselyov (1998). All Rights Reserved.=20 ++

        +

        + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -182,14 +211,13 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        +-
        Editor: Dave M= ason
        ++
        ++
        Editor: Dave Mason
        + +-

        ++

        + +-Last modified: Wed Feb 6 17:21:57 MET 2002 ++Last modified: Sun Jan 28 13:40:28 MET 2007 + +- +- +- ++

        ++ +=20 +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-23.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-23.html +index 8ac31ca..ae2545c 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-23.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-23.html +@@ -1,44 +1,57 @@ +- +- ++ ++ + ++ ++ + SRFI 23: Error reporting mechanism ++ ++ ++ + +=20 + +=20 +-

        Title

        ++

        SRFI 23: Error reporting mechanism

        +=20 +-SRFI 23: Error reporting mechanism ++

        by Stephan Houben

        ++

        This copy of the SRFI 23 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-23/srfi-23.html.

        +=20 +-

        Author

        ++

        Status

        +=20 +-Stephan Houben ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-23 @nospamsrfi.schemers.org. To subscribe to the list, follow these instructions. You can access previous = messages via the mailing list archive.

        ++
          ++
        • Draft: 2001-03-09--2001-06-09
        • ++
        • Revised: 2001-03-22 ++
        • Revised: 2001-04-26 ++
        +=20 +-

        Status

        +=20 +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here.=20=20 +-You can access +-the discussion via +- +-the archive of the mailing list. +-

        +-

          +-
        • Draft: 2001/03/09-2001/06/09
        • +-
        • Revised: 2001/03/22 +-
        • Revised: 2001/04/26 +-
        +-

        +- +-

        Abstract

        ++

        Abstract

        +=20 + A mechanism is proposed to allow Scheme code to report errors and abort + execution. + The proposed mechanism is already implemented in several Scheme systems + and can be implemented, albeit imperfectly, in any R5RS conforming Scheme. +=20 +-

        Rationale

        ++

        Rationale

        +=20 +

        + R5RS Scheme requires certain operations to signal an error when they fail. +@@ -46,14 +59,14 @@ R5RS Scheme requires certain operations to signal an e= rror when they fail. + the error. + Moreover, R5RS encourages, but not requires,=20 + implementations to signal an error in many more circumstances. +- ++

        +

        + However, there is no direct way for the Scheme application programmer to = report +-an error that occurred in his or her own application.=20 ++an error that occured in his or her own application.=20 + This means that Scheme procedures created by applications or libraries are + in this respect not on equal footing with procedures provided by the + Scheme system. +- ++

        +

        + Many Scheme systems already provide a mechanism that allows application c= ode + to report an error. At least the following implementations support +@@ -63,80 +76,96 @@ Of these implementations, the following have an error = mechanism compatible + with this SRFI: Guile, MIT Scheme, PLT Scheme, RScheme, Scsh. + The implementation in SLIB has a different name than the + one proposed in this SRFI. +- ++

        +

        + To summarise, many implementations already have the error reporting + mechanism described in this SRFI and others are easily made compatible + with this SRFI. This shows that the proposed mechanism is considered usef= ul + and that it is easy to implement in most major implementations. ++

        +=20 +-

        Specification

        ++

        Specification

        +=20 +

        + The following procedure should be provided: +-

        ++

        ++

        + (error <reason> [<arg1> [<arg2> ...]= ]) ++

        +

        + The argument <reason> should be a string. + The procedure error will signal an error, + as described in R5RS, and it will report the message <reason> +-and the objects <arg1>, <arg2>, ....=20 ++and the objects <arg1>, <arg2>, ....=20 + What exactly constitutes "signalling" and "reporting" is not prescribed, = because of the large variation in Scheme systems. So it is left to the impl= ementor + to do something reasonable. To that end, a few examples of possible behav= iour + are given. ++

        +
          +
        1. + Display <reason> and <arg1>... on the screen and terminate + the Scheme program. (This might be suitable for a Scheme system + implemented as a batch compiler.) +-
        2. =20=20 ++
        3. ++
        4. + Display <reason> and <arg1>... on the screen and=20=20 + go back to the read-evaluate-print loop. (This might be suitable for + an interactive implementation). ++
        5. +
        6. + In the case of a multi-threaded system: terminate the current + thread, but do not terminate the other threads. Possibly make the + arguments to error available to other threads in some + way. See the thread-join! mechanism in SRFI-18 on + how this could be done. ++
        7. +
        8. + Package <reason> and <arg1>... up into an error object + and pass this error object to an exception handler. The default + exception handler then might do something as described in points 1 to 3. ++
        9. +
        10. + In the case of a Scheme system that runs completely unattended + and that has no way to notify a human, the only reasonable + course of action might be to do nothing at all. However, this should + be considered a last resort. Clearly, if all implementors would choose + this strategy, this SRFI would not be very useful. +-
        =20=20 ++
      • ++ ++

        + An implementation might report more information than just=20 + <reason> and <arg1>... . For instance, it might report the pr= ocedure name in which + the error occurred or even print a stack trace. + However, this will require additional support in the Scheme implementatio= n. ++

        +=20 ++

        Why error is a procedure

        +=20 +-

        Why error is a procedure

        +- ++

        + It is conceivable to allow error to be a special form, + such as a macro, rather than a procedure. This might make providing + information such as the source code location easier. This possibility + has been considered, but rejected, for two reasons. ++

        +
          +
        1. + Since error accepts a variable number of arguments, + it could occasionally be useful to use apply to call + error. However, this is not possible if error + was allowed to be a special form. ++
        2. +
        3. + Since error is currently a procedure in all Scheme + implementations mentioned above, it doesn't seem all that + worthwhile to allow it to be a special form. ++
        4. +
        +=20 +-

        Implementation

        ++

        Implementation

        +=20 ++

        + An implementation that works in almost any R5RS Scheme is the following: ++

        +
        +   (define (error reason . args)
        +       (display "Error: ")
        +@@ -148,36 +177,42 @@ An implementation that works in almost any R5RS Sche=
        me is the following:
        +       (newline)
        +       (scheme-report-environment -1))  ;; we hope that this will signal a=
        n error
        + 
        ++

        + This implementation has a flaw, + namely, in many implementations this + will actually print 2 messages. ++

        +
          +
        1. The message message, followed by objs, and +-
        2. A message about scheme-report-environment getting an i= nvalid argument.=20 +-
        =20 ++ ++
      • A message about scheme-report-environment getting an i= nvalid argument. ++
      • ++ ++

        + This might be confusing to the user. +- ++

        +

        + The SLIB pr= ocedure slib:error works like the error + procedure described in this document. + Thus, when SLIB is loaded, error can be defined as: ++

        +
        +   (define error slib:error)
        + 
        =20=20 +- +

        +-If SRFI 18 is supported= , it is allowed=20 ++If SRFI 18 is supporte= d, it is allowed=20 + (but not required) to implement error in + terms of the exception mechanism of SRFI 18. ++

        +
        +   (define (error reason . args)
        +     (raise (make-error-exception reason args)))
        + 
        ++

        + Here, make-error-exception is implementation dependent. +- +-

        Copyright

        ++

        ++

        Copyright

        +

        Copyright (C) Stephan Houben (2001). All Rights Reserved.

        +- +

        + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -200,13 +235,11 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH= ETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +- +-
        +-
        Editor: Mike Sperber ++
        ++
        Editor: Mike Sperber
        + + +-Last modified: Mon Feb 4 14:46:29 MET 2002 ++Last modified: Sun Jan 28 13:40:28 MET 2007 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-25.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-25.html +index 4d81d03..000adb1 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-25.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-25.html +@@ -1,36 +1,50 @@ +- +- ++ ++ + ++ ++ + SRFI 25: Multi-dimensional Array Primitives ++ ++ ++ + +=20 + +=20 +-

        Title

        ++

        SRFI 25: Multi-dimensional Array Primitives

        +=20 +-SRFI 25: Multi-dimensional Array Primitives ++

        by Jussi Piitulainen

        ++

        This copy of the SRFI 25 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-25/srfi-25.html.

        +=20 +-

        Author

        ++

        Status

        +=20 +-Jussi Piitulainen ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-25 @nospamsrfi.schemers.org. To subscribe to the list, follow these instructions. You can access previous = messages via the mailing list archive.

        ++
          ++
        • Draft: 2001-11-12--2002-01-11
        • ++
        • Revised: 2002-02-03
        • ++
        • Final: 2002-05-21
        • ++
        +=20 +-

        Status

        +=20 +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. You can ac= cess +-the discussion via +- +-the archive of the mailing list. +-

        +-

          +-
        • Draft: 2001/11/12-2002/01/11
        • +-
        • Revised: 2002/02/03
        • +-
        • Final: 2002/05/21
        • +-
        +-

        +- +-

        Abstract

        ++

        Abstract

        +=20 +

        + A core set of procedures for creating and manipulating heterogeneous +@@ -45,7 +59,7 @@ The specification is based on an original contribution b= y Alan Bawden + in 1993. +

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 +

        + The proposed arrays encourage a natural declarative programming +@@ -108,7 +122,7 @@ It is not required that vectors not be arrays. It is n= ot required that + they be, either. +

        +=20 +-

        Specification

        ++

        Specification

        +=20 +

        + Arrays are heterogeneous data structures whose elements are indexed by +@@ -141,8 +155,8 @@ alternately the lower and upper bounds for the dimensi= ons of an array. + The following ten procedures should be implemented. +

        +=20 +-

        +-(array? obj)
        =20 ++

        ++(array? obj)
        +=20 + Returns #t if obj is an array, otherwise + returns #f. +@@ -150,14 +164,14 @@ returns #f. +=20 +

        + Note: there is no reasonable way to implement this procedure +-accurately in R5RS; SRFI ++accurately in R5RS; SRFI + 9 (Defining Record Types) specifies a way, and many Scheme + implementations provide something similar. +

        +=20 +-

        +-(make-array shape)
        +-(make-array shape obj)
        ++

        ++(make-array shape)
        ++(make-array shape obj)
        +=20 + Returns a newly allocated array whose shape is given by + shape. If obj is provided, then each element is +@@ -166,8 +180,8 @@ unspecified. The array does not retain a dependence to + shape. +

        +=20 +-

        +-(shape bound ...)
        =20 ++

        ++(shape bound ...)
        +=20 + Returns a shape. The sequence bound ... must consist of an + even number of exact integers that are pairwise not decreasing. Each +@@ -190,42 +204,42 @@ corresponding upper bound, where k satisf= ies + (< k d). +

        +=20 +-

        +-(array shape obj ...)
        ++

        ++(array shape obj ...)
        +=20 + Returns a new array whose shape is given by shape and the + initial contents of the elements are obj ... in row major + order. The array does not retain a dependence to shape. +

        +=20 +-

        +-(array-rank array)
        ++

        ++(array-rank array)
        +=20 + Returns the number of dimensions of array. ++

        +
        +     (array-rank
        +        (make-array (shape 1 2 3 4)))
        + 
        +- +

        + Returns 2. +

        +=20 +-

        +-(array-start array k)
        ++

        ++(array-start array k)
        +=20 + Returns the lower bound for the index along dimension k. +

        +=20 +-

        +-(array-end array k)
        ++

        ++(array-end array k)
        +=20 + Returns the upper bound for the index along dimension k. +

        +=20 + +=20 +-

        +-(array-ref array k ...)
        +-(array-ref array index)
        ++

        ++(array-ref array k ...)
        ++(array-ref array index)
        +=20 + Returns the contents of the element of array at index + k .... The sequence k ... must be a valid index +@@ -280,30 +294,29 @@ Returns cuatro. + Returns (3 1 4). +

        +=20 +-

        +-(array-set! array k ... obj)
        +-(array-set! array index obj)
        ++

        ++(array-set! array k ... obj)
        ++(array-set! array index obj)
        +=20 + Stores obj in the element of array at index + k .... Returns an unspecified value. The sequence k + ... must be a valid index to array. In the second + form, index must be either a vector or a 0-based + 1-dimensional array containing k .... +- ++

        +
        +     (let ((a (make-array
        +                 (shape 4 5 4 5 4 5))))
        +        (array-set! a 4 4 4 'huuhkaja)
        +        (array-ref a 4 4 4))
        + 
        +- +

        + Returns huuhkaja. +

        +=20 +-

        ++

        + (share-array array shape proc) +-
        =20 ++
        +=20 + Returns a new array of shape shape that shares elements of + array through proc. The procedure +@@ -351,7 +364,7 @@ This document does not specify when arrays are e= qual?. + (Indeed, R5RS equal? will do the wrong thing.) +

        +=20 +-

        Examples

        ++

        Examples

        +=20 +

        + The reference implementation comes with a number of files that +@@ -361,36 +374,33 @@ in testing an implementation; that is their= origin). +=20 +

          +=20 +-
        1. A library arl= ib.scm that contains, among ++
        2. A library ar= lib.scm that contains, among + several other things, tabulate-array for a more + useful initialization of a new array, an + array-equal?, and a transpose that can + permute the dimensions of an array any which way. +=20 +-
        3. A test suite t= est.scm for array, +- and another test suite list.scm for ++
        4. A test suite test.scm for array, ++ and another test suite list.scm for + arlib. +=20 +-
        5. A rudimentary display procedure (play array) in play.scm, for= playing around with the system. ++
        6. A rudimentary display procedure (play array) in play.scm, for play= ing around with the system. +=20 +-
        ++ +=20 +-

        Implementation

        ++

        Implementation

        +=20 +

        + A portable reference implementation is provided. It uses a minimal +-error reporting mechanism that conforms to SRFI 23 (Error reporting ++error reporting mechanism that conforms to SRFI = 23 (Error reporting + mechanism). Type disjointness requires support from the host +-implementation, such as support for SRFI 9 (Defining Record ++implementation, such as support for SRFI 9 (D= efining Record + Types). All names not defined in this proposal are in the prefix + "array:", which serves as a module system. +

        +=20 +

        +-You can get source for the reference ++You can get source for the reference + implementation as a single file and stop reading. But there are + variations. This single file represents arrays as procedures (so the + type predicate is very approximate); it represents index mapping as +@@ -410,18 +420,18 @@ consists of the following parts, each in its own fil= e. + type disjointness, or portable as procedures, in a file + as-*.scm, and +=20 +-

      • indexing operations to match the type, in a file ++
      • indexing operations to match the type, in a file + ix-*.scm, and +=20 +-
      • an affine recogniser of one of three types, optimised ++
      • an affine recogniser of one of three types, optimised + up to some number of dimensions, in a file op-*.scm, and +=20 +-
      • the main source file array.scm. ++
      • the main source file array.scm. +=20 +- ++
      • +=20 +

        +-Affine recognisers are made by a program opt.scm ++Affine recognisers are made by a program opt.scm + but one of each type is also available here, optimized for 0, 1, 2 and + 3 dimensions. Choose one type: pick a recogniser with matching index + procedures; load as-, ix- and op- and +@@ -430,36 +440,34 @@ procedures; load as-, ix- and = op- and +=20 +

          +=20 +-
        1. In the mbda= type representation, index ++
        2. In the mbd= a type representation, index + mappings are procedures that accept an optional argument. The +- matching ac= cess procedures apply the ++ matching a= ccess procedures apply the + mapping to the arguments of array-ref and + array-set!. +=20 +-
        3. In the tter= type representation, index ++
        4. In the tter type representation, index + mappings are pairs of procedures: one takes exactly the indices, +- the other takes indices and an object. The matching access procedu= res apply the first ++ the other takes indices and an object. The matching access procedures apply the f= irst + procedure to the argumets of array-ref and the + second procedure to the arguments of array-set!. +=20 +-
        5. In ctor= representation, index mappings +- are coefficient vectors. The access ++
        6. In ct= or representation, index mappings ++ are coefficient vectors. The access + procedures compute the sum of products of coefficients and + indexes in a loop on the list. +=20 +-
        ++ +=20 +

        +-Record implementations are available for +-generic Scheme (arrays are not disjoint from procedures), for SRFI 9= (Defining Record Types) +-(not tested), and for PLT ++Record implementations are available for ++generic Scheme (arrays are not disjoint from procedures), for SRFI 9 (Def= ining Record Types) ++(not tested), and for PLT + Scheme (arrays belong to a struct type). +

        +=20 +

        +-With the three files from above, the main source ++With the three files from above, the main source + file should work in any Scheme implementation without need of + modification. +

        +@@ -471,7 +479,7 @@ code. (Sharing uses a check that is exponential in the= number of + dimensions. It is disabled above a threshold rank.) +

        +=20 +-

        Acknowledgements

        ++

        Acknowledgements

        +=20 +

        + The original concept comes from a message to the Usenet newsgroup +@@ -490,11 +498,10 @@ wording, hidden shapes, and two kinds of index objec= ts. +=20 +

        + The exact title of the proposal comes from a message titled "a proc= ess that might work" by William D. Clinger to the rrrs-authors +-mailing list in 1998. That appears to be a part of the past of the SRFI process. ++mailing list in 1998. That appears to be a part of the past of the SRFI process. +

        +=20 +-

        Copyright

        ++

        Copyright

        +

        Copyright (C) Jussi Piitulainen (2001). All Rights Reserved.

        +=20 +

        +@@ -520,12 +527,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        +-
        Editor: Mike Sperber ++
        ++
        Editor: Mike Sperber
        + + +-Last modified: Tue May 28 18:46:09 MST 2002 ++Last modified: Sun Jan 28 13:40:29 MET 2007 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-26.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-26.html +index a6cf487..0d6d83e 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-26.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-26.html +@@ -1,39 +1,54 @@ +- +- ++ ++ + ++ ++ + SRFI 26: Notation for Specializing Parameters without Currying= ++ ++ ++ + +=20 + +=20 +-

        Title

        ++

        SRFI 26: Notation for Specializing Parameters without Currying

        +=20 +-SRFI 26: Notation for Specializing Parameters without Currying ++

        by Sebastian Egner

        ++

        This copy of the SRFI 26 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-26/srfi-26.html.

        +=20 +-

        Author

        ++

        Status

        +=20 +-Sebastian Egner ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 26@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

        ++
          ++
        • Draft: 2002-02-06--2002-04-06
        • ++
        • Revised: 2002-02-15
        • ++
        • Revised: 2002-02-28
        • ++
        • Revised: 2002-06-04
        • ++
        • Revised: 2002-06-06
        • ++
        • Final: 2002-06-14
        • ++
        +=20 +-

        Status

        +- +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. You can ac= cess +-the discussion via +- +-the archive of the mailing list. +- +-
          +-
        • Draft: 2002/02/06-2002/04/06
        • +-
        • Revised: 2002/02/15
        • +-
        • Revised: 2002/02/28
        • +-
        • Revised: 2002/06/04
        • +-
        • Revised: 2002/06/06
        • +-
        • Final: 2002/06/14
        • +-
        +- +-

        Abstract

        ++

        Abstract

        +=20 ++

        + When programming in functional style, + it is frequently necessary to specialize some of the + parameters of a multi-parameter procedure. +@@ -41,40 +56,41 @@ For example, from the binary operation cons + one might want to obtain the unary operation=20 + (lambda (x) (cons 1 x)). + This specialization of parameters is also known as +-"partial application", "operator section" or "projection".

        +- ++"partial application", "operator section" or "projection". ++

        ++

        + The mechanism proposed here allows to write this sort + of specialization in a simple and compact way. +-The mechanism is best explained by a few examples:

        +- +- +- +- +- +- +- +- +- +- +- +- +-
        (cut cons (+ a 1) <>)=20 +-is the same as +-(lambda (x2) (cons (+ a 1) x2)) +-
        (cut list 1 <> 3 <> 5)=20 +-is the same as +-(lambda (x2 x4) (list 1 x2 3 x4 5)) +-
        (cut list)=20 +-is the same as +-(lambda () (list)) +-
        (cut list 1 <> 3 <...>)=20 +-is the same as +-(lambda (x2 . xs) (apply list 1 x2 3 xs)) +-
        (cut <> a b)=20 +-is the same as +-(lambda (f) (f a b)) +-

        +- ++The mechanism is best explained by a few examples: ++

        ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
        (cut cons (+ a 1) <>)is the same as(lambda (x2) (cons (+ a 1) x2))
        (cut list 1 <> 3 <> 5)is the same as(lambda (x2 x4) (list 1 x2 3 x4 5))
        (cut list)is the same as(lambda () (list))
        (cut list 1 <> 3 <...>)is the same as(lambda (x2 . xs) (apply list 1 x2 3 xs))
        (cut <> a b)is the same as(lambda (f) (f a b))
        ++

        + As you see, the macro cut specializes some of the=20 + parameters of its first argument.=20 + The parameters that are to show up as formal +@@ -83,27 +99,29 @@ pronouced as "slot". In addition, the symbol <= ;...>, + pronounced as "rest-slot", matches all residual arguments of a variable=20 + argument procedure. + As you can see from the last example above, the first argument can also +-be a slot, as one should expect in Scheme.

        +- ++be a slot, as one should expect in Scheme. ++

        ++

        + In addition to cut, there is a variant called cute + (a mnemonic for "cut with evaluated non-slots") which evalua= tes + the non-slot expressions at the time the procedure is specialized, not at= =20 + the time the specialized procedure is called. +-For example,

        +- +- +- +- +-
        (cute cons (+ a 1) <>)=20 +-is the same as +-(let ((a1 (+ a 1))) (lambda (x2) (cons a1 x2))) +-

        +- ++For example, ++

        ++ ++ ++ ++ ++ ++ ++
        (cute cons (+ a 1) <>)is the same as(let ((a1 (+ a 1))) (lambda (x2) (cons a1 x2)))
        ++

        + As you see from comparing this example with the first example above, + the cute-variant will evaluate (+ a 1) + once, while the cut-variant will evaluate it during +-every invokation of the resulting procedure.

        +- ++every invokation of the resulting procedure. ++

        ++

        + The mechanism proposed in this SRFI allows specializing any subset=20 + of the variables of a procedure. + The result can be of fixed arity or of variable arity. +@@ -111,11 +129,13 @@ The mechanism does not allow permutation, omission, = duplication + or any other processing of the arguments; + for this it is necessary to write to use a different + mechanism such as lambda. ++

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 ++

        + A particularly elegant way to deal with specialization is known=20 +-as currying (Schönfinkel 1924, Curry 1958). ++as currying (Sch=C3=B6nfinkel 1924, Curry 1958). + The idea of currying is to reduce multi-argument functions to + single-argument functions by regarding an n-ary=20 + function as a unary function mapping its first argument into=20 +@@ -123,8 +143,9 @@ an (n-1)-ary function (which is curried in turn= ). + This point of view, apart from its theoretical elegance,=20 + allows an extremely compact notation for specializing the=20 + first argument of a function. +-In the first example, one could simply write (cons 1).

        +- ++In the first example, one could simply write (cons 1). ++

        ++

        + Yet, Scheme is not a curried language---the + number of arguments passed to a procedure must match + the number of its parameters at all times. +@@ -135,73 +156,91 @@ and invent some irrelevant identifiers for its + formal variables (x in the example). + For this reason, the mechanism proposed in this SRFI=20 + provides a simple and compact notation for specializing +-any subset of the parameters of a procedure.

        +- +-Note: The mechanism proposed here is not currying!

        +- ++any subset of the parameters of a procedure. ++

        ++

        ++Note: The mechanism proposed here is not currying! ++

        ++

        + The purpose of the mechanism proposed here is to make the benefits + of currying available within the programming language Scheme. + There are two primary benefits of currying in practice: + Higher-order types are substantially simplified and + there is a simple notation for specializing parameters. + The type aspect is irrelevant as Scheme has latent typing. +-The specialization aspect is largly covered with this SRFI.

        +- ++The specialization aspect is largly covered with this SRFI. ++

        ++

        + Here are a few more examples for illustration: ++

        ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
        (map (cut * 2 <>) '(1 2 3 4))
        (map (cut vector-set! x <> 0) indices)
        (for-each (cut write <> port) exprs)
        (map (cut <> x y z) (list min max))
        (for-each (cut <>) thunks)
        ++ ++

        Specification

        +=20 +- +- +- +- +- +- +- +- +- +- +- +-
        (map (cut * 2 <>) '(1 2 3 4))=20 +-
        (map (cut vector-set! x <> 0) indices)=20 +-
        (for-each (cut write <> port) exprs)=20 +-
        (map (cut <> x y z) (list min max))=20 +-
        (for-each (cut <>) thunks)=20 +-
        +- +-

        Specification

        +- +- ++

        + The formal syntax of a specialized expression, in the style of the=20 +-Revised^= 5 Report on the Algorithmic Language Scheme:

        +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
        <cut-expression>= +---> +-(cut <slot-or-expr> <slot-or-expr>*) +- +-
        |(cut <slot-or-expr> <slot-or-expr>* &l= t;...>) +-; with "rest-slot" +-
        |(cute <slot-or-expr> <slot-or-expr>*)<= /code> +-; evaluate non-slots at specialization time +-
        |(cute <slot-or-expr> <slot-or-expr>* &= lt;...>) +-; with "rest-slot" +-
        <slot-or-expr> +---> +-<>; a "slot" +-
        | <expression>; a "non-slot expres= sion" +-

        +- ++Revised^= 5 Report on the Algorithmic Language Scheme:

        ++

        ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
        <cut-expression>-->(cut <slot-or-expr> <slot-or-expr>*)
        |(cut <slot-or-expr> <slot-or-expr>* <...>)<= /code>; with "rest-slot"
        |(cute <slot-or-expr> <slot-or-expr>*); evaluate non-slots at specialization time
        |(cute <slot-or-expr> <slot-or-expr>* <...>)= ; with "rest-slot"
        <slot-or-expr>--><>; a "slot"
        | <expression>; a "non-slot expression"<= /td> ++
        ++

        + The macro cut transforms a <cut-expression>=20 + into a <lambda expression> with as many formal variabl= es + as there are slots in the list <slot-or-expr>*. +@@ -210,18 +249,21 @@ the first <slot-or-expr> with arg= uments from + <slot-or-expr>* in the order they appear. + In case there is a rest-slot symbol, the resulting procedure is also of=20 + variable arity, and the body calls the first <slot-or-expr> +-with all arguments provided to the actual call of the specialized procedu= re.

        +- ++with all arguments provided to the actual call of the specialized procedu= re. ++

        ++

        + The macro cute is similar to the macro cut, + except that it first binds new variables to the result of evaluating + the non-slot expressions (in an unspecific order) and then substituting=20 + the variables for the non-slot expressions. + In effect, cut evaluates non-slot expressions at the time + the resulting procedure is called, whereas cute evaluates +-the non-slot expressions at the time the procedure is constructed.

        ++the non-slot expressions at the time the procedure is constructed. ++

        +=20 +-

        Implementation

        ++

        Implementation

        +=20 ++

        + The reference implementation defines the two macros + cut and cute using macro=20 + mechanism of R5RS. +@@ -232,24 +274,26 @@ As macros in R5RS are hygienic and referentially tra= nsparent, + the macro mechanism makes sure the names of the newly + introduced formal variables are unique and do not clash. + The template (param ... slot), see=20 +-Sect. 7.1.5. of R5RS, ++Sect. 7.1.5. of R5RS, + allows to preserve the order of arguments---which would get + reversed otherwise. +- ++

        ++

        + The reference implementation has been written by +-Al Petrofsky. It can be found here.

        +- ++Al Petrofsky. It can be found here. ++

        ++

        + Finally, there is a small collection of=20 +-confidence tests. ++confidence tests<= /a>. + It checks some special cases of the mechanism defined + in this SRFI and signals an error in case something is wrong. + Passing the tests does not mean a correct implementation. ++

        +=20 ++

        Design Rationale

        +=20 +-

        Design Rationale

        +- +-

        Why not real currying/uncurrying?

        +- ++

        Why not real currying/uncurrying?

        ++

        + It is possible in Scheme to implement a macro turning a multi-argument=20 + procedure into a nesting of single-argument procedures and back. + These operations are usually called "curry" and "uncurry" in +@@ -261,11 +305,12 @@ if you apply it in the sequence "curry, specialize s= ome arguments, + and uncurry again"---which is exactly the purpose of the macro=20 + cut specified in this document. + The primary relevance of currying/uncurrying in Scheme is to +-teach concepts of combinatory logic.

        +- +-

        Why not a more general mechanism, also allowing permutation, +-omission and duplication of arguments?

        ++teach concepts of combinatory logic. ++

        +=20 ++

        Why not a more general mechanism, also allowing permutation, ++omission and duplication of arguments?

        ++

        + The reason is that I, the author of this SRFI, consider more general=20 + mechanisms too dangerous to mix them with the mechanism proposed here. + In particular, as soon as parameters are being rearranged it +@@ -273,13 +318,14 @@ is usually necessary to be aware of the meaning of t= he parameters; + unnamed variables can be quite harmful then. + The mechanism proposed here is designed to prevent this. + Please refer to the discussion threads +-"= OK, how about...," (Alan Bawden), +-"= is that useful?" (Walter C. Pelissero), and +-"= l, the ultimate curry that is not curry" (Al Petrofsky).

        +- +-

        Why are the macro called cut/cute and not=20 +-[enter your favourite here]?

        ++= "OK, how about...," (Alan Bawden), ++= "is that useful?" (Walter C. Pelissero), and ++= "l, the ultimate curry that is not curry" (Al Petrofsky). ++

        +=20 ++

        Why are the macro called cut/cute and not ++[enter your favourite here]?

        ++

        + Well, the original name proposed for this SRFI was curry + which immediately stirred some emotions as it does not what is + commonly known as currying. +@@ -306,23 +352,26 @@ concept is often called in other programming languag= es, + but I tend to remember it as the acronym for "Curry Upon This" ;-). + The names for the evaluating version of cut that + have been proposed were cut!, cutlet, +-cut*, and cute.

        +- +-

        Is it possible to implement the SRFI without macros?

        ++cut*, and cute. ++

        +=20 ++

        Is it possible to implement the SRFI without macros?

        ++

        + Not really. + As Stephan Houben has pointed out during the discussion (refer to +-"= Implementing it as a procedure") it is possible to implement the=20 ++= "Implementing it as a procedure") it is possible to implement the=20 + cute-mechanism as a procedure. + Refer also to Al Petrofsky's posting=20 +-"= Problems with "curry"'s formal specification" for details. ++= "Problems with "curry"'s formal specification" for details. + However, the procedural implementation comes with a slight performance + penalty and it is not possible the implement the cut-mechani= sm=20 + as a procedure, too. + As both are needed, we rely on macros to implement the SRFI. ++

        +=20 +-

        Why is there another symbol for the rest-slot when lambda-expressions +-use the dotted notation for variable length argument lists?

        ++

        Why is there another symbol for the rest-slot when lambda-expressions ++use the dotted notation for variable length argument lists?

        ++

        + There are two reasons. + The first one is the existence of a procedural implementation + of a related mechanism (refer to the previous paragraph). +@@ -330,10 +379,11 @@ For a procedure, however, it is not possible to have= dotted notation. + The second reason is the way the hygienic macro mechanism in R5RS + is defined to deal with dotted notation, as Felix Winkelmann has pointed = out. + Refer to the discussion threads +-"= Improper lists in macros [WAS: none]".

        ++= "Improper lists in macros [WAS: none]". ++

        +=20 +-

        Why is it impossible to specify when a non-slot is evaluated individu= ally=20 +-per non-slot?

        ++

        Why is it impossible to specify when a non-slot is evaluated individu= ally per non-slot?

        ++

        + Cut evaluates all non-slots at the time the specialized + procedure is called and cute evaluates all non-slots at + the time the procedure is being specialized. +@@ -343,32 +393,34 @@ However, I am convinced that the benefit of the grea= ter flexibility + is not worth the risk of confusion. + If a piece of code really depends on the distinction, it might be + better to make this explicit through let and=20 +-lambda.

        +- +-

        Why is (cut if <> 0 1) etc. illegal?

        ++lambda. ++

        +=20 ++

        Why is (cut if <> 0 1) etc. illegal?

        ++

        + It is specified that a <slot-or-expr> must be + either the slot symbol or an <expression> in the sense +-of R5RS,=20 +-Section 7.1.3. ++of R5RS,=20 ++Section 7.1.3. + As if is no <expression>, + the above case is illegal. + The reason why cut and cute are + restricted in this sense is the difficulty of defining + the meaning of such generalized expressions. + Please refer to the discussion archive for details. ++

        +=20 +-

        Acknowledgements

        +- ++

        Acknowledgements

        ++

        + An important part of this SRFI is based on the contribution + of other people, mostly through the discussion archive. + In particular, the semantics and the design rationale have + been greatly improved in the course of the discussion. + I would like to thank all who have contributed. ++

        +=20 +-

        Copyright

        ++

        Copyright

        +

        Copyright (C) Sebastian Egner (2002). All Rights Reserved.

        +- +

        + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -392,12 +444,12 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        +-
        Editor: Mi= ke Sperber
        ++
        ++
        Editor: Mike Sperber
        +
        Author: Sebas= tian Egner
        + + +-Last modified: Wed Jun 19 10:54:36 MST 2002 ++Last modified: Sun Jan 28 13:40:30 MET 2007 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-27.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-27.html +index 14a88ff..c568d78 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-27.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-27.html +@@ -1,55 +1,67 @@ +- +- ++ ++ + ++ ++ + SRFI 27: Sources of Random Bits ++ ++ ++ + +- + +- +-

        Title

        +- +-SRFI 27: Sources of Random Bits +- +-

        Author

        +- +-Sebastian Egner +- +-

        Status

        +- +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here.=20=20 +-You can access +-previous messages via +- +-the archive of the mailing list. +- +-
          +-
        • Draft: 2002/02/12-2002/04/12
        • +-
        • Revised: 2002/04/04 +-
        • Revised: 2002/04/10 +-
        • Revised: 2002/04/10 +-
        • Final: 2002/06/03 +-
        +- +-

        Abstract

        +- ++

        SRFI 27: Sources of Random Bits

        ++ ++

        by Sebastian Egner

        ++

        This copy of the SRFI 27 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-27/srfi-27.html.

        ++ ++

        Status

        ++ ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 27@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

        ++
          ++
        • Draft: 2002-02-12--2002-04-12
        • ++
        • Revised: 2002-04-04 ++
        • Revised: 2002-04-10 ++
        • Revised: 2002-04-10 ++
        • Final: 2002-06-03 ++
        ++ ++

        Abstract

        ++

        + This document specifies an interface to sources of random bits, + or "random sources" for brevity. + In particular, there are three different ways to use the interface, + with varying demands on the quality of the source and the +-amout of control over the production process: +- +-

          +-
        • ++amount of control over the production process: ++

          ++
            ++
          • + The "no fuss" interface specifies that=20 +-(random-integer n) +-produces the next random integer in {0, ..., n-1} and ++(random-integer n) ++produces the next random integer in {0, ..., n-1} and + (random-real) produces the next random + real number between zero and one. + The details of how these random values are produced may not be + very relevant, as long as they appear to be sufficiently random. +-
          • ++
          • ++
          • + For simulation purposes, on the contrary, it is usually necessary + to know that the numbers are produced deterministically by a pseudo=20 + random number generator of high quality and to have explicit access=20 +@@ -57,18 +69,19 @@ to its state. + In addition, one might want to use several independent sources of + random numbers at the same time and it can be useful to have some + simple form of randomization. +-
          • ++
          • ++
          • + For security applications a serious form of true randomization + is essential, in the sense that it is difficult for an adversary to=20 + exploit or introduce imperfections into the distribution of random bits. + Moreover, the linear complexity of the stream of random bits is more=20 + important than its statistical properties. +-In these applications, an entropy source (producing truly random ++In these applications, an entropy source (producing truely random + bits at a low rate) is used to randomize a pseudo random number + generator to increase the rate of available bits. +-
          ++
        • ++
        +

        +- + Once random sources provide the infrastructure to obtain=20 + random bits, these can be used to construct other random deviates. + Most important are floating point numbers of various distributions +@@ -78,17 +91,20 @@ limited use elsewhere), we do not include them in this= SRFI. + In other words, this SRFI is not about making + all sorts of random objects---it is about obtaining random + bits in a portable, flexible, reliable, and efficient way. ++

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 ++

        + This SRFI defines an interface for sources of random bits=20 + computed by a pseudo random number generator. + The interface provides range-limited integer and real numbers. + It allows accessing the state of the underlying generator. + Moreover, it is possible to obtain a large number of=20 + independent generators and to invoke a mild form of true +-randomization.

        +- ++randomization. ++

        ++

        + The design aims at sufficient flexibility to cover the + usage patterns of many applications as diverse as + discrete structures, numerical simulations, and cryptographic protocols. +@@ -96,8 +112,9 @@ At the same time, the interface aims at simplicity, + which is important for occasional use. + As there is no "one size fits all" random number generator, + the design necessarily represents some form of compromise +-between the needs of the various applications.

        +- ++between the needs of the various applications. ++

        ++

        + Although strictly speaking not part of the specification, + the emphasis of this proposal is on high quality + random numbers and on high performance. +@@ -105,51 +122,49 @@ As the state of the art in pseudo random number gene= rators + is still advancing considerably, the choice of method for + the reference implementation should essentially be=20 + considered preliminary. ++

        +=20 +-

        Specification

        +- +-
        +- +-
        +-(random-integer n) -> x +-
        ++

        Specification

        +=20 +-
        +-The next integer x in {0, ..., n-1}=20 ++
        ++
        ++(random-integer n) -> x<= /code> ++
        ++
        ++

        ++The next integer x in {0, ..., n-1}=20 + obtained from default-random-source. + Subsequent results of this procedure appear to be independent +-uniformly distributed over the range {0, ..., n-1}. +-The argument n must be a positive integer, ++uniformly distributed over the range {0, ..., n-1}. ++The argument n must be a positive integer, + otherwise an error is signalled. +-

        +- +-
        +- +-
        +- +-
        +-(random-real) -> x +-
        +- +-
        +-The next number 0 < x < 1 obtained from ++

        ++
        ++
        ++ ++
        ++
        ++(random-real) -> x ++
        ++
        ++

        ++The next number 0 < x < 1 obtained from + default-random-source. + Subsequent results of this procedure appear to be=20 + independent uniformly distributed. + The numerical type of the results and the=20 + quantization of the output range depend on the implementation; + refer to random-source-make-reals for details. +-

        +- +-
        +- +-
        ++

        ++
        ++
        +=20 +-
        ++
        ++
        + default-random-source +-
        +- +-
        ++
        ++
        ++

        + A random source from which random-integer and=20 + random-real have been derived using + random-source-make-integers and +@@ -157,18 +172,18 @@ A random source from which random-integer and + Note that an assignment to default-random-source=20 + does not change random or random-real; + it is also strongly recommended not to assign a new value. +-

        +- +- +-
        +-
        +- +-
        +-(make-random-source) -> s +-
        +- +-
        +-Creates a new random source s. ++

        ++
        ++
        ++ ++
        ++
        ++
        ++(make-random-source) -> s ++
        ++
        ++

        ++Creates a new random source s. + Implementations may accept additional, optional arguments in=20 + order to create different types of random sources. + A random source created with make-random-source +@@ -177,146 +192,148 @@ by some form of pseudo random number generator. + Each random source obtained as (make-random-source) + generates the same stream of values, unless the state is modified + with one of the procedures below. +-

        +- +-
        +- +-
        +- +-
        +-(random-source? obj) -> bool +-
        +- +-
        +-Tests if obj is a random source. ++

        ++
        ++
        ++ ++
        ++
        ++(random-source? obj) -> bool= ++
        ++
        ++

        ++Tests if obj is a random source. + Objects of type random source are distinct from all + other types of objects. +-

        +- +-
        +- +-
        +- +-
        +-(random-source-state-ref s) -> stat= e
        +-(random-source-state-set! s state= ) +-
        +- +-
        +-Get and set the current state of a random source s. The +-structure of the object state depends on the implementation; ++

        ++
        ++
        ++ ++
        ++
        ++(random-source-state-ref s) -> s= tate
        ++(random-source-state-set! s state= ) ++
        ++
        ++

        ++Get and set the current state of a random source s. The ++structure of the object state depends on the implementation; + the only portable use of it is as argument to=20 + random-source-state-set!. + It is, however, required that a state possess an external + representation. +-

        +- +-
        +- +-
        +-
        +-(random-source-randomize! s) +-
        +- +-
        ++

        ++
        ++
        ++ ++
        ++
        ++(random-source-randomize! s) ++
        ++
        ++

        + Makes an effort to set the state of the random=20 +-source s to a truly random state. ++source s to a truly random state. + The actual quality of this randomization depends on the implementation +-but it can at least be assumed that the procedure sets s to a=20 ++but it can at least be assumed that the procedure sets s to a=20 + different state for each subsequent run of the Scheme system. +-

        +-
        +- +-
        +-
        +-(random-source-pseudo-randomize! s i = j) +-
        +- +-
        +-Changes the state of the random source s into the initial +-state of the (i, j)-th independent random source, +-where i and j are non-negative integers. ++

        ++
        ++
        ++ ++
        ++
        ++(random-source-pseudo-randomize! s i = j) ++
        ++
        ++

        ++Changes the state of the random source s into the initial ++state of the (i, j)-th independent random source, ++where i and j are non-negative integers. + This procedure provides a mechanism to obtain a large number of=20 + independent random sources (usually all derived from the same backbone + generator), indexed by two integers. + In contrast to random-source-randomize!, + this procedure is entirely deterministic. +-

        +-
        +- +- +-
        ++

        ++ ++ +=20 +-
        +=20 +-
        +-(random-source-make-integers s) -> = rand +-
        ++
        +=20 +-
        +-Obtains a procedure rand to generate random integers=20 +-using the random source s. +-Rand takes a single argument n, ++
        ++
        ++(random-source-make-integers s) -> = rand ++
        ++
        ++

        ++Obtains a procedure rand to generate random integers=20 ++using the random source s. ++Rand takes a single argument n, + which must be a positive integer, and returns the next uniformly +-distributed random integer from the interval {0, ..., n-1} +-by advancing the state of the source s.

        +- ++distributed random integer from the interval {0, ..., n-1} ++by advancing the state of the source s. ++

        ++

        + If an application obtains and uses several generators for the same=20 +-random source s, a call to any of these generators advances=20 +-the state of s. Hence, the generators do not produce=20 ++random source s, a call to any of these generators advances=20 ++the state of s. Hence, the generators do not produce=20 + the same sequence of random integers each but rather share a state. + This also holds for all other types of generators derived from + a fixed random sources. + Implementations that support concurrency make sure that +-the state of a generator is properly advanced.

        +-

        +- +-
        +- +-
        +- +-
        +-(random-source-make-reals s) -> ran= d
        +-(random-source-make-reals s unit<= code>) ->
        rand
        +-
        +- +-
        +-Obtains a procedure rand to generate random real numbers +-0 < x < 1 using the random source s. +-The procedure rand is called without arguments.

        +- +-The optional parameter unit determines the type of numbers +-being produced by rand and the quantization of the output. +-Unit must be a number such that 0 < unit < 1. +-The numbers created by rand are of the same numerical +-type as unit and the potential output values are +-spaced by at most unit. One can imagine rand +-to create numbers as x*unit where x +-is a random integer in {1, ..., floor(1/unit)-1}. ++the state of a generator is properly advanced.

        ++
        ++
        ++ ++ ++
        ++
        ++(random-source-make-reals s) -> = rand
        ++(random-source-make-reals s unit<= code>) -> rand
        ++
        ++
        ++

        ++Obtains a procedure rand to generate random real numbers ++0 < x < 1 using the random source s. ++The procedure rand is called without arguments. ++

        ++

        ++The optional parameter unit determines the type of numbers ++being produced by rand and the quantization of the output. ++Unit must be a number such that 0 < unit < 1. ++The numbers created by rand are of the same numerical ++type as unit and the potential output values are ++spaced by at most unit. One can imagine rand ++to create numbers as x*unit where x ++is a random integer in {1, ..., floor(1/unit)-1}. + Note, however, that this need not be the way the values + are actually created and that the actual resolution of +-rand can be much higher than unit. +-In case unit is absent it defaults to a reasonably ++rand can be much higher than unit. ++In case unit is absent it defaults to a reasonably + small value (related to the width of the mantissa of an + efficient number format). +-

        +- +-
        ++

        ++
        ++
        +=20 +=20 +-

        Design Rationale

        ++

        Design Rationale

        +=20 +-

        Why not combine random-integer and +-random-real?

        ++

        Why not combine random-integer and random-real?

        +=20 ++

        + The two procedures are not combined into a single variable-arity=20 + procedures to save a little time and space during execution. + Although some Scheme systems can deal with variable arity as + efficiently as with fixed arity this is not always the case + and time efficiency is very important here. ++

        +=20 +-

        Why not some object-oriented interface?

        ++

        Why not some object-oriented interface?

        +=20 ++

        + There are many alternatives to the interface as specified in this SRFI.=20 + In particular, every framework for object-orientation can be used to + define a class for random sources and specify the interface for the +@@ -324,9 +341,11 @@ methods on random sources. + However, as the object-oriented frameworks differ considerably + in terms of syntax and functionality, this SRFI does not make + use of any particular framework. ++

        +=20 +-

        Why is there not just a generator with a fixed range?

        ++

        Why is there not just a generator with a fixed range?

        +=20 ++

        + A bare fixed-range generator is of very limited use. + Nearly every application has to add some functionality=20 + to make use of the random numbers. +@@ -337,22 +356,26 @@ This is exactly what is provided by + In addition, is saves the user from the pitfall of changing + the range with a simple modulo-computation + which may substantially reduce the quality of the +-numbers being produced.

        +- ++numbers being produced. ++

        ++

        + The design of the interface is based on three prototype applications: +-

          +-
        1. ++

          ++
            ++
          1. + Repeatedly choose from relatively small sets: + As the size of the set is likely to vary from call to call, +-random-integer accepts a range argument n in every ca= ll. ++random-integer accepts a range argument n in every ca= ll. + The implementation should try to avoid boxing/unboxing of values + if the ranges fit into immediate integers. +-
          2. ++
          3. ++
          4. + Generate a few large integers with a fixed number of bits: + As generating the random number itself is expensive,=20 + passing the range argument in every call does not hurt performance. + Hence, the same interface as in the first application can be used. +-
          5. ++
          6. ++
          7. + Generate real numbers: + Unlike the choose-from-set case,=20 + the range and the quantization is constant over a=20 +@@ -365,10 +388,11 @@ Therefore, + random-real does not accept any parameters but + the procedure random-source-make-reals creates + a properly configured random-real procedure. +-
          +- +-

          Why bother about floating point numbers at all?

          ++
        2. ++
        +=20 ++

        Why bother about floating point numbers at all?

        ++

        + A proper floating point implementation of a random number generator + is potentially much more efficient that an integer implementation + because it can use more powerful arithmetics hardware. +@@ -378,19 +402,21 @@ produce floating point random numbers. + A secondary reason is to save the user from the 'not as easy as + it seems' task of converting an integer generator into a real=20 + generator. ++

        +=20 +-

        Why are zero and one excluded from random-real?

        +- ++

        Why are zero and one excluded from random-real?

        ++

        + The procedure random-real does not return=20 +-x =3D 0 or x =3D 1 in order to allow=20 +-(log x) and=20 +-(log (- 1 x)) ++x =3D 0 or x =3D 1 in order to allow=20 ++(log x) and=20 ++(log (- 1 x)) + without the danger of a numerical exception. ++

        +=20 +-

        Implementation

        +- +-

        Choice of generator

        ++

        Implementation

        +=20 ++

        Choice of generator

        ++

        + The most important decision about the implementation is=20 + the choice of the random number generator. + The basic principle here is: Let quality prevail! +@@ -399,8 +425,9 @@ a cheap price to pay for some avoided catastrophes. + It may be unexpected, but I have also seen many examples + where the better generator was also the faster. + Simple linear congruential generator cannot be recommended +-as they tend to be ill-behaved in several ways.

        +- ++as they tend to be ill-behaved in several ways. ++

        ++

        + For this reason, my initial proposal was George Marsaglia's + COMBO generator, which is the combination of a 32-bit=20 + multiplicative lagged Fibonacci-generator with a 16-bit +@@ -408,16 +435,17 @@ multiply with carry generator. + The COMBO generator passes all tests of Marsaglia's + DIEHARD + testsuite for random number generators and has +-a period of order 2^60.

        +- ++a period of order 2^60. ++

        ++

        + As an improvement, Brad Lucier suggested +-s= uggested ++= suggested + Pierre L'Ecuyer's + MRG32k3a + generator which is combination of two recursive generators + of degree three, both of which fit into 54-bit arithmetics. + The MRG32k3a generator also passes DIEHARD and in addition, +-has desirable spectral properties and a period in the ++has desireable spectral properties and a period in the + order of 2^191. + As a matter of fact, multiple recursive generators (MRGs) are=20 + theoretically much better understood than special constructions +@@ -425,10 +453,12 @@ as the COMBO generator. + This is the reason why the implementations provided here + implements the MRG32k3a generator. + When implemented in floating point arithmetics with sufficient +-mantissa-width, this generator is also very fast.

        ++mantissa-width, this generator is also very fast. ++

        +=20 +-

        Choice of arithmetics

        ++

        Choice of arithmetics

        +=20 ++

        + The next important decision about the implementation is + the type of arithmetics to be used. + The choice is difficult and depends heavily on the +@@ -441,8 +471,9 @@ And if you do not have floats either, then at least + try to make sure you work with immediate integers + (instead of allocated objects). + Unfortunately, there is no portable way in Scheme to +-find out about native and emulated arithmetics.

        +- ++find out about native and emulated arithmetics. ++

        ++

        + As performance is critical to many applications,=20 + one might want to implement the actual + generator itself in native code. +@@ -450,17 +481,20 @@ For this reason, I provide three different + implementations of the backbone generator=20 + as a source of inspiration. + See the code below. ++

        +=20 +-

        Data Type for Random Sources

        ++

        Data Type for Random Sources

        +=20 ++

        + An important aspect of the specification in this SRFI + is that random sources are objects of a distinct type. + Although this is straight-forward and available in nearly + every Scheme implementation, there is no portable way=20 + to do this at present. + One way to define the record type is to use=20 +-SRFI-9.

        +- ++SRFI-9. ++

        ++

        + The reference implementations below define a record + type to contain the exported procedures. + The actual state of the generator is stored in the +@@ -468,42 +502,51 @@ binding time environment of make-random-source= . + This has the advantage that access to the state is fast + even if the record type would be slow (which need not be + the case). ++

        +=20 +-

        Entropy Source for Randomization

        ++

        Entropy Source for Randomization

        +=20 ++

        + Another problematic part of the specification with respect + to portability is random-source-randomize! as +-it needs access to a real entropy source.

        +- ++it needs access to a real entropy source. ++

        ++

        + A reasonable choice for such as source is to use the system + clock in order to obtain a value for randomization, for example + in the way John David Stone recommends (see reference below). + This is good enough for most applications with the=20 + notable exception of security related programs. + One way to obtain the time in Scheme is to use=20 +-SRFI-19.

        ++SRFI-19. ++

        +=20 +-

        Implementation of the specified interface

        ++

        Implementation of the specified interface

        +=20 ++

        + Once the portability issues are resolved,=20 + one can provide the remaining functionality as=20 +-specified in this SRFI document.

        +- ++specified in this SRFI document. ++

        ++

        + For the reference implementation, a relatively large part + of the code deals with the more advanced features of the=20 + MRG32k3a generator,=20 + in particular random-source-pseudo-randomize!. + This code is inspired by Pierre L'Ecuyer's own implementation +-of the MRG32k3a generator.

        +- ++of the MRG32k3a generator. ++

        ++

        + Another part of this generic code deals with changing + the range and quantization of the random numbers and +-with error checking to detect common mistakes and abuses.

        ++with error checking to detect common mistakes and abuses. ++

        +=20 +-

        Implementation Examples

        ++

        Implementation Examples

        +=20 +-Here are three= alternative implementations of the SRFI. +-(He= re are all files, tar-gzipped, 13300 bytes.) ++

        ++Here are thre= e alternative implementations of the SRFI. ++(Here are a= ll files, tar-gzipped, 53K bytes.) + Keep in mind that a SRFI is a "request for implementation", + which means these implementations are merely examples + to illustrate the specification and inspire people to implement=20 +@@ -513,35 +556,35 @@ on a Pentium3, 800 Mhz, Linux; x int/s, y<= /i> real/s + means (random-integer 2) can be computed about x + times a second and (random-real) about y times a seco= nd. + The implementations are ++

        +=20 +-
          +- +-
        1. for Scheme 48 0.57, using 54-bit integer only. ++
            ++
          1. for Scheme 48 0.57, using 54-bit integer only. + This implementation aims at portability, not at performance + (30000 ints/s, 3000/s reals/s). +- +-
          2. for Scheme 48 0.57 with the core generator being implemented=20 ++
          3. ++
          4. for Scheme 48 0.57 with the core generator being implemented + in C using (double)-arithmetics. + The generator is made available in Scheme 48 via the + C/Scheme=20 + interface. + The performance of this generator is good + (160000 ints/s, 180000 reals/s). +- +-
          5. for Gambit 3.0, using flonum and=20 ++
          6. ++
          7. for Gambit 3.0, using flonum and + 54-bit integer. + This code is inspired by a program by Brad Lucier as=20 +-p= osted ++= posted + to the discussion archive of this SRFI. + The performance of this generator is good when compiled + (5000 ints/s, 25000/s reals/s when interpreted, + 200000 ints/s, 400000/s reals/s when compiled; + see acknowledgements). +- +-
          +- ++
        2. ++
        ++

        + In addition to the implementations there is a small +-collection of c= onfidence tests ++collection of confidence tests + for the interface specified. + The tests merely check a few assertions expressed by the specification. + It is not the intention to provide a complete test of the interface here. +@@ -550,12 +593,13 @@ generator itself. + However, there is a function to write random bits from + the generators to a file in a way readable by the DIEHARD=20 + testsuite. This makes it easier for implementors to find out +-about their favorite generators and check their implementation.

        +- ++about their favorite generators and check their implementation. ++

        +=20 +=20 +-

        Recommended Usage Patterns

        ++

        Recommended Usage Patterns

        +=20 ++

        + Unless the functionality defined in this SRFI is sufficient, + an application has to implement more procedures to construct + other random deviates. +@@ -565,24 +609,27 @@ examples of increasing difficulty + with respect to the interface. + Note that the code below is not part of the specification, + it is merely meant to illustrate the spirit ++

        +=20 +-

        Generating Random Permutations

        ++

        Generating Random Permutations

        +=20 ++

        + The following code defines procedures to generate random=20 +-permutations of the set {0, ..., n-1}. ++permutations of the set {0, ..., n-1}. + Such a permutation is represented by a vector=20 +-of length n for the images of the points.

        +- ++of length n for the images of the points. ++

        ++

        + Observe that the implementation first defines the procedure=20 + random-source-make-permutations to +-turn a random source s into a procedure to generate +-permutations of given degree n. ++turn a random source s into a procedure to generate ++permutations of given degree n. + In a second step, this is applied to the default source + to define a ready-to-use procedure for permutations: +-(random-permutation n) +-constructs a random permutation of degree n. +- +-

        ++(random-permutation n)
        ++constructs a random permutation of degree n.
        ++

        ++
        + (define (random-source-make-permutations s)
        +   (let ((rand (random-source-make-integers s)))
        +     (lambda (n)
        +@@ -601,19 +648,21 @@ constructs a random permutation of degree n.
        +=20
        + (define random-permutation
        +   (random-source-make-permutations default-random-source))
        +-
        +- ++
        ++

        + For the algorithm refer to Knuth's "The Art of Computer Programming", + Vol. II, 2nd ed., Algorithm P of Section 3.4.2. ++

        +=20 +-

        Generating Exponentially-Distributed Random Numbers

        ++

        Generating Exponentially-Distributed Random Numbers

        +=20 ++

        + The following code defines procedures to generate exponentially + Exp(mu)-distributed random numbers. + The technical difficulty of the interface addressed here is + how to pass optional arguments to random-source-make-reals. +- +-

        ++

        ++
        + (define (random-source-make-exponentials s . unit)
        +   (let ((rand (apply random-source-make-reals s unit)))
        +     (lambda (mu)
        +@@ -621,17 +670,20 @@ how to pass optional arguments to random-sourc=
        e-make-reals.
        +=20
        + (define random-exponential
        +   (random-source-make-exponentials default-random-source))
        +-
        +- ++
        ++

        + The algorithm is folklore. Refer to Knuth's "The Art of Computer=20 + Programming", Vol. II, 2nd ed., Section 3.4.1.D. ++

        +=20 +-

        Generating Normally-Distributed Random Numbers

        ++

        Generating Normally-Distributed Random Numbers

        +=20 ++

        + The following code defines procedures to generate=20 + normal N(mu, sigma)-distributed real numbers using=20 +-the polar method.

        +- ++the polar method. ++

        ++

        + The technical difficulty of the interface addressed here + is that the polar method generates two results per computation. + We return one of the result and store the second one to be=20 +@@ -639,8 +691,8 @@ returned by the next call to the procedure. + Note that this implies that random-source-state-set! + (and the other procedures modifying the state) does not necessarily + affect the output of random-normal immediately! +- +-

        ++

        ++
        + (define (random-source-make-normals s . unit)
        +   (let ((rand (apply random-source-make-reals s unit))
        + 	(next #f))
        +@@ -653,7 +705,7 @@ affect the output of random-normal immedi=
        ately!
        + 	    (let* ((v1 (- (* 2 (rand)) 1))
        + 		   (v2 (- (* 2 (rand)) 1))
        + 		   (s (+ (* v1 v1) (* v2 v2))))
        +-	      (if (>=3D s 1)
        ++	      (if (>=3D s 1)
        + 		  (loop)
        + 		  (let ((scale (sqrt (/ (* -2 (log s)) s))))
        + 		    (set! next (* scale v2))
        +@@ -661,38 +713,40 @@ affect the output of random-normal imme=
        diately!
        +=20
        + (define random-normal
        +   (random-source-make-normals default-random-source))
        +-
        +- ++
        ++

        + For the algorithm refer to Knuth's "The Art of Computer Programming", + Vol. II, 2nd ed., Algorithm P of Section 3.4.1.C. ++

        +=20 +-

        Acknowledgements

        +- ++

        Acknowledgements

        ++

        + I would like to thank all people who have participated in the discussion, + in particular Brad Lucier and Pierre l'Ecuyer. + Their contributions have greatly improved the design of this SRFI. + Moreover, Brad has optimized the Gambit implementation quite substantiall= y. ++

        +=20 +-

        References

        ++

        References

        +=20 +-
          ++
            +=20 +-
          1. ++
          2. + G. Marsaglia:=20 + Diehard -- Testsuite for Random Number Generators.=20 + stat.fsu.edu/~ge= o/diehard.html + (Also contains some generators that do pass Diehard.) +-
          3. ++ +=20 +-
          4. ++
          5. + D. E. Knuth: + The Art of Computer Programming; + Volume II Seminumerical Algorithms. + 2nd ed. Addison-Wesley, 1981. + (The famous chapter on random number generators.) +-
          6. ++ +=20 +-
          7. ++
          8. + P. L'Ecuyer: + "Software for Uniform Random Number Generation: + Distinguishing the Good and the Bad", +@@ -700,93 +754,92 @@ Moreover, Brad has optimized the Gambit implementati= on quite substantially. + IEEE Press, Dec. 2001, 95--105. + www.iro.umontreal.ca/~lecuyer/myftp/papers/wsc01rng.pdf + (Profound discussion of random number generators.) +-
          9. ++ +=20 +-
          10. ++
          11. + P. L'Ecuyer: + "Good Parameter Sets for Combined Multiple Recursive + Random Number Generators",=20 + Shorter version in Operations Research, 47, 1 (1999), 159--164. + www.iro.umontreal.ca/~lecuyer/myftp/papers/combmrg2.ps + (Actual numbers for good generators.) +-
          12. ++ +=20 +-
          13. ++
          14. + P. L'Ecuyer: + "Software for Uniform Random Number Generation: + Distinguishing the Good and the Bad", + Proceedings of the 2001 Winter Simulation Conference,=20 + IEEE Press, Dec. 2001, 95--105. +-
          15. ++ +=20 +-
          16. ++
          17. + MIT Scheme v7.6: + random flo:random-unit *random-state* make-random-state=20 + random-state? + http://www.swiss.ai.mit.edu/projects/scheme/documen= tation/scheme_5.html#SEC53 + (A mechanism to run a fixed unspecified generator.) +-
          18. ++ +=20 +-
          19. ++
          20. + A. Jaffer:=20 + SLIB 2d2 with (require 'random): +- random *random-state* copy-random-state seed->random-state ++ random *random-state* copy-random-state seed->random-st= ate + make-random-state random:uniform random:exp random:normal-vector! + random-hollow-sphere! random:solid-sphere! +- = http://www.swiss.ai.mit.edu/~jaffer/slib_4.html#SEC92 +- (Based on the MIT Scheme mechanism.) +-
          21. ++ = http://swiss.csail.mit.edu/~jaffer/slib_5.html#SEC108 ++ (Uses RC-4.) ++ +=20 +-
          22. ++
          23. + R. Kelsey, J. Rees: + Scheme 48 v0.57 'random.scm':=20 + make-random make-random-vector + (Internal procedures of Scheme48; a fixed 28-bit generator.) +-
          24. ++ +=20 +-
          25. ++
          26. + M. Flatt:=20 + PLT MzScheme Version 200alpha1: + random random-seed current-pseudo-random-generator=20 + make-pseudo-random-generator pseudo-random-generator? +- http://download.plt-scheme.org/doc/200al= pha1/html/mzscheme/mzscheme-Z-H-3.html#%_idx_144 ++ http://download.plt-scheme.org/doc/200= alpha1/html/mzscheme/mzscheme-Z-H-3.html#%_idx_144 + (A mechanism to run a generator and to exchange the generator.) +-
          27. ++ +=20 +-
          28. ++
          29. + H. Abelson, G. J. Sussmann, J. Sussman: + Structure and Interpretation of Computer Programs. +- http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-20.h= tml#%_idx_2934 ++ http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-20= .html#%_idx_2934 + (The rand-example shows a textbook way to define a=20 + random number generator.) +-
          30. ++ +=20 +-
          31. ++
          32. + John David Stone: + A portable random-number generator. + http://www.math.grin.edu/~stone/events/scheme-workshop/random.= html + (An implementation of a linear congruental generator in Scheme.) +-
          33. ++ +=20 +-
          34. ++
          35. + Network Working Group: + RFC1750: Randomness Recommendations for Security. + h= ttp://www.cis.ohio-state.edu/htbin/rfc/rfc1750.html + (A serious discussion of serious randomness for serious security.) +-
          36. ++ +=20 +-
          37. +- http://www.random.org= /essay.html
            ++
          38. ++ http://www.random.org= /essay.html
            + http://www= .taygeta.com/random/randrefs.html + (Resources on random number generators and randomness.) +-
          39. ++ +=20 +-
          ++
        +=20 +=20 +-

        Copyright

        ++

        Copyright

        +

        Copyright (C) Sebastian Egner (2002). All Rights Reserved.

        +- +

        + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -810,12 +863,12 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        +-
        Editor: Mi= ke Sperber
        ++
        ++
        Editor: Mike Sperber
        +
        Author: Sebas= tian Egner
        + + +-Last modified: Fri Sep 5 16:11:17 MST 2003 ++Last modified: Wed Jul 21 08:44:49 MST 2010 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-28.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-28.html +index 8aae23b..c2a0de5 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-28.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-28.html +@@ -1,41 +1,58 @@ +- +- ++ ++ + +- ++ ++ ++ + SRFI 28: Basic Format Strings +- +- ++ ++ ++ ++ ++ + +=20 + +=20 +-

        Title

        ++

        SRFI 28: Basic Format Strings

        +=20 +- SRFI 28: Basic Format Strings=20 ++

        by Scott G. Miller

        ++

        This copy of the SRFI 28 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-28/srfi-28.html.

        +=20 +-

        Author

        ++

        Status

        +=20 +- Scott G. Miller=20 ++

        This SRFI is currently in final status. Here is an explanation of each= status that a SRFI can hold. To provide input on this SRFI, please send e= mail to = srfi-28@nospamsrfi.schemers.org.= To subscribe to the list, follow these instructions. You can access previous mes= sages via the mailing list archive.

        ++
          ++
        • Draft: 2002-03-23--2002-05-23
        • ++
        • Final: 2002-06-25 ++
        +=20 +-

        Status

        +- +- This SRFI is currently in ``final'' status. To see an explanation of = each status that a SRFI can hold, see here. +- +- You can access the discussion on this SRFI via the archive of the mailin= g list. +- +-
          +-
        • Draft: 2002/03/23-2002/05/23
        • +-
        • Final: 2002/06/25 +-
        +- +-

        Abstract

        ++

        Abstract

        +=20 + This document specifies Format Strings, a method of + interpreting a Scheme string which contains a number of escape + sequences that are replaced with other string data according to + the semantics of each sequence.=20 +=20 +-

        Rationale

        ++

        Rationale

        +=20 + Many Scheme systems provide access to a function called + format. This function takes as arguments a format string, +@@ -47,9 +64,9 @@ + allow portable code to be written using the function without + much (if any) effort on the part of Scheme implementors.=20 +=20 +-

        Specification

        ++

        Specification

        +=20 +- format format-string [o= bj ...] -> ++ format format-string [obj ...] -= > + string=20 +=20 +
        +@@ -84,7 +101,7 @@ + value.

        +
        +=20 +-

        Examples

        ++

        Examples

        +
        + (format "Hello, ~a" "World!")
        + ; =3D> "Hello, World!"
        +@@ -93,10 +110,10 @@
        + ; =3D> "Error, list is too short: (one \"two\" 3))"
        + 
        +=20 +-

        Implementation

        ++

        Implementation

        +=20 + The implementation below requires SRFI-6 (Basic string ports) +- and SRFI-23 (Error reporting mechanism).
        ++ and SRFI-23 (Error reporting mechanism).
        +=20=20=20=20=20=20 +
        + (define format
        +@@ -134,7 +151,7 @@
        +=20=20=20=20=20
        + 
        +=20 +-

        Copyright

        ++

        Copyright

        +=20 +

        Copyright (C) Scott G. Miller (2002). All Rights Reserved.

        +=20 +@@ -161,10 +178,10 @@ + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +

        +-
        ++
        +=20 +
        +- Editor: ++ Editor: + Francisco Solsona +
        +=20 +@@ -178,4 +195,3 @@ + + + +- +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-29.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-29.html +index e493c05..bc144b0 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-29.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-29.html +@@ -1,36 +1,46 @@ +- ++ + + +- +- ++ ++ + SRFI 29: Localization +- +- +- ++ ++ ++ + + +-

        3D29: Localization

        ++

        SRFI 29: Localization

        +=20 +

        by Scott G. Miller

        ++

        This copy of the SRFI 29 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-29/srfi-29.html.

        +=20 +

        Status

        +=20 +

        This SRFI is currently in final status. Here is + an + explanation of each status that a SRFI can hold. To provide +- input on this SRFI, please send email to srfi-29@nospamsrfi.schemers.org. +- To subscribe to the list, follow these ++ input on this SRFI, please send email to srfi-29@nospa= msrfi.schemers.org. ++ To subscribe to the list, follow these + instructions. You can access previous messages via the +- mailing list archive.

        ++ mailing list archiv= e.

        +=20 +
          +
        • Draft: 2002-03-26--2002-06-19
        • +@@ -124,9 +134,9 @@ + no-argument procedures:

          +=20 +

          current-language +- -> symbol
          ++ -> symbol
          + current-language symbol -> +- undefined

          ++ undefined

          +=20 +
          + When given no arguments, returns the current ISO 639-1 language +@@ -137,9 +147,9 @@ +
          +=20 +

          current-country +- -> symbol
          ++ -> symbol
          + current-country symbol -> +- undefined

          ++ undefined

          +=20 +
          + returns the current ISO 3166-1 country code as a symbol. +@@ -149,11 +159,10 @@ + is not possible).    +
          +=20 +-

          current-locale-details +- -> list of symbols
          ++

          current-locale-details= ++ -> list of symbols
          + current-locale-details list-of-symbols -> +- undefined

          ++ undefined

          +=20 +
          + Returns a list of additional locale details as a list of +@@ -211,7 +220,7 @@ +=20 +

          declare-bundle! + bundle-specifier association-list -> +- undefined

          ++ undefined

          +=20 +
          + Declares a new bundle named by the given bundle-specifier. +@@ -219,10 +228,10 @@ + association list.  The list contains associations between + Scheme symbols and the message templates (Scheme strings) they + name.  If a bundle already exists with the given name, it +- is overwritten with the newly declared bundle.
          ++ is overwritten with the newly declared bundle.
          +
          + store-bundle +- bundle-specifier -> boolean
          ++ bundle-specifier -> boolean

          +=20 +
          + Attempts to store a bundle named by the given bundle specifier, +@@ -231,10 +240,10 @@ + an unspecified mechanism that may be persistent across Scheme + system restarts.  If successful, a non-false value is + returned.  If unsuccessful, #f is +- returned.
          ++ returned.
          +
          + load-bundle! +- bundle-specifier -> boolean
          ++ bundle-specifier -> boolean
          +=20 +
          + Attempts to retrieve a bundle from an unspecified mechanism +@@ -243,7 +252,7 @@ + non-false value, and the bundle is immediately available to the + Scheme system. If the bundle could not be found or loaded + successfully, the function returns #f, and the +- Scheme system's bundle registry remains unaffected.
          ++ Scheme system's bundle registry remains unaffected.
          +
          +=20 +

          A compliant Scheme system may choose not to provide any +@@ -259,14 +268,14 @@ +=20 +

          localized-template + package-name message-template-name +- -> string or #f

          ++ -> string or #f

          +=20 +
          + Retrieves a localized message template for the given package + name and the given message template name (both symbols). +  If no such message could be found, false (#f) is +- returned.
          +-
          ++ returned.
          ++
          +
          +=20 +

          After retrieving a template, the calling program can use +@@ -324,7 +333,7 @@ + of those functions in the reference implementation are not + capable of that distinction. Their implementation is provided + only so that the following code can run in any R4RS scheme +- system.  

          ++ system.  

          +=20 +

          In addition, the below implementation of a compliant + format requires SRFI-6 (Basic String Ports) and +@@ -500,11 +509,10 @@ + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE.

          +=20 +-
          ++
          +=20 +
          +- Editor: David ++ Editor: David + Rush +
          +=20 +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-30.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-30.html +index b6c2fdc..ee5fafa 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-30.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-30.html +@@ -1,63 +1,69 @@ +- +- ++ ++ + ++ ++ + SRFI 30: Nested Multi-line Comments ++ ++ ++ + +=20 + +=20 +-

          Title

          ++

          SRFI 30: Nested Multi-line Comments

          +=20 +-SRFI 30: Nested Multi-line Comments ++

          by Martin Gasbichler

          ++

          This copy of the SRFI 30 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

          = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-30/srfi-30.html.

          ++=20=20=20=20 ++

          Status

          +=20 +-

          Author

          ++

          This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 30@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

          +=20 +-Martin Gasbichler +-=20=20=20=20 +-

          Status

          +- +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. It will +-remain in draft until 2002-04-06, or as amended. to provide input on +-this SRFI, please +- +-mail to srfi-30@srfi.schemers.org. +-See +-instructions here to subscribe to the list. You can access +-previous messages via +- +-the archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. +- +-
            +-
          • Draft: 2002/04/12-2002/06/10
          • +-
          • Revised: 2002/06/05
          • +-
          • Final: 2002/08/07
          • +-
          +- +-

          Related SRFIs

          ++
            ++
          • Draft: 2002-04-12--2002-06-10
          • ++
          • Revised: 2002-06-05
          • ++
          • Final: 2002-08-07
          • ++
          ++ ++

          Related SRFIs

          +=20=20=20=20=20 +-

          SRFI 22 defines ++

          SRFI 22 defines + a multi line comment that may only appear at the beginning of a + file.

          +=20 +-

          SRFI 10 +- proposes the notation ++

          SRFI 10 ++ proposes the notation

          +=20 +-
           "#" <discriminator> <other-char>*
          for further +- SRFIs that introduce values which may be read and written.

          ++
           "#" <discriminator> <other-char>*
          ++

          for further SRFIs that introduce values which may be read and ++ written.

          +=20 +-

          Abstract

          ++

          Abstract

          +=20 +

          This SRFI extends R5RS by possibly nested, multi-line + comments. Multi-line comments start with #| and end + with |#.

          +=20=20=20=20=20 +-

          Rationale

          ++

          Rationale

          +=20=20=20=20=20 +

          Multi-line comments are common to many programming languages. They + provide a convenient mean for adding blocks of text inside a program = and +@@ -70,13 +76,11 @@ the archive of the mailing list. + with R5RS. Nested comments are an important feature for + incrementally commenting out code.

          +=20=20=20=20=20 +-

          Specification

          ++

          Specification

          +=20 +-

          This SRFI extends the specification of comments -- R5RS ++

          This SRFI extends the specification of comments -- R5RS + section 2.2 -- as follows:

          +=20 +- +

          The sequence #| indicates the start of a + multi-line comment. The multi-line comment continues until + |# appears. If the closing |# is +@@ -88,8 +92,7 @@ the archive of the mailing list. +=20=20=20=20=20 +

          This SRFI furthermore extends the production for + <comment> in the specification of lexical +- structure -- R5RS ++ structure -- R5RS + section 7.1.1 -- to: +

          +
          +@@ -101,11 +104,10 @@ the archive of the mailing list.
          +     
          +=20 +=20 +-

          <delimiter> and #

          =20 ++

          <delimiter> and #

          +=20 +

          The SRFI does not extend the specification of +- <delimiter> from R5RS ++ <delimiter> from R5RS + section 7.1.1. It is therefore required to separate tokens + which require implicit termination (identifiers, numbers, + characters, and dot) from multi-line comments by a +@@ -116,7 +118,7 @@ the archive of the mailing list. + incompatible with existing implementations which allow + # as legal character within identifiers.

          +=20 +-

          Implementation

          ++

          Implementation

          +=20=20=20=20=20 +

          The following procedure skip-comment deletes a + leading multi-line comment from the current input port. Its +@@ -143,7 +145,7 @@ the archive of the mailing list. + ((#\#) (lp 'read-sharp nested-level)) + (else (lp 'start nested-level)))) + ((read-bar) (case (next-char) +- ((#\#) (if (> nested-level 1) ++ ((#\#) (if (> nested-level 1) + (lp 'start (- nested-level 1)))) + (else (lp 'start nested-level)))) + ((read-sharp) (case (next-char) +@@ -151,18 +153,16 @@ the archive of the mailing list. + (else (lp 'start nested-level))))))) +

    +=20 +-

    A SRFI 22 script= to remove nested multi-line comments is ++

    A SRFI 22 scrip= t to remove nested multi-line comments is + available at=20 +=20=20=20=20=20=20=20 +- http://srfi.schemers.org/srfi-30/remove-srfi30-comments-script.scm. ++ https://srfi.schemers.org/srfi-30/remove-srfi30-comments-scrip= t.scm. +=20=20=20=20=20=20=20 + The script will read a Scheme program containing nested + multi-line comments from standard input and emit the same + programs with the comments removed to standard output. The + script mimics the Scheme 48 reader and uses the +- error procedure from SRFI 23.

    ++ error procedure from SRFI 23<= /a>.

    +=20 +

    A number of Scheme implemenations already support this SRFI: + Chez Scheme, Chicken, Gambit-C, Kawa, MIT Scheme, MzScheme and +@@ -171,7 +171,7 @@ the archive of the mailing list. + implementations, Scheme 48 and Guile do not support this SRFI + yet.

    +=20 +-

    Copyright

    ++

    Copyright

    +

    Copyright (C) Martin Gasbichler (2002). All Rights Reserved.

    +=20 +

    +@@ -199,12 +199,11 @@ the archive of the mailing list. +

    +=20 +=20=20=20=20=20=20=20 +-
    +-
    Editor: Mike Sperber ++
    ++
    Editor: Mike Sperber
    + + +-Last modified: Sun Sep 1 17:14:55 MST 2002 ++Last modified: Sun Jan 28 13:40:31 MET 2007 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-31.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-31.html +index faf6eb9..dd8dc91 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-31.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-31.html +@@ -1,306 +1,319 @@ +- +- ++ ++ + +- ++ ++ + SRFI 31: A special form `rec' for recursive evaluation ++ ++ ++ + +=20 + +=20 +-

    Title

    ++

    SRFI 31: A special form rec for recursive evaluation

    +=20 +-SRFI 31: A special form rec for recursive evaluation ++

    by Mirko Luedde

    ++

    This copy of the SRFI 31 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

    = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-31/srfi-31.html.

    +=20 +-

    Author

    =20 ++

    Status

    +=20 +-Mirko Luedde <Mirko.Luedde@SAP= .com> ++

    This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 31@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

    ++
      ++
    • Draft: 2002-05-24--2002-08-24
    • ++
    • Revised: 2002-08-12
    • ++
    • Final: 2002-12-02
    • ++
    +=20 +-

    Status

    +-=20 +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. +- +-You can access the discussion via the +-archive of the mailing list. +- +-
      +-
    • Draft: 2002/05/24-2002/08/24
    • +-
    • Revised: 2002/08/12
    • +-
    • Final: 2002/12/02
    • +-
    +- +-

    Abstract

    =20 ++

    Abstract

    +=20 + We propose the implementation of a special form +-called rec. This form is a generalization and +-combination of the forms rec and +-named-lambda of [Clinger1985]. It allows the simple and ++called rec. This form is a generalization and ++combination of the forms rec and ++named-lambda of [Clinger1985]= . It allows the simple and + non-imperative construction of self-referential expressions. As an + important special case, it extends the A. Church form +-lambda such that it allows the direct definition of ++lambda such that it allows the direct definition of + recursive procedures without using further special forms like +-let or letrec, without using advanced ++let or letrec, without using advanced + constructions like the H. B. Curry combinator and, unlike +-define, without introducing variable bindings into the ++define, without introducing variable bindings into the + external environment. +=20 +-

    Rationale

    =20 ++

    Rationale

    +=20 +-

    General

    Among the prominent features of the Scheme +-programming language as defined in [KCR1998] ++

    General

    Among the prominent features of the Scheme ++programming language as defined in [KCR1998] + are the following. +=20 +-
      ++
        +=20 +-
      1. It has simple syntax.
      2. ++
      3. It has simple syntax.
      4. +=20=20 +-
      5. It encourages recursive definitions, e.g. by ensuring memory +- efficient tail recursion.
      6. ++
      7. It encourages recursive definitions, e.g. by ensuring memory ++ efficient tail recursion.
      8. +=20 +-
      9. It supports non-imperative programming.
      10. ++
      11. It supports non-imperative programming.
      12. +=20 +-
      ++
    +=20 + Nevertheless Scheme does not provide a syntax for recursive + evaluations with the properties of +=20 +-
      ++
        +=20 +-
      1. being as simple, intuitive and close to the mathematical standard +-notation as possible,
      2. ++
      3. being as simple, intuitive and close to the mathematical standard ++notation as possible,
      4. +=20 +-
      5. allowing general recursion,
      6. ++
      7. allowing general recursion,
      8. +=20 +-
      9. being non-imperative.
      10. ++
      11. being non-imperative.
      12. +=20 +-
      ++
    +=20 +-

    Example

    =20 +- +-

    Problem 1

    =20 ++

    Example

    +=20 ++

    Problem 1

    ++

    + Let us look at the factorial function. In mathematical notation this + function is expressed as +- +-

    =20
    +-  (F : N |--> 1,            if N =3D 0;=20
    ++

    ++
    =20
    ++  (F : N |--> 1,            if N =3D 0;=20
    +               N * F(N - 1), otherwise).
    +-
    +- ++
    ++

    + This expression is a term and not a definition or proposition. +- +-

    We investigate some approaches to express the factorial function in +-Scheme. +- +-

      +- +-
    • ++

      ++

      ++We investigate some approaches to express the factorial function in Schem= e. ++

      ++
        ++
      • ++

        + The simplest way perhaps is as +- +-

        ++

        ++
        + (define (F N)=20
        +   (if (zero? N) 1=20
        +     (* N (F (- N 1)))))
        +-
        +- ++
        ++

        + But this expression is not a term. It binds the factorial function to + the variable F. The expression itself may not occur in a +-syntactical context where a name of the factorial is required.

      • +- +-
      • ++syntactical context where a name of the factorial is required. ++

        ++
      • ++
      • ++

        + We list several ways to express the factorial as a function term. +- +-

          +- +-
        1. +-
          ++

          ++
            ++
          1. ++
            + (let ()=20
            +   (define (F N)
            +     (if (zero? N) 1=20
            +         (* N (F (- N 1)))))
            +     F)
            +-
            +-
          2. +- +-
          3. +-
            ++
            ++
          4. ++
          5. ++
            + (lambda (N)=20
            +   (let F ( (N N) )=20
            +        (if (zero? N) 1=20
            + 	 (* N (F (- N 1))))))
            +-
            +-
          6. ++
          ++
        2. +=20 +-
        3. +-
          ++
        4. ++
          + (letrec ( (F (lambda (N)=20
          + 	       (if (zero? N) 1=20
          + 		 (* N (F (- N 1)))))) )	F)
          +-
          +-
        5. ++
          ++
        6. +=20 +-
        7. +-
          ++
        8. ++
          + ((lambda (F)=20
          +    (F F))
          +  (lambda (G)=20
          +    (lambda (N)=20
          +      (if (zero? N) 1=20
          +        (* N ((G G) (- N 1)))))))
          +-
          +-
        9. +- +-
        ++
    ++ +=20 ++ ++

    + All these expressions define the factorial anonymously, not binding it + to a variable. However, all these expressions are more verbose than it + seems necessary and they are less intuitive than it seems +-desirable. +- +- ++desirable. ++

    ++ +=20 +-

    Solution 1

    =20 ++ +=20 +-A solution to our problem was already provided in
    [Clinger1985] by the form +-named-lambda. An even earlier solution with a slightly ++

    Solution 1

    ++

    ++A solution to our problem was already provided in [Clinger1985] by the form ++named-lambda. An even earlier solution with a slightly + different syntax was implemented in Kent Dybvig's Chez Scheme system. +- ++

    + Using this special form, we can denote the factorial simply by +- +-

    ++

    ++
    + (named-lambda (F N)=20
    +               (if (zero? N) 1=20
    +                 (* N (F (- N 1)))))
    +-
    +- ++
    ++

    + This expression is a function term that denotes the factorial in the + appropriate brevity. +=20 +-

    However, the form named-lambda has been dropped from ++

    However, the form named-lambda has been dropped from + later versions of the Scheme Report. Also it is missing in + state-of-the-art implementations such as Chez Scheme (6.0a) and MIT + Scheme (7.7.0). (The latter actually knows a form +-named-lambda with different semantics). ++named-lambda with different semantics). ++

    +=20 +-

    Problem 2

    =20 ++

    Problem 2

    +=20 + The constant stream of ones can be defined via +=20 +-
    (define S (cons 1 (delay S)))
    ++
    (define S (cons 1 (delay S)))
    +=20 + As in the case of the factorial, we are able to define the recursive + object at the price of spending an externally bound name. Remedying +-this with let or letrec leads to similar ++this with let or letrec leads to similar + objections as above. +=20 +-

    Solution 2

    =20 +- ++

    Solution 2

    ++

    + This particular case of the self-referential problem was solved by the +-rec form in [Clinger1985]. +- ++rec form in [Clinger1985]. ++

    + This form allows writing +- +-

    (rec S (cons 1 (delay S)))
    +- ++

    ++
    (rec S (cons 1 (delay S)))
    ++

    + This expression is non-imperative and does not introduce an external + variable binding. +=20 +-

    Also this form has been dropped from later versions of the Scheme ++

    Also this form has been dropped from later versions of the Scheme + Report. Moreover, from our point of view this form alone is not + capable of solving Problem 1. The respective definition would look + like +- +-

    ++

    ++
    + (rec F=20
    +      (lambda (N)=20
    +        (if (zero? N) 1=20
    + 	 (* N (F (- N 1))))))
    +-
    +- ++
    ++

    + This again does not seem quite as simple and intuitive as the + mathematical notation. ++

    +=20 +-

    Proposal

    =20 ++

    Proposal

    +=20 +-We therefore propose to implement the rec special form in ++We therefore propose to implement the rec special form in + a generalized way that combines the advantages of the +-named-lambda and rec forms. ++named-lambda and rec forms. +=20 + The factorial function could be written +-
    ++
    + (rec (F N)=20
    +      (if (zero? N) 1=20
    +        (* N (F (- N 1)))))
    +-
    ++
    +=20 +-

    Specification

    ++

    Specification

    +=20 +-

    Syntax

    =20 ++

    Syntax

    +=20 +-The following production rules are to be added to those of [KCR1998] (we reuse names of non-terminals). ++The following production rules are to be added to those of [KCR1998] (we reuse names of non-terminals). +=20 +-
      ++
        +=20 +-
      1. <derived expression> --> <rec expression>=
      2. ++
      3. <derived expression> --> <rec expression>=
      4. +=20 +-
      5. <rec expression> --> (rec <variable> +-<expression>)
      6. ++
      7. <rec expression> --> (rec <variable> ++<expression>)
      8. +=20 +-
      9. <rec expression> --> (rec (<variable>+) +-<body>)
      10. ++
      11. <rec expression> --> (rec (<variable>+) ++<body>)
      12. +=20 +-
      ++
    +=20 +-

    Semantics

    =20 ++

    Semantics

    +=20 +-Scheme versions such as [KCR1998] providing +-define-syntax, syntax-rules, +-letrec and lambda might implement +-rec as follows. ++Scheme versions such as [KCR1998] providing ++define-syntax, syntax-rules, ++letrec and lambda might implement ++rec as follows. +=20 +-
    ++
    + (define-syntax rec
    +   (syntax-rules ()
    +     ((rec (NAME . VARIABLES) . BODY)
    +      (letrec ( (NAME (lambda VARIABLES . BODY)) ) NAME))
    +     ((rec NAME EXPRESSION)
    +      (letrec ( (NAME EXPRESSION) ) NAME))))
    +-
    ++
    +=20 +-

    Test

    ++

    Test

    +=20 +-The following session shows in which way rec allows a ++The following session shows in which way rec allows a + tail-recursive implementation of the factorial function. +=20 +-
    +-> (define F (rec (F N)
    ++
    ++> (define F (rec (F N)
    + 		((rec (G K L)
    + 		   (if (zero? K) L
    + 		     (G (- K 1) (* K L)))) N 1)))
    +-> F
    ++> F
    + #<procedure>
    +-> (F 0)
    ++> (F 0)
    + 1
    +-> (F 10)
    ++> (F 10)
    + 3628800
    +-
    ++
    +=20 +-

    Acknowledgements

    =20 ++

    Acknowledgements

    +=20 + The author thanks Al Petrofsky for the final solution and Hal Abelson, + Chris Hanson and others for their input. The work of the maintainers + of the SRFI forum is highly appreciated. +=20 +-

    Bibliography

    ++

    Bibliography

    +=20 +- +=20 +-

    Copyright

    ++

    Copyright

    +=20 +

    Copyright (C) Dr. Mirko Luedde (2002). All Rights Reserved.

    +=20 +@@ -350,11 +362,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

    +=20 +-
    ++
    +=20 +-
    Author: Mirko Luedde=
    ++
    Author: Mirko Luedde
    +=20 +-
    Editor: Franci= sco Solsona
    ++
    Editor: Francisco Solsona
    +=20 + +=20 +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-34.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-34.html +index aa46757..144337e 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-34.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-34.html +@@ -1,82 +1,131 @@ +- +- ++ ++ + +-SRFI 34: Exception Handling for Programs ++ ++ ++ SRFI 34: Exception Handling for Programs ++ ++ ++ + +=20 + +-

    Title

    ++

    SRFI 34: Exception Handling for Programs

    +=20 +-SRFI 34: Exception Handling for Programs ++

    by Richard Kelsey and Michael Sperber

    ++

    This copy of the SRFI 34 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

    = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-34/srfi-34.html.

    +=20 +-

    Authors

    ++

    Status

    +=20 +-Richard Kelsey and Michael Sperber ++

    This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 34@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

    +=20 +-

    Status

    +- +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. It will +-remain in draft until 2002-10-20, or as amended. to provide input on +-this SRFI, please mail to=20 +- +-srfi-34@srfi.schemers.org. +-See +-instructions here to subscribe to the list. You can access +-the discussion via +- +-the archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. +- +-
      +-
    • Draft: 2002/07/24-2002/10/20
    • +-
    • Revised: 2002/09/20
    • +-
    • Final: 2002/12/1
    • +-
    • Fixed reference implementation: 2003/03/10
    • +-
    ++
      ++
    • Draft: 2002-07-24--2002-10-20
    • ++
    • Revised: 2002-09-20
    • ++
    • Final: 2002-12-01
    • ++
    • Revised to fix errata: ++
        ++
      • 2003-03-10
      • ++
      • 2018-01-13 (missing test in guard-aux implementation)=
      • ++
      ++
    • ++
    +=20 +-

    Abstract

    +-This SRFI defines exception-handling and exception-raising constructs for= Scheme, including
    • a with-exception-handler +- procedure and a guard +- form for installing exception-handling procedures,
    • +-
    • a raise +- procedure for invoking the current exception handler.
    • ++

      Abstract

      ++

      ++ This SRFI defines exception-handling and exception-raising constructs f= or Scheme, including ++

      ++
        ++
      • a with-exception-handler ++ procedure and a guard ++ form for installing exception-handling procedures, ++
      • ++
      • a raise ++ procedure for invoking the current exception handler. ++
      • +
      +-

      This SRFI is based on (withdrawn) SRFI 12: Exception Handling +-by William Clinger, R. Kent Dybvig, Matthew Flatt, and Marc Feeley.

      +-

      Rationale

      +-

      The goals of the exception mechanism specified in this SRFI are to hel= p programmers share code which relies on exception handling, and to be easi= ly added to existing Scheme systems.

      +-

      This SRFI is primarily useful in conjunction with one or more companio= n SRFIs:

      +-
      • a SRFI specifying exception-describing objects (conditions). An e= xample is SRFI 35 +- (Conditions).
      • +-
      • a SRFI specifying a set of standard condition types to be raised by t= he primitives provided by the Scheme implementation, and requiring that cer= tain Scheme primitives indeed raise exceptions within the framework describ= ed. An example is SRFI 36 +- (I/O Conditions).
      • +-
      • a SRFI specifying how computations may be resumed after an exception = is raised.
      • ++

        ++ This SRFI is based on (withdrawn) ++ SRFI 12: Exception Handl= ing ++ by William Clinger, R. Kent Dybvig, Matthew Flatt, and Marc Feeley. ++

        ++

        Rationale

        ++

        ++ The goals of the exception mechanism specified in this SRFI are to ++ help programmers share code which relies on exception handling, and ++ to be easily added to existing Scheme systems. ++

        ++

        ++ This SRFI is primarily useful in conjunction with one or more companion= SRFIs: ++

        ++
          ++
        • ++ a SRFI specifying exception-describing objects (conditions). An ++ example is SRFI 35 ++ (Conditions). ++
        • ++
        • ++ a SRFI specifying a set of standard condition types to be raised ++ by the primitives provided by the Scheme implementation, and ++ requiring that certain Scheme primitives indeed raise exceptions ++ within the framework described. An example ++ is SRFI 36 (I/O ++ Conditions). ++
        • ++
        • ++ a SRFI specifying how computations may be resumed after an exception = is raised. ++
        • +
        +-

        Specification

        ++

        Specification

        +

        Exception handlers are one-argument procedures that determine the acti= on the program takes when an exceptional situation is signalled. The system= implicitly maintains a current exception handler.

        +

        The program raises an exception by invoking the current exception hand= ler, passing to it an object encapsulating information about the exception.= Any procedure accepting one argument may serve as an exception handler and= any object may be used to represent an exception.

        +

        The system maintains the current exception handler as part of the = dynamic environment of the program, akin to the current input or output= port, or the context for dynamic-wind. The dynamic environmen= t can be thought of as that part of a continuation that does not specify th= e destination of any returned values. It includes the current input and ou= tput ports, the dynamic-wind + context, and this SRFI's current exception handler. See the reference i= mplementation for portable definitions of current-dynamic-environment= + and with-dynamic-environment.

        +

        The initial current exception handler of the program is implementation= -dependent. However, it should interrupt the program in some way visible to= the user, either by aborting it, invoking a debugger, or some similar acti= on.

        +-

        Establishing Exception Handlers

        +-
        (with-exception-handler = handler +- thunk)
        +-

        Returns the result(s) of invoking thunk. Handler +- must be a procedure that accepts one argument. It is installed as the cu= rrent exception handler for the dynamic extent (as determined by dyna= mic-wind) of the invocation of thunk.

        ++

        Establishing Exception Handlers

        ++
        ++
        (with-exception-handler handler ++thunk)
        ++
        ++

        ++ Returns the result(s) of ++ invoking thunk. Handler must be a procedure ++ that accepts one argument. It is installed as the current ++ exception handler for the dynamic extent (as determined ++ by dynamic-wind) of the invocation ++ of thunk. ++

        +
        +
        +-
        (guard ( ++ ++
        ++
        (guard ( + <var> <clause1 + > <clause2 + > ...) +- <body>) (syntax)
        +-

        Syntax: ++<body>) (syntax) ++

        ++
        ++

        Syntax: + Each <clause> should have the same form as a cond + clause

        +

        Semantics: +@@ -91,17 +140,28 @@ by William Clinger, R. Kent Dybvig, Matthew Flatt, an= d Marc Feeley.

        + expression.

        +
        +
        +-

        Raising Exceptions

        +-
        (raise obj)
        +-

        Invokes the current exception handler on obj. The handl= er is called in the dynamic environment of the call to raise, = except that the current exception handler is that in place for the call to = with-exception-handler +- that installed the handler being called. The handler's continuation is = otherwise unspecified.

        ++ ++

        Raising Exceptions

        ++
        ++
        (raise obj) ++
        ++
        ++

        ++ Invokes the current exception handler on obj. The handler ++ is called in the dynamic environment of the call ++ to raise, except that the current exception handler is ++ that in place for the call to with-exception-handler ++ that installed the handler being called. The handler's continuation ++ is otherwise unspecified. ++

        +
        +
        +-

        Examples

        ++ ++

        Examples

        +
        (call-with-current-continuation
        +  (lambda (k)
        +    (with-exception-handler (lambda (x)
        +-                             (display "condition: ")
        ++                             (display "condition: ")
        +                              (write x)
        +                              (newline)
        +                              (k 'exception))
        +@@ -113,7 +173,7 @@ PRINTS: condition: an-error
        + (call-with-current-continuation
        +  (lambda (k)
        +    (with-exception-handler (lambda (x)
        +-                             (display "something went wrong")
        ++                             (display "something went wrong")
        +                              (newline)
        +                              'dont-care)
        +      (lambda ()
        +@@ -123,7 +183,7 @@ then behaves in an unspecified way
        +=20
        + (guard (condition
        +          (else
        +-          (display "condition: ")
        ++          (display "condition: ")
        +           (write condition)
        +           (newline)
        +           'exception))
        +@@ -133,7 +193,7 @@ PRINTS: condition: an-error
        +=20
        + (guard (condition
        +          (else
        +-          (display "something went wrong")
        ++          (display "something went wrong")
        +           (newline)
        +           'dont-care))
        +  (+ 1 (raise 'an-error)))
        +@@ -143,7 +203,7 @@ PRINTS: something went wrong
        + (call-with-current-continuation
        +  (lambda (k)
        +    (with-exception-handler (lambda (x)
        +-                             (display "reraised ") (write x) (n=
        ewline)
        ++                             (display "reraised ") (write x) (newline)
        +                              (k 'zero))
        +      (lambda ()
        +        (guard (condition
        +@@ -155,7 +215,7 @@ PRINTS: something went wrong
        + (call-with-current-continuation
        +  (lambda (k)
        +    (with-exception-handler (lambda (x)
        +-                             (display "reraised ") (write x) (n=
        ewline)
        ++                             (display "reraised ") (write x) (newline)
        +                              (k 'zero))
        +      (lambda ()
        +        (guard (condition
        +@@ -167,7 +227,7 @@ PRINTS: something went wrong
        + (call-with-current-continuation
        +  (lambda (k)
        +    (with-exception-handler (lambda (x)
        +-                             (display "reraised ") (write x) (n=
        ewline)
        ++                             (display "reraised ") (write x) (newline)
        +                              (k 'zero))
        +      (lambda ()
        +        (guard (condition
        +@@ -188,13 +248,14 @@ PRINTS: reraised 0
        +          ((assq 'b condition)))
        +   (raise (list (cons 'b 23))))
        + =3D> (b . 23)
        +-

        Reference Implementation

        +-

        The reference implementation makes use of SRFI 9 +- ("Defining Record Types"), and SRFI 23 +- ("Error reporting mechanism").

        ++
    ++

    Reference Implementation

    ++

    The reference implementation makes use of SRFI= 9 ++ ("Defining Record Types"), and SRFI 23 ++ ("Error reporting mechanism").

    +
    (define *current-exception-handlers*
    +   (list (lambda (condition)
    +-          (error "unhandled exception" condition))))
    ++          (error "unhandled exception" condition))))
    +=20
    + (define (with-exception-handler handler thunk)
    +   (with-exception-handlers (cons handler *current-exception-handlers*)
    +@@ -214,7 +275,7 @@ PRINTS: reraised 0
    +     (with-exception-handlers (cdr handlers)
    +       (lambda ()
    +         ((car handlers) obj)
    +-        (error "handler returned"
    ++        (error "handler returned"
    +                (car handlers)
    +                obj)))))
    +=20
    +@@ -255,7 +316,7 @@ PRINTS: reraised 0
    +            (result temp)
    +            (guard-aux reraise clause1 clause2 ...))))
    +     ((guard-aux reraise (test))
    +-     test)
    ++     (or test reraise))
    +     ((guard-aux reraise (test) clause1 clause2 ...)
    +      (let ((temp test))
    +        (if temp
    +@@ -269,10 +330,11 @@ PRINTS: reraised 0
    +      (if test
    +          (begin result1 result2 ...)
    +          (guard-aux reraise clause1 clause2 ...)))))
    +-

    References

    +-
    • SRFI 12: Exception = Handling ++ ++

      References

      ++ +=20 +-

      Copyright

      ++

      Copyright

      +=20 +

      Copyright (C) Richard Kelsey, Michael Sperber (2002). All Rights + Reserved.

      +@@ -321,6 +383,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O= R IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

      +=20 +-
      +-
      Editor: Fr= ancisco Solsona
      ++
      ++
      Editor: Francisco Solsona
      + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-35.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-35.html +index de261a8..a369fca 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-35.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-35.html +@@ -1,71 +1,73 @@ +- +-SRFI 35: Conditions +-

      Title

      +- +-Conditions +- +-

      Authors

      +- +-Richard Kelsey and Michael Sperber +- +-

      Status

      +- +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. It will +-remain in draft until 2002-10-20, or as amended. to provide input on +-this SRFI, please mail to=20 +- +-srfi minus 35 at srfi dot schemers dot org. +-See +-instructions here to subscribe to the list. You can access +-the discussion via +- +-the archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. ++ ++ ++ ++ ++ ++ SRFI 35: Conditions ++ ++ ++ ++ ++ ++ ++

      SRFI 35: Conditions

      ++ ++

      by Richard Kelsey and Michael Sperber

      ++

      This copy of the SRFI 35 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

      = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-35/srfi-35.html.

      ++ ++

      Status

      ++ ++

      This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 35@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

      +=20 +
        +-
      • Draft: 2002/07/24-2002/10/20
      • +-
      • Revised: 2002/09/20
      • +-
      • Final: 2002/12/1
      • ++
      • Draft: 2002-07-24--2002-10-20
      • ++
      • Revised: 2002-09-20
      • ++
      • Final: 2002-12-01
      • +
      +=20 +-

      Abstract

      +-

      The SRFI defines constructs for creating and inspecting condition +-types and values. A condition value encapsulates information about an +-exceptional situation, or exception. This SRFI also defines a few basic +-condition types.

      +-

      Rationale

      +-

      Conditions are values that communicate information about exceptional +-situations between parts of a program. Code that detects an exception +-may be in a different part of the program than the code that handles +-it. In fact, the former may have been written independently from the +-latter. Consequently, to facilitate effective handling of exceptions, +-conditions must communicate as much information as possible as +-accurately as possible, and still allow effective handling by code that +-did not precisely anticipate the nature of the exception that occurred. +-

      This SRFI provides two mechanisms to enable this kind of communicatio= n

      • subtyping among condition types allows handling code to determ= ine the general +- nature of an exception even though it does not anticipate its exact<= /em> +- nature,
      • +-
      • compound conditions allow an exceptional situation to be described in= multiple ways.
      • ++

        Abstract

        ++

        The SRFI defines constructs for creating and inspecting condition types and values. A condition value encapsulates information about an e= xceptional situation, or exception. This SRFI also defines a few basic cond= ition types.

        ++

        Rationale

        ++

        Conditions are values that communicate information about exceptional s= ituations between parts of a program. Code that detects an exception may be= in a different part of the program than the code that handles it. In fact,= the former may have been written independently from the latter. Consequen= tly, to facilitate effective handling of exceptions, conditions must commun= icate as much information as possible as accurately as possible, and still = allow effective handling by code that did not precisely anticipate the natu= re of the exception that occurred.

        ++

        This SRFI provides two mechanisms to enable this kind of communicatio= n

        ++
          ++
        • ++ subtyping among condition types allows handling code to determine ++ the general nature of an exception even though it does ++ not anticipate its exact nature, ++
        • ++
        • ++ compound conditions allow an exceptional situation to be described ++ in multiple ways. ++
        • +
        +-

        +-

        Specification

        +-

        Conditions are records with named fields. Each condition belongs to on= e or more condition types. +-Each condition type specifies a set of field names. A condition +-belonging to a condition type includes a value for each of the type's +-field names. These values can be extracted from the condition by using +-the appropriate field name.

        ++ ++

        Specification

        ++

        Conditions are records with named fields. Each condition belongs to on= e or more condition types. Each condition type specifies a set of fi= eld names. A condition belonging to a condition type includes a value for e= ach of the type's field names. These values can be extracted from the condi= tion by using the appropriate field name.

        +

        There is a tree of condition types with the distinguished &c= ondition + as its root. All other condition types have a parent condition type.

        +-

        A condition belonging to several condition types with a common +-supertype may have distinct values for the supertype's fields for each +-type. The type used to access a field determines which of the values is +-returned. The program can extract each of these field values separately.<= /p> +-

        Procedures

        +-
        (make-condition-type id ++

        A condition belonging to several condition types with a common superty= pe may have distinct values for the supertype's fields for each type. The t= ype used to access a field determines which of the values is returned. The = program can extract each of these field values separately.

        ++

        Procedures

        ++
        ++
        (make-condition-type id + parent + field-names)
        +

        Make-condition-type +@@ -145,27 +147,28 @@ returns a condition of condition type condition= -type + is a compound condition, extract-condition + extracts the field values from the subcondition belonging to condi= tion-type + that appeared first in the call to make-compound-condition +- that created the condition. The returned condition may be newly created;= it is possible for

        (let* ((&c (make-condition-type 'c &con=
        dition '()))
        ++ that created the the condition. The returned condition may be newly crea=
        ted; it is possible for
        ++

        ++
        (let* ((&c (make-condition-type 'c &condition '()))
        +        (c0 (make-condition &c))
        +        (c1 (make-compound-condition c0)))
        +   (eq? c0 (extract-condition c1 &c)))
        +-
        to return false.

        ++
        ++

        to return false.

        +
        +
        +-

        Macros

        +-
        (define-condition-type <condition-type> <su= pertype> <predicate> <field-spec> ...)
        ++ ++

        Macros

        ++
        ++
        (define-condition-type <condition-type> <supert= ype> <predicate> <field-spec> ...)
        +

        This defines a new condition type. <Condition-type>, <sup= ertypes>, and <predicate> must all be identifiers. Define-co= ndition-type +-defines an identifier <condition-type> to some value describing +-the condition type. <supertype> must be the name of a previously +-defined condition type.

        +-

        Define-condition-type also defines <predicate> to +-a predicate that identifies conditions associated with that type, or +-with any of its subtypes.

        ++ defines an identifier <condition-type> to some value describing th= e condition type. <supertype> must be the name of a previously define= d condition type.

        ++

        Define-condition-type ++ also defines <predicate> to a predicate that identifies conditions= associated with that type, or with any of its subtypes.

        +

        Each <field-spec> must be of the form ( + <field> <accessor>) + where both <field> and <accessor> must be identifiers. Define-condition-type +-defines each <accessor> to a procedure which extracts the value +-of the named field from a condition associated with this condition type.<= /p> ++ defines each <accessor> to a procedure which extracts the value of= the named field from a condition associated with this condition type.

        +
        +
        (condition <type-field-binding> ...)<= /dt> +

        This creates a condition value. Each <type-field-binding> mu= st be of the form ( +@@ -173,9 +176,7 @@ of the named field from a condition associated with th= is condition type.

        + Each <field-binding> must be of the form ( + <field> <exp>) + where <field> is a field identifier from the definition of <con= dition-type>.

        +-

        The <exp> are evaluated in some unspecified order; their +-values can later be extracted from the condition object via the +-accessors of the associated condition types or their supertypes.

        ++

        The <exp> are evaluated in some unspecified order; their values = can later be extracted from the condition object via the accessors of the a= ssociated condition types or their supertypes.

        +

        The condition returned by condition + is created by a call of form

        +
        (make-compound-condition
        +@@ -184,47 +185,47 @@ accessors of the associated condition types or their=
         supertypes.

        +

        with the condition types retaining their order from theconditio= n + form. The field names and values are duplicated as necessary as described= below.

        +

        Each <type-field-binding> must contain field bindings for al= l +-fields of <condition-type> without duplicates. There is an +-exception to this rule: if a field binding is missing, and the field +-belongs to a supertype shared with one of the other +-<type-field-binding> subforms, then the value defaults to that of +-the first such binding in the condition ++ fields of <condition-type> without duplicates. There is an except= ion to this rule: if a field binding is missing, and the field belongs to a= supertype shared with one of the other <type-field-binding> subforms= , then the value defaults to that of the first such binding in the co= ndition + form.

        +
        +
        +-

        Standard Conditions

        +-
        &condition ++ ++

        Standard Conditions

        ++
        ++
        &condition +
        +

        This is the root of the entire condition type hierarchy. It has a = no fields.

        +
        +
        &message +
        +-

        This condition type could be defined by

        (define-condition-=
        type &message &condition
        ++

        This condition type could be defined by

        ++
        (define-condition-type &message &condition
        +   message-condition?
        +   (message condition-message))
        +-

        ++
        +

        It carries a message further describing the nature of the condition to= humans.

        +
        +
        &serious +
        +-

        This condition type could be defined by

        (define-condition-=
        type &serious &condition
        ++

        This condition type could be defined by

        ++
        (define-condition-type &serious &condition
        +   serious-condition?)
        +-

        +-

        This type describes conditions serious enough that they cannot +-safely be ignored. This condition type is primarily intended as a +-supertype of other condition types.

        +-
        &error ++
        ++

        This type describes conditions serious enough that they cannot safely= be ignored. This condition type is primarily intended as a supertype of o= ther condition types.

        ++
        ++
        &error +
        +-

        This condition type could be defined by

        (define-condition-=
        type &error &serious
        ++

        This condition type could be defined by ++

        ++
        (define-condition-type &error &serious
        +   error?)
        +-

        +-

        This condition describes errors, typically caused by something that +-has gone wrong in the interaction of the program with the external +-world or the user.

        ++
        ++

        This condition describes errors, typically caused by something that ha= s gone wrong in the interaction of the program with the external world or t= he user.

        +
        +- +
        +-

        Examples

        ++ ++ ++

        Examples

        +
        (define-condition-type &c &condition
        +   c?
        +   (x c-x))
        +@@ -284,10 +285,11 @@ world or the user.

        + (c-x v5) =3D> "V2" + (c1-a v5) =3D> "a3" + (c2-b v5) =3D> "b2" +-

        Reference Implementation

        +-

        The reference implementation makes use of SRFI 1 +- ("List Library"), SRFI 9 +- ("Defining Record Types"), and SRFI 23 ++ ++

        Reference Implementation

        ++

        The reference implementation makes use of SRFI= 1 ++ ("List Library"), SRFI 9 ++ ("Defining Record Types"), and SRFI 23 + ("Error reporting mechanism").

        +
        (define-record-type :condition-type
        +   (really-make-condition-type name supertype fields all-fields)
        +@@ -463,15 +465,16 @@ world or the user.

        +=20 + (define-condition-type &error &serious + error?) +-

        References

        +-
        • SRFI 12: Exception = Handling ++ ++

          References

          ++ +=20 +-

          Copyright

          ++

          Copyright

          +=20 +

          Copyright (C) Richard Kelsey, Michael Sperber (2002). All Rights + Reserved.

          +@@ -509,7 +512,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O= R IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

          +=20 +-
          ++
          +
          Editor: Francisco Solsona
          +- + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-38.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-38.html +index 378fbd2..535754c 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-38.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-38.html +@@ -1,61 +1,74 @@ +- +- ++ ++ + ++ ++ + SRFI 38: External Representation for Data With Shared Structur= e ++ ++ ++ + +=20 + +=20 +-

          Title

          ++

          SRFI 38: External Representation for Data With Shared Structure

          +=20 +-External Representation for Data With Shared Structure ++

          by Ray Dillinger

          ++

          This copy of the SRFI 38 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

          = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-38/srfi-38.html.

          +=20 +-

          Author

          ++

          Status

          +=20 +-Ray Dillinger ++

          This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 38@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

          ++
            ++
          • Draft: 2002-12-20--2003-04-02
          • ++
          • Final: 2003-04-02
          • ++
          +=20 +-

          Status

          +- +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. +-You can access +-the discussion via +- +-the archive of the mailing list. +- +-
            +-
          • Draft: 2002/12/20-2003/04/02
          • +-
          • Final: 2003/04/02
          • +-
          +- +-

          Abstract

          +-

          ++

          Abstract

          ++

          + This SRFI proposes (write-with-shared-structure) and=20 + (read-with-shared-structure), procedures for writing + and reading external representations of data containing shared + structure. These procedures implement a proposed standard + external notation for data containing shared structure. +-

          +-

          ++

          ++

          + This SRFI permits but does not require replacing the standard + (write) and (read) functions. These functions + may be implemented without the overhead in time and space required + to detect and specify shared structure. +-

          +-

          ++

          ++

          + An implementation conforms to this SRFI if it provides procedures + named (write-with-shared-structure) and + (read-with-shared-structure), which produce and read + the same notation as produced by the reference implementation. + It may also provide (read/ss) and (write/ss), + equivalent functions with shorter names. +-

          ++

          +=20 +=20 +-

          Rationale

          ++

          Rationale

          +=20 +-

          ++

          +=20 + R5RS scheme and IEEE scheme provide the procedure (write), + which prints machine-readable representations of lists and other +@@ -65,8 +78,8 @@ case of self-referential objects the behavior of (wr= ite) + itself is undefined; it is permitted to go into an infinite loop or + invoke the dreaded curse of the nasal demons. +=20 +-

          +-

          ++

          ++

          +=20 + For example, it is possible to have a list within which two or more + members are the same string (in the sense of (eq?)), but when +@@ -75,17 +88,18 @@ representation to recover the (eq?) relations= hip. When the + list is read back in, there will be two or more copies of the string + which are (eqv?) but not (eq?). +=20 +-

          +-

          ++

          ++

          + As an example of the second problem, The results of evaluating +-

          ++

          ++
          + (begin (define a (cons 'val1 'val2))
          +        (set-cdr! a a)
          +        (write a))
          +-
          ++
          +=20 +-are undefined; in R5RS parlance, calling write on such a structure +-"is an error", but not one that is necessarily ++

          are undefined; in R5RS parlance, calling write on such a structure ++"is an error", but not one that is necessarily + signalled. The routine is permitted to print a nonstandard notation + such as the one proposed in this standard or a different one, fail + silently, signal an error, go into an infinite loop, or make demons +@@ -95,33 +109,34 @@ problem by providing a method of writing data which i= s guaranteed to + be well-behaved and predictable even on data containing shared + structures. +=20 +-

          ++

          +=20 +-

          ++

          +=20 + The extended functionality described below in the implementation of + (write-with-shared-structure)is already present in the + (write) function of several major scheme implementations + (PLT, SISC, Chez, Bigloo, MIT scheme, and possibly others). +=20 +-

          ++

          +=20 +-

          Specification

          +-

          ++

          Specification

          +=20 +

          Formal Grammar of the New External Representation

          ++

          + This SRFI creates an alternative external representation for data + written and read under (write/ss) and (read/ss). + It is identical to the grammar for external representation for data + written and read under (write) and (read) given in + section 7 of R5RS, except that the single production +-

          ++

          ++
          +=20
          + <datum> --> <simple datum> | <compound datum>=20
          +=20
          +-
          +-Is replaced by the following five productions. +-
          ++
          ++

          Is replaced by the following five productions.

          ++
          +=20
          + <datum> --> <defining datum> | <nondefining datum> |=
           <defined datum>
          +=20
          +@@ -132,26 +147,25 @@ Is replaced by the following five productions.
          + <nondefining datum> --> <simple datum> | <compound datu=
          m>=20
          +=20
          + <indexnum> --> <digit 10>+
          +-
          +-

          ++
          +=20 +

          New Procedures

          +-

          +-

          +=20
          +-[[library procedure]] (write-with=
          -shared-structure obj)
          ++
          ++
          ++[[library procedure]] (write-with-shared-structure obj)
          + [[library procedure]] (write-with-shared-structure obj port)
          + [[library procedure]] (write-with-shared-structure obj port optarg)
          +=20
          +-
          +- ++
          ++

          + Writes a written representation of obj to the given port. Strings that + appear in the written representation are enclosed in doublequotes, and + within those strings backslash and doublequote characters are escaped + by backslashes. Character objects are written using the #\ + notation.=20 +=20 +-

          ++

          +=20 + Objects which denote locations rather than values (cons cells, + vectors, and non-zero-length strings in R5RS scheme; also mutable +@@ -164,15 +178,15 @@ If objects which denote locations occur only once in= the structure, + then (write-with-shared-structure) must produce the same + external representation for those objects as (write). +=20 +-

          ++

          +=20 +-

          ++

          +=20 + Write-with-shared-structure must terminate in finite time when writing + finite data. Write-with-shared-structure must produce a finite + representation when writing finite data. +=20 +-

          ++

          +=20 + Write-with-shared-structure returns an unspecified value. The port + argument may be omitted, in which case it defaults to the value +@@ -184,30 +198,29 @@ still write a representation that can be read by + use optarg to specify formatting conventions, numeric radixes, or + return values. The reference implementation ignores optarg. +=20 +-

          +-

          ++

          ++

          +=20 +-For example, the code +-

          ++For example, the code

          ++
          +=20
          + (begin (define a (cons 'val1 'val2))
          +        (set-cdr! a a)
          +        (write-with-shared-structure a))
          +=20
          +-
          ++
          +=20 +-should produce the output #1=3D(val1 . #1#) . This shows a cons ++

          should produce the output #1=3D(val1 . #1#) . This shows a = cons + cell whose cdr contains itself. ++

          +=20 +-

          +- +-

          ++
          +=20
          +-[[library procedure]] (read-with-s=
          hared-structure)
          ++[[library procedure]] (read-with-shared-structure)
          + [[library procedure]] (read-with-shared-structure  port)
          +=20
          +-
          +- ++
          ++

          + (read-with-shared-structure) converts the external + representations of Scheme objects produced by + (write-with-shared-structure) into scheme objects. That is, +@@ -217,7 +230,7 @@ external representation grammar defined above. + from the given input port, updating port to point to the first + character past the end of the external representation of the object. +=20 +-

          ++

          +=20 + If an end-of-file is encountered in the input before any characters + are found that can begin an object, then an end-of-file object is +@@ -228,20 +241,20 @@ the beginning of an object's external representation= , but the external + representation is incomplete and therefore not parsable, an error is + signalled. +=20 +-

          ++

          +=20 + The port argument may be omitted, in which case it defaults to the + value returned by (current-input-port). It is an error to + read from a closed port. +=20 +-

          ++

          +=20 +=20 +=20 +=20 +-

          Implementation

          ++

          Implementation

          +=20 +-

          ++

          +=20 + The reference implementation of (write-with-shared-structure) + is based on an implementation provided by Al Petrofsky. If there are +@@ -251,17 +264,17 @@ for an optional port argument. The reference implem= entation of + provided by Al Petrofsky. Both are used here with his generous + permission. +=20 +-

          ++

          +=20 +-

          ++

          +=20 + Note that portability forces the reference implementation of + (write-with-shared-structure) to be O(N^2) but that if an + implementor tracks objects through additional fields hidden from R5RS + scheme, a more efficient implementation can be provided. +=20 +-

          +-

          ++

          ++

          +=20 + If all the locations in your scheme are mutable and you don't do any + locking or multithreading, you can write an O(n) version that +@@ -273,10 +286,10 @@ does not give the programmer access to mutability in= formation nor to + comparison of constant data's addresses, but both of these are trivial + operations if you have access to the system's internals. +=20 +-

          ++

          +=20 +=20 +-
          ++
          + ;;; A printer that shows all sharing of substructures.  Uses the Common
          + ;;; Lisp print-circle notation: #n# refers to a previous substructure
          + ;;; labeled with #n=3D.   Takes O(n^2) time.
          +@@ -354,7 +367,7 @@ operations if you have access to the system's internal=
          s.
          +     (define (scan obj alist)
          +       (cond ((not (interesting? obj)) alist)
          + 	    ((assq obj alist)
          +-             =3D> (lambda (p) (if (cdr p) alist (acons obj #t alist))))
          ++             =3D> (lambda (p) (if (cdr p) alist (acons obj #t alist))))
          + 	    (else
          + 	     (let ((alist (acons obj #f alist)))
          + 	       (cond ((pair? obj) (scan (car obj) (scan (cdr obj) alist)))
          +@@ -406,7 +419,7 @@ operations if you have access to the system's internal=
          s.
          + 	(if (eof-object? c)
          + 	    (error "EOF inside a string")
          + 	    (case c
          +-	      ((#\") (list->string (reverse chars)))
          ++	      ((#\") (list->string (reverse chars)))
          + 	      ((#\\) (read-it (cons (read-char*) chars)))
          + 	      (else (read-it (cons c chars))))))))
          +=20
          +@@ -415,7 +428,7 @@ operations if you have access to the system's internal=
          s.
          +     (let iter ((chars '()))
          +       (let ((c (peek-char*)))
          + 	(if (or (eof-object? c) (not (pred c)))
          +-	    (list->string (reverse chars))
          ++	    (list->string (reverse chars))
          + 	    (iter (cons (read-char*) chars))))))
          +=20
          +   ;; reads a character after the #\ has been read.
          +@@ -433,11 +446,11 @@ operations if you have access to the system's intern=
          als.
          +   (define (read-number first-char)
          +     (let ((str (string-append (string first-char)
          + 			      (read-some-chars not-delimiter?))))
          +-      (or (string->number str)
          ++      (or (string->number str)
          + 	  (error "Malformed number: " str))))
          +=20
          +   (define char-standard-case
          +-    (if (char=3D? #\a (string-ref (symbol->string 'a) 0))
          ++    (if (char=3D? #\a (string-ref (symbol->string 'a) 0))
          + 	char-downcase
          + 	char-upcase))
          +=20
          +@@ -449,10 +462,10 @@ operations if you have access to the system's intern=
          als.
          + 	(string-set! new i (char-standard-case (string-ref str i))))))
          +=20
          +   (define (read-identifier)
          +-    (string->symbol (string-standard-case (read-some-chars not-delimiter?=
          ))))
          ++    (string->symbol (string-standard-case (read-some-chars not-delimit=
          er?))))
          +=20
          +   (define (read-part-spec)
          +-    (let ((n (string->number (read-some-chars char-numeric?))))
          ++    (let ((n (string->number (read-some-chars char-numeric?))))
          +       (let ((c (read-char*)))
          + 	(case c
          + 	  ((#\=3D) (cons 'decl n))
          +@@ -525,8 +538,8 @@ operations if you have access to the system's internal=
          s.
          + 	(if (char? (car first-token))
          + 	    (case (car first-token)
          + 	      ((#\() (read-list-tail))
          +-	      ((#\#) (list->vector (read-list-tail)))
          +-	      ((#\. #\)) (error (string-append "Unexpected \"" first-token "\"")=
          ))
          ++	      ((#\#) (list->vector (read-list-tail)))
          ++	      ((#\. #\)) (error (string-append "Unexpected \"" (string (car firs=
          t-token)) "\"")))
          + 	      (else
          + 	       (list (caadr (assv (car first-token)
          + 				  '((#\' 'x) (#\, ,x) (#\` `x) (#\@ ,@x))))
          +@@ -542,7 +555,7 @@ operations if you have access to the system's internal=
          s.
          + 			((use)
          + 			 ;; To use a part, it must have been
          + 			 ;; declared before this chain started.
          +-			 (cond ((assv n starting-alist) =3D> cdr)
          ++			 (cond ((assv n starting-alist) =3D> cdr)
          + 			       (else (error "Use of undeclared part " n))))
          + 			((decl)
          + 			 (if (assv n parts-alist)
          +@@ -596,10 +609,10 @@ operations if you have access to the system's intern=
          als.
          + 		       (fill-in-parts elt))))))))
          +     obj))
          +=20
          +-
          ++
          +=20 +=20 +-

          Copyright

          ++

          Copyright

          +

          Copyright (C) Ray Dillinger 2003. All Rights Reserved.

          +=20 +

          +@@ -625,13 +638,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF= OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

          +=20 +-
          +-
          Editor: David Rush ++
          ++
          Editor: David Rush
          + + +-Last modified: Wed Apr 2 19:58:58 BST 2003 ++Last modified: Wed Jan 19 08:52:24 MET 2011 + + + +- +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-39.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-39.html +index efd33ed..792b2aa 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-39.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-39.html +@@ -1,69 +1,82 @@ +- +- ++ ++ + ++ ++ + SRFI 39: Parameter objects ++ ++ ++ + +=20 + +=20 +-

          Title

          ++

          SRFI 39: Parameter objects

          +=20 +-SRFI 39: Parameter objects ++

          by Marc Feeley

          ++

          This copy of the SRFI 39 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

          = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-39/srfi-39.html.

          +=20 +-

          Author

          ++

          Status

          +=20 +-Marc Feeley ++

          This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 39@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

          ++
            ++
          • Draft: 2002-12-21--2003-02-18
          • ++
          • Revised: 2003-05-15
          • ++
          • Final: 2003-06-30
          • ++
          +=20 +-

          Status

          +=20 +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here.=20=20 +-You can access +-previous messages via +- +-the archive of the mailing list. ++

          Abstract

          +=20 +-
            +-
          • Draft: 2002/12/21-2003/02/18
          • +-
          • Revised: 2003/5/15
          • +-
          • Final: 2003/6/30
          • +-
          +- +- +-

          Abstract

          +- +-

          +-This SRFI defines parameter objects, the procedure +-make-parameter to +-create parameter objects and the parameterize special ++

          ++This SRFI defines parameter objects, the procedure ++make-parameter to ++create parameter objects and the parameterize special + form to dynamically bind parameter objects. In the dynamic + environment, each parameter object is bound to a cell containing the + value of the parameter. When a procedure is called the called + procedure inherits the dynamic environment from the caller. The +-parameterize special form allows the binding of a ++parameterize special form allows the binding of a + parameter object to be changed for the dynamic extent of its body. +-

          ++

          +=20 +-

          Rationale

          ++

          Rationale

          +=20 +-

          +-The dynamic environment is the structure which allows ++

          ++The dynamic environment is the structure which allows + the system to find the value returned by the R5RS procedures +-current-input-port and current-output-port. +-The R5RS procedures with-input-from-file and +-with-output-to-file extend the dynamic environment to ++current-input-port and current-output-port. ++The R5RS procedures with-input-from-file and ++with-output-to-file extend the dynamic environment to + produce a new dynamic environment which is in effect for the dynamic + extent of the call to the thunk passed as their last argument. These + procedures are essentially special purpose dynamic binding operations +-on hidden dynamic variables (one for current-input-port +-and one for current-output-port). The purpose of this ++on hidden dynamic variables (one for current-input-port ++and one for current-output-port). The purpose of this + SRFI is to generalize this dynamic binding mechanism (which exists in + all R5RS compliant systems) to allow the user to introduce new dynamic + variables and dynamically bind them. +-

          ++

          +=20 +-

          ++

          + General dynamic binding mechanisms exist in several implementations of + Scheme under various names, including "fluid" variables and parameter + objects. The parameter objects specified in this SRFI are compatible +@@ -72,9 +85,9 @@ currently support parameter objects (in the sense that i= t is possible + to implement this SRFI so that old code works the same as before). We + believe Chez-Scheme was the first implementation of Scheme to have + used parameter objects. +-

          ++

          +=20 +-

          ++

          + In the presence of threads, the dynamic binding mechanism does not + behave the same way in all implementations of Scheme supporting + dynamic binding. The issue is the relationship between the dynamic +@@ -92,105 +105,105 @@ environment share the same cells (i.e. an assignmen= t of a value to a + dynamic variable is visible in the other thread). Note that in the + absence of assignment to dynamic variables the MzScheme and Gambit-C + approaches are equivalent. +-

          ++

          +=20 +-

          ++

          + Given that there are semantic differences in the presence of threads + and that there are valid reasons for choosing each semantics, this + SRFI does not specify the semantics of parameter objects in the + presence of threads. It is left to the implementation and other SRFIs + which extend this SRFI to specify the interaction between parameter + objects and threads. +-

          ++

          +=20 +-

          Specification

          ++

          Specification

          +=20 +-

          +-The dynamic environment is composed of two parts: the local +-dynamic environment and the global dynamic environment. ++

          ++The dynamic environment is composed of two parts: the local ++dynamic environment and the global dynamic environment. + The global dynamic environment is used to lookup parameter objects + that can't be found in the local dynamic environment. When parameter + objects are created, their initial binding is put in the global + dynamic environment (by mutation). The local dynamic environment is +-only extended by the parameterize form. +-

          +- +-

          +-Parameter objects are created with the +-make-parameter procedure which takes one or two +-arguments. The second argument is a one argument conversion +-procedure. If only one argument is passed to +-make-parameter the identity function is used as a ++only extended by the parameterize form. ++

          ++ ++

          ++Parameter objects are created with the ++make-parameter procedure which takes one or two ++arguments. The second argument is a one argument conversion ++procedure. If only one argument is passed to ++make-parameter the identity function is used as a + conversion procedure. The global dynamic environment is updated to + associate the parameter object to a new cell. The initial content of + the cell is the result of applying the conversion procedure to the +-first argument of make-parameter. +-

          ++first argument of make-parameter. ++

          +=20 +-

          +-A parameter object is a procedure which accepts zero or one ++

          ++A parameter object is a procedure which accepts zero or one + argument. The cell bound to a particular parameter object in the + dynamic environment is accessed by calling the parameter object. When + no argument is passed, the content of the cell is returned. When one + argument is passed the content of the cell is updated with the result + of applying the parameter object's conversion procedure to the + argument. +-

          ++

          +=20 +-

          +-The parameterize special form, when given a parameter ++

          ++The parameterize special form, when given a parameter + object and a value, binds for the dynamic extent of its body the + parameter object to a new cell. The initial content of the cell is + the result of applying the parameter object's conversion procedure to +-the value. The parameterize special form behaves +-analogously to let when binding more than one parameter ++the value. The parameterize special form behaves ++analogously to let when binding more than one parameter + object (that is the order of evaluation is unspecified and the new +-bindings are only visible in the body of the parameterize ++bindings are only visible in the body of the parameterize + special form). +-

          ++

          +=20 +-

          ++

          + Note that the conversion procedure can be used for guaranteeing the + type of the parameter object's binding and/or to perform some + conversion of the value. +-

          ++

          +=20 +-

          ++

          + Because it is possible to implement the R5RS procedures +-current-input-port and current-output-port ++current-input-port and current-output-port + as parameter objects and this offers added functionnality, it is + required by this SRFI that they be implemented as parameter objects +-created with make-parameter. +-

          ++created with make-parameter. ++

          +=20 +-

          Procedures and syntax

          ++

          Procedures and syntax

          +=20 +-
          ++
          +=20 +-
          +-(make-parameter init [converter]=
          )                     ;procedure
          +-
          ++
          ++(make-parameter init [converter])                     ;proc=
          edure
          ++
          +=20 +-

          ++

          + Returns a new parameter object which is bound in the global dynamic + environment to a cell containing the value returned by the call +-(converter init). If the conversion +-procedure converter is not specified the identity function is ++(converter init). If the conversion ++procedure converter is not specified the identity function is + used instead. +-

          ++

          +=20 +-

          ++

          + The parameter object is a procedure which accepts zero or one + argument. When it is called with no argument, the content of the cell + bound to this parameter object in the current dynamic environment is + returned. When it is called with one argument, the content of the + cell bound to this parameter object in the current dynamic environment +-is set to the result of the call (converter +-arg), where arg is the argument passed to the ++is set to the result of the call (converter ++arg), where arg is the argument passed to the + parameter object, and an unspecified value is returned. +-

          ++

          +=20 +-
          ++
          +     (define radix
          +       (make-parameter 10))
          +=20
          +@@ -202,9 +215,9 @@ parameter object, and an unspecified value is returned.
          +               x
          +               (error "only booleans are accepted by write-shared")))))
          +=20
          +-    (radix)           =3D=3D>  10
          ++    (radix)           =3D=3D>  10
          +     (radix 2)
          +-    (radix)           =3D=3D>  2
          ++    (radix)           =3D=3D>  2
          +     (write-shared 0)  gives an error
          +=20
          +     (define prompt
          +@@ -215,58 +228,61 @@ parameter object, and an unspecified value is return=
          ed.
          +               x
          +               (with-output-to-string (lambda () (write x)))))))
          +=20
          +-    (prompt)       =3D=3D>  "123"
          +-    (prompt ">")
          +-    (prompt)       =3D=3D>  ">"
          +-
          +- +-

          +-

          +-(parameterize ((expr1 expr2) ...) =
          <body>)             ;syntax
          +-
          ++ (prompt) =3D=3D> "123" ++ (prompt ">") ++ (prompt) =3D=3D> ">" ++
          ++
          ++
          ++(parameterize ((expr1 expr2) ...) <body>)     =
                  ;syntax
          ++
          ++
          ++
          +=20 +-

          +- The expressions expr1 and expr2 are evaluated in an +- unspecified order. The value of the expr1 expressions must +- be parameter objects. For each expr1 expression and in an ++

          ++ The expressions expr1 and expr2 are evaluated in an ++ unspecified order. The value of the expr1 expressions must ++ be parameter objects. For each expr1 expression and in an + unspecified order, the local dynamic environment is extended with +- a binding of the parameter object expr1 to a new cell whose +- content is the result of the call (converter +- val), where val is the value of expr2 +- and converter is the conversion procedure of the parameter ++ a binding of the parameter object expr1 to a new cell whose ++ content is the result of the call (converter ++ val), where val is the value of expr2 ++ and converter is the conversion procedure of the parameter + object. The resulting dynamic environment is then used for the +- evaluation of <body> (which refers to the R5RS grammar ++ evaluation of <body> (which refers to the R5RS grammar + nonterminal of that name). The result(s) of the +- parameterize form are the result(s) of the +- <body>. +-

          ++ parameterize form are the result(s) of the ++ <body>. ++

          +=20 +-
          +-    (radix)                                              =3D=3D>  2
          +-    (parameterize ((radix 16)) (radix))                  =3D=3D>  16
          +-    (radix)                                              =3D=3D>  2
          ++
          ++    (radix)                                              =3D=3D>  2
          ++    (parameterize ((radix 16)) (radix))                  =3D=3D>  16
          ++    (radix)                                              =3D=3D>  2
          +=20
          +-    (define (f n) (number->string n (radix)))
          ++    (define (f n) (number->string n (radix)))
          +=20
          +-    (f 10)                                               =3D=3D>  "1010"
          +-    (parameterize ((radix 8)) (f 10))                    =3D=3D>  "12"
          +-    (parameterize ((radix 8) (prompt (f 10))) (prompt))  =3D=3D>  "1010"
          +-
          ++ (f 10) =3D=3D> "101= 0" ++ (parameterize ((radix 8)) (f 10)) =3D=3D> "12" ++ (parameterize ((radix 8) (prompt (f 10))) (prompt)) =3D=3D> "101= 0" ++
          ++
          ++
          +=20 +-

          Implementation

          ++

          Implementation

          +=20 +-

          ++

          + The following implementation uses association lists to represent local + dynamic environments. The global dynamic environment binding is + stored in the parameter object itself. Since we are assuming that + there is a single thread, the current local dynamic environment can be +-bound to a global variable, dynamic-env-local. Mutations +-of this variable are wrapped in a dynamic-wind so that ++bound to a global variable, dynamic-env-local. Mutations ++of this variable are wrapped in a dynamic-wind so that + the local dynamic environment returns to its previous value when +-control exits the body of the parameterize. +-

          ++control exits the body of the parameterize. ++

          +=20 +-
          ++
          +     (define make-parameter
          +       (lambda (init . conv)
          +         (let ((converter
          +@@ -320,9 +336,9 @@ control exits the body of the parameterize.
          +=20
          +     (define dynamic-env-local-set!
          +       (lambda (new-env) (set! dynamic-env-local new-env)))
          +-
          ++
          +=20 +-

          Copyright

          ++

          Copyright

          +

          Copyright (C) Marc Feeley 2002. All Rights Reserved.

          +=20 +

          +@@ -349,7 +365,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE = SOFTWARE. +

          +=20 +=20 +-
          +-
          Editor: Mi= ke Sperber
          ++
          ++
          Editor: Mike Sperber
          + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-4.html b/srfi-doc/srf= i/scribblings/srfi-std/srfi-4.html +index f48174f..d11a35a 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-4.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-4.html +@@ -1,34 +1,51 @@ +- +- ++ ++ + ++ ++ + SRFI 4: Homogeneous numeric vector datatypes ++ ++ ++ + +=20 + +=20 +-

          Title

          ++

          SRFI 4: Homogeneous numeric vector datatypes

          +=20 +-SRFI-4: Homogeneous numeric vector datatypes ++

          by Marc Feeley

          ++

          This copy of the SRFI 4 specifica= tion document ++is distributed as part of the Racket package ++srfi-doc.

          = The canonical source of this document is ++https://srfi.sch= emers.org/srfi-4/srfi-4.html.

          +=20 +-

          Author

          ++

          Status

          +=20 +-Marc Feeley +- +-

          Status

          +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. +-You can access previous messages via the a= rchive of the mailing list. +-

            +-
          • Received: 1998/1/11 +-
          • Draft: 1999/1/19-1999/03/19 +-
          • Revised: 1999/04/26 +-
          • Final: 1999/5/22 +-
          +- +-

          Abstract

          ++

          This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-4= @nospamsrfi.schemers.org. To su= bscribe to the list, follow these instructions. You can access previous messages v= ia the mailing list arch= ive.

          ++
            ++
          • Received: 1998-01-11
          • ++
          • Draft: 1999-01-19--1999-03-19
          • ++
          • Revised: 1999-04-26
          • ++
          • Final: 1999-05-22
          • ++
          +=20 ++

          Abstract

          ++

          + This SRFI describes a set of datatypes for vectors whose elements are + of the same numeric type (signed or unsigned exact integer or inexact + real of a given precision). These datatypes support operations +@@ -37,9 +54,9 @@ An external representation is specified which must be su= pported by the + read and write procedures and by the program + parser (i.e. programs can contain references to literal homogeneous + vectors). +- +-

          Rationale

          +- ++

          ++

          Rationale

          ++

          + Like lists, Scheme vectors are a heterogeneous datatype which impose + no restriction on the type of the elements. This generality is not + needed for applications where all the elements are of the same type. +@@ -51,76 +68,74 @@ Moreover, homogeneous vectors are convenient for inter= facing with + low-level libraries (e.g. binary block I/O) and to interface with + foreign languages which support homogeneous vectors. Finally, the use + of homogeneous vectors allows certain errors to be caught earlier. +- +-

          +- ++

          ++

          + This SRFI specifies a set of homogeneous vector datatypes which cover + the most practical case, that is where the type of the elements is + numeric (exact integer or inexact real) and the precision and + representation is efficiently implemented on the hardware of most + current computer architectures (8, 16, 32 and 64 bit integers, either + signed or unsigned, and 32 and 64 bit floating point numbers). ++

          +=20 +-

          Specification

          +- ++

          Specification

          ++

          + There are 8 datatypes of exact integer homogeneous vectors (which will + be called integer vectors): ++

          ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
          datatype type of elements<= /strong> ++
          s8vector signed exact integer in the r= ange -(2^7) to (2^7)-1 ++
          u8vector unsigned exact integer in the= range 0 to (2^8)-1 ++
          s16vectorsigned exact integer in the r= ange -(2^15) to (2^15)-1 ++
          u16vectorunsigned exact integer in the= range 0 to (2^16)-1 ++
          s32vectorsigned exact integer in the r= ange -(2^31) to (2^31)-1 ++
          u32vectorunsigned exact integer in the= range 0 to (2^32)-1 ++
          s64vectorsigned exact integer in the r= ange -(2^63) to (2^63)-1 ++
          u64vectorunsigned exact integer in the= range 0 to (2^64)-1 ++
          +=20 +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
          datatype type of elements +-
          s8vector signed exact i= nteger in the range -(2^7) to (2^7)-1 +-
          u8vector unsigned exact= integer in the range 0 to (2^8)-1 +-
          s16vectorsigned exact = integer in the range -(2^15) to (2^15)-1 +-
          u16vectorunsigned exac= t integer in the range 0 to (2^16)-1 +-
          s32vectorsigned exact = integer in the range -(2^31) to (2^31)-1 +-
          u32vectorunsigned exac= t integer in the range 0 to (2^32)-1 +-
          s64vectorsigned exact = integer in the range -(2^63) to (2^63)-1 +-
          u64vectorunsigned exac= t integer in the range 0 to (2^64)-1 +-
          +- +-

          +- ++

          + There are 2 datatypes of inexact real homogeneous vectors (which will + be called float vectors): ++

          +=20 +- +- +- +- +- +- +- +-
          datatype type of elements +-
          f32vector inexact real +-
          f64vector inexact real +-
          +- +-

          ++ ++ ++ ++ ++ ++ ++ ++
          datatype type of elements<= /strong> ++
          f32vector inexact real ++
          f64vector inexact real ++
          +=20 ++

          + The only difference between the two float vector types is that + f64vectors preserve at least as much precision as + f32vectors (see the implementation section for details). +- +-

          +- ++

          ++

          + A Scheme system that conforms to this SRFI does not have to support + all of these homogeneous vector datatypes. However, a Scheme system + must support f32vectors and f64vectors if it +@@ -138,17 +153,15 @@ the Scheme system supports by calling the + string->number procedure (e.g. + (string->number "0.0") returns #f if the + Scheme system does not support inexact reals). +- +-

          +- ++

          ++

          + Each homogeneous vector datatype has an external representation which + is supported by the read and write + procedures and by the program parser. Each datatype also has a set of + associated predefined procedures analogous to those available for + Scheme's heterogeneous vectors. +- +-

          +- ++

          ++

          + For each value of TAG in { + s8, u8, + s16, u16, +@@ -156,30 +169,27 @@ For each value of TAG in { + s64, u64, + f32, f64 + }, if the datatype TAGvector is supported, then ++

          +=20 +-

          +- +-
            +- +-
          1. the external representation of instances of the datatype ++
              ++
            1. ++

              ++ the external representation of instances of the datatype + TAGvector is #TAG( ...elements... ). +- +-

              +- ++

              ++

              + For example, #u8(0 #e1e2 #xff) is an + u8vector of length 3 containing 0, 100 and 255; + #f64(-1.5) is an f64vector of length 1 + containing -1.5. +- +-

              +- ++

              ++

              + Note that the syntax for float vectors conflicts with Standard Scheme + which parses #f32() as 3 objects: #f, + 32 and (). For this reason, conformance to + this SRFI implies this minor nonconformance to Standard Scheme. +- +-

              +- ++

              ++

              + This external representation is also available in program source code. + For example, (set! x '#u8(1 2 3)) will set x + to the object #u8(1 2 3). Literal homogeneous vectors +@@ -189,22 +199,23 @@ vectors can appear in quasiquotations but must not c= ontain + (i.e. `(,x #u8(1 2)) is legal but `#u8(1 ,x + 2) is not). This restriction is to accommodate the many Scheme + systems that use the read procedure to parse programs. +- +-

              +- +-
            2. the following predefined procedures are available: +- +-
                +-
              1. (TAGvector? obj) +-
              2. (make-TAGvector n [ TAGvalue ]) +-
              3. (TAGvector TAGvalue...) +-
              4. (TAGvector-length TAGvect) +-
              5. (TAGvector-ref TAGvect i) +-
              6. (TAGvector-set! TAGvect i TAGvalue) +-
              7. (TAGvector->list TAGvect) +-
              8. (list->TAGvector TAGlist) +-
              +- ++

              ++
            3. ++
            4. ++

              ++ the following predefined procedures are available: ++

              ++
                ++
              1. (TAGvector? obj)
              2. ++
              3. (make-TAGvector n [ TAGvalue ])
              4. ++
              5. (TAGvector TAGvalue...)
              6. ++
              7. (TAGvector-length TAGvect)
              8. ++
              9. (TAGvector-ref TAGvect i)
              10. ++
              11. (TAGvector-set! TAGvect i TAGvalue)
              12. ++
              13. (TAGvector->list TAGvect)
              14. ++
              15. (list->TAGvector TAGlist)
              16. ++
              ++

              + where obj is any Scheme object, n is a + nonnegative exact integer, i is a nonnegative exact + integer less than the length of the vector, TAGvect is an +@@ -213,41 +224,40 @@ is a number of the type acceptable for elements of t= he + TAGvector datatype, and TAGlist is a proper + list of numbers of the type acceptable for elements of the + TAGvector datatype. +- +-

              +- ++

              ++

              + It is an error if TAGvalue is not the same type as the + elements of the TAGvector datatype (for example if an + exact integer is passed to f64vector). If the fill + value is not specified, the content of the vector is unspecified + but individual elements of the vector are guaranteed to be in the + range of values permitted for that type of vector. ++

              ++
            5. ++
            +=20 +-
          +- +-

          Implementation

          +- ++

          Implementation

          ++

          + The homogeneous vector datatypes described here suggest a concrete + implementation as a sequence of 8, 16, 32 or 64 bit elements, using + two's complement representation for the signed exact integers, and + single and double precision IEEE-754 floating point representation for + the inexact reals. Although this is a practical implementation on +-many modern byte addressed machines, a different implementation is ++many modern byte-addressed machines, a different implementation is + possible for machines which don't support these concrete numeric types + (the CRAY-T90 for example does not have a 32 bit floating point + representation and the 64 bit floating point representation does not + conform to IEEE-754, so both the f32vector and + f64vector datatypes could be represented the same way + with 64 bit floating point numbers). +- +-

          +- ++

          ++

          + A portable implementation of the homogeneous vector predefined + procedures can be based on Scheme's heterogeneous vectors. + Here is for example an implementation of s8vectors + which is exempt of error checking: +- +-

          ++

          ++
          + (define s8vector? #f)
          + (define make-s8vector #f)
          + (define s8vector #f)
          +@@ -318,10 +328,8 @@ which is exempt of error checking:
          +       (and (orig-vector? obj)
          +            (orig-not (and (orig-> (orig-vector-length obj) 0)
          +                           (orig-eq? (orig-vector-ref obj 0) tag)))))))
          +-
          +- +-

          +- ++
          ++

          + The Scheme system's read and write + procedures and the program parser also need to be extended to handle + the homogeneous vector external representations. The implementation +@@ -333,9 +341,12 @@ is the case, parse a symbol and check if it is = t, + f, s8, f32, and so on, and in + the case of a homogeneous vector prefix, check if the next character + is an opening parenthesis). ++

          +=20 +-

          Copyright

          ++

          Copyright

          ++

          + Copyright (C) Marc Feeley (1999). All Rights Reserved.=20 ++

          +

          + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -360,8 +371,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE = SOFTWARE. +

          +=20 +=20 +-
          +-
          Editor: ++
          ++
          Editor: + Shriram Krishnamurthi
          +=20 + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-40.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-40.html +index 7340781..0d0300c 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-40.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-40.html +@@ -1,46 +1,67 @@ +- +- ++ ++ + ++ ++ + SRFI 40: A Library of Streams ++ ++ ++ + +=20 + +=20 +-

          Title

          ++

          SRFI 40: A Library of Streams

          +=20 +-SRFI 40: A Library of Streams ++

          by Philip L. Bewig

          ++

          This copy of the SRFI 40 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

          = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-40/srfi-40.html.

          +=20 +-

          Author

          ++

          Status

          +=20 +-Philip L. Bewig ++

          This SRFI is currently in withdrawn status. Here is an explanation of each= status that a SRFI can hold. To provide input on this SRFI, please send e= mail to = srfi-40@nospamsrfi.schemers.org.= To subscribe to the list, follow these instructions. You can access previous mes= sages via the mailing list archive.

          ++ +=20 +-

          Status

          +=20 +-

          +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-To comments +-this SRFI, please mail to=20 +- +-srfi-40@srfi.schemers.org. +-See +-instructions here to subscribe to the list. You can access +-the discussion via +- +-the archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. +-

          +- +-
        • Received: 2003/02/03 +-
        • Draft: 2003/02/03-2003/04/03 +-
        • Revised: 2003/08/02 +-
        • Revised: 2003/12/23 +-
        • Final: 2004/08/22 +-
        +- +-

        Abstract

        ++

        Abstract

        +=20 +

        + Along with higher-order functions, one of the hallmarks of functional +@@ -69,7 +90,7 @@ convenient processing of streams and shows several examp= les of their + use.=20=20 +

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 +

        + Two of the defining characteristics of functional programming +@@ -90,17 +111,16 @@ programming with streams. +=20 +

        + Scheme has a long tradition of computing with streams. The great +-computer science textbook Structure and Int= erpretation ++computer science textbook Structure and Interpretation + of Computer Programs, uses streams extensively. +-The example given ++The example given + in R5RS makes use of streams to integrate systems of differential + equations using the method of Runge-Kutta. MIT Scheme, the original +-implementation of Scheme, provides streams natively. Scheme and the Art of Programmin= g,=20 ++implementation of Scheme, provides streams natively. Scheme and the Art of Programming,=20 + discusses streams. + Some Scheme-like languages also have traditions of using streams: +-Winston and Horn, in their classic Lisp tex= tbook, discuss streams, and +-so does Larry Paulson in his text on ++Winston and Horn, in their classic Lisp textbook, d= iscuss streams, and ++so does Larry Paulson in his text on + ML. Streams are an important and useful data structure. +

        +=20 +@@ -128,8 +148,7 @@ operational difference between the two types of stream= s. +

        +=20 +

        +-Philip Wadler, Walid Taha, and David MacQueen, in their paper "How to add laziness to a strict = language ++Philip Wadler, Walid Taha, and David MacQueen, in their paper "How to add laziness to a strict language + without even being odd", describe how they added streams to the + SML/NJ compiler. They discuss two kinds of streams: odd streams, as + in SICP et al, and even streams, as in Haskell; the names odd and even +@@ -180,7 +199,7 @@ Here are the first two figures from their paper, rewri= tten in Scheme: + (cutoff1 (- n 1)=20=20=20=20=20=20=20=20=20=20=20=20=20 + (cdr1 strm))))))=20=20=20=20 + +- ++ +

        ;;; FIGURE 2 -- EVEN
        +=20
        + (define nil2 (delay '()))
        +@@ -259,7 +278,7 @@ and even streams.  We expect the two constructors nil and
        + nil and cons return a strict list, but the
        + even nil and cons return promises.
        + Nil?, car and cdr change to
        +-accommodate the underlying representation differences.
        ++accomodate the underlying representation differences.
        + Cutoff is identical in the two versions, because it
        + doesn't return a stream.
        + 

        +@@ -587,7 +606,7 @@ stream-define are both library procedures, not fundame= ntal to the use + of streams, and are thus excluded from this SRFI. +

        +=20 +-

        Specification

        ++

        Specification

        +=20 +

        A stream-pair is a data structure consisting of two fields call= ed + the stream-car and stream-cdr. Stream-pairs are created +@@ -629,23 +648,25 @@ to detect and report errors. +

        +=20 +
        +-
        +-stream-null (constant)
        ++
        ++stream-null (constant)
        +
        ++

        + Stream-null is the distinguished nil stream, a single + Scheme object distinguishable from all other objects. If the last + stream-pair in a stream contains stream-null in its cdr field, the + stream is finite and has a computable length. However, there is no + need for streams to terminate. +- ++

        +
        +-    stream-null                                 =3D> (stream)
        ++    stream-null                                 =3D> (stream)
        + 
        +
        +=20 +-
        +-(stream-cons object stream) (syntax)
        ++
        ++(stream-cons object stream) (syntax)
        +
        ++

        + Stream-cons is the primitive constructor of streams, + returning a stream with the given object in its car field and the + given stream in its cdr field. The stream returned by +@@ -654,7 +675,7 @@ given stream in its cdr field. The stream returned by + of any type, and there is no requirement that successive elements of a + stream be of the same type, although it is common for them to be. It + is an error if the second argument of stream-cons is not a s= tream. +- ++

        +
            (stream-cons 'a stream-null)                =3D> (stream 'a)
        +     (stream-cons 'a (stream 'b 'c 'd))          =3D> (stream 'a 'b 'c =
        'd)
        +     (stream-cons "a" (stream 'b 'c))            =3D> (stream "a" 'b 'c)
        +@@ -663,73 +684,78 @@ is an error if the second argument of stream-c=
        ons is not a stream.
        + 
        +
        +=20 +-
        +-(stream? object) (function)
        ++
        ++(stream? object) (function)
        +
        ++

        + Stream? returns #t if the object is a stream, a= nd otherwise returns #f. A stream + object may be either the null stream or a stream pair created by st= ream-cons. +- ++

        +
            (stream? stream-null)                       =3D> #t
        +     (stream? (stream-cons 'a stream-null))      =3D> #t
        +     (stream? 3)                                 =3D> #f
        + 
        +
        +=20 +-
        +-(stream-null? object) (f= unction)
        ++
        ++(stream-null? object) (function)
        +
        ++

        + Stream-null? returns #t if the object is the di= stinguished nil stream, and +-otherwise returns #f#f. ++

        +
            (stream-null? stream-null)                  =3D> #t
        +     (stream-null? (stream-cons 'a stream-null)) =3D> #f
        +     (stream-null? 3)                            =3D> #f
        + 
        +
        +=20 +-
        +-(stream-pair? object) (f= unction)
        ++
        ++(stream-pair? object) (function)
        +
        ++

        + Stream-pair? returns #t if the object is a stre= am pair created by stream-cons, and + otherwise returns #f. +- ++

        +
            (stream-pair? stream-null)                  =3D> #f
        +     (stream-pair? (stream-cons 'a stream-null)) =3D> #t
        +     (stream-pair? 3)                            =3D> #f
        + 
        +
        +=20 +-
        +-(stream-car stream) (funct= ion)
        ++
        ++(stream-car stream) (function)
        +
        ++

        + Stream-car returns the object in the stream-car field of + a stream-pair. It is an error to attempt to evaluate the stream-car + of stream-null. +- ++

        +
            (stream-car (stream 'a 'b 'c))              =3D> a
        +     (stream-car stream-null)                    =3D> error
        +     (stream-car 3)                              =3D> error
        + 
        +
        +=20 +-
        +-(stream-cdr stream) (funct= ion)
        ++
        ++(stream-cdr stream) (function)
        +
        ++

        + Stream-cdr returns the stream in the stream-cdr field of + a stream-pair. It is an error to attempt to evaluate the stream-cdr + of stream-null. +- +- ++

        +
            (stream-cdr (stream 'a 'b 'c))              =3D> (stream 'b '=
        c)
        +     (stream-cdr stream-null)                    =3D> error
        +     (stream-cdr 3)                              =3D> error
        +-
        ++
        + 
        +
        +=20 +-
        +-(stream-delay expression) (syntax)
        ++
        ++(stream-delay expression) (syntax)
        +
        ++

        + Stream-delay is the essential mechanism for operating on str= eams, taking an + expression and returning a delayed form of the expression that can be ask= ed at + some future point to evaluate the expression and return the resulting val= ue. The +@@ -737,7 +763,7 @@ action of stream-delay is analogous to the action of d= elay, but it is specific t + the stream data type, returning a stream instead of a promise; no corresp= onding + stream-force is required, because each of the stream functio= ns performs the force + implicitly. +- ++

        +
            (define from0
        +       (let loop ((x 0))
        +         (stream-delay
        +@@ -746,26 +772,28 @@ implicitly.
        + 
        +
        +=20 +-
        (stream object ...) (libra= ry function) ++
        (stream object ...) (library functi= on)
        +
        ++

        + Stream returns a newly allocated finite stream of its argume= nts, in order. +- ++

        +
            (stream 'a (+ 3 4) 'c)                      =3D> (stream 'a 7=
         'c)
        +     (stream)                                    =3D> stream-null
        + 
        +
        +=20 +
        +-(stream-unfoldn generator seed= n) ++(stream-unfoldn generator seed = n) + (function)
        +
        ++

        + Stream-unfoldn returns n streams whose contents are p= roduced by successive calls + to generator, which takes the current seed as an arguments and returns n + 1 + values: +- ++

        +

        +-(proc seed) -> seed result0 ... = resultN +- ++(proc seed) -> seed result0 .= .. resultN ++

        +

        + where resultI indicates how to produce the next element of the Ith= result stream: +

        +@@ -806,8 +834,8 @@ multiple calls to generator. +
        + +=20 +-
        +-(stream-map function stream ..= .) (library ++
        ++(stream-map function stream ...) (library + function)
        +
        + Stream-map creates a newly allocated stream built by +@@ -826,8 +854,8 @@ streams are infinite. The stream elements are evaluat= ed in order. + +
        +=20 +-
        +-(stream-for-each procedure st= ream ...) ++
        ++(stream-for-each procedure stream ...) + (library function)
        +
        + Stream-for-each applies procedure elementwise to the element= s of the streams, +@@ -839,8 +867,8 @@ stream-for-each is unspecified. The stream elements a= re visited in order. + +
        +=20 +-
        +-(stream-filter predicate? strea= m) (library function)
        ++
        ++(stream-filter predicate? stream) (library fun= ction)
        +
        + Stream-filter applies predicate? to each element + of stream and creates a newly allocated stream consisting of those +@@ -855,18 +883,16 @@ same order as they were in the input stream, and are= tested by +
        +
        +=20 +-

        Implementation

        ++

        Implementation

        +=20 +

        A reference implementation of streams is shown below. It strongly + prefers simplicity and clarity to efficiency, and though a reasonable + attempt is made to be safe-for-space, no promises are made. The reference +-implementation relies on the mechanism for defining record types of SRFI-9, and the functions +-any and every from SRFI-1. The ++implementation relies on the mechanism for defining record types of SRFI-9, and the functions ++any and every from SRFI= -1. The + stream-error function aborts by calling error as +-defined in SRFI 23. +- ++defined in SRFI 23. ++

        +
        ;;; PROMISES A LA SRFI-45:
        +=20
        + ;;; A separate implementation is necessary to
        +@@ -1038,15 +1064,17 @@ defined in SRFI 23.
        +         ((not (stream? strm)) (stream-error "attempt to apply stream-filt=
        er to non-stream"))
        +         (else (stream-unfoldn
        +                 (lambda (s)
        +-                  (values
        +-                    (stream-cdr s)
        +-                    (cond ((stream-null? s) '())
        +-                          ((pred? (stream-car s)) (list (stream-car s)))
        +-                          (else #f))))
        ++		  (cond
        ++		   ((stream-null? s)
        ++		    (values stream-null '()))
        ++		   ((pred? (stream-car s))
        ++		    (values (stream-cdr s) (list (stream-car s))))
        ++		   (else
        ++		    (values (stream-cdr s) #f))))
        +                 strm
        +                 1))))
        +=20 +-

        References

        ++

        References

        +=20 +
          +
        • +@@ -1078,8 +1106,8 @@ Workshop on ML, pp. 24-30. + + Patrick H. Winston, Berthold K. Horn: Lisp, 3rd edition, + Addison Wesley, 1989. +-
        +-

        Copyright

        ++
      ++

      Copyright

      +

      Copyright (C) 2003 by Philip L. Bewig of Saint Louis, Missouri, United= States of + America. All rights reserved.

      +=20 +@@ -1106,11 +1134,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT = OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

      +=20 +-
      +-
      Editor: Mi= ke Sperber
      ++
      ++
      Editor: Mike Sperber
      + + +-Last modified: Sat Sep 11 12:40:31 MST 2004 ++Last modified: Fri Jan 25 11:19:45 CET 2008 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-41/srfi-41.html b/srf= i-doc/srfi/scribblings/srfi-std/srfi-41/srfi-41.html +index a937761..6604d2f 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-41/srfi-41.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-41/srfi-41.html +@@ -1,42 +1,55 @@ +- +-SRFI 41: Streams +- +-

      Title

      +- +-Streams +- +- +-

      Author

      +- +-Philip L. Bewig +- +-

      Status

      +- +-This SRFI is currently in ``final'' status. To see an explanation of each +-status that a SRFI can hold, see +-here. +-To comment on this SRFI, please +-mailto:srfi minus 41 at srfi dot schemers dot org. +-See instruc= tions +-here to subscribe to the list. You can access +-the discussion via +- +-the archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. ++ ++ ++ ++ ++ ++ SRFI 41: Streams ++ ++ ++ + +=20 + +=20 +-

      Title

      +- +-SRFI 42: Eager Comprehensions +- +-

      Author

      +- +-Sebastian Egner +- +-

      Status

      +- +-

      This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. +-To comments +-this SRFI, please mail to=20 +- +-srfi-42@srfi.schemers.org. +-See +-instructions here to subscribe to the list. You can access +-the discussion via +- +-the archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. +-

      +-
        =20 +-
      • Received: 2003/02/20=20 +-
      • Draft: 2003/02/20-2003/04/20 +-
      • Revised: 2003/07/07 +-
      • Final: 2003/07/07 +-
      +- +-

      Abstract

      +- +-This SRFI defines a modular and portable mechanism for=20 ++

      SRFI 42: Eager Comprehensions

      ++ ++

      by Sebastian Egner

      ++

      This copy of the SRFI 42 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

      = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-42/srfi-42.html.

      ++ ++

      Status

      ++ ++

      This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 42@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

      ++
        ++
      • Received: 2003-02-20 ++
      • Draft: 2003-02-20--2003-04-20 ++
      • Revised: 2003-07-07 ++
      • Final: 2003-07-07 ++
      ++ ++

      Abstract

      ++

      ++This SRFI defines a modular and portable mechanism for + eager comprehensions extending the algorithmic language Scheme + [R5RS]. + An eager comprehension is a convenient notation +@@ -50,108 +54,108 @@ for one or more nested or parallel loops generating + a sequence of values, and accumulating this sequence into a result. + In its most simple form, a comprehension according to this SRFI + looks like this: +- +-

      (lis=
      t-ec (: i 5) (* i i)) =3D> (0 1 4 9 16).
      +- +-Here, i is a local variable that is sequentially=20 +-bound to the values 0, 1, ..., 4, and the squares of these=20 ++

      ++
      (list-ec =
      (: i 5) (* i i)) =3D> (0 1 4 9 16).
      ++

      ++Here, i is a local variable that is sequentially ++bound to the values 0, 1, ..., 4, and the squares of these + numbers are collected in a list. + The following example illustrates most conventions of this SRFI + with respect to nesting and syntax: +- +-

      (lis=
      t-ec (: n 1 4) (: i n) (list n i)=
      ) =3D> ((1 0) (2 0) (2 1) (3 0) (3 1) (3 2)).
      +- ++

      ++
      (list-ec (: n 1 4) (: i n) (list n i)) =3D> ((1 0) (2 0=
      ) (2 1) (3 0) (3 1) (3 2)).
      ++

      + In the example, the variable n is first bound to 1 +-then to 2 and finally to 3, and for each binding of n=20 +-the variable i is bound to the values=20 ++then to 2 and finally to 3, and for each binding of n ++the variable i is bound to the values + 0, 1, ..., n-1 in turn. + The expression (list n i) constructs a two-element list for + each bindings, and the comprehension list-ec collects +-all these results in a list.

      +- ++all these results in a list. ++

      ++

      + The mechanism defined in this SRFI has the following properties: ++

      ++
        +=20 +-
          +- +-
        • +-The set of comprehensions defined for this SRFI is inspired by=20 ++
        • ++The set of comprehensions defined for this SRFI is inspired by + those procedures and macros of [R5RS, 6.] + leading to natural comprehensions such as + list-ec, + append-ec, + sum-ec, + min-ec, +-every?-ec, ++every?-ec, + do-ec, and others. +-Some other natural comprehensions (e.g. gcd-ec) have=20 +-not been included into this SRFI due to their low significance=20 ++Some other natural comprehensions (e.g. gcd-ec) have ++not been included into this SRFI due to their low significance + for most applications. +-On the other hand, a few comprehensions=20 ++On the other hand, a few comprehensions + (fold-ec, + fold3-ec) +-not inspired by [R5RS] have been=20 ++not inspired by [R5RS] have been + included due to their broad applicability. +-
        • ++ +=20 +-
        • +-There are typed generators=20 +-(:list, :str= ing, ...) ++
        • ++There are typed generators ++(:list, = :string, ...) + expecting certain types of objects for their arguments. + These generators usually produce code as efficient as + hand coded do-loops. +-
        • ++ +=20 +-
        • +-There is also the special generator :=20 +-(read 'run through')=20 ++
        • ++There is also the special generator : ++(read 'run through') + dispatching on the value of its argument list at runtime. + In the examples above, one or two integers were used to define a range. + The convenience of omitting the type comes at a certain + performance penalty, both per iteration and during startup of the loop. +-
        • +- +-
        • +-Generators can be nested depth-first (as in the example above),=20 +-run in parallel (with an optional index variable=20 +-or more generally with :parallel), +-and can be stopped early before (:while<= /a>) +-or after (:until) ++
        • ++ ++
        • ++Generators can be nested depth-first (as in the example above), ++run in parallel (with an optional index variable ++or more generally with :parallel), ++and can be stopped early before (:while) ++or after (:until) + producing the current value. +-
        • ++ +=20 +-
        • +-The sequence of values can be filtered=20 ++
        • ++The sequence of values can be filtered + (if, not, + and, or), + intermediate commands can be evaluated between + generators (begin), and +-intermediate variables can be introduced (:let). +-
        • +-
        • ++intermediate variables can be introduced (:let<= /code>). ++
        • ++
        • + The mechanism is fully modular. +-This means that no existing macro or procedure needs=20 ++This means that no existing macro or procedure needs + to be modified when adding + application-specific comprehensions, +-application-specific typed generators, +-or application-specific dispatching generators. +-
        • +- +-
        • +-Syntactically, this SRFI uses the=20 +-[outer .. inner | expr] convention, +-meaning that the most right generator (inner) spins fastest ++application-specific typed generators, ++or application-specific dispatching generators. ++
        • ++ ++
        • ++Syntactically, this SRFI uses the ++[outer .. inner | expr] convention, ++meaning that the most right generator (inner) spins fastest + and is followed by the result expression over which the +-comprehension ranges (expr). ++comprehension ranges (expr). + Refer to the Section "Design Rationale". + Moreover, the syntax is strictly prefix and the naming +-convention my-comprehension-ec,=20 ++convention my-comprehension-ec, + :my-generator is used systematically. +-
        • ++ +=20 +-
        +- +-

        ++

      +=20 ++

      + The remainder of this document is organized as follows. + In section Rationale a brief + introduction is given what the motivation is for this SRFI. +@@ -170,28 +174,29 @@ Finally, the section Reference + Implementation gives source code for a reference + implementation together with a collection of runnable + examples and a few examples on extensions. ++

      +=20 +- +-

      Rationale

      +- ++

      Rationale

      ++

      + The purpose of this SRFI is to provide a compact notation +-for many common cases of loops, in particular those=20 ++for many common cases of loops, in particular those + constructing values for further computation. + The origin of this SRFI is my frustration that + there is no simple for the list of integers +-from 0 to n-1. ++from 0 to n-1. + With this SRFI it is (list-ec (: i n) i). +-Refer to the collection of examples for the=20 ++Refer to the collection of examples for the + reference implementation + what it can be used for, and what it should not be used for. +-To give a practically useful example,=20 ++To give a practically useful example, + the following procedure computes the sorted + list of all prime numbers below a certain bound + (you may want to run it yourself to get an idea of + its efficiency): ++

      +=20 +
      
      +-(define (eratosthenes n)          ; primes in {2..n-1} for n >=3D 1
      ++(define (eratosthenes n)          ; primes in {2..n-1} for n >=3D 1
      +   (let ((p? (make-string n #\1)))
      +     (do-ec (:range k 2 n)
      +            (if (char=3D? (string-ref p? k) #\1))
      +@@ -199,24 +204,25 @@ its efficiency):
      +            (string-set! p? i #\0) )
      +     (list-ec (:range k 2 n) (if (char=3D? (string-ref p? k) #\1)) k) ))
      +=20 +- +-Apart from make simple things simple,=20 ++

      ++Apart from make simple things simple, + there is no other paradigm involved for this SRFI. + In particular, it is not the ambition to implement the +-powerful lazy list comprehensions of other functional ++powerful lazy list comprehensions of other functional + programming languages in Scheme. + If you are looking for that you may want to refer to + [SRFI 40]. + (The usual definition of the stream of all primes does +-in fact also use Eratosthenes' sieve method.=20 +-It is instructive to compare.)

      +- +-The main focus of the design of this SRFI is portability under=20 ++in fact also use Eratosthenes' sieve method. ++It is instructive to compare.) ++

      ++

      ++The main focus of the design of this SRFI is portability under + [R5RS] and modularity for extension. + Portability is achieved by limiting the features included. + Modularity for generators is achieved by a special +-implementation technique using Continuation +-Passing Style for macros (which I learned from ++implementation technique using Continuation ++Passing Style for macros (which I learned from + Richard Kelsey's implementation of "Macros for writing loops", + [MWL]) and by limiting the + expressive power of generators. +@@ -224,193 +230,199 @@ Modularity for comprehensions requires no addition= al effort. + As modularity was a major design goal, I hope many people will + find it easy to define their own comprehensions and generators. + As a starting point for doing so, I have included several +-suggestions for extensions.

      +- ++suggestions for extensions. ++

      ++

      + For a detailed motivation of the design decisions, +-please refer to the Section "Design Rationale".

      ++please refer to the Section "Design Rationale". ++

      +=20 +-

      Specification

      ++

      Specification

      +=20 +-A comprehensions is a hygienic referentially transparent macro=20 ++

      ++A comprehension is a hygienic, referentially transparent macro + in the sense of [R5RS, 4.3.]. +-The macros extend the <expression>-syntax=20 ++The macros extend the <expression>-syntax + defined in [R5RS, 7.1.3.]. +-The main syntactic pattern used for defining a comprehension is=20 ++The main syntactic pattern used for defining a comprehension is + <qualifier>, representing a generator or a filter. +-It is defined in Section "Qualifiers".

      +- ++It is defined in Section "Qualifiers".

      ++

      ++

      + The most important instances of <qualifier> are genera= tors. + These are defined in Section "Generators". + Generators come in three flavors, +-as typed generators=20 +-(:list,=20 +-:range etc.), +-as the dispatching generator :=20 ++as typed generators ++(:list, ++:range etc.), ++as the dispatching generator : + (pronounced as 'run through'), +-and as combined and modified generators=20 +-(:parallel,=20 +-:while,=20 +-:until). +-Most generators in this SRFI also support an optional=20 ++and as combined and modified generators ++(:parallel, ++:while, ++:until). ++Most generators in this SRFI also support an optional + index variable counting the +-values being generated.

      +- +-Finally, it is explained how to add a new=20 ++values being generated. ++

      ++

      ++Finally, it is explained how to add a new + application-specific comprehension, +-how to add a new application-specific typed generator, ++how to add a new application-specific typed generator= , + and how to add a new +-application-specific dispatching generator. ++application-specific dispatching generator. + As this concerns code unknown at the time this is being written, + the explanation should not be taken as +-a specification in the literal sense.=20 ++a specification in the literal sense. + It rather suggests a convention to follow in order to + ensure new comprehensions and generators blend seamlessly with +-the ones defined in this SRFI.

      ++the ones defined in this SRFI. ++

      +=20 +=20 +-

      Comprehensions

      ++

      Comprehensions

      +=20 +-
      +-
      ++
      ++
      + (do-ec <qualifier>* <command>) +-
      ++
      +=20 +-
      +-Evaluates the <command> exactly once=20 ++
      ++Evaluates the <command> exactly once + for each binding in the sequence defined by the qualifiers. + If there are no qualifiers <command> + is evaluated exactly once. + The expression is evaluated for its side-effects only. + The result of the comprehension is unspecified. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (list-ec <qualifier>* <expression>) +-
      ++
      +=20 +-
      ++
      + The list of values obtained by evaluating +-<expression> once for each binding in the sequence=20 ++<expression> once for each binding in the sequence + defined by the qualifiers. + If there are no qualifiers the result is the list with +-the value of <expression>.=20 +-
      +-
      ++the value of <expression>. ++ ++ +=20 +-
      +-
      ++
      ++
      + (append-ec <qualifier>* <expression>) +-
      ++
      +=20 +-
      ++
      + The list obtained by appending all values of <expression>, +-which must all be lists.
      ++which must all be lists.
      + Think of it as + (apply append (list-ec <qualifier>* <expressi= on>)). +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (string-ec <qualifier>* <expression>) +-
      ++
      +=20 +-
      +-The string of all values of <expression>.
      ++
      ++The string of all values of <expression>.
      + Think of it as +-(list->string (list-ec <qualifier>* <expressi= on>)). +-
      +-
      ++(list->string (list-ec <qualifier>* <expre= ssion>)). ++ ++ +=20 +-
      +-
      ++
      ++
      + (string-append-ec <qualifier>* <expression>= ;) +-
      ++
      +=20 +-
      ++
      + The string obtained by appending all values of <expression>, +-which must all be strings.
      ++which must all be strings.
      + Think of it as + (apply string-append (list-ec <qualifier>* <e= xpression>)). +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (vector-ec <qualifier>* <expression>) +-
      ++
      +=20 +-
      +-The vector of all values of <expression>.
      ++
      ++The vector of all values of <expression>.
      + Think of it as +-(list->vector (list-ec <qualifier>* <expressi= on>)). +-
      +-
      ++(list->vector (list-ec <qualifier>* <expre= ssion>)). ++ ++ +=20 +-
      +-
      ++
      ++
      + (vector-of-length-ec <k> <qualifier>* <= expression>) +-
      ++
      +=20 +-
      ++
      + The vector of all values of <expression>, + of which there must be exactly <k>. + This comprehension behaves like vector-ec + but can be implemented more efficiently. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (sum-ec <qualifier>* <expression>) +-
      ++
      +=20 +-
      +-The sum of all values of <expression>.
      ++
      ++The sum of all values of <expression>.
      + Think of it as + (apply + (list-ec <qualifier>* <expression>= ;)). +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (product-ec <qualifier>* <expression>) +-
      ++
      +=20 +-
      +-The product of all values of <expression>.
      ++
      ++The product of all values of <expression>.
      + Think of it as + (apply * (list-ec <qualifier>* <expression>= ;)). +-
      +-
      ++ ++ +=20 +-
      +-
      +-(min-ec <qualifier>* <expression>)<= BR> ++
      ++
      ++(min-ec <qualifier>* <expression>)<= br /> + (max-ec <qualifier>* <expression>) +-
      ++
      +=20 +-
      ++
      ++

      + The minimum and maximum of all values of <expression>. + The sequence of values must be non-empty. +-Think of these as
      +-(apply min (list-ec <qualifier>* <expression&= gt;))
      +-(apply max (list-ec <qualifier>* <expression&= gt;)).

      +- ++Think of these as
      ++(apply min (list-ec <qualifier>* <expression&= gt;))
      ++(apply max (list-ec <qualifier>* <expression&= gt;)). ++

      ++

      + If you want to return a default value in case the sequence is empty +-you may want to consider
      ++you may want to consider
      + (fold3-ec 'infinity <qualifier>* <expression&= gt; min min). +-

      +-
      +- +-
      +-
      ++

      ++ ++
      + (any?-ec <qualifier>* <test>) +-
      ++ +=20 +-
      ++
      + Tests whether any value of <test> in the sequence + of bindings specified by the qualifiers is non-#f. + If this is the case, #t is returned, otherwise #f. +@@ -418,106 +430,113 @@ If there are no bindings in the sequence specified= by the qualifiers + at all then the result is #f. + The enumeration of values stops after the first non-#f + encountered. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (every?-ec <qualifier>* <test>) +-
      ++
      +=20 +-
      +-Tests whether all values of <test> are non-#f.=20 ++
      ++Tests whether all values of <test> are non-#f. + If this is the case, #t is returned, otherwise #f. + If the sequence is empty the result is #t. + Enumeration stops after the first #f. +-
      +-
      ++ ++ +=20 +-
      +-
      +-(first-ec <default> <qualifier>* <expression&= gt;)
      ++
      ++
      ++(first-ec <default> <qualifier>* <expression&= gt;)
      + (last-ec  <default> <qualifier>
      * <expres= sion>) +-
      ++
      +=20 +-
      +-The first or last value of <expression>=20 ++
      ++The first or last value of <expression> + in the sequence of bindings specified by the qualifiers. + Before enumeration, the result is initialized + with the value of <default>; + so this will be the result if the sequence is empty. +-Enumeration is terminated in first-ec=20 ++Enumeration is terminated in first-ec + when the first value has been computed. +-
      +-
      ++ ++ +=20 +-
      +-
      +-(fold-ec  <x0> <qualifier>* <expression= > <f2>)
      ++
      ++
      ++(fold-ec  <x0> <qualifier>* <expression= > <f2>)
      + (fold3-ec <x0> <qualifier>
      * <expression> &= lt;f1> <f2>) +-
      ++
      +=20 +-
      +-Reduces the sequence x[0], x[1], ..., x[n-1] ++
      ++

      ++Reduces the sequence x[0], x[1], ..., x[n-1] + of values obtained by evaluating <expression> once + for each binding as specified by <qualifier>*. +-The arguments <x0>, <f2>,=20 ++The arguments <x0>, <f2>, + and <f1>, all syntactically equivalent to +-<expression>, specify the reduction process.

      +- ++<expression>, specify the reduction process. ++

      ++

      + The reduction process for fold-ec is defined as follows. +-A reduction variable x is initialized to the value=20 ++A reduction variable x is initialized to the value + of <x0>, +-and for each k in {0, ..., n-1} the command=20 +-(set! x (<f2> x[k] x)) +-is evaluated.=20 +-Finally, x is returned as the value of the comprehension.

      +- ++and for each k in {0, ..., n-1} the command ++(set! x (<f2> x[k] x)) ++is evaluated. ++Finally, x is returned as the value of the comprehension. ++

      ++

      + The reduction process for fold3-ec is different. +-If and only if n =3D 0, i.e. the sequence is empty, then=20 +-<x0> is evaluated and returned as the value=20 ++If and only if n =3D 0, i.e. the sequence is empty, then ++<x0> is evaluated and returned as the value + of the comprehension. + Otherwise, a reduction variable x is initialized +-to the value of (<f1> x[0]), +-and for each k in {1, ..., n-1} the command=20 +-(set! x (<f2> x[k] x)) +-is evaluated.=20 +-Finally, x is returned as the value of the comprehension.

      +- ++to the value of (<f1> x[0]), ++and for each k in {1, ..., n-1} the command ++(set! x (<f2> x[k] x)) ++is evaluated. ++Finally, x is returned as the value of the comprehension. ++

      ++

      + As the order of the arguments suggests, + <x0> is evaluated outside the scope of the + qualifiers, whereas the reduction expressions involving +-<f1> and <f2> are ++<f1> and <f2> are + inside the scope of the qualifiers (so they may depend on + any variable introduced by the qualifiers). + Note that <f2> is evaluated repeatedly, +-with any side-effect or overhead this might have.

      +- +-The main purpose of these comprehensions is=20 ++with any side-effect or overhead this might have. ++

      ++

      ++The main purpose of these comprehensions is + implementing other comprehensions as special cases. + They are generalizations of the procedures + fold and reduce in the sense of +-[SRFI 1].=20 +-(Concerning naming and argument order, please refer to=20 ++[SRFI 1]. ++(Concerning naming and argument order, please refer to + the discussion archive of SRFI 1, in particular + the posting [Folds].) + Note that fold3-ec is defined such that +-<x0> is only evaluated in case the=20 ++<x0> is only evaluated in case the + sequence is empty. +-This allows raising an error for the empty sequence,=20 ++This allows raising an error for the empty sequence, + as in the example definition of min-ec below. +-

      +-
      ++

      ++ ++ +=20 +-
      +-
      ++
      ++
      + <application-specific comprehension> +-
      ++
      +=20 +-
      +-An important aspect of this SRFI is a modular mechanism=20 ++
      ++

      ++An important aspect of this SRFI is a modular mechanism + to define application-specific comprehensions. +-To create a new comprehension a hygienic macro=20 ++To create a new comprehension a hygienic macro + of this name is defined. + The macro transforms the new comprehension patterns + into instances of do-ec, which is the= most +@@ -528,7 +547,7 @@ For example, the following code defines + min-ec + in terms of fold-ec + and fold3-ec: +- ++

      +
      
      + (define-syntax list-ec
      +   (syntax-rules ()
      +@@ -539,23 +558,22 @@ and fold3-ec:
      +   (syntax-rules ()
      +     ((min-ec etc1 etc ...)
      +      (fold3-ec (min) etc1 etc ... min min) )))
      +- ++

      + Note that the pattern etc1 etc ... matches + the syntax <qualifier>* <expression> +-without separate access to <qualifier>*=20 ++without separate access to <qualifier>* + and <expression>. + In order to define a comprehension that does need explicit +-access to the <expression>-part,=20 ++access to the <expression>-part, + the following method is used. +-First, all qualifiers are collected into a=20 ++First, all qualifiers are collected into a + nested-qualifier, and then the + 'exactly one qualifier'-case is implemented. + For illustration, the following code defines +-fold3-ec in terms of=20 ++fold3-ec in terms of + do-ec: +- +- +-

      
      ++

      ++
      + (define-syntax fold3-ec
      +   (syntax-rules (nested)
      +     ((fold3-ec x0 (nested q1 ...) q etc1 etc2 etc3 etc ...)
      +@@ -573,421 +591,441 @@ For illustration, the following code defines
      +                     (begin (set! result (f1 value))
      +                            (set! empty #f) )
      +                     (set! result (f2 value result)) )))
      +-       (if empty x0 result) ))))
      +- ++ (if empty x0 result) ))))
      ++

      + Finally, observe that the newly defined fold3-ec + comprehension inherits all types of qualifiers supported by + do-ec, including all application-specific generators; + no further definitions are necessary. +-

      +-
      ++

      ++ ++ +=20 +=20 +-

      Qualifiers

      ++

      Qualifiers

      +=20 ++

      + This section defines the syntax <qualifier>. + The nesting of qualifiers is from left (outer) to right (inner). + In other words, the rightmost generator spins fastest. + The nesting also defines the scope of the variables introduced +-by the generators.=20 ++by the generators. + This implies that inner generators may depend on the variables + of outer generators. +-The sequence of enumeration of values is strictly depth first. +-These conventions are illustrated by the=20 +-first example.

      +- +-The syntax <qualifier> consists of the following alter= natives:

      ++The sequence of enumeration of values is strictly depth first. ++These conventions are illustrated by the ++first example. ++

      ++

      ++The syntax <qualifier> consists of the following alter= natives: ++

      +=20 +=20 +-
      +-
      ++
      ++
      + <generator> +-
      ++
      +=20 +-
      ++
      + Enumerates a sequence of bindings of one or more variables. + The scope of the variables starts at the generator and extends + over all subsequent qualifiers and expressions in the comprehension. +-The <generator>-syntax is defined in=20 ++The <generator>-syntax is defined in + Section "Generators". +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (if <test>) +-
      ++
      +=20 +-
      ++
      + Filters the sequence of bindings by testing if + <test> evaluates to non-#f. + Only for those bindings for which this is the case, + the subsequent qualifiers of the comprehension are evaluated. +-
      +-
      ++ ++ +=20 +-
      +-
      +-(not <test>)
      +-(and <test>
      *)
      ++
      ++
      ++(not <test>)
      ++(and <test>
      *)
      + (or  <test>
      *) +-
      ++
      +=20 +-
      ++
      + Abbreviated notations for filters of the form + (if (not <test>)), + (if (and <test>*)), and + (if (or <test>*)). + These represent frequent cases of filters. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (begin <sequence>) +-
      ++
      +=20 +-
      ++
      + Evaluate <sequence>, consisting of + <command>* <expression>, +-once for each binding of the variables defined by the=20 ++once for each binding of the variables defined by the + previous qualifiers in the comprehension. + Using this qualifier, side effects can be inserted + into the body of a comprehension. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (nested <qualifier>*) +-
      ++
      +=20 +-
      ++
      + A syntactic construct to group qualifiers. +-The meaning of a qualifier according to the=20 +-nested-syntax is the same as=20 ++The meaning of a qualifier according to the ++nested-syntax is the same as + inserting <qualifier>* + into the enclosing comprehension. + This construct can be used to reduce comprehensions with several + qualifiers into a form with exactly one qualifier. +-
      +-
      ++ ++ +=20 +=20 +-

      Generators

      +- ++

      Generators

      ++

      + This section defines the syntax <generator>. +-Each generator defines a sequence of bindings through=20 ++Each generator defines a sequence of bindings through + which one or more variables are run. +-The scope of the variables begins after the closing=20 ++The scope of the variables begins after the closing + parenthesis of the generator expression and extends +-to the end of the comprehension it is part of.

      +- +-The variables defined by the generators=20 +-are specified using the syntax

      +- ++to the end of the comprehension it is part of. ++

      ++

      ++The variables defined by the generators ++are specified using the syntax ++

      +
      + <vars> --> <variable1> [ (index <var=
      iable2>) ],
      +=20 ++

      + where <variable1> runs through the values in +-the sequence defined by the generator, and the optional=20 +-<variable2> is an exact integer-valued=20 ++the sequence defined by the generator, and the optional ++<variable2> is an exact integer-valued + index variable counting the values (starting from 0). + The names of the variables must be distinct. +-The following example illustrates the index variable:

      +- ++The following example illustrates the index variable: ++

      +
      
      +-(list-ec (: x (index i) "abc") (list x i)) =3D> ((#\a 0) (#\b 1) (#\c 2))=
      
      ++(list-ec (: x (index i) "abc") (list x i)) =3D> ((#\a 0) (#\b 1) (#\c = 2))
      +=20 ++

      + Unless defined otherwise, all generators make sure that the + expressions provided for their syntactic arguments are + evaluated exactly once, before enumeration begins. + Moreover, it may be assumed that the generators do not + copy the code provided for their arguments, because that + could lead to exponential growth in code size. +-Finally, it is possible to assign a value to the variables=20 +-defined by a generator, but the effect of this assignment=20 +-is unspecified.

      +- +-The syntax <generator> consists of the following alter= natives:

      ++Finally, it is possible to assign a value to the variables ++defined by a generator, but the effect of this assignment ++is unspecified. ++

      ++

      ++The syntax <generator> consists of the following alter= natives: ++

      +=20 +-
      +-
      ++
      ++
      + (: <vars> <arg1> <arg>*) +-
      ++
      +=20 +-
      ++
      ++

      + First the expressions <arg1> <arg>* +-are evaluated into a[1] a[2] ... a[n] ++are evaluated into a[1] a[2] ... a[n] + and then a global dispatch procedure is used to dispatch on + the number and types of the arguments and run the resulting + generator. +- +- +-Initially (after loading the SRFI),=20 +-the following cases are recognized:

      +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
      :list +-if +-for all i in {1..n}: +-(list? a[i]). +-
      :string +-if +-for all i in {1..n}: +-(string? a[i]). +-
      :vector +-if +-for all i in {1..n}: +-(vector? a[i]). +-
      :range +-if +-n in {1..3} and=20 +-for all i in {1..n}: +-(integer? a[i]) and +-(exact? a[i]). +-
      :real-range +-if +-n in {1..3} and=20 +-for all i in {1..n}: +-(real? a[i]). +-
      :char-range +-if +-n =3D 2 and +-for all i in {1, 2}: +-(char? a[i]). +-
      :port +-if +-n in {1,2} and +-(input-port? a[1]) and +-(procedure? a[2]). +-

      +- ++

      ++

      ++Initially (after loading the SRFI), ++the following cases are recognized: ++

      ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
      :list ++if ++for all i in {1..n}: ++(list? a[i]). ++
      :string ++if ++for all i in {1..n}: ++(string? a[i]). ++
      :vector ++if ++for all i in {1..n}: ++(vector? a[i]). ++
      :range ++if ++n in {1..3} and ++for all i in {1..n}: ++(integer? a[i]) and ++(exact? a[i]). ++
      :real-range ++if ++n in {1..3} and ++for all i in {1..n}: ++(real? a[i]). ++
      :char-range ++if ++n =3D 2 and ++for all i in {1, 2}: ++(char? a[i]). ++
      :port ++if ++n in {1,2} and ++(input-port? a[1]) and ++(procedure? a[2]). ++
      ++

      + +-The current dispatcher can be retrieved as=20 +-(:-dispatch-ref), a new dispatcher d=20 ++The current dispatcher can be retrieved as ++(:-dispatch-ref), a new dispatcher d + can be installed by +-(:-dispatch-set! d) ++(:-dispatch-set! d) + yielding an unspecified result, + and a copy of the initial dispatcher can be obtained as + (make-initial-:-dispatch). +-Please refer to the section below ++Please refer to the section below + for recommendation how to add cases to the dispatcher. +-

      +-
      ++

      ++ +=20 +-
      +-
      +-(:list   <vars> <arg1> <arg>*)=
      +-(:string <vars> <arg1> <arg>
      *)
      ++
      ++(:list   <vars> <arg1> <arg>*)=
      ++(:string <vars> <arg1> <arg>
      *)
      + (:vector <vars> <arg1> <arg>
      *) +-
      ++ +=20 +-
      ++
      + Run through one or more lists, strings, or vectors. +-First all expressions in <arg1> <arg>*=20 ++First all expressions in <arg1> <arg>* + are evaluated and then all elements of the resulting values + are enumerated from left to right. + One can think of it as first appending all arguments and + then enumerating the combined object. +-As a clarifying example, consider
      +-(list-ec (:string c (index i) "a" "b") (cons c i)) =3D> ++As a clarifying example, consider
      ++(list-ec (:string c (index i) "a" "b") (cons c i)) =3D> + ((#\a . 0) (#\b . 1)). +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (:integers <vars>) +-
      ++
      +=20 +-
      ++
      + Runs through the sequence 0, 1, 2, ... of non-negative integers. +-This is most useful in combination with=20 +-:parallel, +-:while, and=20 +-:until or with ++This is most useful in combination with ++:parallel, ++:while, and ++:until or with + a non-local exit in the body of the comprehension. +-
      +-
      ++ ++ +=20 +-
      +-
      +-(:range <vars>         <= stop>)
      +-(:range <vars> <start> <stop>)
      ++
      ++
      ++(:range <vars>         <= stop>)
      ++(:range <vars> <start> <stop>)
      + (:range <vars> <start> <stop> <step>)
      +-
      +- +-
      +-Runs through a range of exact rational numbers.

      ++

      +=20 ++
      ++

      ++Runs through a range of exact rational numbers. ++

      ++

      + The form (:range <vars> <stop>) + evaluates the expression <stop>, +-which must result in an exact integer n,=20 +-and runs through the finite sequence 0, 1, 2, ..., n-1. +-If n is zero or negative the sequence is empty.

      ++which must result in an exact integer n, ++and runs through the finite sequence 0, 1, 2, ..., n-1. ++If n is zero or negative the sequence is empty.

      +=20 + The form (:range <vars> <start> <stop>) +-evaluates the expressions <start> and=20 ++evaluates the expressions <start> and + <stop>, +-which must result in exact integers a and b,=20 +-and runs through the finite sequence=20 +-a, a+1, a+2, ..., b-1. +-If b is less or equal a then the sequence is empty.

      +- ++which must result in exact integers a and b, ++and runs through the finite sequence ++a, a+1, a+2, ..., b-1. ++If b is less or equal a then the sequence is empty. ++

      ++

      + The form (:range <vars> <start> <stop> <step&g= t;) +-first evaluates the expressions <start>,=20 ++first evaluates the expressions <start>, + <stop>, and <step>, +-which must result in exact integers a, b, and s +-such that s is unequal to zero. ++which must result in exact integers a, b, and s ++such that s is unequal to zero. + Then the sequence +-a, a + s, a + 2 s, ..., a + (n-1) s +-is enumerated where n =3D ceil((b-a)/s). +-In other words, the sequence starts at a, increments by s, +-and stops when the next value would reach or cross b. +-If n is zero or negative the sequence is empty. +-

      +-
      +- +-
      +-
      +-(:real-range <vars>         = ;<stop>)
      +-(:real-range <vars> <start> <stop>)
      ++a, a + s, a + 2 s, ..., a + (n
      -1) s ++is enumerated where n =3D ceil((b-a)/s). ++In other words, the sequence starts at a, increments by s, ++and stops when the next value would reach or cross b. ++If n is zero or negative the sequence is empty. ++

      ++ ++
      ++ ++
      ++
      ++(:real-range <vars>         = ;<stop>)
      ++(:real-range <vars> <start> <stop>)
      + (:real-range <vars> <start> <stop> <step>)
      +-
      ++ +=20 +-
      ++
      ++

      + Runs through a range of real numbers using an explicit index variable. + This form of range enumeration avoids accumulation of rounding errors +-and is the one to use if any of the numbers defining the range is=20 +-inexact, not an integer, or a bignum of large magnitude.

      +- ++and is the one to use if any of the numbers defining the range is ++inexact, not an integer, or a bignum of large magnitude. ++

      ++

      + Providing default value 0 for <start> and + 1 for <step>, the generator first + evaluates <start>, <stop>, + and <step>, which must result in reals +-a, b, and s such that=20 +-n =3D (b-a)/s is also representable ++a, b, and s such that ++n =3D (b-a)/s is also representable + as a real. + Then the sequence 0, 1, 2, ... is enumerated while the +-current value i is less than n, and the ++current value i is less than n, and the + variable in <vars> is bound to the +-value a + i s. +-If any of the values a, b, or s is ++value a + i s. ++If any of the values a, b, or s is + non-exact then all values in the sequence are non-exact. +-

      +-
      ++

      ++ ++ ++ +=20 +-
      +-
      ++
      ++
      + (:char-range <vars> <min> <max>) +-
      ++
      +=20 +-
      ++
      + Runs through a range of characters. + First <min> and <max> are +-evaluated, which must result in two characters a and b. +-Then the sequence of characters=20 +-a, a+1, a+2, ..., b ++evaluated, which must result in two characters a and b. ++Then the sequence of characters ++a, a+1, a+2, ..., b + is enumerated in the order defined by char<=3D? + in the sense of [R5RS, 6.3.4.]. +-If b is smaller than a then the sequence is empty. +-(Note that b is included in the sequence.) +-
      +-
      +- +-
      +-
      +-(:port <vars> <port>)
      ++If b is smaller than a then the sequence is empty. ++(Note that b is included in the sequence.) ++ ++
      ++ ++
      ++
      ++(:port <vars> <port>)
      + (:port <vars> <port> <read-proc>) +-
      ++ +=20 +-
      ++
      + Reads from the port until the eof-object is read. +-Providing the default read for=20 ++Providing the default read for + <read-proc>, the generator first +-evaluates <port> and=20 ++evaluates <port> and + <read-proc>, which must result +-in an input port p and a procedure r. ++in an input port p and a procedure r. + Then the variable is run through the sequence obtained +-by (r p) ++by (r p) + while the result does not satisfy eof-object?. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (:dispatched <vars> <dispatch> <arg1> <arg>= *) +-
      ++
      +=20 +-
      ++
      ++

      + Runs the variables through a sequence defined by <dispatch> + and <arg1> <arg>*. + The purpose of :dispatched is implementing + dispatched generators, in particular the predefined dispatching +-generator :.

      +- ++generator :. ++

      ++

      + The working of :dispatched is as follows. + First <dispatch> and + <arg1> <arg>* are evaluated, +-resulting in a procedure d (the 'dispatcher') and=20 +-the values a[1] a[2] ... a[n]. +-Then=20 +-(d (list a[1] a[2] ... = a[n] ))=20 +-is evaluated, resulting in a value g. +-If g is not a procedure then the dispatcher ++resulting in a procedure d (the 'dispatcher') and ++the values a[1] a[2] ... a[n]. ++Then ++(d (list a[1] a[2] ... = a[n] )) ++is evaluated, resulting in a value g. ++If g is not a procedure then the dispatcher + did not recognize the argument list and an error is raised. +-Otherwise the 'generator procedure' g is used=20 ++Otherwise the 'generator procedure' g is used + to run <vars> through a sequence of values. +-The sequence defined by g is obtained by repeated=20 +-evaluation of (g empty) +-until the result is empty. +-In other words, g indicates the end of the sequence by +-returning its only argument, for which the caller has provided=20 +-an object distinct from anything g can produce. ++The sequence defined by g is obtained by repeated ++evaluation of (g empty) ++until the result is empty. ++In other words, g indicates the end of the sequence by ++returning its only argument, for which the caller has provided ++an object distinct from anything g can produce. + (Generator procedures are state based, they are no such noble things +-as streams in the sense of SRFI 40.)

      +- +- ++as streams in the sense of SRFI 40.) ++

      ++

      + The definition of dispatchers is greatly simplified by the + macro :generator-proc that constructs a generator + procedure from a typed generator. + Let (g var arg1 arg ...) be an instance of + the <generator> syntax, for example an +-application-specific typed generator, ++application-specific typed generator, + with a single variable var and no index variable. + Then +- ++

      +
      +-(:generator-proc (g arg1 arg ...)) =3D> g,
      +- +-where the generator procedure g runs through the list +-(list-ec (g var arg1 arg ...) var).

      ++(:generator-proc (g arg1 arg ...)) =3D> g,

      ++

      ++where the generator procedure g runs through the list ++(list-ec (g var arg1 arg ...) var). ++

      +=20 +- +-Adding an application-specific dispatching generator. ++

      ++Adding an application-specific dispatching generator. + In order to define a new dispatching generator (say :my) + first a dispatching procedure (say :my-dispatch) is defined. + The dispatcher will be called with a single (!) argument +@@ -998,9 +1036,9 @@ when it is called with the empty list. + Otherwise (if there is at least one value to dispatch on), + the dispatcher must either return a generator procedure + or #f (=3D no interest). +-As an example, the following skeleton code defines a dispatcher=20 +-similar to the initial dispatcher of :: +- ++As an example, the following skeleton code defines a dispatcher ++similar to the initial dispatcher of :: ++

      +
      + (define (:my-dispatch args)
      +   (case (length args)
      +@@ -1011,28 +1049,28 @@ similar to the initial dispatcher of ::
      +              (:generator-proc (:list a1)) )
      +             ((string? a1)
      +              (:generator-proc (:string a1)) )
      +-            ...more unary cases...
      ++            ...more unary cases...
      +             (else
      +              #f ))))
      +     ((2) (let ((a1 (car args)) (a2 (cadr args)))
      +            (cond
      +             ((and (list? a1) (list? a2))
      +              (:generator-proc (:list a1 a2)) )
      +-            ...more binary cases...
      ++            ...more binary cases...
      +             (else
      +              #f ))))
      +-    ...more arity cases...
      ++    ...more arity cases...
      +     (else
      +      (cond
      +       ((every?-ec (:list a args) (list? a))
      +        (:generator-proc (:list (apply append args))) )
      +-      ...more large variable arity cases...
      ++      ...more large variable arity cases...
      +       (else
      +        #f )))))
      +- +-Once the dispatcher has been defined, the following macro=20 ++

      ++Once the dispatcher has been defined, the following macro + implements the new dispatching generator: +- ++

      +
      + (define-syntax :my
      +   (syntax-rules (index)
      +@@ -1040,83 +1078,85 @@ implements the new dispatching generator:
      +      (:dispatched cc var (index i) :my-dispatch arg1 arg ...) )
      +     ((:my cc var arg1 arg ...)
      +      (:dispatched cc var :my-dispatch arg1 arg ...) )))
      +- ++

      + This method of extension yields complete control of the dispatching proce= ss. + Other modules can only add cases to :my +-if they have access to :my-dispatch.

      +- +- +-Extending the predefined dispatched generator. ++if they have access to :my-dispatch. ++

      ++

      ++Extending the predefined dispatched generator. + An alternative to adding a new dispatched generators is extending +-the predefined generator :. +-Technically, extending : means ++the predefined generator :. ++Technically, extending : means + installing a new global dispatching procedure using +-:-dispatch-set! ++:-dispatch-set! + as described above. +- +- ++

      ++

      + In most cases, however, the already installed dispatcher should +-be extended by new cases.=20 ++be extended by new cases. + The following procedure is a utility for doing so: +- +-

      (dispatch-union d1 d2) =3D> d,
      =20 +- +-where the new dispatcher d recognizes the union of the +-cases recognized by the dispatchers d1 and d2. ++

      ++
      (dispatch-union d1 d2) =3D> d,
      ++

      ++where the new dispatcher d recognizes the union of the ++cases recognized by the dispatchers d1 and d2. + The new dispatcher always tries both component dispatchers + and raises an error in case of conflict. +-The identification returned by (d) ++The identification returned by (d) + is the concatenation of the component identifications +-(d1) and=20 +-(d2), enclosed in lists ++(d1) and ++(d2), enclosed in lists + if necessary. + For illustration, consider the following code: +- ++

      +
      + (define (example-dispatch args)
      +   (cond
      +    ((null? args)
      +     'example )
      +    ((and (=3D (length args) 1) (symbol? (car args)) )
      +-    (:generator-proc (:string (symbol->string (car args)))) )
      ++    (:generator-proc (:string (symbol->string (car args)))) )
      +    (else
      +     #f )))
      +=20
      + (:-dispatch-set! (dispatch-union (:-dispatch-ref) example-dispatch))
      +- ++

      + After evaluation of this code, the following example will work: +- +-

      (list-ec (: c 'abc) c) =3D> (#\a #\b #\c)
      +- +-Adding cases to : is particularly useful= =20 ++

      ++
      (list-ec (: c 'abc) c) =3D> (#\a #\b #\c)
      ++

      ++Adding cases to : is particularly useful + for frequent cases of interactive input. + Be warned, however, that the advantage of global extension also carries + the danger of conflicts, unexpected side-effects, and slow dispatching. +- +- ++

      ++ ++ ++ +=20 +-
      +-
      +-(:do (<lb>*) <ne1?> (<ls>*))<= br> ++
      ++
      ++(:do (<lb>*) <ne1?> (<ls>*))<= br /> + (:do (let (<ob>*) <oc>*) (<lb>= ;*) <ne1?> (let (<ib>*) <ic>*) <ne2?> (<ls>*)) +-
      ++
      +=20 +-
      ++
      + Defines a generator in terms of a named-let, + optionally decorated with inner and outer lets. + This generator is for defining other generators. + (In fact, the reference implementation transforms any other + generator into an instance of fully decorated :do.) +-The generator is a compromise between expressive power=20 ++The generator is a compromise between expressive power + (more flexible loops) and fixed structure (necessary + for merging and modifying generators). +-In the fully decorated form, the syntactic variables=20 ++In the fully decorated form, the syntactic variables + <ob> (outer binding), + <oc> (outer command), + <lb> (loop binding), + <ne1?> (not-end1?), + <ib> (inner binding), +-<ic> (inner command),=20 ++<ic> (inner command), + <ne2?> (not-end2?), and + <ls> (loop step) + define the following loop skeleton: +@@ -1124,11 +1164,11 @@ define the following loop skeleton: +
      + (let (<ob>*)
      +   <oc>*
      +-  (let loop (<lb>*)=20
      ++  (let loop (<lb>*)
      +     (if <ne1?>
      +         (let (<ib>*)
      +           <ic>*
      +-          payload
      ++          payload
      +           (if <ne2?>
      +               (loop <ls>*) ))))),
      +=20 +@@ -1139,120 +1179,129 @@ i.e. they do not begin with a <definiti= on>. + The latter requirement allows the code generator to + produce more efficient code for special cases by + removing empty let-expressions altogether. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (:let <vars> <expression>) +-
      ++
      +=20 +-
      +-Runs through the sequence consisting of the value of=20 ++
      ++Runs through the sequence consisting of the value of + <expression>, only. + This is the same as + (:list <vars> (list <expression>)). + If an index variable is specified, its value is 0. +-The :let-generator can be used to introduce=20 ++The :let-generator can be used to introduce + an intermediate variable depending on outer generators. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (:parallel <generator>*) +-
      ++
      +=20 +-
      ++
      + Runs several generators in parallel. + This means that the next binding in the sequence is obtained + by advancing each generator in <generator>* + by one step. + The parallel generator terminates when any of its component + generators terminates. +-The generators share a common scope for the variables=20 ++The generators share a common scope for the variables + they introduce. +-This implies that the names of the variables introduced=20 ++This implies that the names of the variables introduced + by the various generators must be distinct. +-
      +-
      ++ ++ +=20 +-
      +-
      ++
      ++
      + (:while <generator> <expression>) +-
      ++
      +=20 +-
      ++
      ++

      + Runs <generator> while <expression> + evaluates to non-#f. + The guarding expression is included in the scope +-of the variables introduced by the generator.

      +- ++of the variables introduced by the generator. ++

      ++

      + Note the distinction between the filter if and + the modified generator expressed by :while. +-

      +-
      ++

      ++ ++ ++ +=20 +-
      +-
      ++
      ++
      + (:until <generator> <expression>) +-
      ++
      +=20 +-
      +-Runs <generator> until after=20 ++
      ++

      ++Runs <generator> until after + <expression> has evaluated to non-#f. + The guarding expression is included in the scope +-of the variables introduced by the generator.

      +- +-Note the distinction between :while, stopping at +-a certain condition, and :until, stopping after ++of the variables introduced by the generator. ++

      ++

      ++Note the distinction between :while, stopping at ++a certain condition, and :until, stopping after + a certain condition has occurred. The latter implies that the binding + that has triggered termination has been processed by the comprehension. +-

      +-
      ++

      ++ ++ +=20 +-
      +-
      ++
      ++
      + <application-specific typed generator> +-
      ++
      +=20 +-
      ++
      ++

      + An important aspect of this SRFI is a modular mechanism to + define new typed generators. + To define a new typed generator a hygienic referentially + transparent macro of the same name is defined to transform +-the generator pattern into an instance of the=20 +-:do-generator. ++the generator pattern into an instance of the ++:do-generator. + The extension is fully modular, meaning that no other + macro has to be modified to add the new generator. + This is achieved by defining the new macro in +-Continuation Passing Style, as in [MWL].

      +- ++Continuation Passing Style, as in [MWL]. ++

      ++

      + Technically, this works as follows. +-Assume the generator syntax (:mygen <var> <arg>)= =20 ++Assume the generator syntax (:mygen <var> <arg>) + is to be implemented, for example running the variable <var><= /code> + through the list (reverse <arg>). +-The following definition implements :mygen=20 +-in terms of :list=20 +-using the additional syntactic variable cc=20 +-(read current continuation): +- ++The following definition implements :mygen ++in terms of :list ++using the additional syntactic variable cc ++(read current continuation): ++

      +
      + (define-syntax :mygen
      +   (syntax-rules ()
      +     ((:mygen cc var arg)
      +      (:list cc var (reverse arg)) )))
      +- +-After this definition, any comprehension will accept=20 ++

      ++After this definition, any comprehension will accept + the :mygen-generator and produce the + proper code for it. +-This works as follows.=20 ++This works as follows. + When a comprehension sees something of the form + (g arg ...) in the position of a + <qualifier> then it will +-transform the entire comprehension into=20 ++transform the entire comprehension into + (g (continue ...) arg ...). +-This effectively 'transfers control' to the=20 ++This effectively 'transfers control' to the + macro g, for example :mygen. + The macro g has full control of + the transformation, but eventually it should +@@ -1263,145 +1312,152 @@ by the :list-macro. + The macro :do finally transforms + into (continue ... (:do etc ...)). + As continue has been chosen by the +-macro implementing the comprehension,=20 ++macro implementing the comprehension, + it can regain control and proceed +-with other qualifiers.

      +- +-In order to ensure consistency of new generators=20 ++with other qualifiers. ++

      ++

      ++In order to ensure consistency of new generators + with the ones defined in this SRFI, a few conventions + are in order. +-Firstly, the generator patterns begin with one or more=20 ++Firstly, the generator patterns begin with one or more + variables followed by arguments defining the sequence. +-Secondly, each generator except :do=20 ++Secondly, each generator except :do + can handle an optional index variable. + This is most easily implemented using +-:parallel +-together with :integers. ++:parallel ++together with :integers. + In case the payload generator needs an index anyhow +-(e.g. :vector) ++(e.g. :vector) + it is more efficient to add an index-variable if + none is given and to implement the indexed case. + Finally, make sure that no syntactic variable of the + generator pattern ever gets duplicated in the code + (to avoid exponential code size in nested application), +-and introduce sufficient intermediate variables to=20 ++and introduce sufficient intermediate variables to + make sure expressions are evaluated at the correct time. +-

      +-
      +- +-

      +-Suggestions for application-specific extensions

      ++

      ++ ++ +=20 +-

      Arrays in the sense of [SRFI25]

      ++

      ++Suggestions for application-specific extensions

      +=20 ++

      Arrays in the sense of [SRFI25]

      ++

      + In order to create an array from a sequence of elements, + a comprehension with the following syntax would be useful: +- ++

      +
      (array-ec <shape> <qualifier>* <expression>).
      +- ++

      + The comprehension constructs a new array of the given shape +-by filling it row-major with the sequence of elements as specified=20 ++by filling it row-major with the sequence of elements as specified + by the qualifiers. +- ++

      ++

      + On the generator side, it would be most useful to have a + generator of the form +- ++

      +
      (:array <vars> <arg>),
      +- ++

      + running through the elements of the array in row-major. +-For the optional index variable, the extension=20 ++For the optional index variable, the extension + (index <k1> <k>*) + could be defined where <k1> <k>* + are variable names indexing the various dimensions. ++

      +=20 +- +-

      Random Numbers in the sense of [SRFI27]

      +- ++

      Random Numbers in the sense of [SRFI27]

      ++

      + In order to create a vector or list of random numbers, + it would be convenient to have generators of the following form: +- ++

      +
      + (:random-integer [ <range> [ <number> ] ] )
      + (:random-real    [ <number> ] )
      +- +-where <range> (default 2) indicates the range of=20 ++

      ++where <range> (default 2) indicates the range of + the integers and <number> (default infinity) + specifies how many elements are to be generated. + Derived from these basic generators, one could define several + other generators for other distributions (e.g. Gaussian). ++

      +=20 +- +-

      Bitstrings in the sense of [SRFI33]

      +- ++

      Bitstrings in the sense of [SRFI33]

      ++

      + As eager comprehensions are efficient, they can be useful + for operations involving strings of bits. + It could be useful to have the following comprehension: +- ++

      +
      (bitwise-ec <qualifier>* <expression>),
      +- ++

      + which constructs an integer from bits obtained as values + of <expression> in the ordering defined + by [SRFI33]. +-In other words, if the sequence of values is=20 +-x[0], x[1], ..., x[n-1] then +-the result is x[0] + x[1] 2 + ... + x[n-1] 2^= (n-1). ++In other words, if the sequence of values is ++x[0], x[1], ..., x[n-1] then ++the result is x[0] + x[1] 2 + ... + x[n-1] 2^= (n-1). + On the generator side, a generator of the form +- ++

      +
      (:bitwise <vars> <arg1> <arg>*)
      +- ++

      + runs through the sequence of bits obtained by appending the + binary digits of the integers <arg1> <arg>*. ++

      ++

      Streams in the sense of [SRFI 40]

      +=20 +-

      Streams in the sense of [SRFI 40]

      +- +-It is possible to 'lazify' the eager comprehension=20 ++

      ++It is possible to 'lazify' the eager comprehension + list-ec, + constructing a stream in the sense of [SRFI 40]. + Clearly, such a comprehension (stream-ec) + is not eager at all since it only runs the loops when results are request= ed. + It is also possible to define a :stream-generator with +-the same API as :list but running +-through streams instead of lists.

      +- +-For what it is worth,=20 +-the file srfi4= 0-ec.scm implements ++the same API as :list but running ++through streams instead of lists. ++

      ++

      ++For what it is worth, ++the file srfi= 40-ec.scm implements + :stream and stream-ec and gives an example. +-The implementation makes substantial use of=20 ++The implementation makes substantial use of + call-with-current-continuation to run the loop + only when necessary. + In some implementations of Scheme this may involve + considerable overhead. ++

      +=20 +-

      Reading Text Files

      +- ++

      Reading Text Files

      ++

      + Eager comprehensions can also be used to process files. + However, bear in mind that an eager comprehension wants + to read and process the entire file right away. + Nevertheless, these generators would be useful for + reading through the lines of a file or through the + characters of a file: +- ++

      +
      + (:lines-of-file <vars> <file>)
      + (:chars-of-file <vars> [ (line <variable1>) ] [ (column <v=
      ariable2>) ] <file>)
      +- ++

      + Here <file> is either an input port + or a string interpreted as a filename. + In a similar fashion, generators reading from sockets defined + by URLs or other communication facilities could be defined. ++

      +=20 +-

      The Scheme shell Scsh

      +- ++

      The Scheme shell Scsh

      ++

      + In the Scheme-shell Scsh it could be useful to have certain +-comprehensions and generators.=20 ++comprehensions and generators. + Candidates for comprehensions are + begin-ec, + |-ec, + ||-ec, and +-&&-ec. ++&&-ec. + Concerning generators, it might be useful to have +-:directory running through the=20 +-records of a directory, and maybe a=20 ++:directory running through the ++records of a directory, and maybe a + sophisticated :file-match-generator + could enumerate file record in a directory structure. + Optional variables of the generators could give +@@ -1409,18 +1465,18 @@ convenient access frequent components of the file = records + (e.g. the filename). + Another candidate is :env to run through + the environment associations. +-It is left to other authors and other SRFIs to=20 ++It is left to other authors and other SRFIs to + define a useful set of comprehensions and generators + for Scsh. ++

      +=20 ++

      Design Rationale

      +=20 +-

      Design Rationale

      +- +-

      What is the difference between eager and lazy comprehensions?

      +- +-A lazy comprehension, for example stream-of in the=20 ++

      What is the difference between eager and lazy comprehensions?

      ++

      ++A lazy comprehension, for example stream-of in the + sense of [SRFI 40], constructs an object +-representing a sequence of values.=20 ++representing a sequence of values. + Only at the time these values are needed that they + are actually produced. + An eager comprehension, on the other hand, is an instruction to +@@ -1429,167 +1485,187 @@ for example as in do-ec= . + In other words, it is nothing more sophisticated than a loop, + potentially with a more convenient notation. + This also explains why stream-of is the most +-fundamental lazy comprehension, and all others can ++fundamental lazy comprehension, and all others can + be formulated in terms of it, whereas the most fundamental +-eager comprehension is do-ec. +- +- +-

      Why the [outer .. inner | expr]=20 +-order of qualifiers?

      ++eager comprehension is do-ec. ++

      +=20 ++

      Why the [outer .. inner | expr] ++order of qualifiers?

      ++

      + In principle, there are six possible orders in which the + qualifiers and the expression of a comprehension can be written. + We denote the different conventions with a pattern in which +-expr denotes the expression over which the comprehension +-ranges, inner denotes the generator spinning fastest, and +-outer denotes the generator spinning slowest. +-For example, [Haskell] and=20 ++expr denotes the expression over which the comprehension ++ranges, inner denotes the generator spinning fastest, and ++outer denotes the generator spinning slowest. ++For example, [Haskell] and + [Python] use +-[expr | outer .. inner]. ++[expr | outer .. inner]. + (Probably with sufficient persistence, instances for any + of the conventions can be found on the Internet.) +-In addition, there is the common mathematical notation=20 +-'{f(x) | x in X}'.

      +- ++In addition, there is the common mathematical notation ++'{f(x) | x in X}'. ++

      ++

      + It is important to understand that the notational convention + does not only determine the order of enumeration but also the + scope of the variables introduced by the generators. +-The scope of inner includes expr, and the +-scope of outer should include inner to allow ++The scope of inner includes expr, and the ++scope of outer should include inner to allow + inner generates depending on outer generators. + Eventually, the choice for a particular syntactic convention is + largely a matter of personal preferences. + However, there are a few considerations that went into the +-choice made for this SRFI:

      +- +-1. The mathematical notation is universally known and widely used. +-However, the mathematical notation denotes a set comprehension ++choice made for this SRFI: ++

      ++
        ++
      1. ++

        ++The mathematical notation is universally known and widely used. ++However, the mathematical notation denotes a set comprehension + in which the order of the qualifiers is either irrelevant or must + be deduced from the context. +-For the purpose of eager comprehensions as a programming language=20 ++For the purpose of eager comprehensions as a programming language + construct, the order does matter and a simple convention is a plus. + For these reasons, the mathematical notation as such is undesirable, + but its widespread use is in favor of +-[expr | inner .. outer] and +-[expr | outer .. inner].

        +- +-2. It is desirable to have the scope of the variables increase ++[expr | inner .. outer] and ++[expr | outer .. inner]. ++

        ++
      2. ++
      3. ++

        ++It is desirable to have the scope of the variables increase + into one direction, as in +-[expr | inner .. outer] and +-[outer .. inner | expr], and ++[expr | inner .. outer] and ++[outer .. inner | expr], and + not change direction, as in +-[expr | outer .. inner] +-where expr is in the scope of inner +-but outer is not. ++[expr | outer .. inner] ++where expr is in the scope of inner ++but outer is not. + This is even more important if the syntax in Scheme +-does not explicitly contain the '|'-separator.

        +- +-3. More complicated comprehensions with several nested generators ++does not explicitly contain the '|'-separator. ++

        ++
      4. ++
      5. ++

        ++More complicated comprehensions with several nested generators + eventually look like nested loops and Scheme always +-introduces them outer .. inner as in=20 ++introduces them outer .. inner as in + do and named-let. +-This is in favor of=20 +-[expr | outer .. inner] and +-[outer .. inner | expr]. ++This is in favor of ++[expr | outer .. inner] and ++[outer .. inner | expr]. + Shorter comprehension may look more naturally the +-other way around.

        +- +-Regarding these contradicting preferences, I regard=20 +-linearity in scoping (2.) most important, followed by=20 ++other way around. ++

        ++
      6. ++
      ++

      ++Regarding these contradicting preferences, I regard ++linearity in scoping (2.) most important, followed by + readability for more complicated comprehensions (3.). +-This leads to [outer .. inner | expr]. ++This leads to [outer .. inner | expr]. + An example in Scheme-syntax is + (list-ec (: x 10) (: y x) (f x y)), + which looks acceptable to me even without similarity + to the mathematical notation. + As a downside, the convention clashes with other the + convention used in other languages (e.g. Haskell and Python). ++

      +=20 +- +-

      You forgot [choose your favorite here]-ec!

      +- ++

      You forgot [choose your favorite here]-ec!

      ++

      + I tried to construct a reasonably useful set of tools + according to what [R5RS] specifies. + Nevertheless, is the choice what to include and what to +-leave out eventually a matter of personal preference.

      +- ++leave out eventually a matter of personal preference.

      ++

      ++

      + When 'packing the toolbox' I went for travelling light; + this SRFI does not include everything imaginable + or even everything useful. +-I oriented myself at the standard procedures=20 ++I oriented myself at the standard procedures + of [R5RS], + with a few omissions and additions. +-A notable omission are gcd-ec and=20 ++A notable omission are gcd-ec and + lcm-ec because they are one-liners, + and more severely, of questionable value in practice. + A notable addition are + fold-ec and + fold3-ec, + providing a mechanism to define lots of useful one-liners. +-The other notable addition is=20 ++The other notable addition is + first-ec, which + is the fundamental 'early stopping' comprehension. +-It is used to define=20 +-any?-ec and +-every?-ec +-which are among the most frequent comprehensions.

      +- ++It is used to define ++any?-ec and ++every?-ec ++which are among the most frequent comprehensions. ++

      ++

      + Concerning the generators, the same principle has been used. +-Additions include :range +-and friends because they are universally needed, and=20 +-:dispatched which is +-primarily intended for implementing :. +- +- +-

      Why is the order of enumeration specified? ++Additions include :range ++and friends because they are universally needed, and ++:dispatched which is ++primarily intended for implementing :. ++

      +=20 ++

      Why is the order of enumeration specified?

      ++

      + For the purpose of this SRFI, every generator runs through +-its sequence of bindings in a well specified order, and nested=20 +-generators run through the Cartesian product in the order=20 ++its sequence of bindings in a well specified order, and nested ++generators run through the Cartesian product in the order + of nested loops. +-The purpose of this definition is making the sequence as=20 ++The purpose of this definition is making the sequence as + easily predictable as possible. +- +-On the other hand, many mechanisms for lazy comprehensions ++

      ++

      ++On the other hand, many mechanisms for lazy comprehensions + do not specify the order in which the elements are enumerated. +-When it comes to infinite streams, this has the great advantage=20 +-that a comprehension may interleave an inner and an outer=20 ++When it comes to infinite streams, this has the great advantage ++that a comprehension may interleave an inner and an outer + enumeration, a method also known as 'dove-tailing' or 'diagonalizing'. +-Interleaving ensures that any value of the resulting stream is=20 +-produced after a finite amount of time, even if one or more=20 ++Interleaving ensures that any value of the resulting stream is ++produced after a finite amount of time, even if one or more + inner streams are infinite. ++

      +=20 +-

      Why both typed and dispatching generators?

      +- ++

      Why both typed and dispatching generators?

      ++

      + The reason for typed generators is runtime efficiency. + In fact, the code produced by :range and others + will run as fast as a hand-coded do-loop. + The primary purpose of the dispatching generator is convenience. + It comes at the price of reduced runtime performance, + both for loop iteration and startup. ++

      +=20 +-

      Why the something-ec and :type naming?

      +- +-The purpose of the :type convention is to keep=20 ++

      Why the something-ec and :type naming?

      ++

      ++The purpose of the :type convention is to keep + many common comprehensions down to one-liners. + In my opinion, the fundamental nature of eager comprehensions + justifies a single character naming convention. +-The something-ec convention is primarily intended to +-stay away from the widely used something-of. ++The something-ec convention is primarily intended to ++stay away from the widely used something-of. + It reduces confusion and conflict with related mechanisms. ++

      +=20 +-

      Why combine variable binding and sequence definition?

      +- ++

      Why combine variable binding and sequence definition?

      ++

      + The generators of this SRFI do two different things with + a single syntactic construct: They define a sequence of values + to enumerate and they specify a variable (within a certain + scope) to run through that sequence. +-An alternative is to separate the two, for example as it=20 +-has been done in=20 +-SRFI 40.

      +- ++An alternative is to separate the two, for example as it ++has been done in ++SRFI 40. ++

      ++

      + The reason for combining sequence definition and enumeration +-for the purpose of this SRFI is threefold.=20 ++for the purpose of this SRFI is threefold. + Firstly, sequences of values are not explicitly represented as + objects in the typed generators; the generators merely + manipulate an internal state. +@@ -1598,115 +1674,125 @@ common comprehensions and reduces syntax to the = naked minimum. + Thirdly, this SRFI aims at the highest possible performance for + typed generators, which is achieved if the state being manipulated + is represented by the loop variable itself. ++

      +=20 +-

      Why is (: <vars>) illegal?

      +- +-It is reasonable and easy to define (: <vars&= gt;)=20 +-as (:integers <vars>),=20 ++

      Why is (: <vars>) illegal?

      ++

      ++It is reasonable and easy to define (: <var= s>) ++as (:integers <vars>), + enumerating the non-negative integers. + However, it turned out that a frequent mistake in using the + eager comprehensions is to forget either the variable + or an argument for the enumeration. +-As this would lead to an infinite loop (not always=20 ++As this would lead to an infinite loop (not always + equally pleasant in interactive sessions), it is not allowed. ++

      +=20 +-

      Why is there no :sequential?

      +- +-Just like :parallel=20 ++

      Why is there no :sequential?

      ++

      ++Just like :parallel + enumerates generators in + parallel, a :sequential generator could +-enumerate a concatenation of several generator, starting=20 ++enumerate a concatenation of several generator, starting + the next one when the previous has finished. + The reason for not having such a qualifier is + that the generators should use all the same variable name + and there is no hygienic and referentially transparent + way of enforcing this (or even knowing the variable). ++

      +=20 +-

      Why is there no general let-qualifier?

      +- +-It is easy to add let, let*,=20 ++

      Why is there no general let-qualifier?

      ++

      ++It is easy to add let, let*, + and letrec as cases to <qualifier>. +-This would allow more sophisticated local variables=20 +-and expressions than possible with=20 +-(:let <vars> <expression>)= and ++This would allow more sophisticated local variables ++and expressions than possible with ++(:let <vars> <expression>) and + (begin <sequence>*). + In particular, a local <definition> + in the sense of [R5RS, 7.1.5.] would +-be possible.

      +- +-There are two reasons for not including let=20 ++be possible. ++

      ++

      ++There are two reasons for not including let + and friends as qualifiers. + The first reason concerns readability. +-A qualifier of the form=20 ++A qualifier of the form + (let (<binding spec>*) <body>) +-only makes sense if the scope of the new variables ends at the=20 +-end of the comprehension, and not already ++only makes sense if the scope of the new variables ends at the ++end of the comprehension, and not already + after <body>. +-The similarity with ordinary let-expressions=20 ++The similarity with ordinary let-expressions + would be very confusing. + The second reason concerns the design rationale. + If sophisticated let-qualifiers involving +-recursion or local definitions are needed, it is likely=20 ++recursion or local definitions are needed, it is likely + that eager comprehensions are being overused. + In that case it might be better to define a procedure + for the task. + So including an invitation to overuse the mechanism would +-be a serious violation of the=20 +-Keep It Simple and Stupid principle. +- +-

      Why is there no :nested generator?

      ++be a serious violation of the ++Keep It Simple and Stupid principle. ++

      +=20 ++

      Why is there no :nested generator?

      ++

      + The specification above defines nested +-as a qualifier but :parallel=20 ++as a qualifier but :parallel + as a generator. + In particular, this makes it impossible to make parallel +-generators from nested ones.

      +- ++generators from nested ones. ++

      ++

      + This design simply reflects an implementability limitation. + All component generators of :parallel are +-transformed into :do-generators +-and these can be merged into a parallel generator.=20 ++transformed into :do-generators ++and these can be merged into a parallel generator. + However, nested generators cannot be merged easily without +-losing the type of the generator,=20 ++losing the type of the generator, + which would seriously hurt modularity and performance. ++

      +=20 +-

      Is any?-ec eager?

      +- +-Yes, it is still eager because it immediately starts to=20 +-run through the sequence.

      +- +-In fact, the reference implementation makes sure=20 ++

      Is any?-ec eager?

      ++

      ++Yes, it is still eager because it immediately starts to ++run through the sequence. ++

      ++

      ++In fact, the reference implementation makes sure + first-ec, +-any?-ec, and +-every?-ec +-execute efficiently so they can be used conveniently=20 +-as in=20 ++any?-ec, and ++every?-ec ++execute efficiently so they can be used conveniently ++as in + (every?-ec (:list x my-list) (pred? x)). ++

      +=20 +-

      Why this whole :dispatched business?

      +- +-It is specified above that the dispatching generator, +-called :, is just a special case +-of :dispatched using=20 ++

      Why this whole :dispatched business?

      ++

      ++It is specified above that the dispatching generator, ++called :, is just a special case ++of :dispatched using + a global dispatching procedure. + Alternatively, a simple fixed global mechanism to extend +-: could have been used. ++: could have been used. + This is much simpler but does not support the definition +-of new dispatched generators.

      +- +-The purpose of :dispatched ++of new dispatched generators. ++

      ++

      ++The purpose of :dispatched + and its utilities +-(:generator-proc and ++(:generator-proc and + dispatch-union) + is the following. +-Assume : is to be used inside a ++Assume : is to be used inside a + module but it is essential that no other module can spoil it, + e.g. by installing a very slow dispatcher. + The recommended way to proceed in this case is to define a +-local copy of the original dispatching generator=20 +-:, ++local copy of the original dispatching generator ++:, + for example with the following code +- ++

      +
      + (define :my-dispatch
      +   (make-initial-:-dispatch) )
      +@@ -1717,33 +1803,36 @@ for example with the following code
      +      (:dispatched cc var (index i) :my-dispatch arg1 arg ...) )
      +     ((:my cc var arg1 arg ...)
      +      (:dispatched cc var :my-dispatch arg1 arg ...) ))),
      +- ++

      + and to use the new generator :my instead of +-:.

      +- ++:. ++

      ++

      + An alternative for the dispatching mechanism as defined in + this SRFI is the use of parameter objects in the sense of +-[SRFI 39].=20 ++[SRFI 39]. + The dispatching generator would then access a dynamically + scoped variable to find the dispatcher, allowing full + control over dispatching. + However, this approach does not solve the dilemma that it is +-sometimes useful that : is global ++sometimes useful that : is global + and sometimes undesired. + The approach specified for this SRFI addresses this dilemma +-by offering options.

      +- ++by offering options. ++

      ++

      + Another alternative for dealing with the dispatching + problem is adding an optional argument to the syntax of +-: through which the dispatcher ++: through which the dispatcher + can be passed explicitly. +-However, as : has variable ++However, as : has variable + arity and the identifier for the variable cannot be +-distinguished from any value for a dispatcher,=20 ++distinguished from any value for a dispatcher, + this is syntactically problematic. ++

      +=20 +-

      Why is there no local mechanism for adding to :<= /code>?

      +- ++

      Why is there no local mechanism for adding to = :?

      ++

      + According to [R5RS, 7.1.6.] macros can only + be defined at the level of the <program> syntax. + This implies that the scope of typed generators cannot easily be +@@ -1751,17 +1840,19 @@ limited to local scopes. + As typed and dispatched generators go together, + there is also no strong need for a limited scope + of dispatched generators either. +-Furthermore, locally extendable dispatchers are another major=20 ++Furthermore, locally extendable dispatchers are another major + headache to those trying to understand other people's code. ++

      +=20 +-

      Why are dispatchers unary?

      +- +-As defined in :dispatched, ++

      Why are dispatchers unary?

      ++

      ++As defined in :dispatched, + a dispatching procedure is called with a single argument being +-the list of values to dispatch on.=20 ++the list of values to dispatch on. + An alternative is to apply the dispatcher to the +-list of values to dispatch on, which would be more natural in Scheme.

      +- ++list of values to dispatch on, which would be more natural in Scheme. ++

      ++

      + The reason for not using apply is a minor + improvement in efficiency. + Every time apply is used on a procedure of variable +@@ -1769,55 +1860,61 @@ arity, an object containing the argument list is a= llocated on + the heap. + As a dispatcher may call many other dispatchers, this will adds + to the overhead of dispatching, which is relevant in inner loops. ++

      +=20 +-

      Why are there two fold comprehensions?

      +- +-The reason for having two fold comprehensions=20 ++

      Why are there two fold comprehensions?

      ++

      ++The reason for having two fold comprehensions + (fold-ec and +-fold3-ec) is efficiency.

      +- +-Clearly, the more general construction is=20 +-fold3-ec=20 ++fold3-ec) is efficiency. ++

      ++

      ++Clearly, the more general construction is ++fold3-ec + as it allows individual treatment of the empty + sequence case and the singleton sequence case. + However, this comes at the price of more book-keeping +-as can be seen from the=20 ++as can be seen from the + implementation example. + As the overhead is located within inner loops, + it makes sense to define another fold comprehension + for the case where the added flexibility is not needed. +-This is fold-ec.

      +- ++This is fold-ec. ++

      ++

      + The names fold-ec and fold3-ec + have been chosen for the comprehensions in order to stay + clear any other 'fold' that may be around. ++

      +=20 +-

      Why is :char-range not defined by integer->char?

      +- +-The definition of :char-range ++

      Why is :char-range not defined by integer->char= ?

      ++

      ++The definition of :char-range + specifies a sequence of adjacent characters ordered by char<=3D?= . +-The reason for not using char->integer and=20 +-integer->char is the fact that ++The reason for not using char->integer and ++integer->char is the fact that + [R5RS, 6.3.4.] leaves it to the implementation + whether the integers representing characters are consecutive or not. + In effect, this underspecification is inherited by :char-range. ++

      +=20 +- +-

      Related Work and Acknowledgements

      +- ++

      Related Work and Acknowledgements

      ++

      + Several other proposals related to the mechanism specified here exists. +-The following mechanisms are made for and in Scheme (or at least a=20 +-specific dialect thereof):

      +- ++The following mechanisms are made for and in Scheme (or at least a ++specific dialect thereof): ++

      ++

      + First of all, the report [R5RS] of Scheme itself +-defines two constructs for writing loops: do and=20 ++defines two constructs for writing loops: do and + named-let. +-Both constructs express a single loop (not nested),=20 ++Both constructs express a single loop (not nested), + possibly with several variables running in parallel, +-based on explicit manipulation of the state variables.=20 ++based on explicit manipulation of the state variables. + For example (do ((x 0 (+ x 1))) ((=3D x 10)) (display x)) +-explicitly mentions how to obtain the next binding of x.

      +- ++explicitly mentions how to obtain the next binding of x. ++

      ++

      + Richard Kelsey's "Macros for writing loops", [MWL] + are an extension to Scheme48 to simplify the formulation of loops. + The basic idea is to stick with a do-like syntax for +@@ -1826,9 +1923,9 @@ a state variable explicitly. + For example, (list* x '(1 2 3)) expresses an enumeration + of the variable x through the list (1 2 3) + without explicit state manipulation. +-The iteration constructs of [MWL], named=20 ++The iteration constructs of [MWL], named + iterate and reduce, +-express a single (not nested) loop (iterate) or=20 ++express a single (not nested) loop (iterate) or + comprehension (reduce) with any number of + parallel enumerations. + A most important feature of the [MWL]-concept +@@ -1837,10 +1934,11 @@ In effect, the addition of a new sequence type doe= s not + require a modification of the existing macros. + This is achieved by carefully limiting the expressive + power of the loop constructs and by using the macros +-in Continuation Passing Style to call other macros. +-The [MWL]-concept, and its implementation,=20 +-were most influential for this SRFI.

      +- ++in Continuation Passing Style to call other macros. ++The [MWL]-concept, and its implementation, ++were most influential for this SRFI. ++

      ++

      + Another related mechanism is the library of streams recently + submitted by Phil L. Bewig as [SRFI 40]. + The library contains a data type to represent even +@@ -1856,35 +1954,36 @@ Nevertheless, modularity is high since it is easy = to define + a procedure producing a stream object and this can be + used for enumeration. + The order of enumeration is left unspecified to allow +-interleaving of generators (also refer to=20 ++interleaving of generators (also refer to + above.) + Before Phil submitted his SRFIs, we had a short + discussion in which we clarified the semantic and syntactic + differences of our approaches. +-It turned out that the mechanisms are sufficiently=20 ++It turned out that the mechanisms are sufficiently + different not to unify them. + The most important difference is the design rationale: + Phil created his library to support the stream-paradigm +-in Scheme, inspired by the work done for Haskell and=20 ++in Scheme, inspired by the work done for Haskell and + other lazy languages, and intrigued by the beauty + of programming with infinite streams. +-My work only aims at a convenient way of expressing=20 ++My work only aims at a convenient way of expressing + frequent patterns of loops in a compact way. + For what it is worth, section SRFI40-ec + contains a suggestion for extending the eager comprehension +-mechanism for SRFI40-streams.

      +- ++mechanism for SRFI40-streams. ++

      ++

      + Phil's work on streams and lazy comprehensions in Scheme + triggered Eli Barzilay to implement a library of eager + comprehensions for PLT-Scheme, [Eli]. + The mechanism implemented by Eli is in essence very + similar to the one proposed in this SRFI, and the two + efforts have been independent until recently. +-Syntactically, Eli uses infix operators for generators,=20 +-whereas this SRFI is purely prefix, and Eli uses the=20 +-[expr | outer .. inner] convention ++Syntactically, Eli uses infix operators for generators, ++whereas this SRFI is purely prefix, and Eli uses the ++[expr | outer .. inner] convention + for nesting, whereas this SRFI uses the +-[outer .. inner | expr] ++[outer .. inner | expr] + convention. + Semantically, Eli's mechanism defines more flexible + loops than this SRFI. +@@ -1892,208 +1991,214 @@ Comprehensions are regarded as generalized colle= ction + processes like fold and reduce. + The mechanism in this SRFI is more restricted with respect + to control flow (there is no general while) +-and more extensive with respect to generators and=20 ++and more extensive with respect to generators and + comprehensions. +-Despite the strong conceptual similarity, the design=20 ++Despite the strong conceptual similarity, the design + rationales are different. + This SRFI focuses on portability and modular extension, +-whatever that may cost in terms of expressive power.

      +- +-Finally, I would like to thank Mike Sperber for his=20 ++whatever that may cost in terms of expressive power. ++

      ++

      ++Finally, I would like to thank Mike Sperber for his + encouragement to proceed with the SRFI and for several + discussions of the matter. + In particular, the dispatching mechanism evolved + rapidly during discussions with Mike. ++

      +=20 +- +-

      Implementation

      +- +-The reference implementation focuses on portability,=20 ++

      Implementation

      ++

      ++The reference implementation focuses on portability, + performance, readability and simplicity, roughly in this order. +-It is written in [R5RS]-Scheme=20 ++It is written in [R5RS]-Scheme + (including macros) extended by [SRFI 23] + (error). + The reference implementation was developed + under Scheme48 (0.57), + PLT (202, 204), and +-SCM (5d7).

      +- +-The file ec.scm i= s the source of ++SCM (5d7). ++

      ++

      ++The file ec.scm = is the source of + the reference implementation. + It also contains comments concerning potential problems. +-Implementors might find the file design.scm +-helpful.=20 +-It contains alternative implementations of certain comprehensions=20 ++Implementors might find the file design.scm ++helpful. ++It contains alternative implementations of certain comprehensions + and generators in order to simplify tuning the implementation +-of this SRFI for different Scheme systems.

      +- +-The file exampl= es.scm contains a ++of this SRFI for different Scheme systems. ++

      ++

      ++The file examp= les.scm contains a + collection of examples, and some code checking their results. + The purpose of most examples is detecting implementation errors, + but the section 'Less artificial examples' contains a few +-real-world examples.

      +- +-The file timing.s= cm contains some ++real-world examples. ++

      ++

      ++The file timing.= scm contains some + code to measure an idea of performance of the comprehensions. + A hand-coded do-loop, the typed generator +-(:range n),=20 +-and the dispatching generator=20 +-(: n) ++(:range n), ++and the dispatching generator ++(: n) + are compared. + For each loop we compare the time needed + per iteration and the time needed to construct the loop (the startup dela= y). +-As a rule of thumb, :range is as fast (or slightly faster)=20 +-as a hand-coded do-loop per iteration and needs about a=20 ++As a rule of thumb, :range is as fast (or slightly faster) ++as a hand-coded do-loop per iteration and needs about a + third more time for startup (due to type checking of the argument). + The dispatching generator needs about twice the time per iteration + (due to calling the generator procedure) and needs about five times +-as long for startup (due to dispatching).

      +- +-The file exten= sion.scm contains +-examples for adding new generators and comprehensions.

      ++as long for startup (due to dispatching). ++

      ++

      ++The file exte= nsion.scm contains ++examples for adding new generators and comprehensions. ++

      +=20 +-

      References

      ++

      References

      +=20 +- ++
      +=20 +- +- ++ ++ +=20 +- +- ++ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +=20 +- +- ++ ++h= ttp://srfi.schemers.org/srfi-1/mail-archive/msg00021.html ++ +=20 +- +- ++ ++ +=20 +- +- ++ ++ +=20 +- +- ++ ++ +=20 +- +- ++ ++ +=20 +- +- ++ ++ +=20 +- +- ++ ++ +=20 +- +- ++ ++ +=20 +- +- ++ ++ +=20 +=20 +-
      [R5RS] +-Richard Kelsey, William Clinger, and Jonathan Rees (eds.): ++
      [R5RS] ++Richard Kelsey, William Clinger, and Jonathan Rees (eds.): + Revised(5) Report on the Algorithmic Language Scheme of + 20 February 1998. + Higher-Order and Symbolic Computation, Vol. 11, No. 1, September 1998. + + http://schemers.org/Documents/Standards/R5RS/. +-
      [MWL] +-Richard Kelsey, Jonathan Rees:=20 ++
      [MWL] ++Richard Kelsey, Jonathan Rees: + The Incomplete Scheme48 Reference Manual for Release 0.57 (July 15, 2001). + Section "Macros for writing loops". + http://s48.org/0= .57/manual/s48manual_49.html +-
      [SRFI 1] +-Olin Shivers: List Library. +-http://srfi.schemers.org/srf= i-1/ +-
      [SRFI 23] +-Stephan Houben: Error reporting mechanism +-http://srfi.schemers.org/sr= fi-23/ +-
      [SRFI 25] +-Jussi Piitulainen: Multi-dimensional Array Primitives. +-http://srfi.schemers.org/sr= fi-25/ +-
      [SRFI 27] +-Sebastian Egner: Sources of Random Bits. +-http://srfi.schemers.org/sr= fi-27/ +-
      [SRFI 33] +-Olin Shivers: Integer Bitwise-operation Library. +-http://srfi.schemers.org/sr= fi-33/ +-
      [SRFI 39] +-Marc Feeley: Parameter objects. +-http://srfi.schemers.org/sr= fi-39/ +-
      [SRFI 40] +-Philip L. Bewig: A Library of Streams. +-http://srfi.schemers.org/sr= fi-40/ +-
      [Eli] +-Eli Barzilay: Documentation for "misc.ss". 2002. ++
      [SRFI 1] ++Olin Shivers: List Library. ++http://srfi.schemers.org/srfi-1/ ++
      [SRFI 23] ++Stephan Houben: Error reporting mechanism ++http://srfi.schemers.org/srfi-23/ ++
      [SRFI 25] ++Jussi Piitulainen: Multi-dimensional Array Primitives. ++http://srfi.schemers.org/srfi-25/ ++
      [SRFI 27] ++Sebastian Egner: Sources of Random Bits. ++http://srfi.schemers.org/srfi-27/ ++
      [SRFI 33] ++Olin Shivers: Integer Bitwise-operation Library. ++http://srfi.schemers.org/s= rfi-33/ ++
      [SRFI 39] ++Marc Feeley: Parameter objects. ++http://srfi.schemers.org/srfi-39/ ++
      [SRFI 40] ++Philip L. Bewig: A Library of Streams. ++http://srfi.schemers.org/srfi-40/ ++
      [Eli] ++Eli Barzilay: Documentation for "misc.ss". 2002. + h= ttp://www.cs.cornell.edu/eli/Swindle/misc-doc.html#collect +-
      [Folds] +-John David Stone: Folds and reductions. ++
      [Folds] ++John David Stone: Folds and reductions. + Posting in relation to [SRFI 1] on 8-Jan-1999. +-ht= tp://srfi.schemers.org/srfi-1/mail-archive/msg00021.html +-
      [Haskell] +-Simon L. Peyton Jones, John Hughes: The Haskell 98 Report 1 February = 1999. ++
      [Haskell] ++Simon L. Peyton Jones, John Hughes: The Haskell 98 Report 1 Febr= uary 1999. + Section 3.11 "List Comprehensions". + http:/= /www.haskell.org/onlinereport/exps.html#sect3.11 +-
      [Python] +-Guido van Rossum, Fred L. Drake Jr. (eds.): ++
      [Python] ++Guido van Rossum, Fred L. Drake Jr. (eds.): + Python Reference Manual. + Section 5.2.4 "List displays". + Release 2.2, December 21, 2001. + http://python.org/do= c/2.2/ref/lists.html +-
      [SICP] +-Harold Abelson, Gerald J. Sussman, Julie Sussman: ++
      [SICP] ++Harold Abelson, Gerald J. Sussman, Julie Sussman: + Structure and Interpretation of Computer Programs. + MIT Press, 1985. + http://mitpress.mit.edu/sicp/ +-
      [IFPL] +-Philip Wadler: List Comprehensions (Chapter 7). In: ++
      [IFPL] ++Philip Wadler: List Comprehensions (Chapter 7). In: + Simon L. Peyton Jones: The Implementation of Functional Programming Langu= ages. + Prentice Hall, 1987. +-
      [Scheme48] +-Richard Kelsey, Jonathan Rees: Scheme48 Release 0.57 (July 15, 2001). ++
      [Scheme48] ++Richard Kelsey, Jonathan Rees: Scheme48 Release 0.57 (July 15, 2= 001). + http://s48.org/ +-
      [SCM] +-Aubrey Jaffer: SCM Scheme Implementation. Version 5d7 (November 27, 2= 002). ++
      [SCM] ++Aubrey Jaffer: SCM Scheme Implementation. Version 5d7 (November = 27, 2002). + http://www.swiss= .ai.mit.edu/~jaffer/SCM.html +-
      [PLT] +-PLT People: PLT Scheme, DrScheme Version 203. ++
      [PLT] ++PLT People: PLT Scheme, DrScheme Version 203. + http://www.plt-scheme.org/ +-
      [Scsh] +-Olin Shivers, Brian D. Carlstrom, Martin Gasbichler, Mike Sperber: ++
      [Scsh] ++Olin Shivers, Brian D. Carlstrom, Martin Gasbichler, Mike Sperbe= r: + Scsh Reference Manual. + For scsh release 0.6.3. + http://scsh.net/ +-
      ++ +=20 +=20 +=20 +-

      Copyright

      ++

      Copyright

      +

      Copyright (C) Sebastian Egner (2003). All Rights Reserved.

      +=20 +

      +@@ -2120,12 +2225,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN = THE SOFTWARE. +

      +=20 +=20 +-
      ++
      +
      Author: Sebas= tian Egner
      +-
      Editor: Fr= ancisco Solsona
      ++
      Editor: Francisco Solsona
      + + +-Last modified: Tue Apr 5 10:43:00 CEST 2005 ++Last modified: Sun Jan 28 13:40:34 MET 2007 + +=20 + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-43.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-43.html +index 7ca1cd3..8c12b5a 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-43.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-43.html +@@ -1,34 +1,30 @@ +- +- ++ ++ + ++ ++ + +-SRFI 43: Vector Library +- ++ SRFI 43: Vector Library ++ ++ ++ + +-
      +-

      Title

      +-A Scheme API for test suites +-
      +- +-

      Author

      +-

      Per Bothner +-<per@bothner.com>

      ++ ++ ++ ++ ++

      SRFI 64: A Scheme API for test suites

      +=20 +-

      Status

      +- +-This SRFI is currently in ``final'' status. To see an explanation of each +-status that a SRFI can hold, see +-here. +-It will remain in draft status until 2005/03/17, or as amended. To +-provide input on this SRFI, please +-mailto:srfi minus 64 at srfi dot schemers dot org. +-See instruc= tions +-here to subscribe to the list. You can access previous messages via +-t= he +-archive of the mailing list. +-

      +-

        +-
      • Received: 2005/01/07
      • +-
      • Draft: 2005/01/28 - 2005/03/28
      • +-
      • Revised: 2005/10/18=20=20 +-
      • Revised: 2006/02/24=20=20 +-
      • Final: 2006/06/18
      • ++

        by Per Bothner
        ++<per@bothner.com>

        ++

        This copy of the SRFI 64 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-64/srfi-64.html.

        ++ ++

        Status

        ++ ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-64 @nospamsrfi.schemers.org. To subscribe to the list, follow these instructions. You can access previous = messages via the mailing list archive.

        ++
          ++
        • Received: 2005-01-07
        • ++
        • Draft: 2005-01-28--2005-03-28
        • ++
        • Revised: 2005-10-18=20=20 ++
        • Revised: 2006-02-24=20=20 ++
        • Final: 2006-06-18
        • ++
        • Revised to fix errata: 2016-08-11
        • +
        +-

        +=20 +=20 +-

        Abstract

        ++ ++

        Abstract

        +

        + This defines an API for writing test suites, to make it easy + to portably test Scheme APIs, libraries, applications, and implementation= s. +@@ -52,7 +61,7 @@ in the context of a test-runner. This specif= ications + also supports writing new test-runners, to allow customization + of reporting and processing the result of running test suites.

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 +

        The Scheme community needs a standard for writing test suites. + Every SRFI or other library should come with a test suite. +@@ -91,18 +100,19 @@ as functions or macros or built-ins. The reason for = specifying them as + syntax is to allow specific tests to be skipped without evaluating sub-ex= pressions, or for implementations + to add features such as printing line numbers or catching exceptions.

        +=20 +-

        Specification

        ++

        Specification

        +=20 +

        While this is a moderately complex specification, + you should be able to write simple test suites after just reading the + first few sections below. More advanced functionality, such + as writing a custom test-runner, is at the end of the specification.

        +=20 +-

        Writing basic test suites

        ++

        Writing basic test suites

        +

        Let's start with a simple example. + This is a complete self-contained test-suite.

        +=20 +-
        ;; Initialize and give a name to a simple testsuite.
        ++
        ++;; Initialize and give a name to a simple testsuite.
        + (test-begin "vec-test")
        + (define v (make-vector 5 99))
        + ;; Require that an expression evaluate to true.
        +@@ -132,12 +142,13 @@ tests to be executed using an implementation-specifi=
        ed default test runner,
        + and test-end will cause a summary to be displayed
        + in an implementation-specified manner.

        +=20 +-

        Simple test-cases

        ++

        Simple test-cases

        +

        + Primitive test cases test that a given condition is true. + They may have a name. + The core test case form is test-assert:

        +-
        (test-assert [test-name] expression)
        ++
        ++(test-assert [test-name] expression)
        + 
        +

        + This evaluates the expression. +@@ -156,39 +167,46 @@ if there is no current test runner.

        +

        + The following forms may be more convenient than + using test-assert directly:

        +-
        (test-eqv [test-name] expected tes=
        t-expr)
        ++
        ++(test-eqv [test-name] expected test-exp=
        r)
        + 
        +

        + This is equivalent to:

        +-
        (test-assert [test-name] (eqv? expected t=
        est-expr))
        ++
        ++(test-assert [test-name] (eqv? expected test-e=
        xpr))
        + 
        +

        + Similarly test-equal and test-eq + are shorthand for test-assert combined with + equal? or eq?, respectively:

        +-
        (test-equal [test-name] expected t=
        est-expr)
        ++
        ++(test-equal [test-name] expected test-e=
        xpr)
        + (test-eq [test-name] expected test-expr=
        )
        +

        + Here is a simple example:

        +-
        (define (mean x y) (/ (+ x y) 2.0))
        ++
        ++(define (mean x y) (/ (+ x y) 2.0))
        + (test-eqv 4 (mean 3 5))
        + 
        +

        For testing approximate equality of inexact reals + we can use test-approximate:

        +-
        (test-approximate [test-name] expected test-expr error)
        ++
        ++(test-approximate [test-name] expected test-expr error)
        + 
        +

        + This is equivalent to (except that each argument is only evaluated once):=

        +-
        (test-assert [test-name]
        ++
        ++(test-assert [test-name]
        +   (and (>=3D test-expr (- expected error))
        +        (<=3D test-expr (+ expected error))))
        + 
        +=20 +-

        Tests for catching errors

        ++

        Tests for catching errors

        +

        + We need a way to specify that evaluation should fail. + This verifies that errors are detected when required.

        +-
        (test-error [[test-name] error-type] test-expr)
        ++
        ++(test-error [[test-name] error-type] te=
        st-expr)
        + 
        +

        + Evaluating test-expr is expected to signal an error. +@@ -197,33 +215,36 @@ The kind of error is indicated by error-type.

        + If the error-type is left out, or it is + #t, it means "some kind of unspecified error should be signa= led". + For example:

        +-
        (test-error #t (vector-ref '#(1 2) 9))
        ++
        ++(test-error #t (vector-ref '#(1 2) 9))
        + 
        +

        + This specification leaves it implementation-defined (or for a future + specification) what form test-error may take, + though all implementations must allow #t. + Some implementations may support +-SRFI-35's condi= tions, ++SRFI-35's conditions, + but these are only standardized for=20 +-SRFI-36's I/O c= onditions, which are seldom useful in test suites. ++SRFI-36's I/O = conditions, which are seldom useful in test suites. + An implementation may also allow implementation-specific + exception types. + For example Java-based implementations may allow + the names of Java exception classes:

        +-
        ;; Kawa-specific example
        ++
        ++;; Kawa-specific example
        + (test-error <java.lang.IndexOutOfBoundsException> (vector-ref '#(1 =
        2) 9))
        + 
        +

        + An implementation that cannot catch exceptions should skip + test-error forms.

        +=20 +-

        Testing syntax

        ++

        Testing syntax

        +

        + Testing syntax is tricky, especially if we want to + check that invalid syntax is causes an error. + The following utility function can help:

        +-
        (test-read-eval-string string)
        ++
        ++(test-read-eval-string string)
        + 
        +

        + This function parses string (using read) +@@ -231,16 +252,17 @@ and evaluates the result. + The result of evaluation is returned from test-read-eval-string. + An error is signalled if there are unread characters after the + read is done. +-For example:
        +-(test-read-eval-string "(+ 3 4)") evaluates to = 7.
        +-(test-read-eval-string "(+ 3 4") signals an error.
        ++For example:
        ++(test-read-eval-string "(+ 3 4)") evaluates to = 7.
        ++(test-read-eval-string "(+ 3 4") signals an error. + (test-read-eval-string "(+ 3 4) ") signals an error, + because there is extra junk (i.e. a space) after the + list is read. +

        +

        + The test-read-eval-string used in tests:

        +-
        (test-equal 7 (test-read-eval-string "(+ 3 4)"))
        ++
        ++(test-equal 7 (test-read-eval-string "(+ 3 4)"))
        + (test-error (test-read-eval-string "(+ 3"))
        + (test-equal #\newline (test-read-eval-string "#\\newline"))
        + (test-error (test-read-eval-string "#\\newlin"))
        +@@ -251,7 +273,7 @@ The test-read-eval-string used in tests:<=
        /p>
        + (test-equal '(x z) (test-read-string "(list 'x #;'y 'z)"))
        + 
        +=20 +-

        Test groups and paths

        ++

        Test groups and paths

        +

        A test group is a named sequence of forms containing testca= ses, + expressions, and definitions. + Entering a group sets the test group name; leaving a +@@ -265,7 +287,8 @@ Scheme values, nor are they syntactic forms.

        + A test group may contain nested inner test groups. + The test group path is a list of the currently-active + (entered) test group names, oldest (outermost) first.

        +-
        (test-begin suite-name [count])
        ++
        ++(test-begin suite-name [count])
        + 
        +

        A test-begin enters a new test group. + The suite-name becomes the current test group name, +@@ -286,7 +309,8 @@ get executed because of some unexpected error.

        +

        + Additionally, if there is no currently executing test runner, + one is installed in an implementation-defined manner.

        +-
        (test-end [suite-name])
        ++
        ++(test-end [suite-name])
        + 
        +

        + A test-end leaves the current test group. +@@ -301,11 +325,13 @@ installed a new test-runner, then the test-end= + will de-install it, after reporting the accumulated test + results in an implementation-defined manner.

        +=20 +-
        (test-group suite-name decl-or-expr ...)
        ++
        ++(test-group suite-name decl-or-expr ...)
        + 
        +

        + Equivalent to:

        +-
        (if (not (test-to-skip% suite-name))
        ++
        ++(if (not (test-to-skip% suite-name))
        +   (dynamic-wind
        +     (lambda () (test-begin suite-name))
        +     (lambda () decl-or-expr ...)
        +@@ -316,8 +342,9 @@ within the named test group.  However, the entire grou=
        p is skipped
        + if it matched an active test-skip (see later).
        + Also, the test-end is executed in case of an exception.

        +=20 +-

        Handling set-up and cleanup

        +-
        (test-group-with-cleanup suite-name
        ++

        Handling set-up and cleanup

        ++
        ++(test-group-with-cleanup suite-name
        +   decl-or-expr ...
        +   cleanup-form)
        + 
        +@@ -329,14 +356,16 @@ The latter should be executed even if + one of a decl-or-expr forms raises an exception + (assuming the implementation has a way to catch exceptions).

        +

        For example:

        +-
        (test-group-with-cleanup "test-file"
        +-  (define f (open-output-file "log"))
        +-  (do-a-bunch-of-tests f)
        +-  (close-output-port f))
        ++
        ++(let ((f (open-output-file "log")))
        ++  (test-group-with-cleanup "test-file"
        ++    (do-a-bunch-of-tests f)
        ++    (close-output-port f)))
        + 
        +- ++

        Erratum note: Earlier versions had a non-working example. ++

        + +=20 +-

        Conditonal test-suites and other advanced features

        ++

        Conditonal test-suites and other advanced features

        +

        + The following describes features for controlling which tests to execute, + or specifing that some tests are expected to fail.

        +=20 +-

        Test specifiers

        ++

        Test specifiers

        +

        Sometimes we want to only run certain tests, or we know that + certain tests are expected to fail. + A test specifier is one-argument function that takes a test-ru= nner +@@ -374,16 +403,17 @@ which is coerced to a specifier procedure, as descri= bed below for + count and name.

        +

        + A simple example is:

        +-
        (if some-condition
        ++
        ++(if some-condition
        +   (test-skip 2)) ;; skip next 2 tests
        + 
        +

        +-(test-match-name name)
        ++(test-match-name name)
        + The resulting specifier matches if the current test name (as + returned by test-runner-test-name) is equals? to + name.

        +

        +-(test-match-nth n [count])
        ++(test-match-nth n [count])
        + This evaluates to a stateful predicate: A counter keeps track of + how many times it has been called. + The predicate matches the n'th time it is called +@@ -391,29 +421,30 @@ The predicate matches the n'th time it is= called + the next (- count 1) times, + where count defaults to 1.

        +

        +-(test-match-any specifier ...)
        ++(test-match-any specifier ...)
        + The resulting specifier matches if any specifier + matches. + Each specifier is applied, in order, + so side-effects from a later specifier happen + even if an earlier specifier is true.

        +

        +-(test-match-all specifier ...)
        ++(test-match-all specifier ...)
        + The resulting specifier matches if each specifier + matches. + Each specifier is applied, in order, + so side-effects from a later specifier happen + even if an earlier specifier is false.

        +

        +-count (i.e. an integer)
        ++count (i.e. an integer)
        + Convenience short-hand for: (test-match-nth 1 count).

        +

        +-name (i.e. a string)
        ++name (i.e. a string)
        + Convenience short-hand for (test-match-name name)= .

        +=20 +-

        Skipping selected tests

        ++

        Skipping selected tests

        +

        In some cases you may want to skip a test.

        +-
        (test-skip specifier)
        ++
        ++(test-skip specifier)
        + 
        +

        Evaluating test-skip adds the + resulting specifier +@@ -425,40 +456,44 @@ If any specifier matches, then the test is skipped.<= /p> + For convenience, if the specifier is a string that + is syntactic sugar for (test-match-name specifier). + For example:

        +-
        (test-skip "test-b")
        ++
        ++(test-skip "test-b")
        + (test-assert "test-a")   ;; executed
        + (test-assert "test-b")   ;; skipped
        + 
        +

        + Any skip specifiers introduced by a test-skip + are removed by a following non-nested test-end.

        +-
        (test-begin "group1")
        ++
        ++(test-begin "group1")
        + (test-skip "test-a")
        + (test-assert "test-a")   ;; skipped
        + (test-end "group1")      ;; Undoes the prior test-skip
        + (test-assert "test-a")   ;; executed
        + 
        +=20 +-

        Expected failures

        ++

        Expected failures

        +

        + Sometimes you know a test case will fail, but you don't have time + to or can't fix it. Maybe a certain feature only works on certain platf= orms. + However, you want the test-case to be there + to remind you to fix it. You want to note that=20 + such tests are expected to fail.

        +-
        (test-expect-fail specifier)
        ++
        ++(test-expect-fail specifier)
        + 
        +

        + Matching tests (where matching is defined as in test-skip) + are expected to fail. This only affects test reporting, + not test execution. For example:

        +-
        (test-expect-fail 2)
        ++
        ++(test-expect-fail 2)
        + (test-eqv ...) ;; expected to fail
        + (test-eqv ...) ;; expected to fail
        + (test-eqv ...) ;; expected to pass
        + 
        +=20 +-

        Test-runner

        ++

        Test-runner

        +

        + A test-runner is an object that runs a test-suite, + and manages the state. The test group path, and the sets skip and +@@ -466,39 +501,39 @@ expected-fail specifiers are part of the test-runner. + A test-runner will also typically accumulate statistics about executed te= sts, +

        +

        +-(test-runner? value)
        ++(test-runner? value)
        + True iff value is a test-runner object.

        +

        +-(test-runner-current)
        +-(test-runner-current runner)
        ++(test-runner-current)
        ++(test-runner-current runner)
        + Get or set the current test-runner. + If an implementation supports parameter objects +-(as in SRFI-39<= /a>), ++(as in SRFI-39), + then test-runner-current can be a parameter object. + Alternatively, test-runner-current may be implemented + as a macro or function=20 + that uses a fluid or thread-local variable, or a plain global variable. +

        +-(test-runner-get)
        +-Same as (test-runner-current), buth trows an exception ++(test-runner-get)
        ++Same as (test-runner-current), buth throws an exception + if there is no current test-runner.

        +

        +-(test-runner-simple)
        ++(test-runner-simple)
        + Creates a new simple test-runner, that prints errors and a summary + on the standard output port.

        +

        +-(test-runner-null)
        ++(test-runner-null)
        + Creates a new test-runner, that does nothing with the test results. + This is mainly meant for extending when writing a custom runner.

        +

        + Implementations may provide other test-runners, perhaps + a (test-runner-gui).

        +-

        (test-runner-create)
        ++

        (test-runner-create)
        + Create a new test-runner. Equivalent to + ((test-runner-factory)).

        +

        +-(test-runner-factory)
        +-(test-runner-factory factory)
        ++(test-runner-factory)
        ++(test-runner-factory factory)
        + Get or set the current test-runner factory. + A factory is a zero-argument function that creates a new test-runner. + The default value is test-runner-simple, +@@ -506,9 +541,9 @@ but implementations may provide a way to override the = default. + As with test-runner-current, this may be a parameter object, + or use a per-thread, fluid, or global variable.

        +=20 +-

        Running specific tests with a specified runner

        ++

        Running specific tests with a specified runner

        +

        +-(test-apply [runner] specifier ... procedure)
        ++(test-apply [runner] specifier ... procedure)
        + Calls procedure with no arguments using the specified + runner as the current test-runner. + If runner is omitted, +@@ -521,16 +556,16 @@ if it matches any of the specifiers in the + test-apply and does not match any + active test-skip specifiers.

        +

        +-(test-with-runner runner decl-or-expr = ...)
        ++(test-with-runner runner decl-or-expr = ...)
        + Executes each decl-or-expr in order in a context + where the current test-runner is runner.

        +=20 +-

        Test results

        ++

        Test results

        +

        Running a test sets various status properties in the current test-runn= er. + This can be examined by a custom test-runner, + or (more rarely) in a test-suite.

        +=20 +-

        Result kind

        ++

        Result kind

        +

        Running a test may yield one of the following + status symbols:

        +
        +@@ -541,7 +576,7 @@ status symbols:

        +
        'skip
        The test was skipped.
        +
        +

        +-(test-result-kind [runner])
        ++(test-result-kind [runner])
        + Return one of the above result codes from the most recent tests. + Returns #f if no tests have been run yet. + If we've started on a new test, but don't have a result yet, +@@ -549,13 +584,13 @@ then the result kind is 'xfail is the t= est is expected to fail, + 'skip is the test is supposed to be skipped, + or #f otherwise.

        +

        +-(test-passed? [runner])
        ++(test-passed? [runner])
        + True if the value of (test-result-kind [runner]) + is one of 'pass or 'xpass. + This is a convenient shorthand that might be useful + in a test suite to only run certain tests if the previous test passed.

        +=20 +-

        Test result properties

        ++

        Test result properties

        +

        + A test runner also maintains a set of more detailed result properties<= /q> + associated with the current or most recent test. (I.e. the properties of= the +@@ -564,44 +599,44 @@ Each property has a name (a symbol) and a value (any= value). + Some properties are standard or set by the implementation; + implementations can add more.

        +

        +-(test-result-ref runner 'pname [d= efault])
        ++(test-result-ref runner 'pname [d= efault])
        + Returns the property value associated with the pname property = name. + If there is no value associated with 'pname + return default, + or #f if default isn't specified.

        +

        +-(test-result-set! runner 'pname v= alue)
        ++(test-result-set! runner 'pname v= alue)
        + Sets the property value associated with the pname + property name to value. + Usually implementation code should call this function, but it may be + useful for a custom test-runner to add extra properties.

        +

        +-(test-result-remove runner 'pname)
        ++(test-result-remove runner 'pname)
        + Remove the property with the name 'pname.

        +

        +-(test-result-clear runner)
        ++(test-result-clear runner)
        + Remove all result properties. + The implementation automatically calls test-result-clear + at the start of a test-assert and similar procedures.

        +

        +-(test-result-alist runner)
        ++(test-result-alist runner)
        + Returns an association list of the current result properties. + It is unspecified if the result shares state with the test-runner. + The result should not be modified, on the other hand the result + may be implicitly modified by future test-result-set! or + test-result-remove calls. +-However, A test-result-clear does not modify the returned ++However, a test-result-clear does not modify the returned + alist. Thus you can archive result objects from previous runs.

        +=20 +-

        Standard result properties

        ++

        Standard result properties

        +

        + The set of available result properties is implementation-specific. + However, it is suggested that the following might be provided:

        +
        +
        'result-kind
        +
        The result kind, as defined previously. +-This is the only mandatory result property.
        +-(test-result-kind runner) is equivalent to:
        ++This is the only mandatory result property.
        ++(test-result-kind runner) is equivalent to:
        + (test-result-ref runner 'result-kind) +
        +
        'source-file
        +@@ -622,12 +657,12 @@ specified in a test-error, if it meanin= gful and known. + The actual error value is implementation-defined. +
        +=20 +-

        Writing a new test-runner

        ++

        Writing a new test-runner

        +

        This section specifies how to write a test-runner. + It can be ignored if you just want to write test-cases.

        +=20 +=20 +-

        Call-back functions

        ++

        Call-back functions

        +

        + These call-back functions are methods (in the object-oriented sens= e) + of a test-runner. A method test-runner-on-event +@@ -635,66 +670,66 @@ is called by the implementation when event happens.

        +

        + To define (set) the callback function for event use the follow= ing expression. + (This is normally done when initializing a test-runner.) +-
        ++
        + (test-runner-on-event! runner event-func= tion)

        +

        + An event-function takes a test-runner argument, and possibly o= ther arguments, depending on the event.

        +

        +-To extract (get) the callback function for event do this:
        ++To extract (get) the callback function for event do this:
        + (test-runner-on-event runner)

        +

        + To extract call the callback function for event use the follow= ing expression. +-(This is normally done by the implementation core.)
        ++(This is normally done by the implementation core.)
        + ((test-runner-on-event runner) runner other-args ...)

        +

        + The following call-back hooks are available.

        +

        +-(test-runner-on-test-begin runner)
        +-(test-runner-on-test-begin! runner on-test-b= egin-function)
        +-(on-test-begin-function runner)
        ++(test-runner-on-test-begin runner)
        ++(test-runner-on-test-begin! runner on-test-b= egin-function)
        ++(on-test-begin-function runner)
        + The on-test-begin-function is called at the start of an + individual testcase, before the test expression (and expected value) are + evaluated. +

        +

        +-(test-runner-on-test-end runner)
        +-(test-runner-on-test-end! runner on-test-end= -function)
        +-(on-test-end-function runner)
        ++(test-runner-on-test-end runner)
        ++(test-runner-on-test-end! runner on-test-end= -function)
        ++(on-test-end-function runner)
        + The on-test-end-function is called at the end of an + individual testcase, when the result of the test is available.

        +

        +-(test-runner-on-group-begin runner)
        +-(test-runner-on-group-begin! runner on-group= -begin-function)
        +-(on-group-begin-function runner suite-na= me count)
        ++(test-runner-on-group-begin runner)
        ++(test-runner-on-group-begin! runner on-group= -begin-function)
        ++(on-group-begin-function runner suite-na= me count)
        + The on-group-begin-function is called by a test-begin, + including at the start of a test-group. + The suite-name is a Scheme string, + and count is an integer or #f.

        +

        +-(test-runner-on-group-end runner)
        +-(test-runner-on-group-end! runner on-group-e= nd-function)
        +-(on-group-end-function runner)
        ++(test-runner-on-group-end runner)
        ++(test-runner-on-group-end! runner on-group-e= nd-function)
        ++(on-group-end-function runner)
        + The on-group-end-function is called by a test-end, + including at the end of a test-group.

        +

        +-(test-runner-on-bad-count runner)
        +-(test-runner-on-bad-count! runner on-bad-cou= nt-function)
        +-(on-bad-count-function runner actual-cou= nt expected-count)
        ++(test-runner-on-bad-count runner)
        ++(test-runner-on-bad-count! runner on-bad-cou= nt-function)
        ++(on-bad-count-function runner actual-cou= nt expected-count)
        + Called from test-end (before the on-group-end-function<= /var> + is called) if an expected-count was specified by the matching + test-begin and the expected-count does not match + the actual-count of tests actually executed or skipped.

        +

        +-(test-runner-on-base-end-name runner)
        +-(test-runner-on-bad-end-name! runner on-bad-= end-name-function)
        +-(on-bad-end-name-function runner begin-n= ame end-name)
        ++(test-runner-on-bad-end-name runner)
        ++(test-runner-on-bad-end-name! runner on-bad-= end-name-function)
        ++(on-bad-end-name-function runner begin-n= ame end-name)
        + Called from test-end (before the on-group-end-function<= /var> + is called) if a suite-name was specified, and it did not that = the + name in the matching test-begin.

        +

        +-(test-runner-on-final runner)
        +-(test-runner-on-final! runner on-final-funct= ion)
        +-(on-final-function runner)
        ++(test-runner-on-final runner)
        ++(test-runner-on-final! runner on-final-funct= ion)
        ++(on-final-function runner)
        + The on-final-function takes one parameter (a test-runner) + and typically displays a summary (count) of the tests. + The on-final-function is called after called the +@@ -705,73 +740,74 @@ to the standard output port the number of tests of t= he various kinds. +

        +

        + The default test-runner returned by test-runner-simple +-uses the following call-back functions:
        +-(test-on-test-begin-simple runner)
        +-(test-on-test-end-simple runner)
        +-(test-on-group-begin-simple runner suite-nam= e count)
        +-(test-on-group-end-simple runner)
        +-(test-on-bad-count-simple runner actual-coun= t expected-count)
        +-(test-on-bad-end-name-simple runner begin-na= me end-name)
        +-You can call those if you want to write a your own test-runner.

        ++uses the following call-back functions:
        ++(test-on-test-begin-simple runner)
        ++(test-on-test-end-simple runner)
        ++(test-on-group-begin-simple runner suite-nam= e count)
        ++(test-on-group-end-simple runner)
        ++(test-on-bad-count-simple runner actual-coun= t expected-count)
        ++(test-on-bad-end-name-simple runner begin-na= me end-name)
        ++You can call those if you want to write your own test-runner.

        +=20 +-

        Test-runner components

        ++

        Test-runner components

        +

        + The following functions are for accessing the other components of a test-= runner. + They would normally only be used to write a new test-runner or + a match-predicate.

        +

        +-(test-runner-pass-count runner)
        ++(test-runner-pass-count runner)
        + Returns the number of tests that passed, and were expected to pass.

        +

        +-(test-runner-fail-count runner)
        ++(test-runner-fail-count runner)
        + Returns the number of tests that failed, but were expected to pass.

        +

        +-(test-runner-xpass-count runner)
        ++(test-runner-xpass-count runner)
        + Returns the number of tests that passed, but were expected to fail.

        +

        +-(test-runner-xfail-count runner)
        ++(test-runner-xfail-count runner)
        + Returns the number of tests that failed, and were expected to pass.

        +

        +-(test-runner-skip-count runner)
        ++(test-runner-skip-count runner)
        + Returns the number of tests or test groups that were skipped.

        +

        +-(test-runner-test-name runner)
        ++(test-runner-test-name runner)
        + Returns the name of the current test or test group, as a string. + During execution of test-begin this is the name of the + test group; during the execution of an actual test, this is the name + of the test-case. + If no name was specified, the name is the empty string.

        +

        +-(test-runner-group-path runner)
        ++(test-runner-group-path runner)
        + A list of names of groups we're nested in, with the outermost group first= .

        +

        +-(test-runner-group-stack runner)
        ++(test-runner-group-stack runner)
        + A list of names of groups we're nested in, with the outermost group last. + (This is more efficient than test-runner-group-path, + since it doesn't require any copying.)

        +

        +-(test-runner-aux-value runner)
        +-(test-runner-aux-value! runner on-test= )
        ++(test-runner-aux-value runner)
        ++(test-runner-aux-value! runner on-test= )
        + Get or set the aux-value field of a test-runner. + This field is not used by this API or the test-runner-simple + test-runner, but may be used by custom test-runners to store extra state.=

        +

        +-(test-runner-reset runner)
        ++(test-runner-reset runner)
        + Resets the state of the runner to its initial state. +

        +=20 +-

        Example

        ++

        Example

        +

        This is an example of a simple custom test-runner. + Loading this program before running a test-suite will install + it as the default test runner.

        +-
        (define (my-simple-runner filename)
        ++
        ++(define (my-simple-runner filename)
        +   (let ((runner (test-runner-null))
        + 	(port (open-output-file filename))
        +         (num-passed 0)
        +         (num-failed 0))
        +-    (test-runner-on-test! runner
        +-      (lambda (runner result)
        +-        (case (cdr (assq 'result-kind result))
        ++    (test-runner-on-test-end! runner
        ++      (lambda (runner)
        ++        (case (test-result-kind runner)
        +           ((pass xpass) (set! num-passed (+ num-passed 1)))
        +           ((fail xfail) (set! num-failed (+ num-failed 1)))
        +           (else #t))))
        +@@ -786,31 +822,31 @@ it as the default test runner.

        + (lambda () (my-simple-runner "/tmp/my-test.log"))) +
        +=20 +-

        Implementation

        ++

        Implementation

        +

        + The test implementation uses cond-expand +-(SRFI-0) ++(SRFI-0) + to select different code depending on certain SRFI names (srfi-9, + srfi-34, srfi-35, srfi-39), + or implementations (kawa). + It should otherwise be portable to any R5RS implementation.

        +=20 +-

        testing.scm

        ++

        testing.scm<= /a>

        +=20 +-

        Examples

        +-

        Here is = srfi-25-test.scm, ++

        Examples

        ++

        Here is srfi-25-test.scm, + based converted from Jussi Piitulainen's +-test.scm +-for SRFI-25= .

        ++test.scm ++for SRFI-25.

        +=20 +-

        Test suite

        ++

        Test suite

        +

        + Of course we need a test suite for the testing framework itself. +-This suite srfi-64-test.scm ++This suite srfi-64-test.scm + was contributed by Donovan Kolbly + <donovan@rscheme.org><= /code>.

        +=20 +-

        Copyright

        ++

        Copyright

        +

        + Copyright (C) Per Bothner (2005, 2006)

        +

        +@@ -832,14 +868,14 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR CO= PYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

        +-
        ++
        +
        Author: Per Bothner +
        Editor: Francisco Solsona
        +

        + + +-Last modified: Sun Jan 28 13:40:18 MET 2007 ++Last modified: Thu Mar 31 19:49:52 MST 2011 + +

        +-=20=20 +- ++ ++ +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-66.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-66.html +index 7d8fcb3..c3936b9 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-66.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-66.html +@@ -1,40 +1,243 @@ +- +- +- ++ ++ + +-SRFI 66: Octet Vectors ++ ++ ++ SRFI 66: Octet Vectors ++ ++ ++ + +=20 + +-

        Title

        +- +-Octet Vectors +- +-

        Authors

        +- +-Michael Sperber +- +-

        Status

        +- +-This SRFI is currently in ``final'' status. To see an explanation of each +-status that a SRFI can hold, see +-here. +-To +-provide input on this SRFI, please +-mailto:srfi-66@srfi.schemers= .org. +-See instruc= tions +-here to subscribe to the list. You can access previous messages via +-t= he +-archive of the mailing list. +-

        +-

        +- +-

        Abstract

        This SRFI defines a set of procedures for creating, a= ccessing, and manipulating uniform vectors of octets.

        Rationale

        =

        A number of applications deal with sequences of octets (often called byt= es), most prominently interfaces to C and I/O. Vectors are typically too s= pace-costly and too slow to work well in these circumstance. This justifie= s having a separate type for octet vectors.

        This SRFI is related to <= a href=3D"http://srfi.schemers.org/srfi-4/">SRFI 4 (Homogeneous numeric= vector datatypes), which also provides vectors of octets, and uses names = consistent with it. However, the extension described here does not require = any extensions to the syntax of the underlying Scheme system, and provides = a slightly richer set of primtives.

        Scheme systems implementing both = SRFI 4 and this SRFI should use the same type for u8vector and= octet vectors as specified here.

        Specification

        Octet vectors= are objects of a new type. This type may or may not be disjoint from the = type of regular vectors. Its elements must be octets, that is, exact integ= ers in the range [0,255].

        As with vectors, the length of a octet vect= or is the number of elements it contains. This number is fixed. A valid i= ndex into a octet vector is an exact, non-negative integer. The first ele= ment of a octet vector has index 0, the last element has an index one less= than the length of the vector.

        (u8vector? ob= j)

        Returns #t if obj = is a vector, otherwise returns #f. Analogous to vector?= .

        (make-u8vector k fill)

        Returns a newly allocated octet vector of = k elements. Each element is initialized to fill. Fi= ll must be an octet. Analogous to make-vector.

        =
        (u8vector octet ...)

        Re= turns a newly allocated octet vector whose elements contain the given argu= ments, which must all be octets. Analogous to vector.

        (u8vector->list u8vector)
        =
        (list->u8vector octets)

        u8vector->listreturns a newly allocated list of the ele= ments of u8vector in the same order.Analogous to vector-&g= t;list.

        List->u8vector returns a newl= y allocated octet vector whose elements are the elements of list octet= s, which must all be octets. Analogous to list->vector.

        (u8vector-length u8vector)

        Returns the number of elements in u8vector as an = exact integer. Analogous to vector-length.

        = (u8vector-ref u8vector k)

        k must be a valid index of u8vector. u8vec= tor-ref returns the contents of element k of u8vecto= r. Analogous to vector-ref.

        (u8vector= -set! u8vector k octet)

        k must be a valid index of u8vector. u8vector-set! stores octet in element k of= u8vector. The number of return values and the return values a= re unspecified. However, the number of return values is such that it is a= ccepted by a continuation created by begin. Analogous to vector-set!.

        (u8vector=3D? u8vector-= 1 u8vector-2)

        Returns #t if u8vector-1 and u8vector-2 are equal---that is, i= f they have the same length and equal elements at all valid indices.

        (u8vector-compare u8vector-1 u8vector-2<= /var>)

        Compares u8vector-1 and u8ve= ctor-2 and returns a value consistent with the vector ordering specif= ied in SRFI 67, i.e. -1 i= f u8vector-1 is smaller than u8vector-2, 0 if they ar= e equal, and 1 if u8vector-1 is greater than u8vector-2. Shorter vectors are always smaller than longer ones, and vectors of eq= ual length are compared lexicographically.

        (u8vector-copy= ! source source-start target t= arget-start n)

        Copies data from oc= tet vector source to octet vector target. Sourc= e-start, target-start, and n must be non-negati= ve exact integers that satisfy

        0 <=3D source-start <= =3D source-start + n <=3D (u8vector-length <= var>source)

        0 <=3D target-start <=3D target-start + n <=3D (u8vector-length ta= rget)

        This copies the octets from source at i= ndices [source-start, source-start + n) to= consecutive indices in target starting at target-index.

        This must work even if the memory regions for the source and the = target overlap, i.e., the octets at the target location after the copy must= be equal to the octets at the source location before the copy.

        The n= umber of return values and the return values are unspecified. However, th= e number of return values is such that it is accepted by a continuation cr= eated by begin. Analogous to vector-ref.

        (u8vector-copy u8vector)
        =

        Returns a newly allocated copy of octet vector u8vector.

        <= /dd>

        Reference Implementation

        This reference implementation = makes use of SRFI 9 (Defin= ing Record Types) and SRFI 23= (Error reporting mechanism) .

        (define-record-type :u8vector
        ++

        SRFI 66: Octet Vectors

        ++ ++

        by Michael Sperber

        ++

        This copy of the SRFI 66 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-66/srfi-66.html.

        ++ ++

        Status

        ++ ++

        ++ This SRFI is currently in final status. Here ++ is an explanati= on ++ of each status that a SRFI can hold. To provide input on this SRFI, pl= ease ++ send email ++ to s= rfi-66@nospamsrfi.schemers.org. ++ To subscribe to the list, ++ follow t= hese ++ instructions. You can access previous messages via the mailing ++ list archive. ++

          ++
        • ++ Received: 2005-03-11 ++
        • ++
        • ++ Revised: 2005-04-18 ++
        • ++
        • ++ Revised: 2005-06-06 ++
        • ++
        • ++ Final: 2005-12-15 ++
        • ++
        • ++ Revised to fix errata: ++
            ++
          • ++ 2017-07-17 (Added missing arguments to u8vector-ref.) ++
          • ++
          ++
        • ++
        ++ ++

        Abstract

        ++

        ++ This SRFI defines a set of procedures for creating, accessing, and ++ manipulating uniform vectors of octets. ++

        ++

        Rationale

        ++

        ++ A number of applications deal with sequences of octets (often called by= tes), ++ most prominently interfaces to C and I/O. Vectors are typically too ++ space-costly and too slow to work well in these circumstance. This ++ justifies having a separate type for octet vectors. ++

        ++

        ++ This SRFI is related to SRFI ++ 4 (Homogeneous numeric vector datatypes), which also provides vecto= rs of ++ octets, and uses names consistent with it. However, the extension descr= ibed ++ here does not require any extensions to the syntax of the underlying Sc= heme ++ system, and provides a slightly richer set of primtives. ++

        ++

        ++ Scheme systems implementing both SRFI 4 and this SRFI should use the sa= me ++ type for u8vector and octet vectors as specified here. ++

        ++

        Specification

        ++

        ++ Octet vectors are objects of a new type. This type may or may not be ++ disjoint from the type of regular vectors. Its elements must be octets, ++ that is, exact integers in the range [0,255]. ++

        ++

        ++ As with vectors, the length of a octet vector is the number of elements= it ++ contains. This number is fixed. A valid index into a octet vector is = an ++ exact, non-negative integer. The first element of a octet vector has i= ndex ++ 0, the last element has an index one less than the length of the vector. ++

        ++
        ++
        (u8vector? obj)
        ++
        ++

        ++ Returns #t if obj is an octect vector, otherw= ise ++ returns #f. Analogous to vector?. ++

        ++
        ++
        (make-u8vector k fill)
        ++
        ++

        ++ Returns a newly allocated octet vector of k elements. Each ++ element is initialized to fill. Fill must be an ++ octet. Analogous to make-vector. ++

        ++
        ++
        (u8vector octet ...)
        ++
        ++

        ++ Returns a newly allocated octet vector whose elements contain the giv= en ++ arguments, which must all be octets. Analogous to vector. ++

        ++
        ++
        (u8vector->list u8vector)
        ++
        (list->u8vector octets)
        ++
        ++

        ++ u8vector->listreturns a newly allocated list of the ++ elements of u8vector in the same order.Analogous ++ to vector->list. ++

        ++
        ++
        ++

        ++ List->u8vector returns a newly allocated octet vector ++ whose elements are the elements of list octets, which must= all ++ be octets. Analogous to list->vector. ++

        ++
        ++
        (u8vector-length u8vector)
        ++
        ++

        ++ Returns the number of elements in u8vector as an exact int= eger. ++ Analogous to vector-length. ++

        ++
        ++
        (u8vector-ref u8vector k)
        ++
        ++

        ++ k must be a valid index ++ of u8vector. u8vector-ref returns the conten= ts of ++ element k of u8vector. Analogous ++ to vector-ref. ++

        ++
        ++
        (u8vector-set! u8vector k oct= et)
        ++
        ++

        ++ k must be a valid index ++ of u8vector. u8vector-set! ++ stores octet in element k of u8vector. ++ The number of return values and the return values are unspecified. ++ However, the number of return values is such that it is accepted by a ++ continuation created by begin. Analogous ++ to vector-set!. ++

        ++
        ++
        (u8vector=3D? u8vector-1 u8vector-2)
        ++
        ++

        ++ Returns #t if u8vector-1 and u8vector-2 ++ are equal---that is, if they have the same length and equal elements = at ++ all valid indices. ++

        ++
        ++
        (u8vector-compare u8vector-1 u8vector-2<= /var>)
        ++
        ++

        ++ Compares u8vector-1 and u8vector-2 and returns a ++ value consistent with the vector ordering specified ++ in SRFI 67, i.e. -1 ++ if u8vector-1 is smaller than u8vector-2, 0 if = they ++ are equal, and 1 if u8vector-1 is greater ++ than u8vector-2. Shorter vectors are always smaller than l= onger ++ ones, and vectors of equal length are compared lexicographically. ++

        ++
        ++
        (u8vector-copy! source source-start target target-start n)
        ++
        ++

        ++ Copies data from octet vector source to octet ++ vector target. Source-start, target-start= , ++ and n must be non-negative exact integers that satisfy ++

        ++

        ++ 0 <=3D source-start <=3D source-start ++ + n <=3D (u8vector-length source) ++

        ++

        ++ 0 <=3D target-start <=3D target-start ++ + n <=3D (u8vector-length target) ++

        ++

        ++ This copies the octets from source at indices ++ [source-start, source-start + n) to ++ consecutive indices in target starting ++ at target-index. ++

        ++

        ++ This must work even if the memory regions for the source and the targ= et ++ overlap, i.e., the octets at the target location after the copy must = be ++ equal to the octets at the source location before the copy. ++

        ++

        ++ The number of return values and the return values are unspecified. ++ However, the number of return values is such that it is accepted by a ++ continuation created by begin. Analogous ++ to vector-ref. ++

        ++
        ++
        (u8vector-copy u8vector)
        ++
        ++

        ++ Returns a newly allocated copy of octet vector u8vector. ++

        ++
        ++
        ++

        Reference Implementation

        ++

        ++ This reference implementation makes use ++ of SRFI 9 (Defining Record ++ Types) and SRFI 23 (Error ++ reporting mechanism) . ++

        ++
        (define-record-type :u8vector
        +   (really-make-u8vector elements)
        +   u8vector?
        +   (elements u8vector-elements))
        +@@ -44,7 +247,7 @@ archive of the mailing list.
        + 		(exact? thing)
        + 		(>=3D thing 0)
        + 		(<=3D thing 255)))
        +-      (error "not a octet" thing)))
        ++      (error "not a octet" thing)))
        +=20
        + (define (make-u8vector k fill)
        +   (ensure-octet fill)
        +@@ -94,8 +297,8 @@ archive of the mailing list.
        +     (and (=3D size (u8vector-length u8vector-2))
        + 	 (let loop ((i 0))
        + 	   (or (>=3D i size)
        +-	       (and (=3D (u8vector-ref u8vector-1)
        +-		       (u8vector-ref u8vector-2))
        ++	       (and (=3D (u8vector-ref u8vector-1 i)
        ++		       (u8vector-ref u8vector-2 i))
        + 		    (loop (+ 1 i))))))))
        +=20
        + (define (u8vector-compare u8vector-1 u8vector-2)
        +@@ -113,27 +316,45 @@ archive of the mailing list.
        +                (cond ((< elt-1 elt-2) -1)
        +                      ((> elt-1 elt-2)  1)
        +                      (else (loop (+ i 1)))))))))))
        +-

        References

        • SRFI 4 (Homogeneous numeric vector datatypes)
        • The "By= te Vectors" section of The Incomplete Scheme 48 Reference Manual available from this page.

        Copyright

        +-Copyright (C) Michael Sperber (2005). All Rights Reserved.=20 ++
        ++

        References

        ++
          ++
        • ++ SRFI 4 (Homogeneous ++ numeric vector datatypes) ++
        • ++
        • ++ The "Byte Vectors" section of The Incomplete Scheme 48 ++ Reference Manual available from t= his ++ page. ++
        • ++
        ++

        Copyright

        ++

        ++ Copyright (C) Michael Sperber (2005). All Rights Reserved. ++

        +

        +-Permission is hereby granted, free of charge, to any person obtaining a +-copy of this software and associated documentation files (the "Software"), +-to deal in the Software without restriction, including without limitation +-the rights to use, copy, modify, merge, publish, distribute, sublicense, +-and/or sell copies of the Software, and to permit persons to whom the +-Software is furnished to do so, subject to the following conditions: ++ Permission is hereby granted, free of charge, to any person obtaining a= copy ++ of this software and associated documentation files (the "Software"), to ++ deal in the Software without restriction, including without limitation = the ++ rights to use, copy, modify, merge, publish, distribute, sublicense, an= d/or ++ sell copies of the Software, and to permit persons to whom the Software= is ++ furnished to do so, subject to the following conditions: ++

        +

        +-The above copyright notice and this permission notice shall be included in +-all copies or substantial portions of the Software. ++ The above copyright notice and this permission notice shall be included= in ++ all copies or substantial portions of the Software. ++

        +

        +-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +-DEALINGS IN THE SOFTWARE. +- +-


        +-
        Editor: Da= vid Van Horn
        +- ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR ++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL= THE ++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEA= LINGS ++ IN THE SOFTWARE. ++

        ++
        ++
        Editor: David Van Horn
        ++ ++ +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-69.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-69.html +index 6e4c3bb..3f99b11 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-69.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-69.html +@@ -1,69 +1,81 @@ +- +- ++ ++ + +- SRFI 69: Basic hash tables +- +- +- +- ++ ++ ++ SRFI 69: Basic hash tables ++ ++ ++ ++ ++ ++ + + +=20 +-

        Title

        ++

        SRFI 69: Basic hash tables

        +=20 +-SRFI 69: Basic hash tables ++

        by Panu Kalliokoski

        ++

        This copy of the SRFI 69 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-69/srfi-69.html.

        +=20 +-

        Author

        ++

        Status

        +=20 +-Panu Kalliokoski +- +-

        Status

        +- +-This SRFI is currently in ``final'' status. To see an explanation of each +-status that a SRFI can hold, see +-here. +-It will remain in draft status until 2005/09/09, or as amended. To +-provide input on this SRFI, please +-mailto:srfi-69@srfi.schemers= .org. +-See instruc= tions +-here to subscribe to the list. You can access previous messages via +-t= he +-archive of the mailing list. +-

        ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-69 @nospamsrfi.schemers.org. To subscribe to the list, follow these instructions. You can access previous = messages via the mailing list archive.

        + +=20 +-

        Abstract

        ++

        Abstract

        +=20 +

        This SRFI defines basic hash tables. Hash tables are widely recognised + as a fundamental data structure for a wide variety of applications. A + hash table is a data structure that: +- ++

        +
        1. provides a mapping from some set of keys to some set of values + associated to those keys +-
        2. has no intrinsic order for the (key, value) associations it contains +-
        3. supports in-place modification as the primary means of setting the ++
        4. has no intrinsic order for the (key, value) associations it cont= ains ++
        5. supports in-place modification as the primary means of setting t= he + contents of a hash table +-
        6. provides key lookup and destructive update in amortised constant ++
        7. provides key lookup and destructive update in amortised constant + time, provided that a good hash function is used. +=20 +-

        This SRFI aims to accomplish these goals: +- ++ ++

        This SRFI aims to accomplish these goals: ++

        +
        1. to provide a consistent, generic and widely applicable API for ha= sh + tables +-
        2. to improve code portability by providing a standard hash table ++
        3. to improve code portability by providing a standard hash table + facility with guaranteed behaviour +-
        4. to help the programmer by defining utility routines that account for ++
        5. to help the programmer by defining utility routines that account= for + the most common situations of using hash tables. +=20 +-

        Issues

        ++ ++ ++

        Issues

        +=20 +

        There is no single best way to make hash tables. The tables presented + in this SRFI aim at being both conceptually simple and usable for a wide +@@ -77,7 +89,7 @@ the global environment, and specifically, to provide sup= port for + between implementation-specific environment data types and the hash + table API presented here; however, these issues are left open. +=20 +-

        This SRFI does not conform to the interface of maps presented in SRFI ++

        This SRFI does not conform to the interface of maps presented in S= RFI + 44. Following SRFI 44 would seriously cripple the interface of hash + tables. The naming of the operations for maps in SRFI 44 goes against + common use and is unnatural. However, this SRFI has been written so +@@ -85,15 +97,16 @@ that it does not prevent a SRFI-44 API to has= h tables. An + implementation supporting both SRFI 44 and this SRFI is encouraged to + provide a SRFI 44 interface to hash tables in addition to the one + presented here. ++

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 +

        Hash tables are widely recognised as a fundamental data structure for + many kinds of computational tasks. Thus far, there is no existing + standard for Scheme hash tables; however, almost every non-minimal + Scheme implementation provides some kind of hash table functionality. +=20 +-

        Alas, although somewhat similar, these hash table APIs have many ++

        Alas, although somewhat similar, these hash table APIs have many + differences: some trivial, like the naming of certain functions; some + complex, like revealing different aspects of the internal implementation + to the user; some coarse, like requiring keys to be of some specific +@@ -102,86 +115,89 @@ hash table in advance to get optimal performance. A= s a result, the + existing hash table facilities cannot be used to write portable + programs. +=20 +-

        The primary aim of this SRFI is to establish a standard API for hash ++

        The primary aim of this SRFI is to establish a standard API for ha= sh + tables so that portable programs can be written that make efficient use + of common hash table functionality. The SRFI resolves discrepancies + that exist between the various hash table API's with respect to naming + and semantics of hash table operations. A lot of effort has been put +-into making the API consistent, simple and generic. The SRFI also ++into making the the API consistent, simple and generic. The SRFI also + defines some of the most common utility routines that would otherwise + need to be written and rewritten for various applications. +=20 +-

        Incorporating this SRFI as a standard feature in Scheme implementations ++

        Incorporating this SRFI as a standard feature in Scheme implementa= tions + makes it possible to write efficient and portable programs that use hash + tables. ++

        +=20 +-

        Specification

        ++

        Specification

        +=20 +

        Names defined in this SRFI: +- ++

        +
        Type constructors and predicate
        +-
        make-hash-table, hash-table?, alist->hash-tab= le ++
        make-hash-table, hash-table?, alist->hash-table +=20 +
        Reflective queries
        +-
        hash-table-equivalence-function, <= a href=3D"srfi-69.html#hsht2">hash-table-hash-function ++
        hash-table-equivalence-function, hash-table-hash-function +=20 +
        Dealing with single elements
        +-
        hash-table-ref, hash-table-ref/default, has= h-table-set!, +-hash-table-delete!, hash-table-exists?, +-hash-table-update!, hash-table-update!/default ++
        hash-table-ref, hash-table-= ref/default, hash-table-set!, ++hash-table-delete!, hash-table-= exists?, ++hash-table-update!, hash-table-= update!/default +=20 +
        Dealing with the whole contents
        +-
        hash-table-size, hash-table-keys, hash-t= able-values, +-hash-table-walk, hash-table-fold, hash-table= ->alist, +-hash-table-copy, hash-table-merge! ++
        hash-table-size, hash-tab= le-keys, hash-table-values, ++hash-table-walk, hash-table-f= old, hash-table->alist, ++hash-table-copy, hash-table-m= erge! +=20 +
        Hashing
        +-
        hash, string-hash, string-ci-hash, hash-by-identity ++
        hash, string-hash, string-ci-hash, hash-by-identity +=20 +-

        An implementation that does not provide hash-table-ref, ++ ++

        An implementation that does not provide hash-table-ref, + hash-table-set!, hash-table-delete!, hash-table-upd= ate!, + hash-table-exists?, and hash-table-size in amortised co= nstant + time (when a good hash function is used), or fails to provide good hash + function definitions for hash, string-hash, string-= ci-hash, + and hash-by-identity, does not conform to this SRFI. +=20 +-

        Hash table implementations are allowed to rely on the fact that the ha= sh ++

        Hash table implementations are allowed to rely on the fact that th= e hash + value of a key in hash table does not change. In most cases, modifying + a key in-place after it has been inserted into the hash table will + violate this constraint and thus leads to unspecified behaviour. ++

        +=20 +-

        Type constructors and predicate

        +- +-

        Procedure: make-hash-table [ equal? [ <= var>hash [ args … ]]] +-→ hash-table ++

        Type constructors and predicate

        +=20 ++

        Procedure: make-hash-table [ equal? [ <= var>hash [ args =E2=80=A6 ]]] ++=E2=86=92 hash-table ++

        +

        Create a new hash table with no associations. equal? is a + predicate that should accept two keys and return a boolean telling + whether they denote the same key value; it defaults to equal?. +- ++

        +

        hash is a hash function, and defaults to an appropriate has= h function +-for the given equal? predicate (see section Hashing). However, ++for the given equal? predicate (see section = Hashing). However, + an acceptable default is not guaranteed to be given for any equivalence + predicate coarser than equal?, except for string-ci=3D?= .[1] The function hash must be acceptable for equal?, so if + you use coarser equivalence than equal? other than string-ci= =3D?, + you must always provide the function hash yourself. +-
        [1] An ++
        [1] An + equivalence predicate c1 is coarser than a equivalence predica= te c2 + iff there exist values x and y such that (and (= c1 x y) (not (c2 x +-y))).
        +- ++y)))
        . ++

        +

        Implementations are allowed to use the rest args for + implementation-specific extensions. Be warned, though, that using these + extensions will make your program less portable. +- +-

        Procedure: hash-table? objboolean +- ++

        ++

        Procedure: hash-table? obj =E2=86=92 <= var>boolean ++

        +

        A predicate to test whether a given object obj is a hash ta= ble. The + hash table type should be disjoint from all other types, if possible. +- +-

        Procedure: alist->hash-table alist [= equal? [ hash=20 +-[ args … ]]] → hash-table +- ++

        ++

        Procedure: alist->hash-table alist [= equal? [ hash ++[ args =E2=80=A6 ]]] =E2=86=92 hash-table ++

        +

        Takes an association list alist and creates a hash t= able + hash-table which maps the car of every element in alist to the + cdr of corresponding elements in alist. equal?<= /var>, hash, and +@@ -191,24 +207,26 @@ precedence over later ones. (Note: the choice of us= ing cdr (instead + of cadr) for values tries to strike balance between the two + approaches: using cadr would render this procedure unusable for + cdr alists, but not vice versa.) +- +-

        The rest args are passed to ma= ke-hash-table and can thus be used for ++

        ++

        The rest args are passed to make-hash-tabl= e and can thus be used for + implementation-specific extensions. ++

        +=20 +-

        Reflective queries

        ++

        Reflective queries

        +=20 +

        Procedure: hash-table-equivalence-function = hash-table +- ++

        +

        Returns the equivalence predicate used for keys of hash-table. +- ++

        +

        Procedure: hash-table-hash-function hash-ta= ble +- ++

        +

        Returns the hash function used for keys of hash-table. ++

        +=20 +-

        Dealing with single elements

        +- +-

        Procedure: hash-table-ref hash-table = key [ thunk ] → value ++

        Dealing with single elements

        +=20 ++

        Procedure: hash-table-ref hash-table = key [ thunk ] =E2=86=92 value ++

        +

        This procedure returns the value associated to key in hash-table. + If no value is associated to key and thunk is given, it is called + with no arguments and its value is returned; if thunk is not g= iven, an +@@ -217,28 +235,28 @@ Given a good hash function, this operation should ha= ve an (amortised) + complexity of O(1) with respect to the number of associations in + hash-table. (Note: this rules out implementation by associati= on lists + or fixed-length hash tables.) +- +-

        Procedure: hash-table-ref/default hash-tabl= e key default → ++

        ++

        Procedure: hash-table-ref/default hash-tabl= e key default =E2=86=92 + value +- ++

        +

        Evaluates to the same value as (hash-table-ref hash-table key (lam= bda + () default)).=20=20 + Given a good hash function, this operation should have an (amortised) + complexity of O(1) with respect to the number of associations in + hash-table. (Note: this rules out implementation by associati= on lists + or fixed-length hash tables.) +- +-

        Procedure: hash-table-set! hash-table= key value → undefined +- ++

        ++

        Procedure: hash-table-set! hash-table= key value =E2=86=92 undefined ++

        +

        This procedure sets the value associated to key = in hash-table. + The previous association (if any) is removed.=20=20 + Given a good hash function, this operation should have an (amortised) + complexity of O(1) with respect to the number of associations in + hash-table. (Note: this rules out implementation by associati= on lists + or fixed-length hash tables.) +- +-

        Procedure: hash-table-delete! hash-table key → undefined +- ++

        ++

        Procedure: hash-table-delete! hash-table key =E2=86=92 undefined ++

        +

        This procedure removes any association to key in hash-= table. It is + not an error if no association for that key exists; in this case, + nothing is done.=20=20 +@@ -246,69 +264,70 @@ Given a good hash function, this operation should ha= ve an (amortised) + complexity of O(1) with respect to the number of associations in + hash-table. (Note: this rules out implementation by associati= on lists + or fixed-length hash tables.) +- +-

        Procedure: hash-table-exists? hash-table keyboolean +- ++

        ++

        Procedure: hash-table-exists? hash-table key =E2=86=92 boolean ++

        +

        This predicate tells whether there is any association to key in + hash-table.=20=20 + Given a good hash function, this operation should have an (amortised) + complexity of O(1) with respect to the number of associations in + hash-table. (Note: this rules out implementation by associati= on lists + or fixed-length hash tables.) +- ++

        +

        Procedure: hash-table-update! hash-table key function +-[ thunk ] → undefined +- ++[ thunk ] =E2=86=92 undefined ++

        +

        Semantically equivalent to, but may be implemented more efficiently + than, the following code: ++

        +
        + (hash-table-set! hash-table key
        +                  (function (hash-table-ref hash-table key thunk)))
        + 
        +- +

        Procedure: hash-table-update!/default +-hash-table key function default<= /var> → undefined +- ++hash-table key function default<= /var> =E2=86=92 undefined ++

        +

        Behaves as if it evaluates to (hash-table-update! hash-table key + function (lambda () default)). ++

        +=20 +-

        Dealing with the whole contents

        +- +-

        Procedure: hash-table-size hash-table → integer ++

        Dealing with the whole contents

        +=20 ++

        Procedure: hash-table-size hash-table =E2=86=92 integer ++

        +

        Returns the number of associations in hash-table. This ope= ration + must have a complexity of O(1) with respect to the number of + associations in hash-table. +- +-

        Procedure: hash-table-keys hash-table → list +- ++

        ++

        Procedure: hash-table-keys hash-table =E2=86=92 list ++

        +

        Returns a list of keys in hash-table. The order of the key= s is + unspecified. +- +-

        Procedure: hash-table-values hash-table → list +- ++

        ++

        Procedure: hash-table-values hash-table =E2=86=92 list ++

        +

        Returns a list of values in hash-table. The order of the v= alues is + unspecified, and is not guaranteed to match the order of keys in the +-result of hash-table-keys. +- +-

        Procedure: hash-table-walk hash-table proc → unspecified +- ++result of hash-table-keys. ++

        ++

        Procedure: hash-table-walk hash-table proc =E2=86=92 unspecified ++

        +

        proc should be a function taking two arguments, a key<= /var> and a value. + This procedure calls proc for each association in hash-ta= ble, giving + the key of the association as key and the value of the associa= tion as + value. The results of proc are discarded. The ord= er in which + proc is called for the different associations is unspecified. +- ++

        +

        (Note: in some implementations, there is a procedure called + hash-table-map which does the same as this procedure. However, = in + other implementations, hash-table-map does something else. In no + implementation that I know of, hash-table-map does a real functo= rial + map that lifts an ordinary function to the domain of hash tables. + Because of these reasons, hash-table-map is left outside this SR= FI.) +- ++

        +

        Procedure: hash-table-fold hash-table f init-value +-→ final-value +- ++=E2=86=92 final-value ++

        +

        This procedure calls f for every association in hash-t= able with + three arguments: the key of the association key, the value of = the + association value, and an accumulated value, val. val is +@@ -317,42 +336,44 @@ invocations of f, the return value of the= previous invocation of final-value returned by hash-table-fold is = the return + value of the last invocation of f. The order in which f<= /var> is called + for different associations is unspecified. +- +-

        Procedure: hash-table->alist hash-table= alist +- ++

        ++

        Procedure: hash-table->alist hash-table= =E2=86=92 alist ++

        +

        Returns an association list such that the car of each element= in + alist is a key in hash-table and the corresponding = cdr of each + element in alist is the value associated to the key in ha= sh-table. + The order of the elements is unspecified. +- ++

        +

        The following should always produce a hash table with the same mappings + as a hash table h: ++

        +
        + (alist->hash-table (hash-table->alist h)
        +                         (hash-table-equivalence-function h)
        +                         (hash-table-hash-function h))
        + 
        +=20 +-

        Procedure: hash-table-copy hash-table → hash-table +- ++

        Procedure: hash-table-copy hash-table =E2=86=92 hash-table ++

        +

        Returns a new hash table with the same equivalence predicate, hash + function and mappings as in hash-table. +- +-

        Procedure: hash-table-merge! hash-table1 hash-table2 → ++

        ++

        Procedure: hash-table-merge! hash-table1 hash-table2 =E2=86=92 + hash-table +- ++

        +

        Adds all mappings in hash-table2 into hash-table1 and returns the + resulting hash table. This function may modify hash-table1 + destructively. ++

        +=20 +-

        Hashing

        ++

        Hashing

        +=20 +

        Hashing means the act of taking some value and producing a number from + the value. A hash function is a function that does this. Every + equivalence predicate e has a set of acceptable has= h functions for +-that predicate; a hash function hash is acceptable iff (e = obj1 +-obj2)(=3D (hash obj1) (hash obj2)). +- ++that predicate; a hash funtion hash is acceptable iff (e o= bj1 ++obj2) =E2=86=92 (=3D (hash obj1) (hash obj2)). ++

        +

        A hash function h is good for a equivalence pred= icate e if it + distributes the result numbers (hash values) for non-equal obj= ects (by + e) as uniformly as possible over the numeric range of hash val= ues, +@@ -360,44 +381,45 @@ especially in the case when some (non-equal) objects= resemble each other + by e.g. having common subsequences. This definition is vague but should + be enough to assert that e.g. a constant function is not a good = hash + function. +- +-

        When the definition of make-hash-table above talks about an ++

        ++

        When the definition of make-hash-table above talk= s about an + appropriate hashing function for e, it means a hashing = function that + gives decent performance (for the hashing operation) while being both + acceptable and good for e. This definition, too, is intention= ally + vague. +- +-

        Procedure: hash object [ bound ] → integer +- ++

        ++

        Procedure: hash object [ bound ] =E2=86=92 integer ++

        +

        Produces a hash value for object in the range ( 0, bou= nd (. If + bound is not given, the implementation is free to choose any b= ound, + given that the default bound is greater than the size of any imaginable + hash table in a normal application. (This is so that the implementation + may choose some very big value in fixnum range for the default bound.) + This hash function is acceptable for equal?. +- +-

        Procedure: string-hash string [ = bound ] → integer +- +-

        The same as hash, except that the arg= ument string must be a string. +- +-

        Procedure: string-ci-hash string [ = bound ] → integer +- +-

        The same as string-hash, except tha= t the case of characters in ++

        ++

        Procedure: string-hash string [ = bound ] =E2=86=92 integer ++

        ++

        The same as hash, except that the argument s= tring must be a string. ++

        ++

        Procedure: string-ci-hash string [ = bound ] =E2=86=92 integer ++

        ++

        The same as string-hash, except that the case o= f characters in + string does not affect the hash value produced. +- +-

        Procedure: hash-by-identity object [ <= var>bound ] → integer +- +-

        The same as hash, except that this fu= nction is only guaranteed to be ++

        ++

        Procedure: hash-by-identity object [ <= var>bound ] =E2=86=92 integer ++

        ++

        The same as hash, except that this function is on= ly guaranteed to be + acceptable for eq?. The reason for providing this function is t= hat + it might be implemented significantly more efficiently than hash. + Implementations are encouraged to provide this function as a builtin. ++

        +=20 +-

        Implementation

        ++

        Implementation

        +=20 +

        This implementation relies on SRFI-9 for distinctness of the hash table + type, and on SRFI-23 for error reporting. Otherwise, the implementation + is pure R5RS. +- ++

        +
        +=20
        + (define *default-bound* (- (expt 2 29) 3))
        +@@ -657,10 +679,10 @@ is pure R5RS.
        +=20
        + 
        +=20 +-

        Copyright

        +- +-

        Copyright © Panu Kalliokoski (2005). All Rights Reserved. ++

        Copyright

        +=20 ++

        Copyright =C2=A9 Panu Kalliokoski (2005). All Rights Reserved. ++

        +

        Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + Software), to deal in the Software without restriction, including +@@ -668,20 +690,20 @@ without limitation the rights to use, copy, modify, = merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: +- ++

        +

        The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. +- ++

        +

        THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, E= XPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.=20 +-


        +-
        Editor: Da= vid Van Horn
        ++SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++

        ++
        ++
        Editor: David Van Horn
        + Last modified: Wed Sep 14 09:54:51 EDT 2005 +- + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-7.html b/srfi-doc/srf= i/scribblings/srfi-std/srfi-7.html +index 17cbb0b..056522a 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-7.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-7.html +@@ -1,32 +1,51 @@ +- +- ++ ++ + ++ ++ + SRFI 7: Feature-based program configuration language ++ ++ ++ + + +=20 +-

        Title

        ++

        SRFI 7: Feature-based program configuration language

        +=20 +-SRFI-7: Feature-based program configuration language ++

        by Richard Kelsey

        ++

        This copy of the SRFI 7 specifica= tion document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.sch= emers.org/srfi-7/srfi-7.html.

        +=20 +-

        Author

        ++

        Status

        +=20 +-Richard Kelsey ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-7= @nospamsrfi.schemers.org. To su= bscribe to the list, follow these instructions. You can access previous messages v= ia the mailing list arch= ive.

        ++
          ++
        • Received: 1999-05-12 ++
        • Draft: 1999-05-26--1999-07-26 ++
        • Final: 1999-08-19 ++
        +=20 +-

        Status

        +- +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion via the archive of the mailing list. +-

          +-
        • Received: 1999/05/12 +-
        • Draft: 1999/05/26-1999/07/26 +-
        • Final: 1999/08/19 +-
        +- +-

        Abstract

        ++

        Abstract

        +=20 +

        +-This SRFI describes a configuration language to be used for specifing ++This SRFI describes a configuration language to be used for specifying + the set of Scheme features or extensions required to run a program. + In addition to a list of required features, a program may also contain + Scheme code to be used only when a particular feature or combination of +@@ -38,7 +57,7 @@ The configuration language is entirely distinct from Sch= eme; it is + neither embedded in Scheme nor includes Scheme as a subset. +

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 +

        + The use of a separate configuration language makes it easy for +@@ -48,48 +67,38 @@ macros to determine which features, and thus which mac= ros, are used + in the program. +

        +=20 +-

        See SRFI 0 for a ++

        See SRFI 0 for a + rationale for the need for some kind of configuration control. +

        +=20 +-

        Specification

        +- +- +- +- +- +- +- +- ++

        Specification

        +=20 +-

        Syntax

        ++

        Syntax

        +=20 +-

        +-

        ++
        +  <program> --> (program <program clause>+)
        +=20
        +  <program clause>
        +-   --> (requires <feature identifier>+)
        ++   --> (requires <feature identifier&g=
        t;+)
        +      | (files <filename>*)
        +-     | (code <Scheme expression, definition, or syntax definition>*)
        +-     | (feature-cond <feature-cond clause>+)
        +-     | (feature-cond <feature-cond clause>* (else <program claus=
        e>+))
        ++     | (code <Scheme expression, definition, =
        or syntax definition>*)
        ++     | (feature-cond <feature-cond cl=
        ause>+)
        ++     | (feature-cond <feature-cond clause>* (else=
         <program clause>+))
        +=20
        +  <feature-cond clause>
        +    --> (<feature requirement> <program clause>+)
        +=20
        +  <feature requirement>
        +    --> <feature identifier>
        +-     | (and <feature requirement>*)
        +-     | (or <feature requirement>*)
        +-     | (not <feature requirement>)
        ++     | (and <feature requirement>*)
        ++     | (or <feature requirement>*)
        ++     | (not <feature requirement>)
        +=20
        +  <feature identifier>
        +    --> a symbol which is the name of a SRFI
        + 
        +-

        +=20 +-

        Semantics

        ++

        Semantics

        +

        + The configuration language is distinct from Scheme. Given a set of + available features a <program> can be converted into a +@@ -109,7 +118,7 @@ compiles a program into an executable file. + given below. The ordering of the clauses in a <program> + determines the order of the forms in the resultant Scheme program. +=20 +-

        In processing the REQUIRES and ++

        In processing the REQUIRES and + FEATURE-COND clauses in a <program>, + an implementation should be consistent with some fixed set of present + and absent features. An implementation may analyze a <program&g= t; +@@ -132,14 +141,16 @@ same <program>. +

        The forms in <body> are added to the program.
        +=20 +
        (feature-cond <feature-cond clause>+)
        +-
        The meaning of a FEATURE-COND clause is that of the ++
        ++

        ++ The meaning of a FEATURE-COND clause is that of the + <program-clause>s in the first <feature-cond = clause> whose + <implementation-requirement> is satisfied by the imple= mentation. + If an ELSE clause is present it is used if and only if no pr= eceding + clause is satisfied; a FEATURE-COND with an + ELSE clause is always satisfied. +- +-

        If no clause can be satisified the <program> cannot= be evaluated in ++

        ++

        If no clause can be satisfied the <program> cannot = be evaluated in + the implementation.

        +=20 +

        +@@ -163,10 +174,11 @@ The meaning of the <implementation requirem= ent>s is as follow +=20 + (not x)satisfied if X is no= t satisfied + +- ++

        + +=20 +-

        Implementation

        ++ ++

        Implementation

        +=20 +

        Two implementations are provided here. The first is a + PROCESS-PROGRAM function that converts a +@@ -184,7 +196,6 @@ an (implementation-dependent) method for evaluating th= e forms returned by + PROCESS-PROGRAM. +

        +=20 +-

        +

        + (define (process-program program features)
        +   (call-with-current-continuation
        +@@ -271,17 +282,17 @@ an (implementation-dependent) method for evaluating =
        the forms returned by
        + 			  '()
        + 			  (cons next (label)))))))
        + 	      (read-files (cdr filenames)))))
        +-

        ++
        +=20 +

        + The second implementation is a PROGRAM macro that implements + the configuration language in terms of the COND-EXPAND +-syntax of SRFI 0. ++syntax of SRFI 0. + Note that this implementation requires that LOAD use the cur= rent + evaluation environment. +

        +=20 +-

        ++
        + (define-syntax program
        +   (syntax-rules (requires files code feature-cond)
        +     ((program)
        +@@ -302,11 +313,12 @@ evaluation environment.
        +               more ...)
        +      (begin (cond-expand (requirement (program stuff ...)) ...)
        +             (program more ...)))))
        +-

        +- +-

        Copyright

        ++
        +=20 ++

        Copyright

        ++

        + Copyright (C) Richard Kelsey (1999). All Rights Reserved. ++

        +

        + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -330,8 +342,8 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O= R IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        +-
        Editor: Mi= ke Sperber
        ++
        ++
        Editor: Mike Sperber
        +=20 + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-71.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-71.html +index a22c3d6..f8a75e7 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-71.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-71.html +@@ -1,46 +1,54 @@ +- +- ++ ++ + ++ ++ + SRFI 71: Extended LET-syntax for multiple values ++ ++ ++ + +=20 + +=20 +-

        Title

        ++

        SRFI 71: Extended LET-syntax for multiple values

        +=20 +-Extended LET-syntax for multiple values ++

        by Sebastian Egner

        ++

        This copy of the SRFI 71 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-71/srfi-71.html.

        +=20 +-

        Author

        ++

        Status

        +=20 +-Sebastian Egner +- +-

        +-This SRFI is currently in ``final'' status. To see an explanation of each +-status that a SRFI can hold, see +-here. +-To +-provide input on this SRFI, please +-mailto:srfi-71@srfi.schemers= .org. +-See instruc= tions +-here to subscribe to the list. You can access the discussion via +-t= he +-archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. +-

        +- ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 71@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

        ++ +=20 +=20 +-

        Abstract

        ++

        Abstract

        +=20 ++

        + This SRFI is a proposal for extending let, + let*, and letrec + for receiving multiple values. +@@ -48,16 +56,19 @@ The syntactic extension is fully compatible with the e= xisting syntax. + It is the intention that single-value bindings,=20 + i.e. (let ((var expr)) ...), and + multiple-value binding can be mixed freely and conveniently. ++

        +

        + The most simple form of the new syntax is best explained by an example: +-

        +-

        (define (quo-rem x y)
        ++

        ++
        ++(define (quo-rem x y)
        +   (values (quotient x y) (remainder x y)))
        +=20
        + (define (quo x y)
        +   (let ((q r (quo-rem x y)))
        +     q))
        + 
        ++

        + The procedure quo-rem delivers two values to + its continuation. These values are received as q + and r in the let-expression of the +@@ -65,13 +76,17 @@ procedure quo. + In other words, the syntax of let is extended such + that several variables can be specified---and these variables + receive the values delivered by the expression (quo-rem x y). ++

        +

        + The syntax of let is further extended to cases in which + a rest argument receives the list of all residual values. + Again by example,=20 +-

        (let (((values y1 y2 . y3+) (foo x)))
        ++

        ++
        ++(let (((values y1 y2 . y3+) (foo x)))
        +    body)
        + 
        ++

        + In this example, values is a syntactic keyword=20 + indicating the presence of multiple values to be received, + and y1, y2, and y3+,=20 +@@ -82,6 +97,7 @@ The syntactic keyword values allows receivi= ng + all values as in (let (((values . xs) (foo x))) body). + It also allows receiving no values at all as in=20 + (let (((values) (for-each foo list))) body). ++

        +

        + A common application of binding multiple values is + decomposing data structures into their components. +@@ -90,9 +106,12 @@ The procedure uncons (defined below) + decomposes a pair x into its car and its cdr + and delivers them as two values to its continuation. + Then an extended let can receive these values: +-

        (let ((car-x cdr-x (uncons x)))
        ++

        ++
        ++(let ((car-x cdr-x (uncons x)))
        +   (foo car-x cdr-x))
        + 
        ++

        + Of course, for pairs this method is probably neither faster=20 + nor clearer than using the procedures car + and cdr. +@@ -107,16 +126,19 @@ point already as both quotient and remainder are pro= bably + computed by a common exact division algorithm. + (And often caching is used to avoid executing this + algorithm twice as often as needed.) ++

        +

        + As the last feature of this SRFI, a mechanism is specified + to store multiple values in heap-allocated data structures. +-For this purpose, values->list and values->vector ++For this purpose, values->list and values->vecto= r + construct a list (a vector, resp.) storing all values delivered=20 + by evaluating their argument expression. + Note that these operations cannot be procedures. ++

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 ++

        + My original motivation for writing this SRFI is my unhappiness with + the current state of affairs in Scheme with respect to multiple values. + Multiple values are mandatory in the +@@ -124,6 +146,7 @@ Revised^5 Report on the Algorithmic + Language Scheme (R5RS), + and they are fully available in all major Scheme implementations. + Yet there is often a painful hesitation about using them. ++

        +

        + The reason for this hesitation is that multiple values are + nearly fully integrated into Scheme---but not quite. +@@ -136,6 +159,7 @@ and I understand this SRFI as a minor contribution + "placing the last corner stone". + But first a very brief history of multiple values in Scheme, + as far as relevant for this SRFI. ++

        +

        + R5RS specifies the procedures values + and call-with-values for passing any number of values +@@ -143,6 +167,7 @@ from a producer procedure to a consumer procedure. + This is the only construct in R5RS=20 + dealing with multiple values explicitly, and it is sufficient + to implement anything that can be implemented for multiple values. ++

        +

        + However, as John David Stone observed in SRFI 8, + the mechanism exposes explicitly how multiple values are=20 +@@ -155,6 +180,7 @@ by adding the special form + for receiving several values produced by the expression + in variables specified by <formals> and + using them in the body. ++

        +

        + The major limitation of receive is that it can only=20 + handle a single expression, which means programs dealing with +@@ -173,17 +199,19 @@ to the list of all values delivered by x (as in S + Or is x to deliver a single value to be + bound to v (as in let)? + Refer to the=20 +-di= scussion ++d= iscussion + archive of SRFI 11 for details. + Moreover, let-values suffers from "parenthesis complexity", + despite Scheme programmers are tolerant to braces. ++

        +

        +-Eli Barzilay's Swindle library (for MzScheme) on=20 ++Eli Barzilay's Swindle library (for MzScheme) on= =20 + the other hand redefines let to include multiple-values and internal + procedures: The syntactic keyword values indicates the + presence of multiple values, while additional parentheses (with the + syntax of <formals>) + indicate a lambda-expression as right-hand side. ++

        +

        + This SRFI follows Eli's approach, while keeping the syntax + simple (few parentheses and concepts) and adding tools for +@@ -194,6 +222,7 @@ This is achieved by extending the syntax in two differ= ent + ways (multiple left-hand sides or a syntactic keyword) + and adding operations to convert between (implicitly passed) + values and (first class) data structures. ++

        +

        + Finally, I would like to mention that Oscar Waddell et al. + describe an efficient compilation method for Scheme's=20 +@@ -203,25 +232,30 @@ to as a basis for internal define. + I expect their compilation method (and letrec*) + and this SRFI to be fully compatible with one another, + although I have not checked this claim by way of implementation. ++

        +=20 +-

        Specification

        ++

        Specification

        +=20 +-The syntax of Scheme (R5RS, Sec= tion 7.1.3.) ++

        ++The syntax of Scheme (R5RS, Section 7.1.3.) + is extended by replacing the existing production: +- +-

        <binding spec> --> (<variable> <expression>)
        ++

        ++
        ++<binding spec> --> (<variable> <expression>)
        + 
        +- ++

        + by the three new productions +- +-

        <binding spec> --> ((values <variable>*) <expressi=
        on>)
        ++

        ++
        ++<binding spec> --> ((values <variable>*) <expression>=
        ;)
        + <binding spec> --> ((values <variable>* . <variable>=
        ) <expression>)
        + <binding spec> --> (<variable>+ <expression>)
        + 
        +- ++

        + The form (<variable>+ <expression>) is just + an abbreviation for ((values <variable>+) <expression>)= , + and it includes the original <binding spec> of R5RS. ++

        +

        + The first two forms are evaluated as follows: The variables are bound and + the expression is evaluated according to the enclosing construct +@@ -229,6 +263,7 @@ the expression is evaluated according to the enclosing= construct + However, the expression may deliver any number of values to its continuat= ion,=20 + which stores these values into the variables specified,=20 + possibly allocating a rest list in case of the . <variable> form.=20 ++

        +

        + The number of values delivered by the expression must match the + number of values expected by the binding specification. +@@ -236,12 +271,16 @@ Otherwise an error is raised, as call-with-val= ues would. + This implies in particular, that each binding of a named let involves + exactly one value, because this binding can also be an argument to a + lambda-expression. ++

        +=20 +

        Standard operations

        +=20 ++

        + The following procedures, specified in terms of standard procedures, + are added to the set of standard procedures: +-

        (define (uncons pair)
        ++

        ++
        ++(define (uncons pair)
        +   (values (car pair) (cdr pair)))
        +=20
        + (define (uncons-2 list)
        +@@ -253,20 +292,22 @@ are added to the set of standard procedures:
        + (define (uncons-4 list)
        +   (values (car list) (cadr list) (caddr list) (cadddr list) (cddddr list)=
        ))
        +=20
        +-(define (uncons-cons alist)
        ++(define (uncons-cons alist)
        +   (values (caar alist) (cdar alist) (cdr alist)))
        +=20
        +-(define (unlist list)
        ++(define (unlist list)
        +   (apply values list))
        +=20
        +-(define (unvector vector)
        +-  (apply values (vector->list vector)))
        ++(define (unvector vector)
        ++  (apply values (vector->list vector)))
        + 
        ++

        + These procedures decompose the standard concrete data structures + (pair, list, vector) and deliver the components as values. + It is an error if the argument cannot be decomposed as expected. + Note that the procedures are not necessarily implemented by + the definition given above. ++

        +

        + The preferred way of decomposing a list into the first two elements + and the rest list is (let ((x1 x2 x3+ (uncons-2 x))) body), +@@ -275,33 +316,38 @@ This is not equivalent to + (let (((values x1 x2 . x3+) (unlist x))) body) + because the latter binds x3+ to a newly allocated + copy of (cddr x). ++

        +

        + Finally, the following two macros are added to the standard macros: +- +-

        (values->list   <expression>)
        +-(values->vector <expression>)
        ++

        ++
        ++(values->list   <expression>)
        ++(values->vector <expression>)
        + 
        +- ++

        + These operation receive all values (if any) delivered by their=20 + argument expression and return a newly allocated list (vector, resp.) + of these values.=20 +-Note that values->list is not the same as=20 ++Note that values->list is not the same as=20 + list (the procedure returning the list of its arguments). ++

        +=20 +-

        Design Rationale

        ++

        Design Rationale

        +=20 +

        Which alternatives designs for the syntax were considered?

        +=20 ++

        + This SRFI defines two notations for receiving several values: + Using the keyword values, + or simply listing the variables if there is at least one. + There are several alternatives for this design, + some of which were proposed during the discussion. +-(Refer in particular to msg00000, +-m= sg00001, and +-m= sg00002, +-m= sg00007.) ++(Refer in particular to msg00000, ++= msg00001, and ++= msg00002, ++= msg00007.) + The alternatives considered include: ++

        +
          +
        1. Just listing the variables (no syntactic keyword at all) as in + (let ((x1 x2 expr)) body).
        2. +@@ -316,20 +362,21 @@ rest list as in (let ((x1 x2 (rest x3+) expr))= body). +
        3. Using the <formals> syntax of + R5RS as in + (let (((x1 x2 . x3+) expr)) body). +-
        4. Mimicking <formals> but with ++
        5. Mimicking <formals> but with + one level of parentheses removed as in + (let ((x1 x2 . x3+ expr)) body).
        6. +
        7. As the previous but with additional syntax for=20 +-"no values" and "just a rest", e.g. ++"no values" and "just a rest", e.g. + (let ((! expr)) body) and + (let ((xs . expr)) body). +-
        ++ +

        + The requirements for the design are + compatibility with the existing let, + concise notation for the frequent use cases, + robustness against most common mistakes, and + full flexibility of receiving values. ++

        +

        + For the sake of compatibility, + only modifications of <binding spec> were +@@ -340,9 +387,10 @@ Concerning concise notation, by far the most convenie= nt notation + is listing the variables. + As this notation also covers the existing syntax, it was adopted + as the basis of the extension to be specified. ++

        +

        + The listing the variables notation is limited by the fact that +-the preferred marker for a rest list (".") ++the preferred marker for a rest list (".") + cannot follow an opening parenthesis as in + (let ((. xs expr)) body),=20 + nor that it can be followed by two syntactic elements as in +@@ -350,6 +398,7 @@ nor that it can be followed by two syntactic elements = as in + Lifting these restrictions would require major modifications + in unrelated parts of the Scheme syntax, which is not an + attractive option. ++

        +

        + Another problematic aspect of the listing the variables notation + is the case of no variables at all. +@@ -360,29 +409,34 @@ it seriously harms syntactic robustness: + syntactically correct and could easily be confused with one another. + For this reason, the notation of listing the variables was + restricted to one or more variables. ++

        +

        + This leaves the problem of extending the notation in order to +-cover rest arguments and the "no values"-case. ++cover rest arguments and the "no values"-case. + This can either be done ad hoc, covering the open cases, + or by adding a general notation covering all cases. + In view of readability and uniformity (useful when code gets + processed automatically) the latter approach was chosen. + This has resulted in the design specified in this SRFI. ++

        +=20 +-

        Why is values needed in the "zero values"-case= ?

        ++

        Why is values needed in the "zero values"-case?

        +=20 ++

        + The syntax specified in this SRFI allows zero variables being + bound in a binding specification using the syntax + (let (((values) (for-each foo (bar)))) body). + An alternative is allowing (<expression>) + as a binding specification. +-(Refer to the discussion archive starting at msg00001.) ++(Refer to the discussion archive starting at msg00001.) ++

        +

        + The syntax specified in this SRFI is designed for static + detection of the most frequent types (forgotten parentheses). + For example, writing=20 + (let ((values) (for-each foo (bar))) body) + is not a well-formed let-expression in this SRFI. ++

        +

        + In the alternative syntax, both=20 + (let (((for-each foo (bar)))) body) +@@ -396,29 +450,36 @@ the error will probably manifest itself at the moment + (bar) fails to deliver exactly two values. + Unless it does, in which case the error must manifest itself much=20 + further downstream from the fact that foo never got called.= =20 ++

        +

        + In order to avoid this sort of expensive typos,=20 + the syntax proposed in this SRFI is more verbose + than it needs to be. ++

        +=20 +

        Why not also include a syntax for procedures?

        +=20 ++

        + This SRFI is a proposal for extending the syntax of let + etc. in order to include multiple values. + It is also desirable to extend the syntax of let=20 + for simplifying the definition of local procedures. + (For example, as in Swindle.) + However, this SRFI does not include this feature. ++

        +

        + The reason I have chosen not restrict this SRFI to a syntax + for multiple values is simplicity. ++

        +=20 +

        Why the names unlist etc.?

        +=20 ++

        + An alternative naming convention for the decomposition +-operation unlist is list->values, ++operation unlist is list->values, + which is more symmetric with respect to its +-inverse operation values->list. ++inverse operation values->list. ++

        +

        + This symmetry ends, however, as soon as more complicated + data structures with other operations are involved. +@@ -426,21 +487,25 @@ Then it becomes apparent that the same data structur= e can + support different decomposition operations: + A double-ended queue (deque) for example supports splitting off + the head and splitting of the tail; and neither of these +-operations should be named deque->values. ++operations should be named deque->values. + The un-convention covers this in a natural way. ++

        +

        + Please also refer to the double-ended queue (deque) example +-in examples.scm to see how to ++in examples.sc= m to see how to + use decomposition procedures for dealing with data structures. ++

        +=20 +

        Which decomposition operations are included?

        +=20 ++

        + The particular set of operations specified in this SRFI=20 + for decomposing lists represents a trade-off between limiting + the number of operations and convenience. ++

        +

        + As Al Petrofsky has pointed out during the discussion +-( ++( + msg00018) it is not sufficient to have only=20 + unlist as this will copy the rest list. + For this reason specialized decomposition operations +@@ -448,15 +513,17 @@ for splitting off the first 1, ..., 4 elements are + provided, and a decomposition operation expecting the + first element to be a pair itself. + These appear to be the most common cases. ++

        +=20 +-

        Implementation

        ++

        Implementation

        +=20 ++

        + The reference implementation is written in R5RS=20 + using hygienic macros, only. + It is not possible, however, to portably detect read access to + an uninitialized variable introduced by letrec. + The definition of the actual functionality can be found=20 +-here. ++here. + The implementation defines macros srfi-let/*/rec etc. + in terms of r5rs-let/*/rec. + Implementors may use this to redefine (or even re-implement) +@@ -464,86 +531,93 @@ Implementors may use this to redefine (or even re-im= plement) + while providing implementations of r5rs-let/*/rec. + An efficient method for the latter is given in Fixing Le= trec + by O. Waddell et al. ++

        +

        + R5RS: + For trying out the functionality, a complete implementation under +-R5RS can be found he= re.=20 ++R5RS can be found here.=20 + It defines r5rs-let/*/rec in terms of lambda + and redefines let/*/rec as srfi-let/*/rec. + This may not be the most efficient implementation, because many + Scheme systems handle let etc. specially and do not + reduce it into lambda ++

        +

        + PLT 208: +-The implementation found here +-uses PLT's module system for exporting=20 ++The implementation found here ++uses PLT's module system for exporting + srfi-let/*/rec + under the name of let/*/rec, while defining + r5rs-let/*/rec as a copy of the built-in + let/*/rec. This code should be efficient. ++

        +

        + Examples using the new functionality +-can be found in examples.scm. ++can be found in examples.scm. ++

        +=20 +-

        References

        ++

        References

        +=20 + +=20 + + ++ +=20 + + ++ +=20 + + ++ +=20 + +- ++ +=20 + + ++ +=20 +
        [R5RS] +-Richard Kelsey, William Clinger, and Jonathan Rees (eds.): ++Richard Kelsey, William Clinger, and Jonathan Rees (eds.): + Revised^5 Report on the Algorithmic Language Scheme of + 20 February 1998. + Higher-Order and Symbolic Computation, Vol. 11, No. 1, September 1998. + + http://schemers.org/Documents/Standards/R5RS/. +-
        [SRFI 8] +-John David Stone: Receive: Binding to multiple values. +-http://srfi.schemers.org/srf= i-8/ +-
        John David Stone: Receive: Binding to multiple valu= es. ++http://srfi.schemers.org/srfi-8/ ++
        [SRFI 11] +-Lars T. Hansen: Syntax for receiving multiple values. +-http://srfi.schemers.org/sr= fi-11/ +-
        Lars T. Hansen: Syntax for receiving multiple values. ++http://srfi.schemers.org/srfi-11/ ++
        [Swindle] +-Eli Barzilay: Swindle, documentation for "base.ss" (Swindle Version 2= 0040908.) ++[Swindle] ++Eli Barzilay: Swindle, documentation for "base.ss" (Swindle Vers= ion 20040908.) + http:= //www.cs.cornell.edu/eli/Swindle/base-doc.html#let +-
        [Fix] +-O. Waddell, D. Sarkar, R. K. Dybvig: ++O. Waddell, D. Sarkar, R. K. Dybvig: + Fixing Letrec: A Faithful Yet Efficient Implementation of Scheme's + Recursive Binding Construct. To appear, 2005. + http://= www.cs.indiana.edu/~dyb/pubs/fixing-letrec.pdf +-
        +=20 +=20 +-

        Copyright

        ++

        Copyright

        ++

        + Copyright (c) 2005 Sebastian Egner. ++

        +

        + Permission is hereby granted, free of charge, to any person obtaining a c= opy of this software and associated documentation files (the ``Software''),= to deal in the Software without restriction, including without limitation = the rights to use, copy, modify, merge, publish, distribute, sublicense, an= d/or sell copies of the Software, and to permit persons to whom the Softwar= e is furnished to do so, subject to the following conditions: ++

        +

        + The above copyright notice and this permission notice shall be included i= n all copies or substantial portions of the Software. ++

        +

        + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY= , FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL T= HE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER L= IABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM= , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN= THE SOFTWARE. +- +-


        ++

        ++
        +
        Author: Sebas= tian Egner
        +-
        Editor: Mike Sperber ++
        Editor: Mike Sperber
        + + +-Last modified: Sun Sep 11 16:07:38 CEST 2005 ++Last modified: Sun Jan 28 13:40:16 MET 2007 + + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-74.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-74.html +index 50be385..6058742 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-74.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-74.html +@@ -1,60 +1,449 @@ +- +- +- ++ ++ + +-SRFI 74: Octet-Addressed Binary Blocks ++ ++ ++ SRFI 74: Octet-Addressed Binary Blocks ++ ++ ++ + +=20 + +-

        Title

        +- +-Octet-Addressed Binary Blocks ++

        SRFI 74: Octet-Addressed Binary Blocks

        +=20 +-

        Authors

        ++

        by Michael Sperber

        ++

        This copy of the SRFI 74 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-74/srfi-74.html.

        +=20 +-Michael Sperber ++

        Status

        +=20 +

        +-This SRFI is currently in ``final'' status. To see an explanation of each +-status that a SRFI can hold, see +-here. +-To +-provide input on this SRFI, please +-mailto:srfi-74@srfi.schemers= .org. +-See instruc= tions +-here to subscribe to the list. You can access previous messages via +-t= he +-archive of the mailing list. ++ This SRFI is currently in final status. Here ++ is an explanati= on ++ of each status that a SRFI can hold. To provide input on this SRFI, pl= ease ++ send email ++ to s= rfi-74@nospamsrfi.schemers.org. ++ To subscribe to the list, ++ follow t= hese ++ instructions. You can access previous messages via the mailing ++ list archive. ++

        ++ ++

        Abstract

        ++

        ++ This SRFI defines a set of procedures for creating, accessing, and ++ manipulating octet-addressed blocks of binary data, in ++ short, blobs. The SRFI provides access primitives for fixed-leng= th ++ integers of arbitrary size, with specified endianness, and a choice of ++ unsigned and two's complement representations. ++

        ++

        Rationale

        ++

        ++ Many applications must deal with blocks of binary data by accessing the= m in ++ various ways---extracting signed or unsigned numbers of various sizes. = Such ++ an application can use octet vectors as ++ in SRFI 66 or any of the ++ other types of homogeneous vectors ++ in SRFI 4, but these both ++ only allow retrieving the binary data of one type. ++

        ++

        ++ This is awkward in many situations, because an application might access ++ different kinds of entities from a single binary block. Even for unifo= rm ++ blocks, the disjointness of the various vector data types in SRFI 4 mea= ns ++ that, say, an I/O API needs to provide an army of procedures for each of ++ them in order to provide efficient access to binary data. ++

        ++

        ++ Therefore, this SRFI provides a single type for blocks of bina= ry ++ data with multiple ways to access that data. It deals only with intege= rs in ++ various sizes with specified endianness, because these are the most fre= quent ++ applications. Dealing with other kinds of binary data, such as ++ floating-point numbers or variable-size integers would be natural ++ extensions, but are left for a future SRFI. ++

        ++

        Specification

        ++

        General remarks

        ++

        ++ Blobs are objects of a new type. Conceptually, a blob represents a seq= uence ++ of octets. ++

        ++

        ++ Scheme systems implementing both SRFI 4 and/or SRFI 66 and this SRFI ma= y or ++ may not use the same type for u8vector and blobs. They are encouraged = to do ++ so, however. ++

        ++

        ++ As with u8vectors, the length of a blob is the number of octets it cont= ains. ++ This number is fixed. A valid index into a blob is an exact, non-negat= ive ++ integer. The first octet of a blob has index 0, the last octet has an = index ++ one less than the length of the blob. ++

        ++

        ++ Generally, the access procedures come in different flavors according to= the ++ size of the represented integer, and ++ the endianness = of the ++ representation. The procedures also distinguish signed and unsigned ++ representations. The signed representations all ++ use two's ++ complement.

        ++

        ++ For procedures that have no "natural" return value, this SRFI often use= s the ++ sentence: ++

        ++

        ++ The return values are unspecified. ++

        ++

        ++ This means that number of return values and the return values are ++ unspecified. However, the number of return values is such that it is ++ accepted by a continuation created by begin. Specifically= , on ++ Scheme implementations where continuations created by begin ++ accept an arbitrary number of arguments (this includes most ++ implementations), it is suggested that the procedure return zero return ++ values. ++

        ++

        Interface

        ++
        ++
        (endianness big) (syntax)
        ++
        (endianness little) (syntax) ++
        (endianness native) (syntax) ++
        ++

        ++ (endianness big) and (endianness little) ++ evaluate to two distinct and unique objects representing an endiannes= s. ++ The native endianness evaluates to the endianness of the ++ underlying machine architecture, and must be eq? to ++ either (endianness big) or (endianness little). ++

        ++
        ++
        (blob? obj)
        ++
        ++

        ++ Returns #t if obj is a blob, otherwise ++ returns #f. ++

        ++
        ++
        (make-blob k)
        ++
        ++

        ++ Returns a newly allocated blob of k octets, all of them 0. ++

        ++
        ++
        (blob-length blob)
        ++
        ++

        ++ Returns the number of octets in blob as an exact integer. ++

        ++
        ++
        (blob-u8-ref blob k)<= /dt> ++
        (blob-s8-ref blob k)<= /dt> ++
        ++

        ++ K must be a valid index of blob. ++

        ++

        ++ Blob-u8-ref returns the octet at index k ++ of blob. ++

        ++

        ++ Blob-s8-ref returns the exact integer corresponding to t= he ++ two's complement representation at index k ++ of blob. ++

        ++
        ++
        (blob-u8-set! blob k octet)
        ++
        (blob-s8-set! blob k byte)
        ++
        ++

        ++ K must be a valid index ++ of blob.

        Blob-u8-set! ++ stores octet in element k of blob. ++

        ++

        ++ Byte, must be an exact integer in the interval {-128, ..., ++ 127}. Blob-u8-set! stores the two's complement represent= ation ++ of byte in element k of blob. ++

        ++

        The return values are unspecified.

        ++
        ++
        (blob-uint-ref size endianness blob k)
        ++
        (blob-sint-ref size endianness blob k)
        ++
        (blob-uint-set! size endianness blob k n)
        ++
        (blob-sint-set! size endianness blob k n)
        ++
        ++

        ++ Size must be a positive exact integer. K must b= e a ++ valid index of blob; so must the indices {k, ++ ..., k + size - 1}. Endianness must = be an ++ endianness object. ++

        ++

        ++ Blob-uint-ref retrieves the exact integer corresponding = to ++ the unsigned representation of size size and specified ++ by endianness at indices {k, ..., k ++ + size - 1}. ++

        ++

        ++ Blob-sint-ref retrieves the exact integer corresponding = to ++ the two's complement representation of size size and speci= fied ++ by endianness at indices {k, ..., k ++ + size - 1}. ++

        ++

        ++ For blob-uint-set!, n must be an exact intege= r in ++ the interval [0, (256^size)-1]. Blob-uint-set! ++ stores the unsigned representation of size size and specif= ied ++ by endianness into the blob at indices {k, ++ ..., k + size - 1}. ++

        ++

        ++ For blob-uint-set!, n must be an exact intege= r in ++ the interval [-256^(size-1), ++ (256^(size-1))-1]. Blob-sint-set! stores the = two's ++ complement representation of size size and specified ++ by endianness into the blob at indices {k, ++ ..., k + size - 1}. ++

        ++
        ++
        (blob-u16-ref endianness blob k)
        ++
        (blob-s16-ref endianness blob k)
        ++
        (blob-u16-native-ref blob k)=
        ++
        (blob-s16-native-ref blob k)=
        ++
        (blob-u16-set! endianness blob k n)
        ++
        (blob-s16-set! endianness blob k n)
        ++
        (blob-u16-native-set! blob k = n)
        ++
        (blob-s16-native-set! blob k = n)
        ++
        ++

        ++ K must be a valid index of blob; so must the ++ index k+ 1. Endianness must be an endianness ++ object. ++

        ++

        ++ These retrieve and set two-octet representations of numbers at ++ indices k and k+1, according to the endianness ++ specified by endianness. The procedures with u16 ++ in their names deal with the unsigned representation, those ++ with s16 with the two's complement representation. ++

        ++

        ++ The procedures with native in their names employ the nat= ive ++ endianness, and only work at aligned indices: k must be a ++ multiple of 2. It is an error to use them at non-aligned indices. ++

        ++
        ++
        (blob-u32-ref endianness blob k)
        ++
        (blob-s32-ref endianness blob k)
        ++
        (blob-u32-native-ref blob k)=
        ++
        (blob-s32-native-ref blob k)=
        ++
        (blob-u32-set! endianness blob k n)
        ++
        (blob-s32-set! endianness blob k n)
        ++
        (blob-u32-native-set! blob k = n)
        ++
        (blob-s32-native-set! blob k = n)
        ++
        ++

        ++ K must be a valid index of blob; so must the in= dices ++ {k, ..., k+ 3}. Endianness must be an ++ endianness object. ++

        ++

        ++ These retrieve and set four-octet representations of numbers at indic= es ++ {k, ..., k+ 3}, according to the endianness ++ specified by endianness. The procedures with u32 ++ in their names deal with the unsigned representation, those ++ with s32 with the two's complement representation. ++

        ++

        ++ The procedures with native in their names employ the nat= ive ++ endianness, and only work at aligned indices: k must be a ++ multiple of 4. It is an error to use them at non-aligned indices. ++

        ++
        ++
        (blob-u64-ref endianness blob k)
        ++
        (blob-s64-ref endianness blob k)
        ++
        (blob-u64-native-ref blob k)=
        ++
        (blob-s64-native-ref blob k)=
        ++
        (blob-u64-set! endianness blob k n)
        ++
        (blob-s64-set! endianness blob k n)
        ++
        (blob-u64-native-set! blob k = n)
        ++
        (blob-s64-native-set! blob k = n)
        ++
        ++

        ++ K must be a valid index of blob; so must the in= dices ++ {k, ..., k+ 7}. Endianness must be an ++ endianness object. ++

        ++

        ++ These retrieve and set eight-octet representations of numbers at indi= ces ++ {k, ..., k+ 7}, according to the endianness ++ specified by endianness. The procedures with u64 ++ in their names deal with the unsigned representation, those ++ with s64 with the two's complement representation. ++

        ++

        ++ The procedures with native in their names employ the nat= ive ++ endianness, and only work at aligned indices: k must be a ++ multiple of 8. It is an error to use them at non-aligned indices. ++

        ++
        ++
        (blob=3D? blob-1 blob-2)
        ++
        ++

        ++ Returns #t if blob-1 and blob-2 are ++ equal---that is, if they have the same length and equal octets at all ++ valid indices. ++

        ++
        ++
        (blob-copy! source source-start target target-start n)
        ++
        ++

        ++ Copies data from blob source to ++ blob target. Source-start, target-start, ++ and n must be non-negative exact integers that satisfy ++

        ++

        ++ 0 <=3D source-start <=3D source-start ++ + n <=3D (blob-length source) ++

        ++

        ++ 0 <=3D target-start <=3D target-start ++ + n <=3D (blob-length target) ++

        ++

        ++ This copies the octets from source at indices ++ [source-start, source-start + n) to ++ consecutive indices in target starting ++ at target-index. ++

        ++

        ++ This must work even if the memory regions for the source and the targ= et ++ overlap, i.e., the octets at the target location after the copy must = be ++ equal to the octets at the source location before the copy. ++

        ++

        ++ The return values are unspecified. ++

        ++
        ++
        (blob-copy blob)
        ++
        ++

        ++ Returns a newly allocated copy of blob blob. ++

        ++
        ++
        (blob->u8-list blob)
        ++
        (u8-list->blob blob)
        ++
        ++

        ++ blob->u8-listreturns a newly allocated list of the oc= tets ++ of blob in the same ++ order. ++

        ++
        ++
        ++

        ++ U8-list->blob returns a newly allocated blob whose ++ elements are the elements of list octets, which must all be ++ octets, in the same order. Analogous to list->vector. ++

        ++
        ++
        (blob->uint-list size endianness blob)
        ++
        (blob->sint-list size endianness blob)
        ++
        (uint-list->blob size endianness list)
        ++
        (sint-list->blob size endianness list)
        ++
        ++

        ++ Size must be a positive exact integer. Endianness ++ must be an endianness object. ++

        ++

        ++ These convert between lists of integers and their consecutive ++ representations according to size and endianness in ++ blobs in the same way ++ as blob->u8-list, blob->s8-list, ++ u8-list->blob, and s8-list->blob do f= or ++ one-octet representations. ++

        ++
        ++
        +=20 ++

        Reference Implementation

        ++

        ++ This reference i= mplementation makes use ++ of SRFI 23 (Error reporting ++ mechanism), SRFI 26 ++ (Notation for Specializing Parameters without ++ Currying), SRFI 60 (Integers ++ as Bits), and SRFI 66 (Octet ++ Vectors). ++

        ++

        Examples

        ++

        ++ The test suit= e doubles as a source of examples. +

        ++

        References

        + +-

        Abstract

        This SRFI defines a set of procedures for creating, a= ccessing, and manipulating octet-addressed blocks of binary data, in short,= blobs. The SRFI provides access primitives for fixed-length integer= s of arbitrary size, with specified endianness, and a choice of unsigned an= d two's complement representations.

        Rationale

        Many applicatio= ns must deal with blocks of binary data by accessing them in various ways--= -extracting signed or unsigned numbers of various sizes. Such an applicati= on can use octet vectors as in SRFI 66 or any of the other types of homogeneous vectors in SRFI 4, but these both only allow= retrieving the binary data of one type.

        This is awkward in many situ= ations, because an application might access different kinds of entities fro= m a single binary block. Even for uniform blocks, the disjointness of the = various vector data types in SRFI 4 means that, say, an I/O API needs to pr= ovide an army of procedures for each of them in order to provide efficient = access to binary data.

        Therefore, this SRFI provides a single type for blocks of binary data with multiple ways to access that data. I= t deals only with integers in various sizes with specified endianness, beca= use these are the most frequent applications. Dealing with other kinds of = binary data, such as floating-point numbers or variable-size integers would= be natural extensions, but are left for a future SRFI.

        Specificatio= n

        General remarks

        Blobs are objects of a new type. Conceptu= ally, a blob represents a sequence of octets.

        Scheme systems implemen= ting both SRFI 4 and/or SRFI 66 and this SRFI may or may not use the same t= ype for u8vector and blobs. They are encouraged to do so, however.

        A= s with u8vectors, the length of a blob is the number of octets it contains.= This number is fixed. A valid index into a blob is an exact, non-negati= ve integer. The first octet of a blob has index 0, the last octet has an = index one less than the length of the blob.

        Generally, the access pr= ocedures come in different flavors according to the size of the represented= integer, and the endia= nness of the representation. The procedures also distinguish signed an= d unsigned representations. The signed representations all use two's complement.

        = For procedures that have no "natural" return value, this SRFI often uses th= e sentence

        The return values are unspecified.

        This mea= ns that number of return values and the return values are unspecified. Ho= wever, the number of return values is such that it is accepted by a contin= uation created by begin. Specifically, on Scheme implementati= ons where continuations created by begin accept an arbitrary n= umber of arguments (this includes most implementations), it is suggested th= at the procedure return zero return values.

        Interface

        (endianness big) (syntax)
        (endianness little) (syntax)
        (endianness native) (syntax)
        (endianness big) and (endianness little) evaluat= e to two distinct and unique objects representing an endianness. The native endianness evaluates to the endianness of the underlying ma= chine architecture, and must be eq? to either (endiannes= s big) or (endianness little).

        (blob?= obj)

        Returns #t if = obj is a blob, otherwise returns #f.

        (make-blob k)

        Returns a newly= allocated blob of k octets, all of them 0.

        (b= lob-length blob)

        Returns the numb= er of octets in blob as an exact integer.

        (blo= b-u8-ref blob k)
        (b= lob-s8-ref blob k)

        K must be a valid index of blob.

        Blob-u8-ref= returns the octet at index k of blob.

        <= code>Blob-s8-ref returns the exact integer corresponding to the two'= s complement representation at index k of blob.

        (blob-u8-set! blob k octet)
        (blob-s8-set! blob = k byte)

        K must be a val= id index of blob.

        Blob-u8-set! stores oc= tet in element k of blob.

        Byte= , must be an exact integer in the interval {-128, ..., 127}. Blob-u8-= set! stores the two's complement representation of byte = in element k of blob.

        The return values are uns= pecified.

        (blob-uint-ref size endi= anness blob k)
        (blob= -sint-ref size endianness blob k)
        (blob-uint-set! size= endianness blob k n)
        (blob-sint-set! size endianness blob k n)

        Size must be a positive exact integer. K must be a valid = index of blob; so must the indices {k, ..., k + size - 1}. Endianness must be an endianness obj= ect.

        Blob-uint-ref retrieves the exact integer correspo= nding to the unsigned representation of size size and specified = by endianness at indices {k, ..., k + size - 1}.

        Blob-sint-ref retrieves the exact inte= ger corresponding to the two's complement representation of size size<= /var> and specified by endianness at indices {k, ...,= k + size - 1}.

        For blob-uint-set!= , n must be an exact integer in the interval [0, (256^size<= /var>)-1]. Blob-uint-set! stores the unsigned representation o= f size size and specified by endianness into the blob= at indices {k, ..., k + size - 1}.

        = For blob-uint-set!, n must be an exact integer in t= he interval [-256^(size-1), (256^(size-1))-1]. = Blob-sint-set! stores the two's complement representation of size size and specified by endianness into the blob at indic= es {k, ..., k + size - 1}.

        (blob-u16-ref endianness blob k<= code>)
        (blob-s16-ref endianness blob k)
        (blob-u16-native-ref <= /code>blob k)
        (blob-s16-na= tive-ref blob k)
        (b= lob-u16-set! endianness blob k n)
        (blob-s16-set! endianness<= /var> blob k n)
        (blob-u16-native-set! blob k n)
        (blob-s16-native-set! blob = k n)

        K must be a valid = index of blob; so must the index k+ 1. Endiannes= s must be an endianness object.

        These retrieve and set two-oct= et representations of numbers at indices k and k+1, a= ccording to the endianness specified by endianness. The procedur= es with u16 in their names deal with the unsigned representati= on, those with s16 with the two's complement representation.

        The procedures with native in their names employ the nati= ve endianness, and only work at aligned indices: k must be a mul= tiple of 2. It is an error to use them at non-aligned indices.

        (blob-u32-ref endianness blob k)
        (blob-s32-ref endianness = blob k)
        (blob-u32-native-r= ef blob k)
        (blob-s3= 2-native-ref blob k)
        (blob-u32-set! endianness blob k = n)
        (blob-s32-set! endiann= ess blob k n)
        <= code>(blob-u32-native-set! blob k n= )
        (blob-s32-native-set! blob <= var>k n)

        K must be a va= lid index of blob; so must the indices {k, ..., = k+ 3}. Endianness must be an endianness object.

        The= se retrieve and set four-octet representations of numbers at indices {= k, ..., k+ 3}, according to the endianness specified by endianness. The procedures with u32 in their names de= al with the unsigned representation, those with s32 with the t= wo's complement representation.

        The procedures with native in their names employ the native endianness, and only work at aligned in= dices: k must be a multiple of 4. It is an error to use them at= non-aligned indices.

        (blob-u64-ref endiannes= s blob k)
        (blob-s64-= ref endianness blob k)=
        (blob-u64-native-ref blob k)
        (blob-s64-native-ref blob k= )
        (blob-u64-set! endianness blob k n)
        (= blob-s64-set! endianness blob k n)
        (blob-u64-native-set! blo= b k n)
        (blob-s64-nat= ive-set! blob k n)

        K must be a valid index of blob; so must the = indices {k, ..., k+ 7}. Endianness must be= an endianness object.

        These retrieve and set eight-octet representa= tions of numbers at indices {k, ..., k+ 7}, according= to the endianness specified by endianness. The procedures with = u64 in their names deal with the unsigned representation, thos= e with s64 with the two's complement representation.

        The= procedures with native in their names employ the native endia= nness, and only work at aligned indices: k must be a multiple of= 8. It is an error to use them at non-aligned indices.

        (= blob=3D? blob-1 blob-2)
        <= p>Returns #t if blob-1 and blob-2 are equa= l---that is, if they have the same length and equal octets at all valid ind= ices.

        (blob-copy! source source-st= art target target-start n)

        Copies data from blob source to blob target<= /var>. Source-start, target-start, and n = must be non-negative exact integers that satisfy

        0 <=3D sourc= e-start <=3D source-start + n <=3D = (blob-length source)

        0 <=3D target-start <=3D target-start + n <=3D (blob-leng= th target)

        This copies the octets from source<= /var> at indices [source-start, source-start + n= ) to consecutive indices in target starting at target= -index.

        This must work even if the memory regions for the sourc= e and the target overlap, i.e., the octets at the target location after the= copy must be equal to the octets at the source location before the copy.

        The return values are unspecified.

        (blob-copy blob)

        Returns a newly allocated copy of= blob blob.

        (blob->u8-list blob= )
        (u8-list->blob blob= )

        blob->u8-listreturns a newly allo= cated list of the octets of blob in the same order.

        =

        U8-list->blob returns a newly allocated blob whose eleme= nts are the elements of list octets, which must all be octets, i= n the same order. Analogous to list->vector.

        (blob->uint-list size endianness b= lob)
        (blob->sint-list size<= /var> endianness blob)
        (ui= nt-list->blob size endianness list)
        (sint-list->blob size <= var>endianness list)

        Size must be a positive exact integer. Endianness must be an endia= nness object.

        These convert between lists of integers and their conse= cutive representations according to size and endianness in blobs in the same way as blob->u8-list, blob-&g= t;s8-list, u8-list->blob, and s8-list->blo= b do for one-octet representations.

        Reference Imple= mentation

        This reference implementation mak= es use of SRFI 23 (Error = reporting mechanism), SRFI 26= (Notation for Specializing Parameters without Currying), SRFI 60 (Integers as Bits), and SRFI 66 (Octet Vectors) .

        Examples

        The test suite doubles as a so= urce of examples.

        References

        Copyright

        +-Copyright (C) Michael Sperber (2005). All Rights Reserved.=20 +-

        +-Permission is hereby granted, free of charge, to any person obtaining a +-copy of this software and associated documentation files (the "Software"), +-to deal in the Software without restriction, including without limitation +-the rights to use, copy, modify, merge, publish, distribute, sublicense, +-and/or sell copies of the Software, and to permit persons to whom the +-Software is furnished to do so, subject to the following conditions: +-

        +-The above copyright notice and this permission notice shall be included in +-all copies or substantial portions of the Software. +-

        +-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +-DEALINGS IN THE SOFTWARE. +- +-


        +-
        Editor: Da= vid Van Horn
        +- ++

        Copyright

        ++

        ++ Copyright (C) Michael Sperber (2005). All Rights Reserved. ++

        ++

        ++ Permission is hereby granted, free of charge, to any person obtaining a= copy ++ of this software and associated documentation files (the "Software"), to ++ deal in the Software without restriction, including without limitation = the ++ rights to use, copy, modify, merge, publish, distribute, sublicense, an= d/or ++ sell copies of the Software, and to permit persons to whom the Software= is ++ furnished to do so, subject to the following conditions: ++

        ++

        ++ The above copyright notice and this permission notice shall be included= in ++ all copies or substantial portions of the Software. ++

        ++

        ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR ++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL= THE ++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEA= LINGS ++ IN THE SOFTWARE. ++

        ++
        ++
        Editor: David Van Horn
        ++ ++ +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-78.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-78.html +index 4267157..270196e 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-78.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-78.html +@@ -1,102 +1,122 @@ +- +- ++ ++ + ++ ++ + SRFI 78: Lightweight testing ++ ++ ++ + +=20 + +=20 +-

        Title

        +- +-Lightweight testing +- +-

        Author

        +- +-Sebastian Egner +- +-

        Status

        +- +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. +- +-To provide input on this SRFI, please mail to +-<srfi-78@srfi.schemers.org>. See instructions here to subscribe to +-the list. You can access previous messages via the archive of the mailing list. +- +- +-

          +-
        • Received: 2005/10/25
        • +-
        • Draft: 2005/11/11 - 2006/01/10
        • +-
        • Draft extended: 2006/01/17 - 2006/01/31
        • +-
        • Revised: 2006/01/18
        • +-
        • Revised: 2006/02/08
        • +-
        • Final: 2006/03/06
        • +-
        +- +-

        Abstract

        +- ++

        SRFI 78: Lightweight testing

        ++ ++

        by Sebastian Egner

        ++

        This copy of the SRFI 78 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-78/srfi-78.html.

        ++ ++

        Status

        ++ ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 78@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

        ++
          ++
        • Received: 2005-10-25
        • ++
        • Draft: 2005-11-11--2006-01-10
        • ++
        • Draft extended: 2006-01-17--2006-01-31
        • ++
        • Revised: 2006-01-18
        • ++
        • Revised: 2006-02-08
        • ++
        • Final: 2006-03-06
        • ++
        • Revised to fix errata:
            ++
          • 2019-10-25 (Fix broken links.)
        • ++
        ++ ++

        Abstract

        ++

        + A simple mechanism is defined for testing Scheme programs. + As a most primitive example, the expression +- +-

           (check (+ 1 1) =3D> 3)
        +-
        +- +-evaluates the expression (+ 1 1) and compares the result ++

        ++
        ++   (check (+ 1 1) =3D> 3)
        ++
        ++

        ++evaluates the expression (+ 1 1) and compares the result + with the expected result 3 provided after the syntactic +-keyword =3D>. Then the outcome of this comparison is repo= rted ++keyword =3D>. Then the outcome of this comparison is repo= rted + in human-readable form by printing a message of the form +- +-

           (+ 1 1) =3D> 2 ; *** failed ***
        ++

        ++
        ++   (+ 1 1) =3D> 2 ; *** failed ***
        +    ; expected result: 3
        +-
        +- ++
        ++

        + Moreover, the outcome of any executed check is recorded + in a global state counting the number of correct and failed + checks and storing the first failed check. At the end of a + file, or at any other point, the user can print a summary +-using check-report. ++using check-report. ++

        +

        + In addition to the simple test above, it is also possible + to execute a parametric sequence of checks. Syntactically, + this takes the form of an eager comprehension in the sense +-of SRFI 42 [5]. For exam= ple, +- +-

           (check-ec (:range e 100)
        ++of SRFI 42 [5]. For example,
        ++

        ++
        ++   (check-ec (:range e 100)
        +              (:let x (expt 2.0 e))=20
        +-             (=3D (+ x 1) x) =3D> #f (e x))
        +-
        +- +-This statement runs the variable e through {0..99} and +-for each binding defines x as (expt 2.0 e). The= n it is=20 +-checked if (+ x 1) is equal to x, and it is exp= ected that +-this is not the case (i.e. expected value is #f). The +-trailing (e x) tells the reporting mechanism to print +-the values of both e and x in case of a failed = check. ++ (=3D (+ x 1) x) =3D> #f (e x)) ++
        ++

        ++This statement runs the variable e through {0..99} and ++for each binding defines x as (expt 2.0 e). The= n it is=20 ++checked if (+ x 1) is equal to x, and it is exp= ected that ++this is not the case (i.e. expected value is #f). The ++trailing (e x) tells the reporting mechanism to print ++the values of both e and x in case of a failed = check. + The output could look like this: +- +-

           (let ((e 53) (x 9007199254740992.0)) (=3D (+ x 1) x)) =3D> #t ; *=
        ** failed ***
        ++

        ++
        ++   (let ((e 53) (x 9007199254740992.0)) (=3D (+ x 1) x)) =3D> #t ; ***=
         failed ***
        +     ; expected result: #f
        +-
        +- +-The specification of bindings to report, (e x) in the=20 ++
        ++

        ++The specification of bindings to report, (e x) in the=20 + example, is optional but very informative. +- ++

        ++

        + Other features of this SRFI are: +-

          +-
        • A way to specify a different equality predicate (default is equ= al?).
        • +-
        • Controlling the amount of reporting being printed.
        • +-
        • Switching off the execution and reporting of checks entriely.
        • +-
        • Retrieving a boolean if all checks have been executed and passed.
        • +-
        +- +-

        Rationale

        ++

        ++
          ++
        • A way to specify a different equality predicate (default is equ= al?).
        • ++
        • Controlling the amount of reporting being printed.
        • ++
        • Switching off the execution and reporting of checks entriely.
        • ++
        • Retrieving a boolean if all checks have been executed and passed.
        • ++
        ++ ++

        Rationale

        ++

        + The mechanism defined in this SRFI should be available in + every Scheme system because it has already proven useful + for interactive development---of SRFIs.=20 ++

        +

        + Although it is extremely straight-forward, the origin of the + particular mechanism described here is the 'examples.scm' file +@@ -104,209 +124,234 @@ accompanying the reference implementation of SRFI = 42 [5]. + The same mechanism has been reimplemented for the reference + implementation of SRFI 67, and a simplified version is yet + again found in the reference implementation of SRFI 77. ++

        +

        + The mechanism in this SRFI does not replace more sophisticated + approaches to unit testing, like SRFI 64 [1] or SchemeUnit [2]. + These systems provide more control of the testing, separate + the definition of a test, its execution, and its reports, and + provide several other features. ++

        +

        + Neil Van Dyke's Testeez library [3] is very close in spirit=20 + to this SRFI. In Testeez, tests are disabled by (re-)defining a + macro. The advantage of this method is that the code for the + test cases can be removed entirely, and hence even the dependency + on the Testeez library. This SRFI on the other hand, uses a +-Scheme conditional (COND, IF) to prevent execut= ion of the ++Scheme conditional (COND, IF) to prevent execut= ion of the + testing code. This method is more dynamic but retains dead + testing code, unless a compiler and a module system are used + to apply constant folding and dead code elimination. The only + major addition in SRFI over Testeez is the comprehension for + formulating parametric tests. ++

        +

        + Design considerations for this SRFI include the following: +-

          +-
        • Reporting is human-readable and as specific as possible, ++

          ++
            ++
          • Reporting is human-readable and as specific as possible, + i.e. not just "assertion failed" but the expression with + actual and expected value, and if possibly the relevant=20 +- part of the bindings environment.
          • +-
          • An effort is made to print closed Scheme expressions, i.e.=20 ++ part of the bindings environment.
          • ++
          • An effort is made to print closed Scheme expressions, i.e.=20 + expressions that can directly be copy/pasted into a REPL +- for further analysis (e.g. the let expression in the abstract).
          • +-
          • By default the checks report both correct and failed checks. ++ for further analysis (e.g. the let expression in the abstract).
          • ++
          • By default the checks report both correct and failed checks. + However, it is possible to reduce the output---or even to=20 + switch off the execution of checks. It has turned out useful + to be able to run only some subset checks for the features + currently under development. This can be done by changing +- the reporting mode between different sections.
          • +-
          • The global state (correct/failed count) is not made available ++ the reporting mode between differnt sections.
          • ++
          • The global state (correct/failed count) is not made available + to the user program. This reduces the dependencies between +- different checks because it is not possible to use the state.
          • +-
          • Ocassionally, it is useful to check that a certain expression=20 +- does not yield an ordinary result but raises an error. However,= =20 ++ different checks because it is not possible to use the state.
          • ++
          • Ocassionally, it is useful to check that a certain expression=20 ++ does not yield an ordinary result but raises an error. However,= =20 + R5RS [4] does not specify the mechanism by which this occurs + (e.g. raising exception, breaking into a REPL, aborting the + program, etc.). For this reason, this SRFI is restricted to=20 +- the case that the checked expressions evaluate normally.
          • +-
          • Though usually I am very much in favor of strictly prefix ++ the case that the checked expressions evaluate normally.
          • ++
          • Though usually I am very much in favor of strictly prefix + syntax, for this SRFI I make an exception because the=20 +- infix "=3D>" syntax is widely used and intuitive.
          • +-
          ++ infix "=3D>" syntax is widely used and intuitive.
        • ++
        +=20 +-

        Specification

        ++

        Specification

        +=20 +-
        +-
        +-(check <expr> (=3D> <equal>) <exp= ected>)     = ;    MACRO
        ++
        ++
        ++(check <expr> (=3D> <equal>) <expected>) =        &nb= sp;MACRO
        + (check <expr> =3D> <expected>) +-
        +-
        +- evaluates <expr> and compares the value to the value +- of <expected> using the predicate <equal&g= t;, which is +- equal? when omitted. Then a report is printed according ++
        ++
        ++ evaluates <expr> and compares the value to the value ++ of <expected> using the predicate <equal&g= t;, which is ++ equal? when omitted. Then a report is printed according + to the current mode setting (see below) and the outcome +- is recorded in a global state to be used in check-report. +- The precise order of evaluation is that first <equal> +- and <expected> are evaluated (in unspecified order)= and +- then <expr> is evaluated.
        +- Example: (check (+ 1 1) =3D> 2) +-
        +-
        +- +-
        +-
        +-(check-ec <qualifier>* <ex= pr> (=3D> <equal>) <expected> (<argument>*))         MACRO=
        +-(check-ec <qualifier>
        * <expr> =3D> = <expected> (<argument>*))
        +-(check-ec <qualifier>
        * <expr> (=3D> <equal= >) <expected>)
        +-(check-ec <qualifier>
        * <expr> =3D> = <expected>) +-
        +-
        +- an eager comprehension for executing a parametric sequence of checks.<= p> +- Enumerates the sequence of bindings specified by <qualifie= r>*. +- For each binding evaluates <equal> and <ex= pected> in unspecified +- order. Then evalues <expr> and compares the value o= btained to the +- value of <expected> using the value of <eq= ual> as predicate, which +- is equal? when omitted. ++ is recorded in a global state to be used in check-report. ++ The precise order of evaluation is that first <equal> ++ and <expected> are evaluated (in unspecified order)= and ++ then <expr> is evaluated.
        ++ Example: (check (+ 1 1) =3D> 2) ++
        ++
        ++ ++
        ++
        ++(check-ec <qualifier>* <expr> (=3D> <equal= >) <expected> (<argument>*))  &nb= sp;      MACRO
        ++(check-ec <qualifier>
        * <expr> =3D> = <expected> (<argument>*))
        ++(check-ec <qualifier>
        * <expr> (=3D> <equal= >) <expected>)
        ++(check-ec <qualifier>
        * <expr> =3D> = <expected>) ++
        ++
        ++

        ++ an eager comprehension for executing a parametric sequence of checks. ++

        ++

        ++ Enumerates the sequence of bindings specified by <qualifie= r>*. ++ For each binding evaluates <equal> and <ex= pected> in unspecified ++ order. Then evalues <expr> and compares the value o= btained to the ++ value of <expected> using the value of <eq= ual> as predicate, which ++ is equal? when omitted. + The comprehension stops after the first failed check, if there + is any. Then a report is printed according to the current mode=20 + setting (see below) and the outcome is recorded in a global state=20 +- to be used in check-report. The entire check-ec counts as a single=20 +- check.

        +- In case the check fails <argument>* is used for = constructing an +- informative message with the argument values. Use <argument&g= t;* to +- list the relevant free variables of <expr> (see exa= mples) that you +- want to have printed.

        +- A <qualifier> is any qualifier of an eager compr= ehension as +- specified in SRFI 42 = [5].

        +- ++ to be used in check-report. The entire check-ec counts as a single=20 ++ check.

        ++ In case the check fails <argument>* is used for = constructing an ++ informative message with the argument values. Use <argument&g= t;* to ++ list the relevant free variables of <expr> (see exa= mples) that you ++ want to have printed.

        ++ A <qualifier> is any qualifier of an eager compr= ehension as ++ specified in SRFI 42 [5]. ++

        ++

        + Examples: +-

             (check-ec (: e 100) (positive? (expt 2 e)) =3D> #t (e)) ;=
         fails on fixnums
        ++

        ++
        ++     (check-ec (: e 100) (positive? (expt 2 e)) =3D> #t (e)) ; fails o=
        n fixnums
        +      (check-ec (: e 100) (:let x (expt 2.0 e)) (=3D (+ x 1) x) =3D> #f=
         (x)) ; fails
        +      (check-ec (: x 10) (: y 10) (: z 10)
        +                (* x (+ y z)) =3D> (+ (* x y) (* x z))
        +                (x y z)) ; passes with 10^3 cases checked
        +-   
        +-
        +-
        ++
        ++ ++ ++ +=20 +-
        +-
        +-(check-report)    &nbs= p;    PROCEDURE +-
        +-
        ++
        ++
        ++(check-report)         PRO= CEDURE ++
        ++
        ++

        + prints a summary and the first failed check, if there is any, + depending on the current mode settings. +-

        +-
        +- +-
        +-
        +-(check-set-mode! mode)   =       PROCEDURE +-
        +-
        ++

        ++
        ++
        ++ ++
        ++
        ++(check-set-mode! mode)        &= nbsp;PROCEDURE ++
        ++
        ++

        + sets the current mode to mode, which must be a symbol in +- '(off summary report-failed report), default is 're= port. ++ '(off summary report-failed report), default is 're= port. + Note that you can change the mode at any time, and that check, +- check-ec and check-report use the current va= lue. +-

        +- The mode symbols have the following meaning:
        +- off: do not execute any of the checks,
        +- summary: print only summary in (check-repor= t) and nothing else,
        +- report-failed: report failed checks when they happen, a= nd in summary,
        +- report: report every example executed.
        +-

        +-
        +- +-
        +-
        +-(check-reset!)     = ;    PROCEDURE +-
        +-
        ++ check-ec and check-report use the current va= lue. ++

        ++

        ++ The mode symbols have the following meaning:
        ++ off: do not execute any of the checks,
        ++ summary: print only summary in (check-repor= t) and nothing else,
        ++ report-failed: report failed checks when they happen, a= nd in summary,
        ++ report: report every example executed.
        ++

        ++
        ++
        ++ ++ ++
        ++
        ++(check-reset!)         PRO= CEDURE ++
        ++
        + resets the global state (counters of correct/failed examples) + to the state immediately after loading the module for the + first time, i.e. no checks have been executed. +-
        +-
        +- +-
        +-
        +-(check-passed? expected-total-count) =         PROCEDURE +-
        +-
        +- #t if there were no failed checks and expected-total-coun= t=20 +- correct checks, #f otherwise.

        ++

        ++
        ++ ++
        ++
        ++(check-passed? expected-total-count)      = ;   PROCEDURE ++
        ++
        ++

        ++ #t if there were no failed checks and expected-total-coun= t=20 ++ correct checks, #f otherwise. ++

        ++

        + Rationale: This procedure can be used in automatized + tests by terminating a test program with the statement +- (exit (if (check-passed? n) 0 1)). +-

        +-
        +- ++ (exit (if (check-passed? n) 0 1)). ++

        ++
        ++
        +=20 +-

        Implementation

        +=20 +-check.scm: ++

        Implementation

        ++

        ++check.scm: + implementation in R5RS + SRFI 23 (error) + SRFI 42 (comprehensions); +- tested under PLT 208p1 and Scheme 48 1.3.
        +- +-examples.scm: ++ tested under PLT 208p1 and Scheme 48 1.3.
        ++

        ++

        ++examples.scm: + a few examples. ++

        ++

        References

        +=20 +-

        References

        +- +-
        +=20 ++

        Copyright

        ++

        + Copyright (C) Sebastian Egner (2005-2006). All Rights Reserved. ++

        +

        + Permission is hereby granted, free of charge, to any person obtaining a c= opy of this software and associated documentation files (the "Software"), t= o deal in the Software without restriction, including without limitation th= e rights to use, copy, modify, merge, publish, distribute, sublicense, and/= or sell copies of the Software, and to permit persons to whom the Software = is furnished to do so, subject to the following conditions:=20 ++

        +

        + The above copyright notice and this permission notice shall be included i= n all copies or substantial portions of the Software.=20 ++

        +

        + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS O= R IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, = FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE= AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA= BILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, = OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN T= HE SOFTWARE. +-

        +-


        ++

        ++
        +
        Author: srfi-= 78@sebastian-egner.net
        +-
        Editors: s= rfi-editors@srfi.schemers.org
        +- ++
        Editor: David Van Horn
        ++ + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-8.html b/srfi-doc/srf= i/scribblings/srfi-std/srfi-8.html +index 38b7340..ed3e26e 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-8.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-8.html +@@ -1,41 +1,58 @@ +- +- ++ ++ + +-SRFI 8: RECEIVE: Binding to multiple values ++ ++ ++ SRFI 8: RECEIVE: Binding to multiple values ++ ++ ++ + +=20 + +-

        Title

        ++

        SRFI 8: receive: Binding to multiple values

        +=20 +-SRFI 8: receive: Binding to multiple values +- +-

        Author

        +- +-John David Stone +- +-

        ++

        by John David Stone
        + Department of Mathematics and Computer Science, Grinnell College, Grinnel= l, Iowa 50112, + email. +

        ++

        This copy of the SRFI 8 specifica= tion document ++is distributed as part of the Racket package ++srfi-doc.

        = The canonical source of this document is ++https://srfi.sch= emers.org/srfi-8/srfi-8.html.

        +=20 +-

        Status

        ++

        Status

        +=20 +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion via the archive of the mailing list. +-

          +-
        • Received: 1999/05/27 +-
        • Draft: 1999/07/01-1999/08/30 +-
        • Final: 1999/08/30 +-
        ++

        This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-8= @nospamsrfi.schemers.org. To su= bscribe to the list, follow these instructions. You can access previous messages v= ia the mailing list arch= ive.

        ++
          ++
        • Received: 1999-05-27 ++
        • Draft: 1999-07-01--1999-08-30 ++
        • Final: 1999-08-30 ++
        +=20 +-

        Related SRFIs

        ++

        Related SRFIs

        +=20 +

        + The syntax proposed in this SRFI is used in the reference implementation = of + SRFI-1, ``List library.'' +

        +=20 +-

        Abstract

        ++

        Abstract

        +=20 +

        + The only mechanism that R5RS provides for binding identifiers = to +@@ -44,7 +61,7 @@ the values of a multiple-valued expression is the primit= ive + readable syntax for creating such bindings. +

        +=20 +-

        Rationale

        ++

        Rationale

        +=20 +

        + Although R5RS supports multiple-valued expressions, it provides +@@ -116,8 +133,8 @@ established from a ``body'' in which they are used mak= es it easier to + follow the code. +

        +=20 +-

        Specification

        +- ++

        Specification

        ++ +

        + (receive <formals> <expression> + <body>)     library synt= ax=20 +@@ -134,7 +151,7 @@ forms: + (<variable1> ... + <variablen>): The environment in whi= ch=20 + the receive-expression is evaluated is extended by binding +-<variable1>, ..., ++<variable1>, ..., + <variablen> to fresh locations. The + <expression> is evaluated, and its values are stored into those + locations. (It is an error if <expression> does not have exactly +@@ -154,7 +171,7 @@ stored in the location bound to <variable>. + <variablen> . <variablen + + 1>): The environment in which=20 + the receive-expression is evaluated is extended by binding +-<variable1>, ..., ++<variable1>, ..., + <variablen + 1> to fresh locations. The + <expression> is evaluated. Its first n values are stored in= to + the locations bound to <variable1> ... +@@ -172,7 +189,7 @@ the extended environment. The results of the last exp= ression in the body + are the values of the receive-expression. +

        +=20 +-

        Reference implementation

        ++

        Reference implementation

        +=20 +
        + 
        +@@ -184,7 +201,7 @@ are the values of the receive-expression.
        + 
        + 
        +=20 +-
        ++
        +=20 +

        + Copyright (C) John David Stone (1999). All Rights Reserved. +@@ -213,9 +230,9 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O= R IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

        +=20 +-
        ++
        +=20 +-
        Editor: Mi= ke Sperber
        ++
        Editor: Mike Sperber
        +=20 + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-86.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-86.html +index 39255f2..414fc56 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-86.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-86.html +@@ -1,41 +1,51 @@ +- +-SRFI 86: MU and NU simulating VALUES & CALL-WITH-V= ALUES, and their related LET-syntax +- +-

        Title

        +- +-MU and NU simulating VALUES & CALL-WITH-VALUES, and their related LET= -syntax +- +-

        Author

        +- +-Joo ChurlSoo +- +-

        Status

        +- +-This SRFI is currently in ``final'' status. To see an explanation of each +-status that a SRFI can hold, see +-here. +-To +-provide input on this SRFI, please +-mailt= o:srfi minus 86 at srfi dot schemers dot org. +-See instructions +-here to subscribe to the list. You can access the discussion via +-t= he +-archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. +-

        +-

          +-
        • Received: 2006/04/03
        • +-
        • Revised: 2006/05/08
        • +-
        • Revised: 2006/05/22
        • +-
        • Revised: 2006/06/20
        • +-
        • Final: 2006/06/20
        • +-
        • Draft: 2006/04/04 - 2006/06/01
        • ++ ++ ++ ++ ++ ++ SRFI 86: MU and NU simulating VALUES & CALL-WITH-VALUES, a= nd their related LET-syntax ++ ++ ++ ++ ++ ++ ++

          SRFI 86: MU and NU simulating VALUES & CALL-WITH-VALUES, and thei= r related LET-syntax

          ++ ++

          by Joo ChurlSoo

          ++

          This copy of the SRFI 86 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

          = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-86/srfi-86.html.

          ++ ++

          Status

          ++ ++

          This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 86@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

          ++ +=20 +-

          Abstract

          ++

          Abstract

          +=20=20=20=20=20 +

          + Unlike the values/call-with-values mechanism of +@@ -66,7 +76,7 @@ multiple values. In addition, they have several new bin= ding forms for + useful functions such as escape, recursion, etc. +

          +=20 +-

          Rationale

          ++

          Rationale

          +=20 +

          + It is impossible to bind the evaluated result of values +@@ -79,7 +89,8 @@ consumer procedure of call-with-values. Th= e following are examples + show the differences. +

          +=20 +-
          (define v (values 1 2 3))		=3D> error
          ++
          ++(define v (values 1 2 3))		=3D> error
          + (define v (lambda () (values 1 2 3)))	=3D> (lambda () (values 1 2 3))
          + (define m (mu 1 2 3))			=3D> (lambda (f) (f 1 2 3))
          + (define a (apply values 1 '(2 3)))	=3D> error
          +@@ -107,21 +118,24 @@ best explained by simple examples.
          +=20
          + 

          In SRFI 11:

          +=20 +-
          (let-values ((a (values 1 2)) ((b c) (values 3 4)))
          ++
          ++(let-values ((a (values 1 2)) ((b c) (values 3 4)))
          + 	    (list a b c))
          + =3D> ((1 2) 3 4)
          + 
          +=20 +

          In SRFI 71:

          +=20 +-
          (srfi-let (((values . a) (values 1 2)) ((values b c) (values 3 4)))
          ++
          ++(srfi-let (((values . a) (values 1 2)) ((values b c) (values 3 4)))
          + 	  (list a b c))
          + =3D> ((1 2) 3 4)
          + 
          +=20 +

          In this SRFI:

          +=20 +-
          (alet (a (mu 1 2) ((b c) (mu 3 4)))
          ++
          ++(alet (a (mu 1 2) ((b c) (mu 3 4)))
          +   (list a b c))
          + =3D> ((1 2) 3 4)
          + 
          +@@ -134,7 +148,8 @@ sequence from left to right unlike let of= R5RS and +=20 +

          In SRFI 71:

          +=20 +-
          (srfi-let ((a (begin (display "1st") 1))
          ++
          ++(srfi-let ((a (begin (display "1st") 1))
          + 	   (b c (values (begin (display "2nd") 2) 3))
          + 	   (d (begin (display "3rd") 4))
          + 	   ((values e . f) (values (begin (display "4th") 5) 6)))
          +@@ -144,7 +159,8 @@ sequence from left to right unlike let of=
           R5RS and
          +=20
          + 

          In this SRFI:

          +=20 +-
          (alet ((a (begin (display "1st") 1))
          ++
          ++(alet ((a (begin (display "1st") 1))
          +        (b c (mu (begin (display "2nd") 2) 3))
          +        (d (begin (display "3rd") 4))
          +        ((e . f) (mu (begin (display "4th") 5) 6)))
          +@@ -157,7 +173,8 @@ sequence from left to right unlike let of=
           R5RS and
          +    syntactically possible, as well as a single expression that produce
          +    multiple values.

          +=20 +-
          (alet* (((a b) (mu 1 2))
          ++
          ++(alet* (((a b) (mu 1 2))
          + 	((c d e) a (+ a b c) (+ a b c d))
          + 	((f . g) (mu 5 6 7))
          + 	((h i j . k) e 9 10 h i j))
          +@@ -172,14 +189,16 @@ allowed to take multiple values bindings.

          +=20 +

          In SRFI 71:

          +=20 +-
          (srfi-let tag ((a 1) (b 2) (c 3) (d 4) (e 5))
          ++
          ++(srfi-let tag ((a 1) (b 2) (c 3) (d 4) (e 5))
          + 	  (if (< a 10) (tag 10 b c d e) (list a b c d e)))
          + =3D> (10 2 3 4 5)
          + 
          +=20 +

          In this SRFI:

          +=20 +-
          (alet* tag ((a 1) (a b b c (mu (+ a 2) 4 5 6)) ((d e e) b 5 (+ a b c=
          )))
          ++
          ++(alet* tag ((a 1) (a b b c (mu (+ a 2) 4 5 6)) ((d e e) b 5 (+ a b c)))
          +        (if (< a 10) (tag a 10 b c c d e d) (list a b c d e)))
          + =3D> (10 6 6 5 5)
          + 
          +@@ -189,7 +208,8 @@ allowed to take multiple values bindings.

          + named-alet. It is also allowed to take multiple values + bindings.

          +=20 +-
          (alet* ((a 1)
          ++
          ++(alet* ((a 1)
          + 	((b 2) (b c c (mu 3 4 5)) ((d e d (mu a b c)) . intag) . tag)
          + 	(f 6))
          +   (if (< d 10)
          +@@ -203,7 +223,8 @@ bindings.

          +=20 +
        • They have a new binding form that has an escape function.

          +=20 +-
          (alet ((exit)
          ++
          ++(alet ((exit)
          +        (a (begin (display "1st") 1))
          +        (b c (mu (begin (display "2nd") 2) (begin (display "3rd") 3))))
          +   (display (list a b c))
          +@@ -217,7 +238,8 @@ bindings.

          + integrated into the alet and alet* with a + syntactic keyword and.

          +=20 +-
          (alet ((and (a (begin (display "1st") 1))
          ++
          ++(alet ((and (a (begin (display "1st") 1))
          + 	    (b (begin (display "2nd") 2))
          + 	    (c (begin (display "false") #f))
          + 	    (d (begin (display "3nd") 3))))
          +@@ -238,7 +260,8 @@ integrated into the alet and alet*<=
          /code> with a
          +    syntactic keywords opt and cat in the
          +    similar way to let-optionals in Scsh.

          +=20 +-
          ((lambda (str . rest)
          ++
          ++((lambda (str . rest)
          +    (alet* ((len (string-length str))
          + 	   (opt rest
          + 		(start 0 (integer? start)
          +@@ -277,8 +300,9 @@ integrated into the alet and alet*<=
          /code> with a
          + 	  are integrated into the alet and
          + 	  alet* with a syntactic keyword key.
          + 	  They use any Scheme objects as keywords.
          +-
          +-

          (define rest-list '(a 10 cc 30 40 b 20))
          ++

          ++
          ++(define rest-list '(a 10 cc 30 40 b 20))
          + (alet ((key rest-list (a 1) (b 2) ((c 'cc) 3) . d)) (list a b c d))
          + =3D> (10 2 30 (40 b 20))
          +=20
          +@@ -318,7 +342,8 @@ integrated into the alet and alet*<=
          /code> with a
          + into the alet and alet* with a
          +     syntactic keyword rec.

          +=20 +-
          (alet* ((a 1)
          ++
          ++(alet* ((a 1)
          + 	(rec (a 2) (b 3) (b (lambda () c)) (c a))
          + 	(d 50))
          +   (list a (b) c d))
          +@@ -330,7 +355,8 @@ into the alet and alet* with=
           a
          + and values to handle multiple values with a syntactic
          + keyword values like SRFI 71.

          +=20 +-
          (alet ((a b (mu 1 2))
          ++
          ++(alet ((a b (mu 1 2))
          +        (values c d (values 3 4))	;This is different from SRFI 71.
          +        ((e f) (mu 5 6))
          +        ((values g h) (values 7 8))
          +@@ -347,7 +373,8 @@ keyword values like S=
          RFI 71.

          + environment in alet and as an intervening internal + environment in alet*.

          +=20 +-
          (alet ((a 1)
          ++
          ++(alet ((a 1)
          +        (() (define a 10) (define b 100))
          +        (b a))
          +   (list a b))
          +@@ -362,9 +389,10 @@ keyword values like =
          SRFI 71.

          +
        • + +=20 +-

          Specification

          ++

          Specification

          +=20 +-
          (mu <expr> ...)			=3D> (lambda (f) (f <expr> ...))
          ++
          ++(mu <expr> ...)			=3D> (lambda (f) (f <expr> ...))
          + (nu <expr> ... <exprn>)		=3D> (lambda (f) (apply f <exp=
          r> ... <exprn>))
          + 
          +=20 +@@ -381,7 +409,8 @@ argument procedure of mu is called with t= he <expr>s, + and that of nu is applied to APPLY procedure with the + <expr>s.

          +=20 +-
          (alet  (<binding spec> ...) body ...)
          ++
          ++(alet  (<binding spec> ...) body ...)
          + (alet* (<binding spec> ...) body ...)
          + 
          +=20 +@@ -406,17 +435,20 @@ and that of nu is applied to APPLY proc= edure with the +
        • (<binding spec1> <binding spec2> ... . <var>)<=
          /pre>
        • +
        • (() . <var>)
        • +
        • (and (<var1> <expr1> [<test1>]) (<var2> =
          <expr2> [<test2>]) ...)
        • +-
        • (opt <rest list>
          ++
        • ++(opt <rest list>
          +     (<var1> <default1> [<test1> [<true substitute1&g=
          t; [<false substitute1>]]])
          +     ...
          +     (<varn> <defaultn> [<testn> [<true substituten&g=
          t; [<false substituten>]]])
          +     . [<rest var>])
        • +-
        • (cat <rest list>
          ++
        • ++(cat <rest list>
          +      (<var1> <default1> [<test1> [<true substitute1&=
          gt; [<false substitute1>]]])
          +      ...
          +      (<varn> <defaultn> [<testn> [<true substituten&=
          gt; [<false substituten>]]])
          +      . [<rest var>])
        • +-
        • (key <rest list>
          ++
        • ++(key <rest list>
          +  (<var spec1> <default1> [<test1> [<true substitute1=
          > [<false substitute1>]]])
          +  ...
          +  (<var specn> <defaultn> [<testn> [<true substituten=
          > [<false substituten>]]])
          +@@ -527,7 +559,8 @@ instead of signaling an error.  If it returns a true v=
          alue and there is a
          + substitute>.
          +       
        • +=20 +-
        • (cat <rest list>
          ++
        • ++(cat <rest list>
          +      (<var1> <default1> [<test1> [<true substitute1&=
          gt; [<false substitute1>]]])
          +      ...
          +      (<varn> <defaultn> [<testn> [<true substituten&=
          gt; [<false substituten>]]])
          +@@ -549,7 +582,8 @@ and <test> returns a true value, <var> is =
          finally bound to
          + the result of evaluating <true substitute>.
          +       
        • +=20 +-
        • (key <rest list>
          ++
        • ++(key <rest list>
          +  (<var spec1> <default1> [<test1> [<true substitute1=
          > [<false substitute1>]]])
          +  ...
          +  (<var specn> <defaultn> [<testn> [<true substituten=
          > [<false substituten>]]])
          +@@ -642,7 +676,8 @@ This works as an intervening external environment in
          +       
        • + +=20 +-
          (alet  name (<binding spec> ...) body ...)
          ++
          ++(alet  name (<binding spec> ...) body ...)
          + (alet* name (<binding spec> ...) body ...)
          + 
          +=20 +@@ -651,9 +686,10 @@ These are the same as the named-let (R5R= S, 4.2.4) except + binding specification. These allow all sorts of bindings in <binding + spec>.

          +=20 +-

          Examples

          ++

          Examples

          +=20 +-
          (alet ((a (begin (display "1st") 1))
          ++
          ++(alet ((a (begin (display "1st") 1))
          +        ((b c) 2 (begin (display "2nd") 3))
          +        (() (define m #f) (define n (list 8)))
          +        ((d (begin (display "3rd") 4))
          +@@ -749,14 +785,15 @@ spec>.

          + "cdefghi" +
          +=20 +-

          Implementation

          ++

          Implementation

          +=20 +

          + The following implementation is written in R5RS hygienic macros and + requires SRFI 23 (Error reporting mechanism). +

          +=20 +-
          ;;; mu & nu
          ++
          ++;;; mu & nu
          + (define-syntax mu
          +   (syntax-rules ()
          +     ((mu argument ...)
          +@@ -1888,7 +1925,7 @@ requires SRFI 23 (Error reporting mechanism).
          +      (let ((e z)) bd ...))))
          + 
          +=20 +-

          References

          ++

          References

          +=20 +
            +
          • [R5RS] Richard Kelsey, William Clinger, and Jona= than Rees: Revised(5) +@@ -1896,20 +1933,21 @@ requires SRFI 23 (Error reporting mechanism). + Link +
          • [SRFI 2] Oleg Kiselyov: and-let*: = and and with local bindings, a guarded + let* special form. +- Link
          • ++ Link +
          • [SRFI 11] Lars T. Hansen: Syntax for receiving= multiple values. +- Link
          • ++ Link +
          • [SRFI 51] Joo ChurlSoo: Handling rest list. +- Link
          • ++ Link +
          • [SRFI 71] Sebastian Egner: Extended let<= /code>-syntax for multiple values. +- Link
          • ++ Link +
          • [Scsh] Olin Shivers, Brian Carlstrom, Martin Gas= bichler, Mike Sperber +- Link
          • ++ Link +
          +=20=09=20=20=20=20 +-

          Copyright

          +- ++

          Copyright

          ++

          + Copyright (c) 2006 Joo ChurlSoo. ++

          +

          + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), +@@ -1917,10 +1955,12 @@ to deal in the Software without restriction, inclu= ding without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: +-

          ++

          ++

          + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. +-

          ++

          ++

          + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +@@ -1928,10 +1968,8 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY = CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +- +-


          ++

          ++
          +
          Editor: Mike + Sperber
          +- +- + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-87.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-87.html +index 73986bb..7920a28 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-87.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-87.html +@@ -1,44 +1,63 @@ +- +-SRFI 87: =3D> in case clauses ++ ++ ++ ++ ++ ++ SRFI 87: =3D> in case clauses ++ ++ ++ ++ +=20 +-

          Title

          ++ +=20 +-=3D> in case clauses ++

          SRFI 87: =3D> in case clauses

          +=20 +-

          Author

          ++

          by Chongkai Zhu

          ++

          This copy of the SRFI 87 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

          = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-87/srfi-87.html.

          +=20 +-Chongkai Zhu ++

          Status

          +=20 +-

          Status

          +- +-This SRFI is currently in ``final'' status. To see an explanation of each +-status that a SRFI can hold, see +-here. +-To provide input on this SRFI, please +-mailto:srfi-87@srfi.schemers= .org. +-See instruc= tions +-here to subscribe to the list. You can access the discussion via +-t= he +-archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. +-

          +-

            +-
          • Received: 2006/04/10
          • +-
          • Revised: 2006/05/08
          • +-
          • Draft: 2006/04/10 - 2006/06/08
          • +-
          • Final: 2006/10/18
          • ++

            This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 87@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

            ++ +=20 +-

            Abstract

            This SRFI proposes an extension to the case= syntax=20 ++

            Abstract

            ++

            ++This SRFI proposes an extension to the case syntax + to allow the =3D> clauses as in cond. +-

            Rationale

            case is introduced as a syntax sugar based= on=20 ++

            ++ ++

            Rationale

            ++

            ++case is introduced as a syntax sugar based on + cond, which helps to save a explicit calling to let.=20 + But without the =3D> clause, if the result e= xpression=20 + needs the value of key, the let can't be saved.= For an=20 + easy example, suppose we want the following: ++

            +
            (case (get-symbol)
            +   ((true) #t)
            +   ((false) #f)
            +@@ -49,14 +68,15 @@ write:

            + (cond ((eq? key 'true) #t) + ((eq? key 'false) #f) + (else key)))
            +-

            Specification

            ++ ++

            Specification

            +

            (Based on R5RS section 4.2.1 Conditionals)

            +
            +-
            library syntax: case <key&= gt; <clause1>=20 +- <clause2> ...=20 ++
            library syntax: case <key> <c= lause1> ++ <clause2> ... +
            Syntax: <Key> may be any expression. Each <c= lause>=20 + should have the form
            ((<datum1> ...) <expression1>=
             <expression2> ...),
            +-

            where each <datum> is an external representation of some objec= t. All=20 ++

            where each <datum> is an external representation of = some object. All=20 + the <datum>s must be distinct. The last <clause> may be an = "else=20 + clause," which has the form

            (else <expression1> <=
            expression2> ...).
            +

            Alternatively, a <clause> may be of th= e form=20 +@@ -66,7 +86,7 @@ write:

            +

            Semantics: A `case' expression is evaluated as= =20 + follows. <Key> is evaluated and its result is compared against ea= ch=20 + <datum>. If the result of evaluating <key> is equivalent (i= n the=20 +- sense of `eqv?'; see section see section 6.1 Equivalence=20 ++ sense of `eqv?'; see section see section 6.1 Equivalence=20 + predicates) to a <datum>, then the expressions in the corresp= onding=20 + <clause> are evaluated from left to right and the result(s) of th= e last=20 + expression in the <clause> is(are) returned as the result(s) of t= he=20 +@@ -79,13 +99,14 @@ write:

            + <expression> is evaluated. Its value must be a procedure that acc= epts=20 + one argument; this procedure is then called on the value of <Key>= and=20 + the value(s) returned by this procedure is(are) returned by the=20 +- `case' expression.

            ++ `case' expression.

            +

            (Based on R5RS section 3.5 Proper tail recursion)

            +-
            If a cond or case ex= pression is in a tail context, and has a clause of the=20 ++

            If a cond or case exp= ression is in a tail context, and has a clause of the=20 + form (<expression1> =3D> <expression2>) then the=20 + (implied) call to the procedure that results from the evaluation of <e= xpression2>=20 +-is in a tail context. <expression2> itself is not in a t= ail context.

            +-

            Implementation

            ++is in a tail context. <expression2> itself is not in a t= ail context.

            ++ ++

            Implementation

            +
            (define-syntax case
            +   (syntax-rules (else =3D>)
            +     ((case (key ...)
            +@@ -118,24 +139,31 @@ is in a tail context. <expression2>=
             itself is not in a tail con
            +      (if (memv key '(atoms ...))
            +          (begin result1 result2 ...)
            +          (case key clause clauses ...)))))
            +-

            Copyright

            Copyright (C) 2006 Chongkai Zhu. All Rights Reserved.=20 ++

            Copyright

            ++

            ++Copyright (C) 2006 Chongkai Zhu. All Rights Reserved. ++

            +

            Permission is hereby granted, free of charge, to any person obtaining = a copy=20 + of this software and associated documentation files (the "Software"), to = deal in=20 + the Software without restriction, including without limitation the rights= to=20 + use, copy, modify, merge, publish, distribute, sublicense, and/or sell co= pies of=20 + the Software, and to permit persons to whom the Software is furnished to = do so,=20 + subject to the following conditions:=20 +-

            The above copyright notice and this permission notice shall be inc= luded in=20 ++

            ++

            ++The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software.=20 +-

            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EX= PRESS OR=20 ++

            ++

            ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, = FITNESS=20 + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHO= RS OR=20 + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WH= ETHER=20 + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN=20 + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE= .=20 +-


            ++

            ++
            +=20 +-
            Editor: Mike=20 ++
            Editor: Mike=20 + Sperber
            Last=20 +-modified: Mon Apr 10 21:20:25 CEST 2006 +- ++modified: Mon Apr 10 21:20:25 CEST 2006 +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-9.html b/srfi-doc/srf= i/scribblings/srfi-std/srfi-9.html +index 0bf112a..4a64ddb 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-9.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-9.html +@@ -1,63 +1,90 @@ +- +- ++ ++ + ++ ++ + SRFI 9: Defining Record Types ++ ++ ++ + +=20 + +=20 +-

            Title

            ++

            SRFI 9: Defining Record Types

            +=20 +-SRFI 9: Defining Record Types ++

            by Richard Kelsey

            ++

            This copy of the SRFI 9 specifica= tion document ++is distributed as part of the Racket package ++srfi-doc.

            = The canonical source of this document is ++https://srfi.sch= emers.org/srfi-9/srfi-9.html.

            +=20 +-

            Author

            ++

            Status

            +=20 +-Richard Kelsey +- +-

            Status

            +- +-This SRFI is currently in ``final'' status. To see an explanation of eac= h status that a SRFI can hold, see here. +-You can access the discussion via the archive of the mailing list. +-

              +-
            • Received: 1999/07/01 +-
            • Revised: 1999/08/25 +-
            • Draft: 1999/07/07-1999/09/06 +-
            • Final: 1999/09/09 +-
            +- +-

            Abstract

            ++

            This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-9= @nospamsrfi.schemers.org. To su= bscribe to the list, follow these instructions. You can access previous messages v= ia the mailing list arch= ive.

            ++
              ++
            • Received: 1999-07-01
            • ++
            • Revised: 1999-08-25
            • ++
            • Draft: 1999-07-07--1999-09-06
            • ++
            • Final: 1999-09-09
            • ++
            +=20 ++

            Abstract

            ++

            + This SRFI describes syntax for creating new data types, called record typ= es. + A predicate, constructor, and field accessors and modifiers are defined f= or + each record type. Each new record type is distinct from all existing typ= es, + including other record types and Scheme's predefined types. ++

            +=20 +-

            Rationale

            +- ++

            Rationale

            ++

            + Many Scheme implementations provide means for creating new types, + usually called either records or structures. + The DEFINE-RECORD-TYPE syntax described here is a slight +- simplification of one written for Scheme 48 by Jonathan Rees. ++ simplification of one written for Scheme 48 by Jonathan Rees. + Unlike many record-defining macros or special forms, it + does not create any new identifiers. + Instead, the names of the + record type, predicate, constructor, and so on are all listed explicitly + in the source. + This has the following advantages: +-

              +-
            • It can be defined using a simple SYNTAX-RULES macro ++

              ++
                ++
              • ++ It can be defined using a simple SYNTAX-RULES macro + in Scheme implementations that provide a procedural interface + for creating record types. +-
              • It does not restrict users to a particular naming convention. +-
              • Tools like grep and GNU Emacs's tag facility will see t= he ++
              • ++
              • ++ It does not restrict users to a particular naming convention. ++
              • ++
              • ++ Tools like grep and GNU Emacs's tag facility will see the + defining occurrence of each identifier. +-
              +- +-

              Specification

              ++
            • ++
            +=20 ++

            Specification

            ++

            + The syntax of a record-type definition is: +- +-

            ++

            ++
            +  <command or definition>=20=20=20=20=20=20=20=20=20=20=20
            +    -> <record type definition>           ; addition to 8.1.6 in =
            R5RS
            +=20
            +@@ -72,70 +99,80 @@ The syntax of a record-type definition is:
            +=20
            +  <field tag> -> <identifier>
            +  <... name>  -> <identifier>
            +-
            =20 +- ++
            ++

            + DEFINE-RECORD-TYPE is generative:=20 + each use creates a new record type that is distinct from all existing typ= es, + including other record types and Scheme's predefined types. +- ++

            ++

            + Record-type definitions may only occur at top-level (there are two + possible semantics for `internal' record-type definitions, generative + and nongenerative, and no consensus as to which is better). +- +-

            ++

            ++

            + An instance of DEFINE-RECORD-TYPE is equivalent to the follo= wing + definitions: +-

              +-
            • <type name> is bound to a representation of the r= ecord ++

              ++
                ++
              • ++ <type name> is bound to a representation of the re= cord + type itself. Operations on record types, such as defining print + methods, reflection, etc. are left to other SRFIs. +- +-
              • <constructor name> is bound to a procedure that t= akes ++
              • ++
              • ++ <constructor name> is bound to a procedure that ta= kes + as many arguments as there are <field tag>s in the + (<constructor name> ...) + subform and returns a new <type name> record. + Fields whose tags are listed with <constructor name> + have the corresponding argument as their + initial value. The initial values of all other fields are unspecifie= d. +- +-
              • <predicate name> is a predicate that returns #T w= hen ++
              • ++
              • ++ <predicate name> is a predicate that returns #T wh= en + given a value returned by <constructor name> and #F + for everything else. +- +-
              • Each <accessor name> is a procedure that takes a = record ++
              • ++
              • ++ Each <accessor name> is a procedure that takes a r= ecord + of type <type name> and returns the current value = of the + corresponding field. + It is an error to pass an accessor a value which is not a record of + the appropriate type. +-=20=20=20=20 +-
              • Each <modifier name> is a procedure that takes a = record ++
              • ++
              • ++ Each <modifier name> is a procedure that takes a r= ecord + of type <type name> and a value which becomes the = new + value of the corresponding field; an unspecified value is returned. + It is an error to pass a modifier a first + argument which is not a record of the appropriate type. +-
              ++
            • ++
            +=20 +-

            ++

            + Records are disjoint from the types listed in Section 4.2 of R5RS. +- +-

            ++

            ++

            + Set!ing the value of any of these identifiers has no + effect on the behavior of any of their original values. +- +-

            ++

            ++

            + The following +-

            ++

            =20=20 ++
            +   (define-record-type :pare
            +     (kons x y)
            +     pare?
            +     (x kar set-kar!)
            +     (y kdr))
            +-
            ++
            ++

            + defines KONS to be a constructor, KAR and + KDR to be accessors, SET-KAR! to be a modifier, + and PARE? to be a predicate for :PAREs. +- +-

            ++

            ++
            +   (pare? (kons 1 2))        --> #t
            +   (pare? (cons 1 2))        --> #f
            +   (kar (kons 1 2))          --> 1
            +@@ -143,27 +180,33 @@ and PARE? to be a predicate for :=
            PAREs.
            +   (let ((k (kons 1 2)))
            +     (set-kar! k 3)
            +     (kar k))                --> 3
            +-
            +- +-

            Implementation

            ++
            +=20 ++

            Implementation

            ++

            + This code is divided into three layers. In top-down order these are: +-

              +-
            1. Syntax definitions for DEFINE-RECORD-TYPE and an auxili= ary +- macro. +-
            2. An implementation of record types with a procedural interface. ++

              ++
                ++
              1. ++Syntax definitions for DEFINE-RECORD-TYPE and an auxillary m= acro. ++
              2. ++
              3. ++An implementation of record types with a procedural interface. + Some Scheme implementations already have something close to this. +-
              4. Vector-like records implemented in R5RS. This redefines some standa= rd ++
              5. ++
              6. ++Vector-like records implemented in R5RS. This redefines some standard + Scheme procedures and therefor must be loaded before any other code, incl= uding + part 2 above. Note that these procedures can be used to break the + record-type abstraction (for example, RECORD-SET! can be used + to modify the type of a record). Access to these procedures should be + restricted. +-
              ++
            3. ++
            +=20 +-

            Syntax definitions

            ++

            Syntax definitions

            +=20 +-
            ++
            + ; Definition of DEFINE-RECORD-TYPE
            +=20
            + (define-syntax define-record-type
            +@@ -193,23 +236,23 @@ restricted.
            +      (begin
            +        (define accessor (record-accessor type 'field-tag))
            +        (define modifier (record-modifier type 'field-tag))))))
            +-
            ++
            +=20 +-

            Record types

            ++

            Record types

            +=20 +-
            ++
            + ; We define the following procedures:
            + ;=20
            +-; (make-record-type <type-name <field-names>)    -> <record-t=
            ype>
            +-; (record-constructor <record-type<field-names>) -> <construc=
            tor>
            +-; (record-predicate <record-type>)               -> <predicate&g=
            t;
            +-; (record-accessor <record-type <field-name>)    -> <accessor=
            >
            +-; (record-modifier <record-type <field-name>)    -> <modifier=
            >
            ++; (make-record-type <type-name <field-names>)    -> <recor=
            d-type>
            ++; (record-constructor <record-type<field-names>) -> <const=
            ructor>
            ++; (record-predicate <record-type>)               -> <predicat=
            e>
            ++; (record-accessor <record-type <field-name>)    -> <acces=
            sor>
            ++; (record-modifier <record-type <field-name>)    -> <modif=
            ier>
            + ;   where
            +-; (<constructor> <initial-value> ...)         -> <record&g=
            t;
            +-; (<predicate> <value>)                       -> <boolean&=
            gt;
            +-; (<accessor> <record>)                       -> <value>
            +-; (<modifier> <record> <value>)         -> <unspecif=
            ic>
            ++; (<constructor> <initial-value> ...)         -> <recor=
            d>
            ++; (<predicate> <value>)                       -> <boole=
            an>
            ++; (<accessor> <record>)                       -> <value=
            >
            ++; (<modifier> <record> <value>)         -> <unspe=
            cific>
            +=20
            + ; Record types are implemented using vector-like records.  The first
            + ; slot of each record contains the record's type, which is itself a
            +@@ -308,19 +351,19 @@ restricted.
            +                     type))
            +           (record-set! thing index value)
            +           (error "modifier applied to bad value" type tag thing)))))
            +-
            ++
            +=20 +-

            Records

            ++

            Records

            +=20 +-
            ++
            + ; This implements a record abstraction that is identical to vectors,
            + ; except that they are not vectors (VECTOR? returns false when given a
            + ; record and RECORD? returns false when given a vector).  The following
            + ; procedures are provided:
            +-;   (record? <value>)                -> <boolean>
            +-;   (make-record <size>)             -> <record>
            +-;   (record-ref <record> <index>)    -> <value>
            +-;   (record-set! <record> <index> <value>) -> <unspe=
            cific>
            ++;   (record? <value>)                -> <boolean>
            ++;   (make-record <size>)             -> <record>
            ++;   (record-ref <record> <index>)    -> <value>
            ++;   (record-set! <record> <index> <value>) -> <un=
            specific>
            + ;
            + ; These can implemented in R5RS Scheme as vectors with a distinguishing
            + ; value at index zero, providing VECTOR? is redefined to be a procedure
            +@@ -366,9 +409,9 @@ restricted.
            +=20
            + (define (record-set! record index value)
            +   (vector-set! record (+ index 1) value))
            +-
            ++
            +=20 +-

            Copyright

            ++

            Copyright

            +=20 +

            Copyright (C) Richard Kelsey (1999). All Rights Reserved.

            +=20 +@@ -395,9 +438,9 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O= R IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

            +=20 +-
            ++
            +=20 +-
            Editor: Mi= ke Sperber
            ++
            Editor: Mike Sperber
            +=20 + + +diff --git a/srfi-doc/srfi/scribblings/srfi-std/srfi-98.html b/srfi-doc/sr= fi/scribblings/srfi-std/srfi-98.html +index 8ff8dfb..f5edd0e 100644 +--- a/srfi-doc/srfi/scribblings/srfi-std/srfi-98.html ++++ b/srfi-doc/srfi/scribblings/srfi-std/srfi-98.html +@@ -1,57 +1,63 @@ +- +- +-= +- +- +-=20=20 ++ ++ ++ ++ ++ + SRFI 98: An interface to access environment variables. +- +- +-

            Title

            +- +-An interface to access environment variables. +- +-

            Author

            +- +-Taro Minowa(Higepon) +- +-

            Status

            +- +-This SRFI is currently in ``final'' status. To see an explanation of +-each status that a SRFI can hold, see here. +- +-To provide input on this SRFI, please send email to +- +-<srfi minus 98 at srfi dot schemers dot org>. See= =20 +-instruction= s here to subscribe to +-the list. You can access the discusssion via=20 +-t= he archive of the mailing list. +-You can access +-post-finalization messages via +- +-the archive of the mailing list. +-

              +- +-
            • Received: 2008/07/06
            • +-
            • Draft: 2008/07/06 - 2008/09/06
            • +-
            • Revised: 2008/07/18
            • +-
            • Revised: 2008/07/18
            • +-
            • Revised: 2008/08/14
            • +-
            • Final: 2008/09/19
            • +-
            • R6RS library name: 2009/02/16
            • ++ ++ ++ ++ ++ ++ ++ ++

              SRFI 98: An interface to access environment variables.

              ++ ++

              by Taro Minowa (Higepon)

              ++

              This copy of the SRFI 98 specific= ation document ++is distributed as part of the Racket package ++srfi-doc.

              = The canonical source of this document is ++https://srfi.s= chemers.org/srfi-98/srfi-98.html.

              ++ ++

              Status

              ++ ++

              This SRFI is currently in final status. Here is an explanation of each stat= us that a SRFI can hold. To provide input on this SRFI, please send email = to srfi-= 98@nospamsrfi.schemers.org. To = subscribe to the list, follow these instructions. You can access previous messages= via the mailing list a= rchive.

              ++ +=20 +-

              Abstract

              ++

              Abstract

              + This SRFI specifies the procedure get-environment-variable, which gets + the value of the specified environment variable, and the procedure + get-environment-variables, which gets an association list of all + environment variables. +=20 +-

              Rationale

              ++

              Rationale

              +

              Most operating systems provide a mechanism for passing auxiliary + parameters implicitly to child processes. Usually, this mechanism is + called "the environment", and is conceptually a map from string names +-to string values. The string names are called environment ++to string values. The string names are called enviornment + variables.

              +=20 +

              Some applications rely on environment variables to modify their +@@ -60,9 +66,8 @@ protocols rely on environment variables as a form of int= erprocess + communication. For example, most implementations of the common + gateway interface (CGI) use environment variables to pass + Meta-Variables from the server to the script [1]. +-Environment variables are also required +-by SRFI 96: SLIB Prerequisites. ++Environment variables are also required by ++SRFI 96: SLIB Prerequisites. + Providing a means to access environment variables is therefore + indispensable for writing practical programs in Scheme. +

              +@@ -83,10 +88,10 @@ Meta-Variables "QUERY_STRING", "CONTENT_LENGTH" and +
          +=20 +

          [1] The Common Gateway Interface (CGI) Version= 1.1, RFC3875, http://www.ietf.org/rfc/rfc3875.

          +-

          Specification

          ++

          Specification

          +
          R6RS library name
          + The following two procedures belong to the R6RS library named (srfi :98 o= s-environment-variables). +-
          Function: get-environment-varia=
          ble name
          Returns the value of ++
          Function: get-environment-variable n=
          ame
          Returns the value of + the named environment variable as a string, or #f if the named + environment variable is not found. The name argument is expected to be + a string. +@@ -96,19 +101,21 @@ the environment variable. + If get-environment-variable can't decode the value, get-environment-varia= ble may raise an exception. +
          (get-environment-variable "PATH") =3D> "/usr/local/sbin:/usr/loca=
          l/bin:/usr/sbin:/usr/bin"
          + 
          +-
          Function: get-environment-vari=
          ables
          ++
          Function: get-environment-variables=
          
          + Returns names and values of all the environment variables as an a-list. + The same decoding considerations as for get-environment-variable apply. +
          (get-environment-variables) =3D> (("PATH" . "/usr/local/sbin:/usr=
          /local/bin:/usr/sbin:/usr/bin") ("USERNAME" . "taro"))
          + 
          +=20 +-

          Implementation

          +-

          Gauche

          +-
          (define get-environment-variable sys-getenv)
          ++

          Implementation

          ++

          Gauche

          ++
          ++(define get-environment-variable sys-getenv)
          + (define get-environment-variables sys-environ->alist)
          + 
          +-

          Scheme48

          +-
          (define (get-environment-variable name)
          ++

          Scheme48

          ++
          ++(define (get-environment-variable name)
          +   (cond
          +     ((lookup-environment-variable name) =3D> os-string->string)
          +     (else #f)))
          +@@ -117,17 +124,19 @@ The same decoding considerations as for get-environm=
          ent-variable apply.
          +         (cons (os-string->string (car p)) (os-string->string (cdr p=
          ))))
          +        (environment-alist)))
          + 
          +-

          scsh

          +-
          (define get-environment-variable getenv)
          ++

          scsh

          ++
          ++(define get-environment-variable getenv)
          + (define get-environment-variables env->alist)
          + 
          +=20 +-

          SCM

          +-
          (define get-environment-variable getenv)
          ++

          SCM

          ++
          ++(define get-environment-variable getenv)
          + (define get-environment-variables getenv)
          + 
          +=20 +-

          Issues

          ++

          Issues

          +

          get-environment-variable is expected to return a "Scheme string". + Unfortunately, many current platforms, including POSIX-like ones, do + not require environment variables to be interpretable as sequences of +@@ -143,7 +152,7 @@ implementations, and captures the semantically desirab= le behavior in + the common case that the byte sequence is interpretable as a string.

          +=20 + +-

          Appendix: Existing implementations

          ++

          Appendix: Existing implementations

          + + + +@@ -161,10 +170,10 @@ the common case that the byte sequence is interpreta= ble as a string.

          + + +
          Scheme implementationget environment variableget all the environment variables as an a-list
          Bigloo(getenv name) =3D> (or string? false) name:st= ring? 
          STklos(getenv name) =3D> (or string? false) name:st= ring?(getenv)
          SCM(getenv name) =3D> (or string? false) name:strin= g?(getenv)
          +-

          Acknowledgements

          ++

          Acknowledgements

          + Thanks to Shiro Kawai, Alexey Radul, jmuk, Kokosabu, leque and all the me= mbers of the #Lisp_Scheme IRC channel on Freenode. +-

          Copyright

          +-Copyright (C) Taro Minowa(Higepon) (2008). All Rights Reserved. ++

          Copyright

          ++Copyright (C) Taro Minowa (Higepon) (2008). All Rights Reserved. +

          + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the +@@ -185,7 +194,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIO= N OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

          +-
          ++
          +
          Editor: Mike Sperber
          + + +diff --git a/srfi-doc/srfi/scribblings/srfi.scrbl b/srfi-doc/srfi/scribbli= ngs/srfi.scrbl +index 4ab1397..3b1807d 100644 +--- a/srfi-doc/srfi/scribblings/srfi.scrbl ++++ b/srfi-doc/srfi/scribblings/srfi.scrbl +@@ -1,12 +1,23 @@ + #lang scribble/doc +-@(require srfi/scribblings/util ++@(require "util.rkt" + scribble/manual + scribble/eval + scriblib/render-cond + scribble/core + scribble/html-properties + (for-syntax scheme/base) +- (for-label scheme/base ++ (for-label (except-in scheme/base ++ make-date ;; but we DO want `date` ++ date? ++ date-second ++ date-minute ++ date-hour ++ date-day ++ date-month ++ date-year ++ date-week-day ++ date-year-day) ++ srfi/19 + racket/stream)) +=20 + @; ---------------------------------------------------------------------- +@@ -27,7 +38,7 @@ which can be implemented as libraries. To import the bin= dings of SRFI + ] +=20 + This document lists the SRFIs that are supported by Racket and +-provides a link to the original SRFI specification (which is also ++provides links to the original SRFI specifications (which are also + distributed as part of Racket's documentation). +=20 + @table-of-contents[] +@@ -95,7 +106,7 @@ functions. + (concatenate #f "concatenate") + (concatenate! #f "concatenate!") + (reverse #f "reverse") +- (reverse! #f "srfi-1.html") ++ (reverse! #f "reverse!") + (append-reverse #f "append-reverse") + (append-reverse! #f "append-reverse!") + (zip #f "zip") +@@ -114,7 +125,7 @@ functions. + (unfold #f "unfold") + (unfold-right #f "unfold-right") + (map #f "map") +- (for-each #f "srfi-1.html") ++ (for-each #f "for-each") + (append-map #f "append-map") + (append-map! #f "append-map!") + (map! #f "map!") +@@ -153,7 +164,6 @@ functions. + (alist-copy #f "alist-copy") + (alist-delete #f "alist-delete") + (alist-delete! #f "alist-delete!") +- (lset #f "lset") + (lset=3D #f "lset=3D") + (lset-adjoin #f "lset-adjoin") + (lset-union #f "lset-union") +@@ -198,6 +208,11 @@ are also available from @racketmodname[scheme/foreign= ]. +=20 + @; ---------------------------------------- +=20 ++@; special case for historical license reasons ++@include-section["srfi-5-doc-free.scrbl"] ++ ++@; ---------------------------------------- ++ + @srfi[6]{Basic String Ports} +=20 + @redirect[6 '( +@@ -430,7 +445,7 @@ are also available from @racketmodname[scheme/foreign]. + @srfi[17]{Generalized set!} +=20 + @redirect[17 '( +- (set! #t "set!") ++ (set! #t "!set") + (getter-with-setter #f "getter-with-setter") + )] +=20 +@@ -439,13 +454,13 @@ are also available from @racketmodname[scheme/foreig= n]. + @srfi[19]{Time Data Types and Procedures} +=20 + @redirect[19 '( +- (time-duration #f "") ++ (time-duration #f "time-duration") + (time-monotonic #f "time-monotonic") + (time-process #f "time-process") + (time-tai #f "time-tai") + (time-thread #f "time-thread") + (time-utc #f "time-utc") +- (current-date #f "") ++ (current-date #f "current-date") + (current-julian-day #f "current-julian-day") + (current-modified-julian-day #f "current-modified-julian-day") + (current-time #f "current-time") +@@ -526,20 +541,31 @@ to the one provided by @racketmodname[racket/base] i= n most cases + (see @racket[date]). +=20 + For backwards compatibility, when an invalid date field value is +-provided to the SRFI constructor, the constructor will produce a lax +-date structure. A lax date structure is @emph{not} compatible with +-functions from @racketmodname[racket/base] or ++provided to the SRFI constructor, the constructor will produce a ++@deftech{lax date structure}. A lax date structure is @emph{not} ++compatible with functions from @racketmodname[racket/base] or + @racketmodname[racket/date]. SRFI functions such as + @racket[string->date] may return a lax date structure depending on the + format string. ++The predicate @racket[lax-date?] recognizes lax dat structures. ++ ++As an extension, Racket's implementation of @racket[string->date] ++supports @litchar{~?} as a conversion specifier: ++it parses one- and two-digit years like @litchar{~y} ++and three- and four-digit years like @litchar{~Y}. +=20 + @(define srfi-19-eval (make-base-eval)) + @(srfi-19-eval '(require srfi/19)) +=20 ++@examples[#:eval srfi-19-eval ++ (string->date "4-1-99" "~d-~m-~?") ++ (string->date "4-1-1999" "~d-~m-~?") ++] ++ + @defproc[(lax-date? [v any/c]) boolean?]{ +=20 +-Returns @racket[#t] if @racket[_v] is a lax date structure. Otherwise +-returns @racket[#f]. ++Returns @racket[#t] if @racket[_v] is a @tech{lax date structure}. ++Otherwise, returns @racket[#f]. +=20 + @examples[#:eval srfi-19-eval + (lax-date? (make-date 0 19 10 10 14 "bogus" "bogus" 0)) +@@ -688,8 +714,8 @@ This SRFI's syntax is part of Racket's default reader = and printer. +=20 + @redirect[40 '( + (stream-cons #t "stream-cons") +- (stream? #f "stream?") +- (stream-null? #f "stream-null?") ++ (stream? #f "streamp") ++ (stream-null? #f "stream-nullp") + (stream-car #f "stream-car") + (stream-cdr #f "stream-cdr") + (stream-delay #t "stream-delay") +@@ -787,7 +813,7 @@ same as from @racketmodname[racket/stream]. + (:real-range #t ":real-range") + (:char-range #t ":char-range") + (:port #t ":port") +- (:dispatched #t "") ++ (:dispatched #t ":dispatched") + (:generator-proc #t ":generator-proc") + (:do #t ":do") + (:let #t ":let") +@@ -814,7 +840,7 @@ from @racketmodname[scheme/base] and @mz-if from + (vector-append #f "vector-append") + (vector-concatenate #f "vector-concatenate") + (vector? #f "vector-p") +- (vector-empty? #f "vector-empty?") ++ (vector-empty? #f "vector-empty-p") + (vector=3D #f "vector-eq") + (vector-ref #f "vector-ref") + (vector-length #f "vector-length") +@@ -837,10 +863,10 @@ from @racketmodname[scheme/base] and @mz-if from + (vector-reverse! #f "vector-reverse-bang") + (vector-copy! #f "vector-copy-bang") + (vector-reverse-copy! #f "vector-reverse-copy-bang") +- (vector->list #f "vector->list") +- (reverse-vector->list #f "reverse-vector->list") +- (list->vector #f "list->vector") +- (reverse-list->vector #f "reverse-list->vector") ++ (vector->list #f "vector-to-list") ++ (reverse-vector->list #f "reverse-vector-to-list") ++ (list->vector #f "list-to-vector") ++ (reverse-list->vector #f "reverse-list-to-vector") + )] +=20 + @; ---------------------------------------- +diff --git a/srfi-doc/srfi/scribblings/util.rkt b/srfi-doc/srfi/scribbling= s/util.rkt +index d67c82a..786fea9 100644 +--- a/srfi-doc/srfi/scribblings/util.rkt ++++ b/srfi-doc/srfi/scribblings/util.rkt +@@ -59,3 +59,20 @@ +=20 + @(define srfi-std (style #f (list (install-resource "srfi-std")))) +=20 ++@(define srfi-license-history-url ++ ;; explains the "historical reasons" for the restrictive license on SR= FI 5 ++ "https://srfi-email.schemers.org/srfi-announce/msg/2652023/") ++@(define srfi-5-std-taglet "srfi-5-std") ++@(define srfi-5-license-taglet "srfi-5-std-license") ++ ++@(define (racket-license-link . args) ++ ;; FIXME why does this not work? ++ #; ++ (apply seclink "License" #:doc '(lib "scribblings/main/license.scrbl")= args) ++ (define (link base) ++ (apply hyperlink (string-append base "license/index.html") args)) ++ (cond-element ++ [(or latex text) ++ (link "https://docs.racket-lang.org/")] ++ [else ++ (link "../")])) +diff --git a/srfi-lib/info.rkt b/srfi-lib/info.rkt +index da0d08d..56d31b7 100644 +--- a/srfi-lib/info.rkt ++++ b/srfi-lib/info.rkt +@@ -2,6 +2,8 @@ +=20 + (define collection 'multi) +=20 ++(define version "1.1") ++ + (define deps '("scheme-lib" + "base" + "srfi-lite-lib" +diff --git a/srfi-lib/srfi/5/let.rkt b/srfi-lib/srfi/5/let.rkt +index a1a88fb..19be931 100644 +--- a/srfi-lib/srfi/5/let.rkt ++++ b/srfi-lib/srfi/5/let.rkt +@@ -7,51 +7,62 @@ + (define-syntax (s:let stx) + (define-syntax-class loopid + #:description "loop identifier" ++ #:opaque + (pattern :id)) + (define-syntax-class binding-pair + #:description "binding pair" + (pattern [name:id arg:expr])) +- (define-syntax-class rest-binding +- #:description "\"rest\" binding" +- (pattern [rest-name:id rest-arg:expr ...])) +- (define-splicing-syntax-class let-style-bindings +- #:description "let-style bindings" +- #:attributes (loop* [name 1] [arg 1] rest-name [rest-arg 1]) +- ;; in let-style bindings, rest-binding only allowed w/ +- ;; at least one binding-pair +- (pattern (~seq (~optional loop*:loopid) +- (:binding-pair ...)) +- #:with (rest-arg ...) #'() +- #:attr rest-name #f) +- (pattern (~seq (~optional loop*:loopid) +- (:binding-pair ...+ . :rest-binding)))) +- (define-splicing-syntax-class define-style-bindings +- #:description "define-style bindings" +- #:attributes (loop* [name 1] [arg 1] rest-name [rest-arg 1]) +- (pattern (~seq (loop*:loopid :binding-pair ...)) +- #:with (rest-arg ...) #'() +- #:attr rest-name #f) +- (pattern (~seq (loop*:loopid +- :binding-pair ... +- . :rest-binding)))) +- (define-splicing-syntax-class bindings ++ (define-splicing-syntax-class maybe-rest-binding + #:description #f ++ #:no-delimit-cut ++ (pattern (~describe "\"rest\" binding" ++ (~seq (~describe #:opaque "\"rest\" identifier" ++ rest-name:id) ++ ~! ++ (~describe #:opaque "\"rest\" init expressi= on" ++ rest-arg:expr) ++ ...))) ++ (pattern (~seq) ++ #:attr rest-name #f ++ #:with (rest-arg ...) #'())) ++ (define-splicing-syntax-class bindings ++ #:description "bindings" + #:attributes (loop* [name 1] [arg 1] rest-name [rest-arg 1]) +- (pattern :let-style-bindings) +- (pattern :define-style-bindings))=20 ++ (pattern ++ (~describe ++ "\"named let\"-style bindings" ++ (~seq loop*:loopid ++ ~! ++ (~describe ++ "parenthesized sequence of binding pairs with optional \"res= t\" binding" ++ (:binding-pair ... :maybe-rest-binding))))) ++ (pattern ++ (~describe ++ "\"define\"-style bindings" ++ (~seq (loop*:loopid ~! :binding-pair ... :maybe-rest-binding)))) ++ (pattern ++ (~describe ++ "\"let\"-style bindings with no loop identifier" ++ (~seq ++ (~or* (~describe #:opaque "empty sequence of binding pairs" ++ (~and () (:binding-pair ... :maybe-rest-binding))) ++ (~describe ++ "parenthesized sequence of one or more binding pairs with o= ptional \"rest\" binding" ++ (:binding-pair ...+ :maybe-rest-binding))))) ++ #:attr loop* #f)) + (syntax-parse stx +- [(_ () body:expr ...+) +- #'(let () body ...)] + [(_ :bindings +- body:expr ...+) ++ (~describe "body forms" (~seq body:expr ...+))) ++ ;; it is NOT an error for loop* to be shaddowed: ++ ;; see https://srfi-email.schemers.org/srfi-5/msg/18712014/ + #:fail-when (check-duplicate-identifier + (syntax->list #'(name ... (~? rest-name)))) + "duplicate variable name" +- #:with loop (or (attribute loop*) #'tmp-loop) +- #'(letrec ([loop (=CE=BB (~? (name ... . rest-name) +- (name ...)) +- body ...)]) ++ #:with loop (or (attribute loop*) #'anonymous-srfi-5-let) ++ #`(letrec ([loop #,(syntax-property ++ (syntax/loc stx ++ (=CE=BB (~? (name ... . rest-name) ++ (name ...)) ++ body ...)) ++ 'inferred-name (or (attribute loop*) (void)))]) + (loop arg ... rest-arg ...))])) +- +- +- +diff --git a/srfi-test/tests/srfi/5/srfi-5-test.rkt b/srfi-test/tests/srfi= /5/srfi-5-test.rkt +index 47bb660..9b3ab73 100644 +--- a/srfi-test/tests/srfi/5/srfi-5-test.rkt ++++ b/srfi-test/tests/srfi/5/srfi-5-test.rkt +@@ -27,16 +27,24 @@ + (cons x y)) + '(1 2) + "rest binding w/ 1 value") ++ (check-equal? (s:let ([x 1] y 2) ++ (cons x y)) ++ '(1 2) ++ "rest binding w/ 1 value (no dot)") + (check-equal? (s:let ([x 1] . [y 2 3]) + (cons x y)) + '(1 2 3) + "rest binding w/ multiple values") ++ (check-equal? (s:let ([x 1] y 2 3) ++ (cons x y)) ++ '(1 2 3) ++ "rest binding w/ multiple values (no dot)") + (check-exn exn:fail:syntax? + (=CE=BB () (convert-syntax-error (s:let ([x 1 2]) x))) +- "rest binding alone is an error")) ++ "malformed binding pair is an error")) +=20 + (test-case +- "let-style loop" ++ "\"named let\"-style loop" + (check-equal? (s:let loop () 1) + 1 + "loop w/ no bindings is ok") +@@ -61,6 +69,13 @@ + [else (list args)])) + '((a) (b) (c d)) + "rest binding w/ 1 initial value") ++ (check-equal? (s:let loop ([continue? 0] args 'a) ++ (case continue? ++ [(0) (cons args (loop 1 'b))] ++ [(1) (cons args (loop 2 'c 'd))] ++ [else (list args)])) ++ '((a) (b) (c d)) ++ "rest binding w/ 1 initial value (no dot)") + (check-equal? (s:let loop ([continue? 0] + . [args 'a 'a1 'a2]) + (case continue? +@@ -69,12 +84,48 @@ + [else (list args)])) + '((a a1 a2) (b) (c d)) + "rest binding w/ multiple initial values") ++ (check-equal? (s:let loop ([continue? 0] args 'a 'a1 'a2) ++ (case continue? ++ [(0) (cons args (loop 1 'b))] ++ [(1) (cons args (loop 2 'c 'd))] ++ [else (list args)])) ++ '((a a1 a2) (b) (c d)) ++ "rest binding w/ multiple initial values (no dot)") ++ (check-equal? (s:let loop (x) ++ x) ++ '() ++ "rest binding alone w/ 0 initial values") ++ (check-equal? (s:let loop (x 1) ++ x) ++ '(1) ++ "rest binding alone w/ 1 initial value") ++ (check-equal? (s:let loop (x 1 2) ++ x) ++ '(1 2) ++ "rest binding alone w/ multiple initial values") ++ (check-equal? (s:let a (b (+ 1)) ++ b) ++ '(1) ++ ;; "confusable" here means that the expression (+ 1) ++ ;; could be confused for a binding pair ++ "rest binding alone w/ confusable initial value") ++ (check-exn (=CE=BB (e) ++ (and (exn:fail:syntax? e) ++ (regexp-match? #rx"^x: unbound" (exn-message e)))) ++ (=CE=BB () ++ (convert-syntax-error ++ (s:let a (b [x 1]) 2))) ++ "rest binding alone: correct error when confused w/ define= ") ++ (check-pred procedure? ++ (s:let loop (args 1 2 3) ++ loop) ++ "rest binding alone: does bind procedure") + (check-exn exn:fail:syntax? + (=CE=BB () (convert-syntax-error (s:let loop ([x 1 2]) x))) +- "rest binding alone is an error")) ++ "malformed binding pair is an error")) +=20 + (test-case +- "define-style loop" ++ "\"define\"-style loop" + (check-equal? (s:let (loop) 1) + 1 + "loop w/ no bindings is ok") +@@ -91,6 +142,20 @@ + (list x))) + '(1 2) + "loop w/ 2 normal args") ++ (check-equal? (s:let (loop [continue? 0] . [args]) ++ (case continue? ++ [(0) (cons args (loop 1 'b))] ++ [(1) (cons args (loop 2 'c 'd))] ++ [else (list args)])) ++ '(() (b) (c d)) ++ "rest binding w/ 0 initial values") ++ (check-equal? (s:let (loop [continue? 0] args) ++ (case continue? ++ [(0) (cons args (loop 1 'b))] ++ [(1) (cons args (loop 2 'c 'd))] ++ [else (list args)])) ++ '(() (b) (c d)) ++ "rest binding w/ 0 initial values (no dot)") + (check-equal? (s:let (loop [continue? 0] + . [args 'a]) + (case continue? +@@ -99,24 +164,94 @@ + [else (list args)])) + '((a) (b) (c d)) + "rest binding w/ 1 initial value") +- (check-equal? (s:let (loop [continue? 0] +- . [args 'a 'a1 'a2]) ++ (check-equal? (s:let (loop [continue? 0] args 'a) ++ (case continue? ++ [(0) (cons args (loop 1 'b))] ++ [(1) (cons args (loop 2 'c 'd))] ++ [else (list args)])) ++ '((a) (b) (c d)) ++ "rest binding w/ 1 initial value (no dot)") ++ (check-equal? (s:let (loop [continue? 0] args 'a 'a1 'a2) + (case continue? + [(0) (cons args (loop 1 'b))] + [(1) (cons args (loop 2 'c 'd))] + [else (list args)])) + '((a a1 a2) (b) (c d)) +- "rest binding w/ multiple initial values") ++ "rest binding w/ multiple initial values (no dot)") ++ (check-equal? (s:let (loop . [args]) ++ (case args ++ [(()) (cons args (loop 'b))] ++ [((b)) (cons args (loop 'c 'd))] ++ [else (list args)])) ++ '(() (b) (c d)) ++ "rest binding alone w/ 0 initial values") ++ (check-equal? (s:let (loop args) ++ (case args ++ [(()) (cons args (loop 'b))] ++ [((b)) (cons args (loop 'c 'd))] ++ [else (list args)])) ++ '(() (b) (c d)) ++ "rest binding alone w/ 0 initial values (no dot)") + (check-equal? (s:let (loop . [args 'a]) + (case args + [((a)) (cons args (loop 'b))] + [((b)) (cons args (loop 'c 'd))] + [else (list args)])) + '((a) (b) (c d)) +- "define-style loop can have only rest arg")) +- +- (check-exn exn:fail:syntax? +- (=CE=BB () +- (convert-syntax-error +- (s:let a (b [x 1]) x))) +- "combining let- and define- style loop names is an error"))) ++ "rest binding alone w/ 1 initial value") ++ (check-equal? (s:let (loop args 'a) ++ (case args ++ [((a)) (cons args (loop 'b))] ++ [((b)) (cons args (loop 'c 'd))] ++ [else (list args)])) ++ '((a) (b) (c d)) ++ "rest binding alone w/ 1 initial value (no dot)") ++ (check-equal? (s:let (loop . [args 'a1 'a2 'a3]) ++ (case args ++ [((a1 a2 a3)) (cons args (loop 'b))] ++ [((b)) (cons args (loop 'c 'd))] ++ [else (list args)])) ++ '((a1 a2 a3) (b) (c d)) ++ "rest binding alone w/ multiple initial values") ++ (check-equal? (s:let (loop args 'a1 'a2 'a3) ++ (case args ++ [((a1 a2 a3)) (cons args (loop 'b))] ++ [((b)) (cons args (loop 'c 'd))] ++ [else (list args)])) ++ '((a1 a2 a3) (b) (c d)) ++ "rest binding alone w/ multiple initial values (no dot)= ")) ++ (test-case ++ "shaddowing" ++ ;; See: https://srfi-email.schemers.org/srfi-5/msg/18712014/ ++ (check-equal? (s:let x ((x 1)) x) ++ 1 ++ "let-style: loop id can be shaddowed") ++ (check-equal? (s:let (x (x 1)) x) ++ 1 ++ "define-style: loop id can be shaddowed") ++ (check-eq? (object-name (s:let f () f)) ++ 'f ++ "let-style object name") ++ (check-eq? (object-name (s:let (g) g)) ++ 'g ++ "define-style object name") ++ (check-exn #rx"duplicate" ++ (=CE=BB () (convert-syntax-error (s:let loop ((x 1) x) #t)= )) ++ "let-style: check duplicate ids") ++ (check-exn #rx"duplicate" ++ (=CE=BB () (convert-syntax-error (s:let (loop (x 1) x) #t)= )) ++ "define-style: check duplicate ids") ++ (check-exn #rx"duplicate" ++ (=CE=BB () (convert-syntax-error (s:let ((x 1) (x 2)) #t))) ++ "non-loop: check duplicate ids")) ++ (test-case ++ "ambiguous \"define\"-style loop: preserve compatible behavior" ++ ;; See: https://srfi-email.schemers.org/srfi-5/msg/18709896/ ++ (check-pred procedure? ++ (s:let (ambiguous (+ 1) (- 2) (list 5)) ++ ambiguous) ++ "ambiguous is not a rest binding") ++ (check-equal? (s:let (ambiguous (+ 1) (- 2) (abs -7)) ++ (list + - abs)) ++ '(1 2 -7) ++ "binds identifiers")))) +diff --git a/srfi/info.rkt b/srfi/info.rkt +index c8d82de..45152e3 100644 +--- a/srfi/info.rkt ++++ b/srfi/info.rkt +@@ -3,11 +3,9 @@ + (define collection 'multi) +=20 + (define deps '("srfi-lib" +- "srfi-doc" +- "srfi-doc-nonfree")) ++ ["srfi-doc" #:version "1.1"])) + (define implies '("srfi-lib" +- "srfi-doc" +- "srfi-doc-nonfree")) ++ "srfi-doc")) +=20 + (define pkg-desc "Legacy SRFI (Scheme) libraries") +=20 +--=20 +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index e8d016c07b..62053500cb 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Cour= t=C3=A8s ;;; Copyright =C2=A9 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2020 Pierre Neidhardt -;;; Copyright =C2=A9 2021 Philip McGrath +;;; Copyright =C2=A9 2021, 2022 Philip McGrath ;;; Copyright =C2=A9 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -21,8 +21,6 @@ ;;; along with GNU Guix. If not, see . =20 (define-module (gnu packages racket) - #:use-module ((guix licenses) - #:select (asl2.0 expat lgpl3+)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -30,7 +28,10 @@ (define-module (gnu packages racket) #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) + #:use-module (ice-9 exceptions) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) @@ -47,200 +48,87 @@ (define-module (gnu packages racket) #:use-module (gnu packages multiprecision) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages xorg)) - -;; Commentary: -;; -;; Here's how bootstrapping minimal Racket works: -;; -;; - Racket BC [CGC] can be built with only a C compiler (except for -;; one caveat discussed below). -;; - 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 -;; 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 comp= iler -;; 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. -;; -;; So, we build CGC to build 3M to build bootfiles and CS. -;; -;; 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 -;; README file applies to all such subsystems: -;; -;; The Racket version must be practically the same as the current Rack= et -;; verson, although it can be the Racket BC implementation (instead of -;; the Racket CS implementation). -;; -;; Unlike Chez Scheme boot files, the files generated in "schemified" -;; are human-readable and -editable Scheme code. That provides a way -;; out of bootstrapping black holes, even without BC. -;; -;; However, other Racket subsystems implemented in Racket for Racket CS -;; use older C implementations for Racket BC, whereas the reader, expander, -;; and module system were completely replaced with the Racket implementati= on -;; as of Racket 7.0. -;; -;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) -;; are embeded in C as a static string constant. Eventually, they are furt= her -;; compiled by the C-implemented Racket BC bytecode and JIT compilers. -;; (On platforms where Racket BC's JIT is not supported, yet another compi= ler -;; instead compiles the linklets to C code, but this is not a bootstrapping -;; issue.) -;; -;; Code: - -(define cfg-flag:sh-for-rktio - `(string-append "CPPFLAGS=3D-DGUIX_RKTIO_PATCH_BIN_SH=3D" - (assoc-ref %build-inputs "sh") - "/bin/sh")) -(define cfg-flag:enable-lt - `(string-append "--enable-lt=3D" - (assoc-ref %build-inputs "libtool") - "/bin/libtool")) -(define cfg-flag:enable-racket - `(let ((racket (assoc-ref %build-inputs "racket"))) - (string-append "--enable-racket=3D" - racket - "/bin/racket"))) - -(define unpack-nanopass+stex - ;; Copied from chez-scheme. - ;; TODO: Eventually, we should refactor Chez Scheme - ;; enough to share more directly, so that we can make - ;; Racket's version of Chez avalable as a Guix package, - ;; e.g. for architectures not supported upstream. - ;; For now, we let Racket drive the Chez build process - ;; other than this step. - `(for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex"))) - + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) =20 (define-public racket-minimal (package (name "racket-minimal") - (version "8.3") ; note: remember to also update racket! - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit (string-append "v" version)))) - (sha256 - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") - (file-name (git-file-name name version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) - (modules '((guix build utils))) - (snippet - (with-imported-modules '((guix build utils)) - #~(begin - ;; Unbundle Chez submodules. - (with-directory-excursion "racket/src/ChezScheme" - ;; Remove bundled libraries (copied from 'chez-scheme'). - (for-each delete-file-recursively - '("stex" - "nanopass" - "lz4" - "zlib"))) - ;; Unbundle libffi. - (delete-file-recursively "racket/src/bc/foreign/libffi")))))) - (inputs - `(;; common to all racket-minimal variants: - ("openssl" ,openssl) - ("sqlite" ,sqlite) - ("sh" ,bash-minimal) - ;; only for CS - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static"))) - (native-inputs - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) + (version (package-version (racket-vm-for-system))) + (source (package-source (racket-vm-for-system))) + ;; For cross-compilation, Matthew Flatt recommends reusing + ;; as much of `raco cross` as possible. So, put that off until + ;; we have a build system for Racket packages. + (inputs (list openssl sqlite (racket-vm-for-system))) (build-system gnu-build-system) (arguments - `(#:configure-flags - (list "--enable-csonly" - "--enable-libz" - "--enable-liblz4" - ,cfg-flag:enable-racket - ,cfg-flag:sh-for-rktio) - #:out-of-source? #true - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main distribution. - #:tests? #f - #:modules ((ice-9 match) - (guix build gnu-build-system) - (guix build utils)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (string-append (assoc-ref inputs "bootfiles") "/boot") - "boot")) - #t)) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f ,@(map (lambda (lib) - (string-append (assoc-ref inputs lib) - "/lib")) - '("openssl" - "sqlite")))) - (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - ,version - "/catalog/") - #f)))))) - #t)) - (add-before 'configure 'change-directory - (lambda _ - (chdir "racket/src") - #t)) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda* (#:key outputs #:allow-other-keys) - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append (assoc-ref outputs "out") - "/share/racket/pkgs")) - #t))))) + (list + #:configure-flags + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + (list #$(file-append (this-package-input "openssl") "/l= ib") + #$(file-append (this-package-input "sqlite") "/li= b")))) + #:make-flags #~`("base") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (ice-9 match)) + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs configure-flags make-flags + #:allow-other-keys) + (let* ((vm-dir (search-input-directory inputs "opt/racket-vm= ")) + (racket (string-append vm-dir "/bin/racket"))) + (apply invoke + racket + #$make-installation-layer.rkt + `(,@(cond + ((false-if-exception + (search-input-file + inputs "etc/racket/config.rktd")) + =3D> (lambda (file) + `("--parent" + ,(dirname (dirname (dirname file)))))) + (else + '())) + ,@configure-flags + ,vm-dir + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p (string-append #$output "/lib/racket/pkgs")) + (for-each (lambda (name) + (copy-recursively + (string-append "pkgs/" name) + (string-append #$output "/lib/racket/pkgs/" nam= e))) + '("base" "racket-lib")))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket + (search-input-file inputs "/opt/racket-vm/bin/racket"= ))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) (home-page "https://racket-lang.org") (synopsis "Racket without bundled packages such as DrRacket") (description @@ -254,280 +142,77 @@ (define (write-racket-hash alist) DrRacket IDE, are not included.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list asl2.0 expat)))) - - -(define-public racket-minimal-bc-3m - (hidden-package - (package - (inherit racket-minimal) - (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (delete "zlib" "zlib:static" "lz4" "lz4:static") - (prepend libffi ;; <- only for BC variants - ))) - (native-inputs - `(("libtool" ,libtool) - ("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc)))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) - ((#:configure-flags _ '()) - `(list "--enable-bconly" - ,cfg-flag:enable-racket - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)) - ((#:phases usual-phases) - `(modify-phases ,usual-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") - (description "The Racket BC (``before Chez'' or ``bytecode'') -implementation was the default before Racket 8.0. It uses a compiler writ= ten -in C targeting architecture-independent bytecode, plus a JIT compiler on m= ost -platforms. Racket BC has a different C API and supports a slightly differ= ent -set of architectures than the current default runtime system, Racket CS (b= ased -on ``Chez Scheme''). - -This package is the normal implementation of Racket BC with a precise garb= age -collector, 3M (``Moving Memory Manager'').") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list lgpl3+ asl2.0 expat))))) - - -(define-public racket-minimal-bc-cgc - (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs - (alist-delete "racket" (package-native-inputs racket-minimal-bc-3m))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:configure-flags _ '()) - `(list "--enable-cgcdefault" - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default= in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by t= he -Racket CS implementation. - -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) - - -(define-public racket-bootstrap-chez-bootfiles - (hidden-package - (package - (inherit racket-minimal) - (name "racket-bootstrap-chez-bootfiles") - (inputs `()) - (native-inputs - `(("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-3m)) - ("stex" ,(package-source stex)) - ("nanopass" ,(package-source chez-nanopass)))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (delete 'configure) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (invoke (string-append (assoc-ref inputs "racket") - "/bin/racket") - "rktboot/main.rkt" - "--dest" (assoc-ref outputs "out"))) - #t)) - (delete 'check) - (delete 'install)))) - (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 -supported platforms.) - -The Racket package @code{cs-bootstrap} (part of the main Racket Git -repository) implements enough of a Chez Scheme simulation to load the Chez -Scheme compiler purely from source into Racket and apply the compiler to -itself, thus bootstrapping Chez Scheme. Bootstrapping takes about 10 time= s as -long as using an existing Chez Scheme, but @code{cs-bootstrap} supports Ra= cket -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 upstre= am -Chez Scheme.") - (license (list asl2.0))))) - - -(define %installer-mirrors - ;; Source: - ;; https://github.com/racket/racket-lang-org/blob/master/download/data.r= kt#L58 - ;; Matthew Flatt says: "note that many are commented out" - ;; INVARIANT: End with a trailing "/"! - '("https://mirror.racket-lang.org/installers/" - "https://www.cs.utah.edu/plt/installers/" - "https://plt.cs.northwestern.edu/racket-mirror/" - "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" - ;; Universit=C3=A4t T=C3=BCbingen is using a self-signed HTTPS certifi= cate: - "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" - "https://racket.infogroep.be/" - )) - -(define %main-repo-main-distribution-pkgs - ;; These are the packages developed in the main Racket Git repository - ;; that are part of the main distribution. - '("at-exp-lib" - "base" - "compiler-lib" - ;; NOT "compiler-test" - "compiler" - "net-doc" - "net-lib" - ;; NOT "net-test" - "net" - ;; NOT "plt-services" - ;; NOT "racket-benchmarks" - ;; NOT "racket-build-guide" - "racket-doc" - "racket-index" - "racket-lib" - ;; NOT "racket-test-core" - ;; NOT "racket-test-extra" - ;; NOT "racket-test" - "zo-lib")) - + (license (list license:asl2.0 license:expat)))) =20 (define-public racket (package (inherit racket-minimal) (name "racket") - (version (package-version racket-minimal)) ; needed for origin uri to = work - (source - (origin - (method url-fetch) - (uri (map (lambda (base) - (string-append base version "/racket-src.tgz")) - %installer-mirrors)) - (sha256 - (base32 - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) - (snippet - #~(begin - (use-modules (guix build utils) - (ice-9 match) - (ice-9 regex)) - ;; unbundle minimal Racket - (for-each delete-file-recursively - '("collects" - "doc" - "etc" - "README" - "src")) - ;; unbundle package sources included elsewhere - (with-directory-excursion "share/pkgs" - (for-each delete-file-recursively - '#+%main-repo-main-distribution-pkgs)) - #t)))) + (source #f) (inputs - `(("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("glib" ,glib) - ("glu" ,glu) - ("gmp" ,gmp) - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("mpfr" ,mpfr) - ("pango" ,pango) - ("unixodbc" ,unixodbc) - ("libedit" ,libedit))) - (native-inputs - `(("racket" ,racket-minimal) - ("extend-layer" ,extend-layer) - ("main-repo" ,(package-source racket-minimal)))) + (list cairo + fontconfig + glib + glu + gmp + gtk+ ;; propagates gdk-pixbuf+svg + libjpeg-turbo + libpng + libx11 ;; ?? wayland ?? + mesa + mpfr + pango + unixodbc + libedit ;; TODO reconsider in light of expeditor and readline-g= pl + racket-minimal ;; <-- TODO non-tethered layer + (racket-vm-for-system))) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'configure 'unpack-packages - (let ((unpack (assoc-ref %standard-phases 'unpack))) - (lambda* (#:key native-inputs inputs outputs #:allow-other-k= eys) - (let* ((racket (assoc-ref (or native-inputs inputs) "racket= ")) - (prefix (assoc-ref outputs "out")) - (pkgs-dir (string-append prefix "/share/racket/pkgs"= ))) - (mkdir-p pkgs-dir) - (copy-recursively - "share/links.rktd" - (string-append prefix "/share/racket/links.rktd")) - (copy-recursively "share/pkgs" pkgs-dir) - ;; NOTE: unpack changes the working directory - (unpack #:source (assoc-ref (or native-inputs inputs) - "main-repo")) - (for-each (lambda (pkg) - (define dest (string-append pkgs-dir "/" pkg)) - (mkdir-p dest) - (copy-recursively (string-append "pkgs/" pkg) - dest)) - ',%main-repo-main-distribution-pkgs) - #t)))) - (replace 'configure - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out"))) - (apply invoke - (string-append racket "/bin/racket") - (assoc-ref inputs "extend-layer") - racket - prefix - (map - (lambda (lib) - (string-append (assoc-ref inputs lib) "/lib")) - '("cairo" - "fontconfig" - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))) - #t))) - (replace 'build - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) - "racket") - "/bin/racket") - "--config" - (string-append (assoc-ref outputs "out") - "/etc/racket") - "-l" - "raco" - "setup") - #t)) - (delete 'install)) - ;; we still don't have these: - #:tests? #f)) + (substitute-keyword-arguments (package-arguments racket-minimal) + ((#:configure-flags _ '()) + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + =3D> (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' packa= ge") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit")))))) + ((#:make-flags _ '()) + #~`("main-distribution")) + ((#:phases parent-phases #~%standard-phases) + #~(modify-phases #$parent-phases + (delete 'unpack) + (replace 'build + (lambda args + (mkdir-p (string-append #$output "/lib/racket/pkgs")) + (for-each + (match-lambda + ((name src) + (copy-recursively + src + (string-append #$output "/lib/racket/pkgs/" name)))) + '(#$@main-distribution-packages)))))))) (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme famil= y, @@ -539,82 +224,900 @@ (define dest (string-append pkgs-dir "/" pkg)) DrRacket IDE, libraries for GUI and web programming, and implementations of languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalo= g."))) =20 - -(define extend-layer +(define make-installation-layer.rkt (scheme-file - "extend-layer.rkt" + "make-installation-layer.rkt" `(module - extend-layer racket/base + make-installation-layer racket/base (require racket/cmdline racket/match racket/file + racket/port racket/list racket/pretty) - (define config-file-pth - "etc/racket/config.rktd") (define (build-path-string . args) (path->string (apply build-path args))) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) - (command-line - #:args (parent-layer prefix . lib-dir*) - (let* ([config - (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) - (hash-set* - config - main-key - (build-path-string prefix pth) - search-key - (list* #f - (hash-ref config - main-key - (build-path-string parent-layer pth)) - (filter values (hash-ref config search-key null))))= )] - [config - (hash-set config - 'apps-dir - (build-path-string prefix "share/applications"))] - [config - ;; place new foreign lib-search-dirs before old - ;; foreign dirs, but after Racket layers - (let-values - ([(rkt extra) - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - (hash-ref config 'lib-search-dirs))]) - (hash-set config + (define tethered? #f) + (define parent #f) + (define extra-foreign-lib-search-dirs '()) + (define-values [vm-dir prefix] + (command-line + #:once-each + [("--tethered") "create a tethered layer" + (set! tethered? #t)] + [("--parent") dir "path of parent layer, if any" + (set! parent dir)] + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` synt= ax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (vm-dir prefix) + (values vm-dir prefix))) + (let* ([config + (for/fold + ([config (file->value + (if parent + (build-path parent "etc/racket/config.rktd") + (build-path vm-dir "etc/config.rktd")))]) + ([spec + (in-list + '((lib-dir lib-search-dirs "lib/racket" "lib") + (share-dir share-search-dirs "share/racket" "share") + (links-file links-search-files + "lib/racket/links.rktd" + "share/links.rktd") + (pkgs-dir pkgs-search-dirs "lib/racket/pkgs" "share/pkg= s") + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(bin-dir bin-search-dirs "bin" "bin") + (bin-dir bin-search-dirs "unused-untethered-bin" "bin") + (man-dir man-search-dirs "share/man" "share/man") + (doc-dir doc-search-dirs "share/doc/racket" "doc") + (include-dir include-search-dirs + "include/racket" + "include")))]) + (match-define (list main-key search-key pth vm-pth) spec) + (hash-set* + config + main-key + (build-path-string prefix pth) + search-key + (list* #f + (hash-ref config + main-key + (lambda () + (if parent + (build-path-string parent pth) + (build-path-string vm-dir vm-pth)))) + (filter values (hash-ref config search-key null)))))] + [config + (hash-update config 'lib-search-dirs - (append rkt - lib-dir* - extra)))] - [bin-dir - (hash-ref config 'bin-dir)] - [config - (hash-set* config - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) - (make-parent-directory* new-config-pth) - (call-with-output-file* - new-config-pth - (lambda (out) - (pretty-write config out)))))))) + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pt= h))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] + [config + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packag= es + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we suppo= rt + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaroung Guile reader/printe= r: + ['|3m| "-bc"] + [_ ""])))] + [config + (cond + [tethered? + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(define bin-dir (hash-ref config 'bin-dir)) + (define bin-dir (build-path-string prefix "bin")) + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps= -dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [else + config])]) + (define new-config-pth + (build-path prefix "etc/racket/config.rktd")) + (make-parent-directory* new-config-pth) + (call-with-output-file* + new-config-pth + (lambda (out) + (pretty-write config out))))))) + +(define-public main-distribution-packages + (let* ((%racket-version (package-version (racket-vm-for-system))) + (%racket-commit (string-append "v" %racket-version))) + ;; on release, commit will be %racket-commit + (append-map + (match-lambda + ((source . pkgs) + (map (match-lambda + ((? string? name) + (list name (file-append source (string-append "/" name)))) + ((name ".") + (list name source)) + ((name rel-path) + (list name (file-append source (string-append "/" rel-path= ))))) + pkgs))) + `((,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/2d") + (commit %racket-commit))) + (sha256 (base32 + "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr"= )) + (file-name + (git-file-name "racket-2d" %racket-version))) + "2d" "2d-doc" "2d-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/algol60") + (commit %racket-commit))) + (sha256 (base32 + "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx"= )) + (file-name + (git-file-name "racket-algol60" %racket-version))) + ("algol60" ".")) + (,(package-source (racket-vm-for-system)) + ("at-exp-lib" "pkgs/at-exp-lib") + ("compiler" "pkgs/compiler") + ("compiler-lib" "pkgs/compiler-lib") + ("net" "pkgs/net") + ("net-doc" "pkgs/net-doc") + ("net-lib" "pkgs/net-lib") + ("racket-doc" "pkgs/racket-doc") + ("racket-index" "pkgs/racket-index") + ("sandbox-lib" "pkgs/sandbox-lib") + ("zo-lib" "pkgs/zo-lib")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/cext-lib") + (commit %racket-commit))) + (sha256 (base32 + "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341"= )) + (file-name (git-file-name "racket-cext-lib" %racket-version))) + "cext-lib" "dynext-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/class-iop") + (commit %racket-commit))) + (sha256 (base32 + "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l"= )) + (file-name (git-file-name "racket-class-iop" %racket-version))) + "class-iop-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/compatibility") + (commit "37f11132cdad7ef27386b68383d073f275d67c31"))) + (sha256 (base32 + "0bfqwscjpyi325br5pa6g62g9c8lq18a80zp5g3d2qzn3n3mi6x0"= )) + (file-name (git-file-name "racket-compatibility" %racket-versio= n))) + "compatibility" "compatibility-doc" "compatibility-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/contract-profile") + (commit "95d980a076126b8e4e4284e912f2a7d9d3ab6860"))) + (sha256 (base32 + "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3"= )) + (file-name + (git-file-name "racket-contract-profile" %racket-version))) + ("contract-profile" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/data") + (commit "e32d012b394e32e102e8a9adfcc885bb0541ab51"))) + (sha256 (base32 + "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55"= )) + (file-name (git-file-name "racket-data" %racket-version))) + "data" "data-doc" "data-enumerate-lib" "data-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/datalog") + (commit "7d160a86451af8298093d07674a2eb0e1a0161a4"))) + (sha256 (base32 + "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp"= )) + (file-name (git-file-name "racket-datalog" %racket-version))) + ("datalog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/db") + (commit %racket-commit))) + (sha256 (base32 + "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5"= )) + (file-name (git-file-name "racket-db" %racket-version))) + "db" "db-doc" "db-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/deinprogramm") + (commit %racket-commit))) + (sha256 (base32 + "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd"= )) + (file-name (git-file-name "racket-deinprogramm" %racket-version= ))) + "deinprogramm" "deinprogramm-signature") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/distributed-places") + (commit %racket-commit))) + (sha256 (base32 + "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0"= )) + (file-name + (git-file-name "racket-distributed-places" %racket-version))) + "distributed-places" "distributed-places-doc" "distributed-places-= lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/draw") + (commit %racket-commit))) + (sha256 (base32 + "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly"= )) + (file-name (git-file-name "racket-draw" %racket-version))) + "draw" "draw-doc" "draw-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/drracket") + (commit %racket-commit))) + (sha256 (base32 + "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c"= )) + (file-name (git-file-name "racket-drracket" %racket-version))) + "drracket" + "drracket-plugin-lib" + "drracket-tool" + "drracket-tool-doc" + "drracket-tool-lib" + "drracket-tool-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/ds-store") + (commit "949ca63dd00522b3ab8aec2d71c543ece8266872"))) + (sha256 (base32 + "0ajr27kipp4dr1qlisaghsb3h7lhhjwrfw2r79b5myczsa1mp661"= )) + (file-name (git-file-name "racket-ds-store" %racket-version))) + "ds-store" "ds-store-doc" "ds-store-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eli-tester") + (commit "036e07d43a1f478ea1750881d5591d983ce1ffaf"))) + (sha256 (base32 + "0icx6wn14gjm8kdmq1jppqgq87sxkras4qb5xmdr6wigxafhjqyk"= )) + (file-name (git-file-name "racket-eli-tester" %racket-version))) + ("eli-tester" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eopl") + (commit %racket-commit))) + (sha256 (base32 + "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s"= )) + (file-name (git-file-name "racket-eopl" %racket-version))) + ("eopl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/errortrace") + (commit %racket-commit))) + (sha256 (base32 + "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip"= )) + (file-name (git-file-name "racket-errortrace" + (package-version (racket-vm-for-syste= m))))) + "errortrace" "errortrace-doc" "errortrace-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/expeditor") + (commit %racket-commit))) + (sha256 (base32 + "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf"= )) + (file-name (git-file-name "racket-expeditor" %racket-version))) + "expeditor" "expeditor-doc" "expeditor-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/frtime") + (commit %racket-commit))) + (sha256 (base32 + "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5"= )) + (file-name (git-file-name "racket-frtime" %racket-version))) + ("frtime" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/future-visualizer") + (commit %racket-commit))) + (sha256 (base32 + "1758qq769m0r14xf64sl2ix2l9z340kvapar0j7s5kdg42lmvnhm"= )) + (file-name + (git-file-name "racket-future-visualizer" %racket-version))) + "future-visualizer" "future-visualizer-pict" "future-visualizer-ty= ped") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/games") + + (commit %racket-commit))) + (sha256 (base32 + "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d"= )) + (file-name (git-file-name "racket-games" %racket-version))) + ("games" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui") + (commit %racket-commit))) + (sha256 (base32 + "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj"= )) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) + (file-name (git-file-name "racket-gui" %racket-version))) + "gui" "gui-doc" "gui-lib" "tex-table") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui-pkg-manager") + (commit %racket-commit))) + (sha256 (base32 + "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5"= )) + (file-name + (git-file-name "racket-gui-pkg-manager" %racket-version))) + "gui-pkg-manager-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/htdp") + (commit %racket-commit))) + (sha256 (base32 + "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl"= )) + (file-name (git-file-name "racket-htdp" %racket-version))) + "htdp" "htdp-doc" "htdp-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/html") + (commit %racket-commit))) + (sha256 (base32 + "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x"= )) + (file-name (git-file-name "racket-html" %racket-version))) + "html" "html-doc" "html-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/icons") + (commit %racket-commit))) + (sha256 (base32 + "1s5a6j11fg3fdr6b7vm2q7q178d7q8b8igy73bs211r27qrd1gg7"= )) + (file-name (git-file-name "racket-icons" %racket-version))) + ("icons" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/images") + (commit %racket-commit))) + (sha256 (base32 + "0rpjxqw34bq5m08kh1ldl1mr7s9z1lyydxxcyzb292kqh9qiqvfl"= )) + (file-name (git-file-name "racket-images" %racket-version))) + "images" "images-doc" "images-gui-lib" "images-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/lazy") + (commit %racket-commit))) + (sha256 (base32 + "176ylzgbdsbmqknpihaz519afq71pyjkv1h87j5v8jfbpbddyfsf"= )) + (file-name (git-file-name "racket-lazy" %racket-version))) + ("lazy" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/macro-debugger") + (commit %racket-commit))) + (sha256 (base32 + "14hyrwbkffr61fk44l02xb47bhv5zccw0ymaa9kxld86hvyqhqbm"= )) + (file-name (git-file-name "racket-macro-debugger" %racket-versi= on))) + "macro-debugger" "macro-debugger-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/main-distribution") + (commit %racket-commit))) + (sha256 (base32 + "0m2n9s32s8a4a2gn4ywrm9l8jycdm5ayi5w9kh5wchhrrw7qzq7y"= )) + (file-name + (git-file-name "racket-main-distribution" %racket-version))) + ("main-distribution" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/make") + (commit %racket-commit))) + (sha256 (base32 + "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa"= )) + (file-name (git-file-name "racket-make" %racket-version))) + ("make" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/math") + (commit %racket-commit))) + (sha256 (base32 + "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac"= )) + (file-name (git-file-name "racket-math" %racket-version))) + "math" "math-doc" "math-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mysterx") + (commit %racket-commit))) + (sha256 (base32 + "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48"= )) + (file-name (git-file-name "racket-mysterx" %racket-version))) + ("mysterx" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzcom") + (commit %racket-commit))) + (sha256 (base32 + "0rc9pfj7gwm5azghqvcibz6si1x5s2v8mr2yngk7ssq9gzfbi6a4"= )) + (file-name (git-file-name "racket-mzcom" %racket-version))) + ("mzcom" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzscheme") + (commit %racket-commit))) + (sha256 (base32 + "192c52zi726h5wjamxrhivjw2waq1im0zpyxhbrkrxknm8x84bs9"= )) + (file-name (git-file-name "racket-mzscheme" %racket-version))) + "mzscheme" "mzscheme-doc" "mzscheme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RenaissanceBug/racket-cookies") + (commit %racket-commit))) + (sha256 (base32 + "0k0hifxhywl5c3hjcaiizc098dpyk001d981p572gly116yvjxc1"= )) + (file-name + (git-file-name "RenaissanceBug-racket-cookies" %racket-version= ))) + "net-cookies" "net-cookies-doc" "net-cookies-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stamourv/optimization-coach") + (commit %racket-commit))) + (sha256 (base32 + "0b27sw48d7rhz0hin88c7rbr9vpg1c23sn82nd4jkmq54h6gasr1"= )) + (file-name + (git-file-name "stamourv-optimization-coach" %racket-version))) + ("optimization-coach" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/option-contract") + (commit %racket-commit))) + (sha256 (base32 + "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk"= )) + (file-name + (git-file-name "racket-option-contract" %racket-version))) + "option-contract" "option-contract-doc" "option-contract-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/parser-tools") + (commit %racket-commit))) + (sha256 (base32 + "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3"= )) + (file-name (git-file-name "racket-parser-tools" %racket-version= ))) + "parser-tools" "parser-tools-doc" "parser-tools-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pconvert") + (commit %racket-commit))) + (sha256 (base32 + "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1"= )) + (file-name (git-file-name "racket-pconvert" %racket-version))) + "pconvert-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict") + (commit %racket-commit))) + (sha256 (base32 + "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x"= )) + (file-name (git-file-name "racket-pict" %racket-version))) + "pict" "pict-doc" "pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict-snip") + (commit %racket-commit))) + (sha256 (base32 + "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x"= )) + (file-name (git-file-name "racket-pict-snip" %racket-version))) + "pict-snip" "pict-snip-doc" "pict-snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/picturing-programs") + (commit %racket-commit))) + (sha256 (base32 + "1g6xr39hx1j03gb3d4dljm3v91xcj2gfpq3dgy5xvplzr6cmmxgr"= )) + (file-name + (git-file-name "racket-picturing-programs" %racket-version))) + ("picturing-programs" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plai") + (commit %racket-commit))) + (sha256 (base32 + "0i983sh0r0zm2ng4j44m5aw9669kh5fhp91bzpc9jm280rfcqvyl"= )) + (file-name (git-file-name "racket-plai" %racket-version))) + "plai" "plai-doc" "plai-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/planet") + (commit %racket-commit))) + (sha256 (base32 + "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9"= )) + (file-name (git-file-name "racket-planet" %racket-version))) + "planet" "planet-doc" "planet-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plot") + (commit %racket-commit))) + (sha256 (base32 + "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7"= )) + (file-name (git-file-name "racket-plot" %racket-version))) + "plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/preprocessor") + (commit %racket-commit))) + (sha256 (base32 + "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg"= )) + (file-name (git-file-name "racket-preprocessor" %racket-version= ))) + ("preprocessor" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/profile") + (commit %racket-commit))) + (sha256 (base32 + "179i86lyby29nywz60l4vnadi02w8b12h7501nm5h5g4pq9jjmbb"= )) + (file-name (git-file-name "racket-profile" %racket-version))) + "profile" "profile-doc" "profile-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Metaxal/quickscript") + (commit %racket-commit))) + (sha256 (base32 + "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr"= )) + (file-name (git-file-name "Metaxal-quickscript" %racket-version= ))) + ("quickscript" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r5rs") + (commit %racket-commit))) + (sha256 (base32 + "1g3cysj7z88r38vkzvi8g2fb2hn4yg1fdhy5smxw303jxgl3inp6"= )) + (file-name (git-file-name "racket-r5rs" %racket-version))) + "r5rs" "r5rs-doc" "r5rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r6rs") + (commit %racket-commit))) + (sha256 (base32 + "0b1ymzdp10r0flw2acbidjsh5ma1pm5hy54jss37sxf89z3xbvm4"= )) + (file-name (git-file-name "racket-r6rs" %racket-version))) + "r6rs" "r6rs-doc" "r6rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeapostrophe/racket-cheat") + (commit %racket-commit))) + (sha256 (base32 + "06wcj558rzkbl2bwkmikyspya9v1f4iwlzwnwxpkc33h2xapwabr"= )) + (file-name + (git-file-name "jeapostrophe-racket-cheat" %racket-version))) + ("racket-cheat" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racklog") + (commit %racket-commit))) + (sha256 (base32 + "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb"= )) + (file-name (git-file-name "racket-racklog" %racket-version))) + ("racklog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/rackunit") + (commit %racket-commit))) + (sha256 (base32 + "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p"= )) + (file-name (git-file-name "racket-rackunit" %racket-version))) + "rackunit" + "rackunit-doc" + "rackunit-gui" + "rackunit-lib" + "rackunit-plugin-lib" + "rackunit-typed" + "schemeunit" + "testing-util-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/readline") + (commit %racket-commit))) + (sha256 (base32 + "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn"= )) + (file-name (git-file-name "racket-readline" %racket-version))) + "readline" "readline-doc" "readline-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/realm") + (commit %racket-commit))) + (sha256 (base32 + "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi"= )) + (file-name (git-file-name "racket-realm" %racket-version))) + ("realm" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/redex") + (commit %racket-commit))) + (sha256 (base32 + "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f"= )) + (file-name (git-file-name "racket-redex" %racket-version))) + "redex" + "redex-benchmark" + "redex-doc" + "redex-examples" + "redex-gui-lib" + "redex-lib" + "redex-pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sasl") + (commit %racket-commit))) + (sha256 (base32 + "0ibh4wb4gn8pggx6gkv4vk4d6rwzn5nrvjibhvkzhaynf6lhb824"= )) + (file-name (git-file-name "racket-sasl" %racket-version))) + "sasl" "sasl-doc" "sasl-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scheme-lib") + (commit %racket-commit))) + (sha256 (base32 + "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x"= )) + (file-name (git-file-name "racket-scheme-lib" %racket-version))) + ("scheme-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scribble") + (commit %racket-commit))) + (sha256 (base32 + "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm"= )) + (file-name (git-file-name "racket-scribble" %racket-version))) + "scribble" + "scribble-doc" + "scribble-html-lib" + "scribble-lib" + "scribble-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/serialize-cstruct-lib") + (commit %racket-commit))) + (sha256 (base32 + "1rq3n1fa7ldjwx3lrh9ybhig7jlsw1crpzyklbzp3xqdw6jymfnz"= )) + (file-name + (git-file-name "racket-serialize-cstruct-lib" %racket-version)= )) + ("serialize-cstruct-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sgl") + (commit %racket-commit))) + (sha256 (base32 + "0nkymhdyjrwi5h199j4w5zh7y3x3ai42gsiwxzh0hy7yqrqqg9zv"= )) + (file-name (git-file-name "racket-sgl" %racket-version))) + ("sgl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/shell-completion") + (commit %racket-commit))) + (sha256 (base32 + "04m144gy2mp4fiq6rcbf12wjr8mws8k9scfhg9lc38vqppp4lxsj"= )) + (file-name + (git-file-name "racket-shell-completion" %racket-version))) + ("shell-completion" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/simple-tree-text-markup") + (commit %racket-commit))) + (sha256 (base32 + "0fyd9gfz6bnv0m1901wv5mnhc05rm8hw9i6ddrqx33hs6qsg2zqr"= )) + (file-name + (git-file-name "racket-simple-tree-text-markup" %racket-versio= n))) + "simple-tree-text-markup" + "simple-tree-text-markup-doc" + "simple-tree-text-markup-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slatex") + (commit "47e1d3e3e33d826bc2b26f9e8998eb235b23a9a5"))) + (sha256 (base32 + "0pkm2isbbdk63slrbsxcql7rr0wdrw5kapw1xq4ps5k8dhlzv8x0"= )) + (file-name (git-file-name "racket-slatex" %racket-version))) + ("slatex" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slideshow") + (commit %racket-commit))) + (sha256 (base32 + "1znv1i2d0610hhy71q932xy7wka00q3q50in1xfnk8ibg7nzkagm"= )) + (file-name (git-file-name "racket-slideshow" %racket-version))) + "slideshow" "slideshow-doc" "slideshow-exe" "slideshow-lib" + "slideshow-plugin") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/snip") + (commit %racket-commit))) + (sha256 (base32 + "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj"= )) + (file-name (git-file-name "racket-snip" %racket-version))) + "snip" "snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/typed-racket") + (commit %racket-commit))) + (sha256 (base32 + "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv"= )) + (file-name (git-file-name "racket-typed-racket" %racket-version= ))) + "source-syntax" + "typed-racket" + "typed-racket-compatibility" + "typed-racket-doc" + "typed-racket-lib" + "typed-racket-more") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/srfi") + (commit %racket-commit))) + (sha256 (base32 + "0cga4ijid6lg5j68cvdfs4xr69rsyzw7d7lixr3i866kran61sys"= )) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/srfi/pull/15 + (search-patches "racket-srfi-fsdg-backport.patch")) + (file-name (git-file-name "racket-srfi" %racket-version))) + "srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/string-constants") + (commit %racket-commit))) + (sha256 (base32 + "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6"= )) + (file-name + (git-file-name "racket-string-constants" %racket-version))) + "string-constants" "string-constants-doc" "string-constants-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/swindle") + (commit %racket-commit))) + (sha256 (base32 + "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67"= )) + (file-name (git-file-name "racket-swindle" %racket-version))) + ("swindle" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/syntax-color") + (commit %racket-commit))) + (sha256 (base32 + "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp"= )) + (file-name (git-file-name "racket-syntax-color" %racket-version= ))) + "syntax-color" "syntax-color-doc" "syntax-color-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/trace") + (commit %racket-commit))) + (sha256 (base32 + "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia"= )) + (file-name (git-file-name "racket-trace" %racket-version))) + ("trace" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/unix-socket") + (commit %racket-commit))) + (sha256 (base32 + "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y"= )) + (file-name (git-file-name "racket-unix-socket" %racket-version)= )) + "unix-socket" "unix-socket-doc" "unix-socket-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/web-server") + (commit %racket-commit))) + (sha256 (base32 + "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn"= )) + (file-name (git-file-name "racket-web-server" %racket-version))) + "web-server" "web-server-doc" "web-server-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/wxme") + (commit %racket-commit))) + (sha256 (base32 + "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b"= )) + (file-name (git-file-name "racket-wxme" %racket-version))) + "wxme" "wxme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/xrepl") + (commit %racket-commit))) + (sha256 (base32 + "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3"= )) + (file-name (git-file-name "racket-xrepl" %racket-version))) + "xrepl" "xrepl-doc" "xrepl-lib"))))) --=20 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 16:57:10 2022 Received: (at control) by debbugs.gnu.org; 13 Feb 2022 21:57:10 +0000 Received: from localhost ([127.0.0.1]:39090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMrl-0003JV-Sa for submit@debbugs.gnu.org; Sun, 13 Feb 2022 16:57:10 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:46988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJMrj-0003JH-T8 for control@debbugs.gnu.org; Sun, 13 Feb 2022 16:57:08 -0500 Received: by mail-qv1-f42.google.com with SMTP id n6so13393046qvk.13 for ; Sun, 13 Feb 2022 13:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:content-language:to:from :subject:content-transfer-encoding; bh=+W7IiSt5Zm2t7kxDhwIUhLc9+jh21qeastmRaJ/1nF0=; b=OdlYZ5lASa8NGW7OEV55coJILpFWYh8XUp0jEKGu2o4cZ6RRnjqhtM96ZeK6s7ej2P FOWB2tS628SrpugkYknGrLSOyKa0dbZCLj364ThzbUwuMbLP1N6MNwZmxN96/apahqfF CpMm+MS7KTN0WUw8lAVXxO0RoHCs3/AbGUm4TxjCBhxcST+yWa12kIMxBQeJhiDyKDJs BYjDjVJz0cKMGuPYz8HlY628K2mHl1I2+YTC/Z3RudKCiy4Mn4M5HJMbHitASqxvH81p wJ4qroix4SQ9JtOEP/CJbue7057iqhuUzyXYleYvtuGAaLLUmK+/Mc82FQEEB7ejy4j5 h0Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject:content-transfer-encoding; bh=+W7IiSt5Zm2t7kxDhwIUhLc9+jh21qeastmRaJ/1nF0=; b=aLh/whsE1okP7NkahNvNJvrEf8g8qKhxU0RwQGG+3/3lnn3ohPGQFP7DG/0U+CX4UM Aw6J42xE1Eb1b8aTKh/HnzqDhjRWBNReFtCtXlGzF8HmdocduwwBk18WhqMXRoFIk1wx mxcojVcZp3qSQEusR2sYC7HHfYi8v3giBO7kYFAhuGjXX5UwVkJQMh8U4Zf7hf/ahjX3 j8i/PqFapoX5+7w7GCimq3NgbAn4OyR+OdpJ64P/3Bg5KNtR7adK9f0QKqy8OHKjLCSy JlMdqGOYfMimNAGPPvTUujpWf2QfVHqJiET3Lan0Igu+GYN6fO+m97fV8Jdv8wRxhvJQ 5nOA== X-Gm-Message-State: AOAM5335gBchjBxU0Y5W+qvD/dJiTFvCVVXvnkJ2ITqpPR57vs2043sH lFY61yNQ+LquNyLTE16AkdJ+iyhkK32vNNBxWc0= X-Google-Smtp-Source: ABdhPJxyh4mw0cRCZz5BQEp3MP6EfXo/Ey8IqU9eMr3exSeub4GVk7Ie4MLzg8ZFjRYIfcVeA+chXw== X-Received: by 2002:a05:6214:2528:: with SMTP id gg8mr481612qvb.8.1644789422402; Sun, 13 Feb 2022 13:57:02 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id w14sm17621225qtc.29.2022.02.13.13.57.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 13:57:02 -0800 (PST) Message-ID: <1515f77e-33be-7ca3-1675-1d0bcbee7199@philipmcgrath.com> Date: Sun, 13 Feb 2022 16:57:01 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: control@debbugs.gnu.org From: Philip McGrath Subject: control message for bug #53878 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) retitle 53878 [PATCH 00/11] Update Racket to 8.4. Adjust Chez Scheme packages. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 09:34:29 2022 Received: (at 53878) by debbugs.gnu.org; 14 Feb 2022 14:34:29 +0000 Received: from localhost ([127.0.0.1]:40403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJcQv-0007ob-Ay for submit@debbugs.gnu.org; Mon, 14 Feb 2022 09:34:29 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:22017) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJcQp-0007oM-TH for 53878@debbugs.gnu.org; Mon, 14 Feb 2022 09:34:27 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Jy6DP6rCCz1LZVs; Mon, 14 Feb 2022 15:34:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4Jy6DP6rCCz1LZVs DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1644849254; bh=zqf3XEAt4PWWuoxdrHkmgAjFxejtsJ9lkazsj3pJnmA=; h=Subject:From:To:Date:In-Reply-To:References:From; b=aEE29frwy3QRD3YucEK079FrzUQ1cWWpdNwvpomq2l2b8R4x2E0p7cIi8gaqfMB+I Se+oA+sJN2QgvWyfKks0bGV2l9KiN7fg+I7fdA+RUB3p9FiYfOQPMGh+guOmZMLRMe Uz0XLcnmklbv2BbTuFv5EUq1Ni+Xr2rXWtP8WMAE= Message-ID: <20ade6d2f82b20f25d0eb1c8b2b5c409c189d05a.camel@ist.tugraz.at> Subject: Re: [PATCH 04/11] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Mon, 14 Feb 2022 15:34:13 +0100 In-Reply-To: <20220213215127.218952-5-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-5-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: > [...] > +(define (chez-machine->upstream-restriction mach) > +  "Given a string MACH naming a Chez Scheme machine type, returns a > symbol > +naming a restriction on the upstream Chez Scheme implementation > compared to > +the Racket variant, or @code{#f} if no such restriction exists.  The > +restriction is reported for the architecture--OS pair, regardless of > whether > +MACH specifies a threaded or an unthreaded variant. > + > +Possible restrictions currently include: > +@itemize @bullet > +@item > +@code{'no-threads}: Support for native threads is not available > upstream. > +@item > +@code{'no-support}: The upstream release doesn't claim to support > this > +architecture--OS combination at all. > +@end itemize > + > +See @code{chez-machine->nix-system} for more details about > acceptable values > +for MACH." > +  (let ((mach (chez-machine->unthreaded mach))) > +    (cond > +     ((string-prefix? "arm64" mach) > +      'no-support) > +     ((string-prefix? "arm32" mach) > +      (if (string-suffix? "le" mach) > +          'no-threads > +          'no-support)) > +     ((string-prefix? "ppc32" mach) > +      (if (string-suffix? "le" mach) > +          #f > +          'no-support)) > +     (else > +      #f)))) -> is a conversion operator, not an "accessor". "upstream-restriction" sounds rather negative, I'd rather have (chez- machine-features), which yields #f if the machine is unsupported and a (possibly empty) list of features otherwise, such as '(threads). I'm also not quite sure what the point is behind using chez machines here. Why not simply test the systems with the predicates we already have, i.e. target-arm64?, target-arm32?, target-linux?, target-ppc32?, ... And as a minor pet peeve, you ought to spell out machine. > +(define* (nix-system->chez-machine #:optional (system (%current- > system)) > +                                   #:key (threads? 'always)) > +  "Return the Chez Scheme machine type corresponding to the Nix > system > +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a > Chez Scheme > +machine type is undefined. > + > +When THREADS? is @code{'always} (the default), the threaded variant > of the > +machine type will be returned: note that the package returned by > +@code{chez-scheme-for-system} will always support native threads.  > When > +THREADS? is @code{#f}, the unthreaded machine type will be > returned.  If > +THREADS? is @code{'upstream} (the default), the threaded variant of > the > +machine type will be returned if and only if it is supported by > upstream Chez > +Scheme (see @code{chez-machine->upstream-restriction}).  If THREADS? > is any > +other value, an exception is raised." What's the point in having THREADS? 'always? In any case, assuming chez-machine-features is to be exported, this can easily be checked -- even if not, we can add the check internally by writing  #:key (threads? (chez-supports-threads? system)) > +  (let* ((hyphen (string-index system #\-)) > +         (nix-arch (substring system 0 hyphen)) > +         (nix-os (substring system (+ 1 hyphen))) > +         (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) > +         (chez-os (assoc-ref %nix-os-to-chez-alist nix-os)) > +         (mach (and chez-arch chez-os (string-append chez-arch chez- > os)))) This series of let-bindings should probably be done in a separate function called nix-system->chez-machine. Cheers From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 09:47:01 2022 Received: (at 53878) by debbugs.gnu.org; 14 Feb 2022 14:47:01 +0000 Received: from localhost ([127.0.0.1]:40423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJcd0-0001RO-Vs for submit@debbugs.gnu.org; Mon, 14 Feb 2022 09:47:01 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:29588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJccv-0001Kn-Hi for 53878@debbugs.gnu.org; Mon, 14 Feb 2022 09:46:57 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Jy6Vv6nlLz3x8h; Mon, 14 Feb 2022 15:46:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1644850008; bh=bwdTFHz057hXg8tkXgg648FFX2kCCbz/HhHJVsCwJ0w=; h=Subject:From:To:Date:In-Reply-To:References; b=P1WgGnSJGnQAoBmYWx2T53+oxHryuLmAUE/zNYGbq+gZrFl+VTPUG0hhXuu/gYDev /PH6ZDKUqqiVJVwaxHlDk+WPrPLhRIiDmFEFY1MtW91qkl0kHepGQoRiIN3AZMSY4V w3JHymyVU3OhcWFcUmOtszGs8xAuxdRkEFzhk5Rs= Message-ID: Subject: Re: [PATCH 05/11] gnu: Add stex. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Mon, 14 Feb 2022 15:46:47 +0100 In-Reply-To: <20220213215127.218952-6-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-6-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: > * gnu/packages/chez-and-racket-bootstrap.scm (stex-bootstrap): New > variable. > (stex): Change from origin to package inheriting from 'stex- > bootstrap'. > (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove > labels. Remove dependencies of stex-bootstrap. > [inputs]: Remove labels. > [arguments]: Adapt to use 'stex-bootstrap', 'search-input-file', and > G-expressions. > (nanopass): Make it public as a temporary workaround for Racket. > * gnu/packages/racket.scm > (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. This is again a large number of changes in one go. When it comes to writing good patches, less is more, especially in terms of being understandable. > +(define (unpack-nanopass+stex) > +  ;; delayed resolution of `nanopass` > +  #~(begin > +      (copy-recursively #$nanopass > +                        "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"))))) > [...] > -       (snippet > -        ;; Remove bundled libraries. > -        (with-imported-modules '((guix build utils)) > -          #~(begin > -              (use-modules (guix build utils)) > -              (for-each (lambda (dir) > -                          (when (directory-exists? dir) > -                            (delete-file-recursively dir))) > -                        '("stex" > -                          "nanopass" > -                          "lz4" > -                          "zlib"))))))) > [...] > +              (snippet unbundle-chez-submodules))) Why? >      (build-system gnu-build-system) >      (inputs > -     `(("libuuid" ,util-linux "lib") > -       ("zlib" ,zlib) > -       ("lz4" ,lz4) > -       ;; for expeditor: > -       ("ncurses" ,ncurses) > -       ;; for X11 clipboard support in expeditor: > -       ;; > https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 > -       ("libx11" ,libx11))) > -    (native-inputs > -     `(("nanopass" ,nanopass) ; source only > -       ;; for docs > -       ("stex" ,stex) > -       ("xorg-rgb" ,xorg-rgb) > -       ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend > -                                             texlive-epsf > -                                             texlive-fonts-ec > -                                             texlive-oberdiek))) > -       ("ghostscript" ,ghostscript) > -       ("netpbm" ,netpbm))) > +     (list > +      `(,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 stex-bootstrap)) This is a lot of noise. Either first clean up the inputs and then add new ones or the other way round, but doing both in the same commit (especially with other stuff as well) is too much imo. >      (native-search-paths >       (list (search-path-specification >              (variable "CHEZSCHEMELIBDIRS") >              (files (list (string-append "lib/chez-scheme")))))) >      (outputs '("out" "doc")) >      (arguments > -     `(#:modules > -       ((guix build gnu-build-system) > +     (list > +      #:modules > +      '((guix build gnu-build-system) >          (guix build utils) >          (ice-9 ftw) >          (ice-9 match)) > -       #:test-target "test" > -       #:configure-flags > -       '("--threads") ;; TODO when we fix armhf, it doesn't support > --threads > -       #:phases > -       (modify-phases %standard-phases > -         ;; put these where configure expects them to be > -         (add-after 'unpack 'unpack-nanopass+stex > -           (lambda* (#:key native-inputs inputs #:allow-other-keys) > -             (for-each (lambda (dep) > -                         (define src > -                           (assoc-ref (or native-inputs inputs) > dep)) > -                         (copy-recursively src dep > -                                           #:keep-mtime? #t)) > -                       '("nanopass" "stex")))) > -         ;; NOTE: the custom Chez 'configure' script doesn't allow > -         ;; unrecognized flags, such as those automatically added > -         ;; by `gnu-build-system`. > -         (replace 'configure > -           (lambda* (#:key inputs outputs > -                           (configure-flags '()) > -                           #:allow-other-keys) > -             (let* ((zlib-static (assoc-ref inputs "zlib:static")) > -                    (lz4-static (assoc-ref inputs "lz4:static")) > -                    (out (assoc-ref outputs "out")) > -                    ;; add flags which are always required: > -                    (flags (cons* (string-append "--installprefix=" > out) > +      #:test-target "test" > +      ;; TODO when we fix armhf, it may not support --threads > +      #:configure-flags #~'("--threads") > +      #:phases > +      #~(modify-phases %standard-phases > +          (add-after 'unpack 'unpack-nanopass+stex > +            (lambda args > +              #$(unpack-nanopass+stex))) > +          ;; NOTE: the custom Chez 'configure' script doesn't allow > +          ;; unrecognized flags, such as those automatically added > +          ;; by `gnu-build-system`. > +          (replace 'configure > +            (lambda* (#:key inputs (configure-flags '()) #:allow- > other-keys) > +              ;; add flags which are always required: > +              (let ((flags (cons* (string-append "--installprefix=" > #$output) >                                    "ZLIB=-lz" >                                    "LZ4=-llz4" >                                    "--libkernel" > @@ -305,90 +276,59 @@ (define src >                                    ;; and letting Chez try causes an > error >                                    "--nogzip-man-pages" >                                    configure-flags))) > -               (format #t "configure flags: ~s~%" flags) > -               ;; Some makefiles (for tests) don't seem to propagate > CC > -               ;; properly, so we take it out of their hands: > -               (setenv "CC" ,(cc-for-target)) > -               (setenv "HOME" "/tmp") > -               (apply invoke > -                      "./configure" > -                      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* ((out (assoc-ref outputs "out")) > -                    (bin (string-append out "/bin")) > -                    (lib (string-append out "/lib")) > -                    (name "chez-scheme")) > -               (symlink (string-append bin "/scheme") > -                        (string-append bin "/" name)) > -               (map (lambda (file) > -                      (symlink file (string-append (dirname file) > -                                                   "/" name > ".boot"))) > -                    (find-files lib "scheme.boot"))))) > -         ;; Building explicitly lets us avoid using substitute* > -         ;; to re-write makefiles. > -         (add-after 'install-symlink 'prepare-stex > -           (lambda* (#:key native-inputs inputs outputs #:allow- > other-keys) > -             (let* ((stex+version > -                     (strip-store-file-name > -                      (assoc-ref (or native-inputs inputs) "stex"))) > -                    ;; Eventually we want to install stex as a real > -                    ;; package so it's reusable. For now: > -                    (stex-output "/tmp") > -                    (doc-dir (string-append stex-output > -                                            "/share/doc/" > -                                            stex+version))) > -               (with-directory-excursion "stex" > -                 (invoke "make" > -                         "install" > -                         (string-append "LIB=" > -                                        stex-output > -                                        "/lib/" > -                                        stex+version) > -                         (string-append "Scheme=" > -                                        (assoc-ref outputs "out") > -                                        "/bin/scheme")) > -                 (for-each (lambda (pth) > -                             (install-file pth doc-dir)) > -                           '("ReadMe" ; includes the license > -                             "doc/stex.html" > -                             "doc/stex.css" > -                             "doc/stex.pdf")))))) > -         ;; Building the documentation requires stex and a running > scheme. > -         ;; FIXME: this is probably wrong for cross-compilation > -         (add-after 'prepare-stex 'install-doc > -           (lambda* (#:key native-inputs inputs outputs #:allow- > other-keys) > -             (let* ((chez+version (strip-store-file-name > -                                   (assoc-ref outputs "out"))) > -                    (stex+version > -                     (strip-store-file-name > -                      (assoc-ref (or native-inputs inputs) "stex"))) > -                    (scheme (string-append (assoc-ref outputs "out") > -                                           "/bin/scheme")) > -                    ;; see note on stex-output in phase build-stex, > above: > -                    (stexlib (string-append "/tmp" > -                                            "/lib/" > -                                            stex+version)) > -                    (doc-dir (string-append (assoc-ref outputs > "doc") > -                                            "/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")) > -               (with-directory-excursion doc-dir > -                 (symlink "release_notes/release_notes.pdf" > -                          "release_notes.pdf") > -                 (symlink "csug/csug9_5.pdf" > -                          "csug.pdf")))))))) > +                (format #t "configure flags: ~s~%" flags) > +                ;; Some makefiles (for tests) don't seem to > propagate CC > +                ;; properly, so we take it out of their hands: > +                (setenv "CC" #$(cc-for-target)) > +                (setenv "HOME" "/tmp") > +                (apply invoke "./configure" 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* ((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. > +          ;; FIXME: this is probably wrong for cross-compilation > +          (add-after 'install-symlink 'install-doc > +            (lambda* (#:key native-inputs inputs outputs > +                            #:allow-other-keys) > +              (match (assoc-ref outputs "doc") > +                (#f > +                 (format #t "not installing docs~%")) > +                (doc-prefix > +                 (let* ((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")) > +                   (with-directory-excursion doc-dir > +                     (symlink "release_notes/release_notes.pdf" > +                              "release_notes.pdf") > +                     (symlink "csug/csug9_5.pdf" > +                              "csug.pdf")))))))))) Again mixing cosmetic changes with functional ones. >      ;; Chez Scheme does not have a  MIPS backend. >      ;; FIXME: Debian backports patches to get armhf working. >      ;; We should too. It is the Chez machine type arm32le > @@ -412,3 +352,145 @@ (define* (stex-make #:optional (suffix "")) >  generates native code for each target processor, with support for > x86, x86_64, >  and 32-bit PowerPC architectures.") >      (license license:asl2.0))) > + > +;; > +;; Chez's bootstrap dependencies: > +;; > + > +(define-public stex-bootstrap > +  ;; This commit includes a fix which we would otherwise want to use > as > +  ;; patch.  Let's revert to tagged releases as soon as one becomes > available. > +  (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") > +        (revision "1")) > +    (hidden-package > +     (package > +       (name "stex") > +       ;; ^ Debian calls this "stex", not "chez-stex". It is a set > of > +       ;; command-line tools, and there isn't a Scheme API, let > alone a > +       ;; Chez-specific one, except perhaps that the Scheme examples > are > +       ;; assumed to be Chez-compatible. > +       (version (git-version "1.2.2" revision commit)) > +       (source > +        (origin > +          (method git-fetch) > +          (uri (git-reference > +                (url "https://github.com/dybvig/stex") > +                (commit commit))) > +          (sha256 > +           (base32 > "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) > +          (file-name (git-file-name name version)) > +          (snippet > +           #~(for-each delete-file > +                       '("sbin/install" "doc/stex.pdf" > "doc/stex.html"))))) > +       (outputs '("out")) > +       (build-system copy-build-system) > +       ;; N.B. Upstream does not seem to support cross-compilation, > +       ;; though it would probably be easy to add. > +       (propagated-inputs > +        (list xorg-rgb > +              (texlive-updmap.cfg > +               (list texlive-dvips-l3backend > +                     texlive-hyperref > +                     texlive-bibtex > +                     texlive-epsf > +                     texlive-fonts-ec > +                     texlive-oberdiek)) > +              ghostscript > +              netpbm)) > +       ;; Debian uses a versionless path for STEXLIB, > +       ;; which is much more convienient. > +       (arguments > +        (list > +         #:install-plan #~`(("inputs" "lib/stex/") > +                            ("gifs" "lib/stex/") > +                            ("math" "lib/stex/") > +                            ("src" "lib/stex/") ;; can run without > compiling > +                            ("Mf-stex" "lib/stex/") > +                            ("Makefile.template" "lib/stex/")) > +         #:phases > +         #~(modify-phases %standard-phases > +             (add-before 'install 'patch-sources > +               (lambda* (#:key native-inputs inputs outputs #:allow- > other-keys) > +                 (define scheme > +                   (false-if-exception > +                    (search-input-file inputs "/bin/scheme"))) > +                 (when scheme > +                   (setenv "Scheme" scheme)) > +                 (substitute* '("Makefile.template" > +                                "doc/Makefile") > +                   (("STEXLIB=[^\n]*") > +                    (string-append "STEXLIB=" #$output "/lib/stex")) > +                   (("Scheme=[^\n]*") > +                    (string-append "Scheme=" (or scheme "scheme")))) > +                 (substitute* '("Mf-stex" > +                                "math/Makefile") > +                   (("/bin/rm") > +                    "rm")) > +                 (substitute* "Mf-stex" > +                   (("SHELL=bash") > +                    ;; avoid Solaris workaround > +                    "#SHELL=bash")))) > +             (add-after 'install 'maybe-compile > +               (lambda* (#:key native-inputs inputs outputs #:allow- > other-keys) > +                 (cond > +                  ((getenv "Scheme") > +                   => (lambda (scheme) > +                        (define makefile > +                          (string-append (getcwd) "/Makefile")) > +                        (define machine > +                          #$(nix-system->chez-machine > +                             (or (%current-target-system) > +                                 (%current-system)))) > +                        (with-directory-excursion > +                            (search-input-directory outputs > "/lib/stex") > +                          (invoke "make" > +                                  "-f" makefile > +                                  (string-append "Scheme=" scheme)) > +                          (for-each delete-file > +                                    (find-files machine "\\."))))) > +                  (else > +                   (format #t "not compiling~%"))))) > +             (add-after 'maybe-compile 'maybe-make-docs > +               (lambda* (#:key native-inputs inputs outputs #:allow- > other-keys) > +                 (cond > +                  ((assoc-ref outputs "doc") > +                   => (lambda (doc-prefix) > +                        (define doc-dir > +                          (string-append doc-prefix > "/share/doc/stex")) > +                        ;; the Makefile is referenced in the > documentation > +                        (copy-recursively "doc" doc-dir) > +                        (install-file "ReadMe" doc-dir) > +                        (with-directory-excursion "doc" > +                          (invoke "make") > +                          (install-file "stex.html" doc-dir) > +                          (install-file "stex.pdf" doc-dir)))) > +                  (else > +                   (format #t "not making docs~%")))))))) > +       (home-page "https://github.com/dybvig/stex") > +       (synopsis "LaTeX with embeded Scheme code and HTML > generation") > +       (description "The @code{stex} package extends LaTeX with a > handful of > +commands for including Scheme code (or pretty much any other kind of > code, as > +long as you don't plan to use the Scheme-specific transcript > support) in a > +document.  It provides the programs @code{scheme-prep} and > @code{html-prep} to > +convert @code{stex} documents to LaTeX and HTML, respectively, plus > makefile > +templates, style files, and other resources.  The @code{stex} system > is used > +to typeset @cite{The Scheme Programming Language} and the @cite{Chez > Scheme > +User's Guix}, among other documents.") > +       (license license:expat))))) > + > +(define-public stex > +  (package/inherit stex-bootstrap > +    (inputs (modify-inputs (package-inputs stex-bootstrap) > +              (prepend chez-scheme))) > +    (outputs '("out" "doc")) > +    (properties '()))) > + > +(define-public nanopass > +  (let ((version "1.9.2")) > +    (origin > +      (method git-fetch) > +      (uri (git-reference > +            (url > "https://github.com/nanopass/nanopass-framework-scheme") > +            (commit (string-append "v" version)))) > +      (sha256 (base32 > "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) > +      (file-name (git-file-name "nanopass" version))))) > diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm > index 865fdff70f..d8338bcd6f 100644 > --- a/gnu/packages/racket.scm > +++ b/gnu/packages/racket.scm > @@ -333,9 +333,8 @@ (define-public racket-bootstrap-chez-bootfiles >        `(("racket" ,(if (%current-target-system) >                         racket-minimal >                         racket-minimal-bc-3m)) > -        ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) > "stex")) > -        ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) > -                                 "nanopass")))) > +        ("stex" ,(package-source stex)) > +        ("nanopass" ,nanopass))) >       (arguments >        `(#:phases >          (modify-phases %standard-phases Not quite sure on these hunks. Could be fine, could not be fine. Disentangling stex from chez and publicly exporting it is probably a good idea, though. Cheers From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 09:55:03 2022 Received: (at 53878) by debbugs.gnu.org; 14 Feb 2022 14:55:03 +0000 Received: from localhost ([127.0.0.1]:40467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJckp-0002HG-3d for submit@debbugs.gnu.org; Mon, 14 Feb 2022 09:55:03 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:5099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJckm-0002GX-Ni for 53878@debbugs.gnu.org; Mon, 14 Feb 2022 09:55:01 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Jy6hJ3vTMz3xZZ; Mon, 14 Feb 2022 15:54:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1644850496; bh=dQgrHZ5sBvAbpXpmPmEDjnVldQqQfPLCHdRJhhFd5RY=; h=Subject:From:To:Date:In-Reply-To:References; b=GVVb+kw/UdCQTgko+Zmz12xaMb3ltrjAXLjyI1qw8sbmqmcUeP9v+2cZaUqoNHxRO wa1Px5knNlVD5JwQ0G4oL5/xnhwQpsjsyRUfqufFTAnl6pdcZzotOb39NwdTJGGYpD qtkd4yn7uTdMvlBi5tFOeOGSPDK4Uj+k40SYWkrc= Message-ID: <7a5ff55f7c05308cac7bb2aae5dbe0a16b8fa9b9.camel@ist.tugraz.at> Subject: Re: [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Mon, 14 Feb 2022 15:54:55 +0100 In-Reply-To: <20220213215127.218952-8-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-8-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: > This might seem a bit silly in isolation, but it makes the structure > of the upstream Chez Scheme package the same as for the Racket > variant, it sets things up for (one day, hopefully) actually being > able to bootstrap the upstream Chez Scheme bootfiles, and it may be > useful for cross-compilation and adding support for architectures > without pre-built bootfiles from upstream. > > * gnu/packages/chez-and-racket-bootstrap.scm > (chez-scheme-bootstrap-bootfiles): New variable. > (chez-scheme)[native-inputs]: Add it. > [arguments]: Add new phase 'unpack-bootfiles'. > [version, source, home-page]: Derive from 'chez-scheme-bootstrap- > bootfiles'. > --- While having chez-scheme-bootstrap-bootfiles (silly name) does make some kind of sense, making chez-scheme inherit from it does not. Given that we don't have a chez-scheme bootstrap tower at hand, you should probably make (chez-scheme-bootstrap) a procedure which takes chez- scheme's origin as argument and returns the full package. Also, while technically a violation of the DRY principle, you are allowed to type out the homepage multiple times. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 10:18:57 2022 Received: (at 53878) by debbugs.gnu.org; 14 Feb 2022 15:18:57 +0000 Received: from localhost ([127.0.0.1]:42297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJd7w-0003TI-OK for submit@debbugs.gnu.org; Mon, 14 Feb 2022 10:18:57 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:14471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJd7t-0003T6-2m for 53878@debbugs.gnu.org; Mon, 14 Feb 2022 10:18:55 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Jy7Cs4jGkz3xbk; Mon, 14 Feb 2022 16:18:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1644851929; bh=SSI7psRRBrXkSjh0aaXXhnym8YiCr/IEhVV2DamVnx4=; h=Subject:From:To:Date:In-Reply-To:References; b=mQgMXBqWkh8hPC3ijzLg4UsxHC/G125c9B63yYJTuLuJQzJJcMt1ka26LllARcuCO olxUO5S82qnhuCRj68e0aMGsrohrcS+wIFYlrJpAXkzvUJmsKEak2iPk3ihkobl/b4 fo6eaBn2BjMSGFFPzDWOrEcGn+BLPmGrP4Jtai68= Message-ID: Subject: Re: [PATCH 08/11] gnu: Add chez-scheme-for-racket. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Mon, 14 Feb 2022 16:18:49 +0100 In-Reply-To: <20220213215127.218952-9-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-9-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: > [...] > * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cgc): > (racket-vm-bc): > (racket-vm-cs): > (chez-scheme-for-racket-bootstrap-bootfiles): > (chez-scheme-for-racket): New variables. One patch per package is probably better. > [...] One way of thinking about the > +;; bounary between the Racket VM and Racket programs is that the VM > implements boundary. > +;; the primitives accessed by the 'ffi/unsafe/vm' library. Another > perspective > +;; is that DrRacket's ``Open defining file''/``Jump to definition'' > features > +;; can navigate into Racket programs, including into the > implementation of > +;; 'racket/base', but can not jump into the implementation of the > Racket VM > +;; itself. A third, related perspective is that Racket code is > usually > +;; installed with source files alongside compiled code (though this > is not > +;; mandatory), whereas the Racket VM is installed only in compiled > form. > [...] > +;; output. The function 'racket-vm-for-system' returns the > recomended Racket > +;; VM package for a given system. This is a very long comment. Consider how much of it is actually necessary and how much of it is not (do I really need to know about the capabilities of DrRacket for instance?) > +;; Bootstrapping Racket: > +;; --------------------- > +;; > +;; Here's how bootstrapping Racket works: > +;; > +;;   - Racket BC [CGC] can be built with only a C compiler (except > for > +;;     one caveat discussed below). > +;;   - 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 > +;;     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. > +;; > +;; So, we build CGC to build 3M to build bootfiles and CS. This block I'd consider necessary, but again slightly on the verbose end. > +;; (Note: since the CGC variant is basically only for bootstrapping, > we > +;; often use "BC" to mean "3M", consistent with `(banner)` and the > +;; suffixes used on executables when more than one variant co- > exists.) > +;; > +;; 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 > +;; README file applies to all such subsystems: > +;; > +;;     The Racket version must be practically the same as the > current Racket > +;;     verson, although it can be the Racket BC implementation > (instead of > +;;     the Racket CS implementation). > +;; > +;;     Unlike Chez Scheme boot files, the files generated in > "schemified" > +;;     are human-readable and -editable Scheme code. That provides a > way > +;;     out of bootstrapping black holes, even without BC. > +;; > +;; However, other Racket subsystems implemented in Racket for Racket > CS > +;; use older C implementations for Racket BC, whereas the reader, > expander, > +;; and module system were completely replaced with the Racket > implementation > +;; > +;; For Racket BC, the compiled "linklet" s-expressions (primitive > modules) > +;; are embeded in C as a static string constant. Eventually, they > are further > +;; compiled by the C-implemented Racket BC bytecode and JIT > compilers. > +;; (On platforms where Racket BC's JIT is not supported, yet another > compiler > +;; instead compiles the linklets to C code, but this is not a > bootstrapping > +;; issue.) > +;; Again, you want to be brief and understandable. What does this mean in practise? Do we have racket bootstrapped yet or is there still some magic hidden within? >  ;; Code: >   >  (define (chez-machine->unthreaded mach) > @@ -189,19 +330,19 @@ (define* (nix-system->chez-machine #:optional > (system (%current-system)) >                  (chez-machine->threaded mach))))))) >   >  ;; > -;; Chez Scheme: > +;; Chez auxiliary G-expressions: >  ;; >   >  (define unbundle-chez-submodules >    #~(begin >        (use-modules (guix build utils)) >        (for-each (lambda (dir) > -                (when (directory-exists? dir) > -                  (delete-file-recursively dir))) > -              '("stex" > -                "nanopass" > -                "lz4" > -                "zlib")))) > +                  (when (directory-exists? dir) > +                    (delete-file-recursively dir))) > +                '("stex" > +                  "nanopass" > +                  "lz4" > +                  "zlib")))) As in one of your previous patches, you're mixing cosmetic changes with non-cosmetic ones. This one could be prevented by correctly indenting it in the patch that introduces it. >  (define unpack-nanopass+stex >    #~(begin > @@ -216,6 +357,234 @@ (define unpack-nanopass+stex >            ;; otherwise, it will try to download submodules >            (display "# to placate ../configure"))))) >   > +;; > +;; Racket VM: > +;; > + > +(define (racket-vm-common-configure-flags) > +  ;; under a lambda extraction to avoid evaluating bash-minimal too > early > +  #~`(,@(cond > +         ((false-if-exception > +           (search-input-file %build-inputs "/bin/libtool")) > +          => (lambda (libtool) > +               (list (string-append "--enable-lt=" libtool)))) > +         (else > +          '())) > +      ,@(cond > +         ((false-if-exception > +           (search-input-file %build-inputs "/opt/racket- > vm/bin/racket")) Did we have /opt/racket... before? We should probably avoid such paths. > +          => (lambda (racket) > +               (list (string-append "--enable-racket=" racket)))) > +         (else > +          '())) > +      ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" > +                      #$(file-append bash-minimal "/bin/sh")) > +      "--disable-strip" > +      "--enable-origtree") For the record, why do you need double quoting here? Would ungexp- splicing extract this too soon? > +(define-public racket-vm-cgc > +  ;; Eventually, it may make sense for some vm packages to not be > hidden, > +  ;; but this one is especially likely to remain hidden. > +  (hidden-package > +   (package > +     (name "racket-vm-cgc") > +     (version "8.4") > +     ;; ^ Remember to also update the version of > +     ;;   chez-scheme-for-racket-bootstrap-bootfiles > +     (source > +      (origin > +        (method git-fetch) > +        (uri (git-reference > +              (url "https://github.com/racket/racket") > +              (commit (string-append "v" version)))) > +        (sha256 > +         (base32 > "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) > +        (file-name (git-file-name "racket" version)) > +        (patches (search-patches "racket-minimal-sh-via-rktio.patch" > +                                 ;; Remove by Racket 8.5: > +                                 "racket-enable-scheme- > backport.patch")) > +        (modules '((guix build utils))) > +        (snippet > +         #~(begin > +             ;; Unbundle Chez submodules. > +             (with-directory-excursion "racket/src/ChezScheme" > +               #$unbundle-chez-submodules) > +             ;; Unbundle libffi. > +             (delete-file-recursively > "racket/src/bc/foreign/libffi"))))) > +     (inputs (list ncurses ;; <- common to all variants (for > #%terminal) > +                   bash-minimal ;; <- common to all variants (for > `system`) > +                   libffi)) ;; <- only for BC variants > +     (native-inputs (list libtool)) ;; <- only for BC variants > +     (outputs '("out" "debug")) > +     (build-system gnu-build-system) > +     (arguments > +      (list > +       #:configure-flags > +       #~(cons "--enable-cgcdefault" > +               #$(racket-vm-common-configure-flags)) > +       ;; Tests are in packages like racket-test-core and > +       ;; main-distribution-test that aren't part of the main > +       ;; distribution. > +       #:tests? #f > +       ;; Upstream recommends #:out-of-source?, and it does > +       ;; help with debugging, but it confuses `install-license- > files`. > +       #:modules '((ice-9 match) > +                   (ice-9 regex) > +                   (guix build gnu-build-system) > +                   (guix build utils)) > +       #:strip-directories #~'("opt/racket-vm/bin" > +                               "opt/racket-vm/lib") > +       #:phases > +       #~(let () > +           (define* ((wrap-racket-vm-outputs phase) . args) > +             (apply > +              phase > +              (let loop ((args args)) > +                (match args > +                  ((#:outputs outputs . args) > +                   `(#:outputs > +                     ,(let loop ((outputs outputs)) > +                        (match outputs > +                          ((("out" . out) . outputs) > +                           `(("out" . ,(string-append out > "/opt/racket-vm/")) > +                             ,@outputs)) > +                          ((other . outputs) > +                           (cons other (loop outputs))))) > +                     ,@args)) > +                  ((arg . args) > +                   (cons arg (loop args))))))) Why? Cheers From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 10:28:40 2022 Received: (at 53878) by debbugs.gnu.org; 14 Feb 2022 15:28:40 +0000 Received: from localhost ([127.0.0.1]:42320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJdHM-0003ko-Kv for submit@debbugs.gnu.org; Mon, 14 Feb 2022 10:28:40 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:39759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJdHJ-0003kZ-SP for 53878@debbugs.gnu.org; Mon, 14 Feb 2022 10:28:39 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Jy7R61bM4z3xcb; Mon, 14 Feb 2022 16:28:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1644852514; bh=g2UGnfFefNG/FsDEcqCQ37KMTwFULqOYkeLkXZoV4Yo=; h=Subject:From:To:Date:In-Reply-To:References; b=I3Jy1f+2wJvNVB5/q0yJQx5dDH/9ST4j133PV4D/YO9eF+mWE8EC5lL6hqyJgDhHU 2MADU8mHAXXoCqd/9On5XPSuXjnSKB5weVZQwJJh2AqvB+3CQ2De68llmqqie0o3DQ yD8Be+vKeSSwilU1elRMfjlJLbdCT0U0jLsjYhgY= Message-ID: <841fd9aa797eeaa3e5c202e8957574c22098c81f.camel@ist.tugraz.at> Subject: Re: [PATCH 11/11] gnu: racket: Update to 8.4. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Mon, 14 Feb 2022 16:28:33 +0100 In-Reply-To: <20220213215127.218952-12-philip@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-12-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: > * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, > gnu/packages/patcheches/racket-srfi-fsdg-backport.patch: New patches. > * gnu/local.mk (dist_patch_DATA): Add them. > * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): > New procedure. > * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.4. > Rewrite to use 'racket-vm-for-system', label-less inputs, G- > expressions, and Git origins for main-distribution packages. Separate into multiple patches. >  .../patches/racket-srfi-fsdg-backport.patch   | 41622 ++++++++++++++++ No. Patches should be small, not include a bunch of irrelevant doc changes. Cheers From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 11:40:35 2022 Received: (at control) by debbugs.gnu.org; 14 Feb 2022 16:40:35 +0000 Received: from localhost ([127.0.0.1]:42399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJeOx-0005pz-9I for submit@debbugs.gnu.org; Mon, 14 Feb 2022 11:40:35 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:48236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJeOw-0005pl-Kc for control@debbugs.gnu.org; Mon, 14 Feb 2022 11:40:34 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 39FB6B5F for ; Mon, 14 Feb 2022 17:40:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xZmZW3qglGoT for ; Mon, 14 Feb 2022 17:40:28 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id C5569B2D for ; Mon, 14 Feb 2022 17:40:28 +0100 (CET) Date: Mon, 14 Feb 2022 17:40:28 +0100 Message-Id: <875yphwgeb.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #53878 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 39FB6B5F X-Spamd-Result: default: False [0.61 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[control@debbugs.gnu.org]; RCPT_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_MIXED_CHARSET(0.71)[subject]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) merge 53878 53997 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 16 14:59:03 2022 Received: (at 53878) by debbugs.gnu.org; 16 Feb 2022 19:59:03 +0000 Received: from localhost ([127.0.0.1]:49549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKQS6-0001p9-LQ for submit@debbugs.gnu.org; Wed, 16 Feb 2022 14:59:03 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:41694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKQS4-0001oe-B6 for 53878@debbugs.gnu.org; Wed, 16 Feb 2022 14:59:01 -0500 Received: by mail-qv1-f50.google.com with SMTP id x3so4016336qvd.8 for <53878@debbugs.gnu.org>; Wed, 16 Feb 2022 11:59:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:from:subject:to:references :content-language:in-reply-to:content-transfer-encoding; bh=D0Qnabzo3meV014AhERnKC4+t6IBAVfftZ9KphyrR/M=; b=UHwn9Tzf6CGrmbe1euNV62igp4GAqsnWXTM7LLcdMj88hYaQ5i4UG2xw1AJdUCfAET iFQH3xivjuCNX07F7valTtHAgE3fFKv/yQTrG1Td6ax7lq6O9L0jtSye8vvChqahtqTS 8r1NTNQrjq3UfMrKUVlrfuwalkq2aObDHj+zXCgQo/oh6kY7ma62MgKYZ6JQlpo8AaK1 acKiafNUGiNZtkly7d+JyME8kg3rxOugcqlD/nDXY2E4ikG6zx3d+tgab9GQXz6IU8I6 6cxEmO8hOzMz6RPs0uD6kzEjixA4Iq3dF4S3vIzThRWs8dwr5G7+e7bMQu84D3gCL1v2 LyHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:references:content-language:in-reply-to :content-transfer-encoding; bh=D0Qnabzo3meV014AhERnKC4+t6IBAVfftZ9KphyrR/M=; b=pB2TC/uyAja8lCTTKg7eI9bgZr13xSpYY31Mfce1LAKr0mzeN0VxKv9L7hdtHTFGiY QspVSEflXE90MDzJeHQNaa62uv/WhCTo0E2AS4TgQaXQUVGRxXbtaLHIJhTThBlcYS8e fdQSPl0w/xGCYd59MBj2Rz/zJPqDESn8TiG4mQM9rHVFnjPfHLVBW3Z+27NS9n1sLKzD gm4war8crFAOsXR5XCnaUnPNiVa+UovJ6LNHkPVZM4GWZVO9i/FHhIwDzaY9gX6HhCFL eEO70Ljuq9dC0HdgDLswum1uYItiBdWVOoOUwG2n3IfecZi3a033mZLAbv1kbn1c6VtJ C6JQ== X-Gm-Message-State: AOAM533hKlCVX5O8sej/z5YWcGjSqJIrEqWmpHb3BhQCxGbuxxcD8WIo m0zu7VXN8pX5k4XEz26Twv/IYtckNTKFKcWdiVw= X-Google-Smtp-Source: ABdhPJyczKFk/SqNAfFWKpDzdgn44yF9JVLdvBd7MXInxRZTGOit6RKKVi/NspggAJmQBMvEPu0jdw== X-Received: by 2002:ac8:5c50:0:b0:2d5:c5f5:93de with SMTP id j16-20020ac85c50000000b002d5c5f593demr3246819qtj.303.1645041534408; Wed, 16 Feb 2022 11:58:54 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id 84sm2306460qkk.32.2022.02.16.11.58.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Feb 2022 11:58:54 -0800 (PST) Message-ID: <58a2566e-370c-9c9c-0284-023808a093ce@philipmcgrath.com> Date: Wed, 16 Feb 2022 14:58:53 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: Philip McGrath Subject: Re: [PATCH 08/11] gnu: Add chez-scheme-for-racket. To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-9-philip@philipmcgrath.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/14/22 10:18, Liliana Marie Prikler wrote: > Hi, > > Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: >> [...] >> * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cgc): >> (racket-vm-bc): >> (racket-vm-cs): >> (chez-scheme-for-racket-bootstrap-bootfiles): >> (chez-scheme-for-racket): New variables. > One patch per package is probably better. That's fine; I'll change it. (I thought that's what I'd suggested in .) > >> [...] One way of thinking about the >> +;; bounary between the Racket VM and Racket programs is that the VM >> implements > boundary. Thanks, I'll fix it. > >> +;; the primitives accessed by the 'ffi/unsafe/vm' library. Another >> perspective >> +;; is that DrRacket's ``Open defining file''/``Jump to definition'' >> features >> +;; can navigate into Racket programs, including into the >> implementation of >> +;; 'racket/base', but can not jump into the implementation of the >> Racket VM >> +;; itself. A third, related perspective is that Racket code is >> usually >> +;; installed with source files alongside compiled code (though this >> is not >> +;; mandatory), whereas the Racket VM is installed only in compiled >> form. >> [...] >> +;; output. The function 'racket-vm-for-system' returns the >> recomended Racket >> +;; VM package for a given system. > This is a very long comment. Consider how much of it is actually > necessary and how much of it is not (do I really need to know about the > capabilities of DrRacket for instance?) I guess it would be ok to cut the explanation of the distinction between VM primitives and the ``built in'' collections, since the bottom line is that the truly primitive primitives aren't useful without the main collections. I'm not sure what else to cut that wouldn't leave room for confusion. >> +;; (Note: since the CGC variant is basically only for bootstrapping, >> we >> +;; often use "BC" to mean "3M", consistent with `(banner)` and the >> +;; suffixes used on executables when more than one variant co- >> exists.) >> +;; >> +;; 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 >> +;; README file applies to all such subsystems: >> +;; >> +;;     The Racket version must be practically the same as the >> current Racket >> +;;     verson, although it can be the Racket BC implementation >> (instead of >> +;;     the Racket CS implementation). >> +;; >> +;;     Unlike Chez Scheme boot files, the files generated in >> "schemified" >> +;;     are human-readable and -editable Scheme code. That provides a >> way >> +;;     out of bootstrapping black holes, even without BC. >> +;; >> +;; However, other Racket subsystems implemented in Racket for Racket >> CS >> +;; use older C implementations for Racket BC, whereas the reader, >> expander, >> +;; and module system were completely replaced with the Racket >> implementation >> +;; >> +;; For Racket BC, the compiled "linklet" s-expressions (primitive >> modules) >> +;; are embeded in C as a static string constant. Eventually, they >> are further >> +;; compiled by the C-implemented Racket BC bytecode and JIT >> compilers. >> +;; (On platforms where Racket BC's JIT is not supported, yet another >> compiler >> +;; instead compiles the linklets to C code, but this is not a >> bootstrapping >> +;; issue.) >> +;; > Again, you want to be brief and understandable. What does this mean in > practise? Do we have racket bootstrapped yet or is there still some > magic hidden within? This is just the comment that is currently at the top of "gnu/packages/racket.scm", but moved to this file because this is now going to be where the bootstrapping happens. Are there specific thing you want to cut? On the current state of bootstrapping, almost everything is bootstrapped from C, but the "expander" subsystem (which includes the reader and the module system) is not currently bootstrappable, though it is readily auditable. I made another attempt at an explanation in this email: https://lists.gnu.org/archive/html/guix-devel/2021-08/msg00103.html I'd welcome suggestions to improve the explanation! >>  (define unbundle-chez-submodules >>    #~(begin >>        (use-modules (guix build utils)) >>        (for-each (lambda (dir) >> -                (when (directory-exists? dir) >> -                  (delete-file-recursively dir))) >> -              '("stex" >> -                "nanopass" >> -                "lz4" >> -                "zlib")))) >> +                  (when (directory-exists? dir) >> +                    (delete-file-recursively dir))) >> +                '("stex" >> +                  "nanopass" >> +                  "lz4" >> +                  "zlib")))) > As in one of your previous patches, you're mixing cosmetic changes with > non-cosmetic ones. This one could be prevented by correctly indenting > it in the patch that introduces it. Sorry, I missed this in a previous round of indentation fixing. >> +;; >> +;; Racket VM: >> +;; >> + >> +(define (racket-vm-common-configure-flags) >> +  ;; under a lambda extraction to avoid evaluating bash-minimal too >> early >> +  #~`(,@(cond >> +         ((false-if-exception >> +           (search-input-file %build-inputs "/bin/libtool")) >> +          => (lambda (libtool) >> +               (list (string-append "--enable-lt=" libtool)))) >> +         (else >> +          '())) >> +      ,@(cond >> +         ((false-if-exception >> +           (search-input-file %build-inputs "/opt/racket- >> vm/bin/racket")) > Did we have /opt/racket... before? We should probably avoid such > paths. We did not have "opt/racket-vm/" before---adding it was sort of the point of this patch series. Is the reason to avoid it a dislike for "opt", or something else? An ``in place'' build of Racket is not meant to be unpacked directly into some PREFIX where it will coexist with other software. The build is vaguely FHS-like in that e.g. it includes a "bin" directory, but it also e.g. has a "collects" directory at the top level, and it puts other things in paths like "etc/config.rktd" rather than "etc/racket/config.rktd". Subdirectories of "opt" often have that sort of layout, so it seemed like a reasonable place to put it. I considered just embracing Guix not being tied to FHS and putting it directly in the store output, but in build-side code it turned out to be useful to be able to use `search-input-{file,directory}` without potentially confusing the in-place VM with an intermediate, potentially tethered layer. If the question is, ``why do we want an in-place build?'', I can go into as much depth as you want, but it makes the build-side code easier to reason about, it's more compatible with Racket tools e.g. for cross-compilation, and it should help to reduce closure sizes by letting us build packages with non-tethered intermediate layers. >> +          => (lambda (racket) >> +               (list (string-append "--enable-racket=" racket)))) >> +         (else >> +          '())) >> +      ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" >> +                      #$(file-append bash-minimal "/bin/sh")) >> +      "--disable-strip" >> +      "--enable-origtree") > For the record, why do you need double quoting here? Would ungexp- > splicing extract this too soon? I'm not 100% sure I'm following your question correctly, but yes, there were problems with referencing `bash-minimal` too early. (An alternative I considered was to add these arguments in a wrapper around gnu-build-system's configure phase, so that #:configure-flags would be only for arguments that variants want to override, or plausibly might.) > >> +(define-public racket-vm-cgc >> +  ;; Eventually, it may make sense for some vm packages to not be >> hidden, >> +  ;; but this one is especially likely to remain hidden. >> +  (hidden-package >> +   (package >> +     (name "racket-vm-cgc") >> +     (version "8.4") >> +     ;; ^ Remember to also update the version of >> +     ;;   chez-scheme-for-racket-bootstrap-bootfiles >> +     (source >> +      (origin >> +        (method git-fetch) >> +        (uri (git-reference >> +              (url "https://github.com/racket/racket") >> +              (commit (string-append "v" version)))) >> +        (sha256 >> +         (base32 >> "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) >> +        (file-name (git-file-name "racket" version)) >> +        (patches (search-patches "racket-minimal-sh-via-rktio.patch" >> +                                 ;; Remove by Racket 8.5: >> +                                 "racket-enable-scheme- >> backport.patch")) >> +        (modules '((guix build utils))) >> +        (snippet >> +         #~(begin >> +             ;; Unbundle Chez submodules. >> +             (with-directory-excursion "racket/src/ChezScheme" >> +               #$unbundle-chez-submodules) >> +             ;; Unbundle libffi. >> +             (delete-file-recursively >> "racket/src/bc/foreign/libffi"))))) >> +     (inputs (list ncurses ;; <- common to all variants (for >> #%terminal) >> +                   bash-minimal ;; <- common to all variants (for >> `system`) >> +                   libffi)) ;; <- only for BC variants >> +     (native-inputs (list libtool)) ;; <- only for BC variants >> +     (outputs '("out" "debug")) >> +     (build-system gnu-build-system) >> +     (arguments >> +      (list >> +       #:configure-flags >> +       #~(cons "--enable-cgcdefault" >> +               #$(racket-vm-common-configure-flags)) >> +       ;; Tests are in packages like racket-test-core and >> +       ;; main-distribution-test that aren't part of the main >> +       ;; distribution. >> +       #:tests? #f >> +       ;; Upstream recommends #:out-of-source?, and it does >> +       ;; help with debugging, but it confuses `install-license- >> files`. >> +       #:modules '((ice-9 match) >> +                   (ice-9 regex) >> +                   (guix build gnu-build-system) >> +                   (guix build utils)) >> +       #:strip-directories #~'("opt/racket-vm/bin" >> +                               "opt/racket-vm/lib") >> +       #:phases >> +       #~(let () >> +           (define* ((wrap-racket-vm-outputs phase) . args) >> +             (apply >> +              phase >> +              (let loop ((args args)) >> +                (match args >> +                  ((#:outputs outputs . args) >> +                   `(#:outputs >> +                     ,(let loop ((outputs outputs)) >> +                        (match outputs >> +                          ((("out" . out) . outputs) >> +                           `(("out" . ,(string-append out >> "/opt/racket-vm/")) >> +                             ,@outputs)) >> +                          ((other . outputs) >> +                           (cons other (loop outputs))))) >> +                     ,@args)) >> +                  ((arg . args) >> +                   (cons arg (loop args))))))) > Why? > Why what? Why 'wrap-racket-vm-outputs'? The wrapped phases don't have keywords like #:strip-directories, so adjusting their #:output argument is the only way to tell them where to find the files they need to operate on. -Philip From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 16 15:16:41 2022 Received: (at 53878) by debbugs.gnu.org; 16 Feb 2022 20:16:41 +0000 Received: from localhost ([127.0.0.1]:49553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKQjA-0002GD-Ro for submit@debbugs.gnu.org; Wed, 16 Feb 2022 15:16:41 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:35598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKQj8-0002G1-VZ for 53878@debbugs.gnu.org; Wed, 16 Feb 2022 15:16:39 -0500 Received: by mail-qk1-f182.google.com with SMTP id 200so2737741qki.2 for <53878@debbugs.gnu.org>; Wed, 16 Feb 2022 12:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:from:subject:to:references :content-language:in-reply-to:content-transfer-encoding; bh=08vcj/14tlZzjsW7Mj47G+XTtEwMmifCGATZ7IWJzu4=; b=QQ5cd4UApruItf4sEKiwRdRvL+N9UZFidZv+dP1nclqHpT+f040vJ7IqB0eLE8r02w mtDOzNwVXOLViPAJQuoES1oA/ruNIGrBW7VMyT8xRLBYDaYaKY9BzdagumM1C7kQpOM7 2/g8i4N7YJl5WKTy03eRC8AOutlLL8dcVaHeWWfoZU1BIEOV2MZE+//4wc4Xr77JEHRX W881pk/JiBBr2ZABMlLsYndjHF6uGNI8RSDAfoc/UYfaT1ZLbuPB6SUMXWnGnkBLqiLJ fmCydHq/w+vO0KR23FnvOe6C/vMORd2BwozjQI7do9rUI27sG3RCbVmIs0oPw5tnHUKT hB8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:references:content-language:in-reply-to :content-transfer-encoding; bh=08vcj/14tlZzjsW7Mj47G+XTtEwMmifCGATZ7IWJzu4=; b=ki4uGdUL/BXXfCCAkOLqALJPWV6/0BpVT84eRE3iqGJLFSeL2dONGkCKB1kSV4nQyc 41wL/P9uJwbhG2fAkqtT74scZ0HHll0II/51YTzxccbyNgpjVIUYdHeGSIZmvDLSojk7 0cuON4x5Yptb7tHOQ8ce3L/+E1X8beNQevKP5vDNahU/ltTQKo6TnlYME6yGIcc2hzQt nJj0deMfOYzy6leS7pRYMA0RPZvniJKeZmEEqADX/fptRxCSh5noS+3BdV4F3Ct21S/Q bVFR67oxqnOW2UkwMLNoz2Fo+i3ft+pC06fQRyRCWzAEyhLbGsIYdNCzsXPdXXJdH6MY sEDg== X-Gm-Message-State: AOAM532le6a44f2Eq3kNiow5zeI9Ewg8coPSJnWo7eDftIYiZb9oMMS6 +UyjSDzflKLT22QBAloMrvNd3tPVX0/bDQGIRtI= X-Google-Smtp-Source: ABdhPJzSkOKhAvQUJ8YAfE0EJ+8XCBfwTNJNb+x3IltVjmXQI4N42stDIzVDLUl3/G1AcX4FD6yxXg== X-Received: by 2002:a05:620a:1538:b0:506:cf08:8c3e with SMTP id n24-20020a05620a153800b00506cf088c3emr2148930qkk.115.1645042593412; Wed, 16 Feb 2022 12:16:33 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id s7sm19414235qki.20.2022.02.16.12.16.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Feb 2022 12:16:33 -0800 (PST) Message-ID: Date: Wed, 16 Feb 2022 15:16:33 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: Philip McGrath Subject: Re: [PATCH 11/11] gnu: racket: Update to 8.4. To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-12-philip@philipmcgrath.com> <841fd9aa797eeaa3e5c202e8957574c22098c81f.camel@ist.tugraz.at> Content-Language: en-US In-Reply-To: <841fd9aa797eeaa3e5c202e8957574c22098c81f.camel@ist.tugraz.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/14/22 10:28, Liliana Marie Prikler wrote: > Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: >> * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch, >> gnu/packages/patcheches/racket-srfi-fsdg-backport.patch: New patches. >> * gnu/local.mk (dist_patch_DATA): Add them. >> * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): >> New procedure. >> * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.4. >> Rewrite to use 'racket-vm-for-system', label-less inputs, G- >> expressions, and Git origins for main-distribution packages. > Separate into multiple patches. > >>  .../patches/racket-srfi-fsdg-backport.patch   | 41622 ++++++++++++++++ > No. > Patches should be small, not include a bunch of irrelevant doc changes. The FSDG fix has now been applied upstream, so I can now just point at the right Git commit. Other than that, I don't know how this could reasonably be split into multiple patches. I deleted the vast majority of "gnu/packages/racket.scm" and rewrote it. Most of the work done by the old version was bootstrapping, which is now handled by the racket-vm-* packages: keeping "gnu/packages/racket.scm" nearly unchanged until this point basically was my attempt at making these changes more granularly, Even the switch to use Git origins for main-distribution packages rather than carving them out of the built tarball (which was always an ugly hack) would not be trivial to move to a separate patch. The new "racket-gui-tethered-launcher-backport.patch" (without which the 'racket' package would be broken) would have to be manually edited to apply to the built tarball---the built tarball is really not the preferred form for modifications by a long shot---and newly added packages for the new expeditor and the redesigned syntax highlighting and indentation libraries would need to be added to the old listing, only to be immediately removed. -Philip From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 16 15:47:03 2022 Received: (at 53878) by debbugs.gnu.org; 16 Feb 2022 20:47:03 +0000 Received: from localhost ([127.0.0.1]:49569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKRCX-0002zX-Rp for submit@debbugs.gnu.org; Wed, 16 Feb 2022 15:47:03 -0500 Received: from mail-qk1-f176.google.com ([209.85.222.176]:44893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKRCU-0002zH-Og for 53878@debbugs.gnu.org; Wed, 16 Feb 2022 15:47:00 -0500 Received: by mail-qk1-f176.google.com with SMTP id q4so1432359qki.11 for <53878@debbugs.gnu.org>; Wed, 16 Feb 2022 12:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:references:in-reply-to:content-transfer-encoding; bh=mp7MM8Ru1YD0QtTKc01f5oYAC62kFQy8ZIBqVMzsrjM=; b=EtUR8HJUz6JhuL0cJIw2roN3OYljLW8oNYPhYWL0Fir0xO97hPf/8VCgJVpWAWR/SG DFfM44WxFHHyGogCWZeU41k8fslLvTYOIK+zQ346jrWsBam9uIbwgB7okEsf0WohcPOv hVrekngIuQ94GR7ToP2mdw/1e5ux7YiYOMVolaD84XN87TAgSABtraFzB+H6cxQ0DPor /fiaY4xz/NsnMPSEjCYaaqIdg/PIqh0rFGRr2YHe7P4ARC70dUtu8d63RfN+AE/0TIhC QJWhIhIdxwBjfEiB+MAdYxmCqoOZr9Etd2OnVZHPfZpkwQiiQbofT87UZ1yWI9g7RJW+ 3EGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:references:in-reply-to :content-transfer-encoding; bh=mp7MM8Ru1YD0QtTKc01f5oYAC62kFQy8ZIBqVMzsrjM=; b=w+OnqTq1XRdrGv9V5W8X32GkCdRuda+fHbjbnqMeOjjAUpmRwUqM1BVB20YfcEBhOW RjzQtyu8ZZMZ4C88M4l4gr5Q1C/THi4MC2NRLOzwlggrYHJdtlsEiKnxYZgD/gs2XYK3 e0ViZBBKVDDbLjzVp+Vkl+PzXxNSFqRM59TMFuPFk7AlPkgqPlvmLF60g7WH75zBrQ7g x499rnDqscbhicwrCuKsXINumHm6BHDpAOmQqM5Hj6icJuI4MNYVzHbT777z1MObvp6I mqpCdQJbgchSXb5k0FtMIPtwXAFYkq/fIkWOEBkd0Acq3WT/EJAlK3ht3erupG86/0lv Dzbg== X-Gm-Message-State: AOAM530ZK3vztcA0LvsQ2Yq2YMnpOabS50JjASr/TZdb8HrFYYd9M1Mw FJgfBMgQlmqDdZD7pqBAQCiSfTcq/8I4VN276RM= X-Google-Smtp-Source: ABdhPJxxoP0JJtBSCWyMJzPFRNlcirAnBYEd9fbCJovcw42AIYyeI4nJqwjBzlNSH8NFWcs4re2ybw== X-Received: by 2002:a37:b704:0:b0:478:9e60:4ec0 with SMTP id h4-20020a37b704000000b004789e604ec0mr2256505qkf.697.1645044412997; Wed, 16 Feb 2022 12:46:52 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id a6sm23257924qta.91.2022.02.16.12.46.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Feb 2022 12:46:52 -0800 (PST) Message-ID: Date: Wed, 16 Feb 2022 15:46:50 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 05/11] gnu: Add stex. Content-Language: en-US From: Philip McGrath To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-6-philip@philipmcgrath.com> <72f7937e-7476-a48c-56af-8f68834d4359@philipmcgrath.com> In-Reply-To: <72f7937e-7476-a48c-56af-8f68834d4359@philipmcgrath.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/16/22 13:35, Philip McGrath wrote: > Hi, > > On 2/14/22 09:46, Liliana Marie Prikler wrote: >> Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: >>> * gnu/packages/chez-and-racket-bootstrap.scm (stex-bootstrap): New >>> variable. >>> (stex): Change from origin to package inheriting from 'stex- >>> bootstrap'. >>> (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove >>> labels. Remove dependencies of stex-bootstrap. >>> [inputs]: Remove labels. >>> [arguments]: Adapt to use 'stex-bootstrap', 'search-input-file', and >>> G-expressions. >>> (nanopass): Make it public as a temporary workaround for Racket. >>> * gnu/packages/racket.scm >>> (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. >> This is again a large number of changes in one go.  When it comes to >> writing good patches, less is more, especially in terms of being >> understandable. I will separate the non-substantive changes to input labels and such as discussed below. >>> +(define (unpack-nanopass+stex) >>> +  ;; delayed resolution of `nanopass` >>> +  #~(begin >>> +      (copy-recursively #$nanopass >>> +                        "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"))))) >>> [...] >>> -       (snippet >>> -        ;; Remove bundled libraries. >>> -        (with-imported-modules '((guix build utils)) >>> -          #~(begin >>> -              (use-modules (guix build utils)) >>> -              (for-each (lambda (dir) >>> -                          (when (directory-exists? dir) >>> -                            (delete-file-recursively dir))) >>> -                        '("stex" >>> -                          "nanopass" >>> -                          "lz4" >>> -                          "zlib"))))))) >>> [...] >>> +              (snippet unbundle-chez-submodules))) >> Why? Why lift the snippet to `unbundle-chez-submodules`? The origin of Racket also needs it, but wrapped in a `with-directory-excursion`. >> >>>       (build-system gnu-build-system) >>>       (inputs >>> -     `(("libuuid" ,util-linux "lib") >>> -       ("zlib" ,zlib) >>> -       ("lz4" ,lz4) >>> -       ;; for expeditor: >>> -       ("ncurses" ,ncurses) >>> -       ;; for X11 clipboard support in expeditor: >>> -       ;; >>> https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 >>> -       ("libx11" ,libx11))) >>> -    (native-inputs >>> -     `(("nanopass" ,nanopass) ; source only >>> -       ;; for docs >>> -       ("stex" ,stex) >>> -       ("xorg-rgb" ,xorg-rgb) >>> -       ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend >>> -                                             texlive-epsf >>> -                                             texlive-fonts-ec >>> -                                             texlive-oberdiek))) >>> -       ("ghostscript" ,ghostscript) >>> -       ("netpbm" ,netpbm))) >>> +     (list >>> +      `(,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 stex-bootstrap)) >> This is a lot of noise.  Either first clean up the inputs and then add >> new ones or the other way round, but doing both in the same commit >> (especially with other stuff as well) is too much imo. Ok, I will clean the inputs before lifting out stex. >> >>>       (native-search-paths >>>        (list (search-path-specification >>>               (variable "CHEZSCHEMELIBDIRS") >>>               (files (list (string-append "lib/chez-scheme")))))) >>>       (outputs '("out" "doc")) >>>       (arguments >>> -     `(#:modules >>> -       ((guix build gnu-build-system) >>> +     (list >>> +      #:modules >>> +      '((guix build gnu-build-system) >>>           (guix build utils) >>>           (ice-9 ftw) >>>           (ice-9 match)) >>> -       #:test-target "test" >>> -       #:configure-flags >>> -       '("--threads") ;; TODO when we fix armhf, it doesn't support >>> --threads >>> -       #:phases >>> -       (modify-phases %standard-phases >>> -         ;; put these where configure expects them to be >>> -         (add-after 'unpack 'unpack-nanopass+stex >>> -           (lambda* (#:key native-inputs inputs #:allow-other-keys) >>> -             (for-each (lambda (dep) >>> -                         (define src >>> -                           (assoc-ref (or native-inputs inputs) >>> dep)) >>> -                         (copy-recursively src dep >>> -                                           #:keep-mtime? #t)) >>> -                       '("nanopass" "stex")))) >>> -         ;; NOTE: the custom Chez 'configure' script doesn't allow >>> -         ;; unrecognized flags, such as those automatically added >>> -         ;; by `gnu-build-system`. >>> -         (replace 'configure >>> -           (lambda* (#:key inputs outputs >>> -                           (configure-flags '()) >>> -                           #:allow-other-keys) >>> -             (let* ((zlib-static (assoc-ref inputs "zlib:static")) >>> -                    (lz4-static (assoc-ref inputs "lz4:static")) >>> -                    (out (assoc-ref outputs "out")) >>> -                    ;; add flags which are always required: >>> -                    (flags (cons* (string-append "--installprefix=" >>> out) >>> +      #:test-target "test" >>> +      ;; TODO when we fix armhf, it may not support --threads >>> +      #:configure-flags #~'("--threads") >>> +      #:phases >>> +      #~(modify-phases %standard-phases >>> +          (add-after 'unpack 'unpack-nanopass+stex >>> +            (lambda args >>> +              #$(unpack-nanopass+stex))) >>> +          ;; NOTE: the custom Chez 'configure' script doesn't allow >>> +          ;; unrecognized flags, such as those automatically added >>> +          ;; by `gnu-build-system`. >>> +          (replace 'configure >>> +            (lambda* (#:key inputs (configure-flags '()) #:allow- >>> other-keys) >>> +              ;; add flags which are always required: >>> +              (let ((flags (cons* (string-append "--installprefix=" >>> #$output) >>>                                     "ZLIB=-lz" >>>                                     "LZ4=-llz4" >>>                                     "--libkernel" >>> @@ -305,90 +276,59 @@ (define src >>>                                     ;; and letting Chez try causes an >>> error >>>                                     "--nogzip-man-pages" >>>                                     configure-flags))) >>> -               (format #t "configure flags: ~s~%" flags) >>> -               ;; Some makefiles (for tests) don't seem to propagate >>> CC >>> -               ;; properly, so we take it out of their hands: >>> -               (setenv "CC" ,(cc-for-target)) >>> -               (setenv "HOME" "/tmp") >>> -               (apply invoke >>> -                      "./configure" >>> -                      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* ((out (assoc-ref outputs "out")) >>> -                    (bin (string-append out "/bin")) >>> -                    (lib (string-append out "/lib")) >>> -                    (name "chez-scheme")) >>> -               (symlink (string-append bin "/scheme") >>> -                        (string-append bin "/" name)) >>> -               (map (lambda (file) >>> -                      (symlink file (string-append (dirname file) >>> -                                                   "/" name >>> ".boot"))) >>> -                    (find-files lib "scheme.boot"))))) >>> -         ;; Building explicitly lets us avoid using substitute* >>> -         ;; to re-write makefiles. >>> -         (add-after 'install-symlink 'prepare-stex >>> -           (lambda* (#:key native-inputs inputs outputs #:allow- >>> other-keys) >>> -             (let* ((stex+version >>> -                     (strip-store-file-name >>> -                      (assoc-ref (or native-inputs inputs) "stex"))) >>> -                    ;; Eventually we want to install stex as a real >>> -                    ;; package so it's reusable. For now: >>> -                    (stex-output "/tmp") >>> -                    (doc-dir (string-append stex-output >>> -                                            "/share/doc/" >>> -                                            stex+version))) >>> -               (with-directory-excursion "stex" >>> -                 (invoke "make" >>> -                         "install" >>> -                         (string-append "LIB=" >>> -                                        stex-output >>> -                                        "/lib/" >>> -                                        stex+version) >>> -                         (string-append "Scheme=" >>> -                                        (assoc-ref outputs "out") >>> -                                        "/bin/scheme")) >>> -                 (for-each (lambda (pth) >>> -                             (install-file pth doc-dir)) >>> -                           '("ReadMe" ; includes the license >>> -                             "doc/stex.html" >>> -                             "doc/stex.css" >>> -                             "doc/stex.pdf")))))) >>> -         ;; Building the documentation requires stex and a running >>> scheme. >>> -         ;; FIXME: this is probably wrong for cross-compilation >>> -         (add-after 'prepare-stex 'install-doc >>> -           (lambda* (#:key native-inputs inputs outputs #:allow- >>> other-keys) >>> -             (let* ((chez+version (strip-store-file-name >>> -                                   (assoc-ref outputs "out"))) >>> -                    (stex+version >>> -                     (strip-store-file-name >>> -                      (assoc-ref (or native-inputs inputs) "stex"))) >>> -                    (scheme (string-append (assoc-ref outputs "out") >>> -                                           "/bin/scheme")) >>> -                    ;; see note on stex-output in phase build-stex, >>> above: >>> -                    (stexlib (string-append "/tmp" >>> -                                            "/lib/" >>> -                                            stex+version)) >>> -                    (doc-dir (string-append (assoc-ref outputs >>> "doc") >>> -                                            "/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")) >>> -               (with-directory-excursion doc-dir >>> -                 (symlink "release_notes/release_notes.pdf" >>> -                          "release_notes.pdf") >>> -                 (symlink "csug/csug9_5.pdf" >>> -                          "csug.pdf")))))))) >>> +                (format #t "configure flags: ~s~%" flags) >>> +                ;; Some makefiles (for tests) don't seem to >>> propagate CC >>> +                ;; properly, so we take it out of their hands: >>> +                (setenv "CC" #$(cc-for-target)) >>> +                (setenv "HOME" "/tmp") >>> +                (apply invoke "./configure" 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* ((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. >>> +          ;; FIXME: this is probably wrong for cross-compilation >>> +          (add-after 'install-symlink 'install-doc >>> +            (lambda* (#:key native-inputs inputs outputs >>> +                            #:allow-other-keys) >>> +              (match (assoc-ref outputs "doc") >>> +                (#f >>> +                 (format #t "not installing docs~%")) >>> +                (doc-prefix >>> +                 (let* ((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")) >>> +                   (with-directory-excursion doc-dir >>> +                     (symlink "release_notes/release_notes.pdf" >>> +                              "release_notes.pdf") >>> +                     (symlink "csug/csug9_5.pdf" >>> +                              "csug.pdf")))))))))) >> Again mixing cosmetic changes with functional ones. Ok, I separate these. >>> @@ -412,3 +352,145 @@ (define* (stex-make #:optional (suffix "")) >>>   generates native code for each target processor, with support for >>> x86, x86_64, >>>   and 32-bit PowerPC architectures.") >>>       (license license:asl2.0))) >>> + >>> +;; >>> +;; Chez's bootstrap dependencies: >>> +;; ... >> Not quite sure on these hunks.  Could be fine, could not be fine. >> Disentangling stex from chez and publicly exporting it is probably a >> good idea, though. Especially because it is also needed to build the docs for nanopass, itself, and at least one package not yet in Guix (). -Philip From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 16 16:13:46 2022 Received: (at 53878) by debbugs.gnu.org; 16 Feb 2022 21:13:46 +0000 Received: from localhost ([127.0.0.1]:49588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKRcP-0003fl-NY for submit@debbugs.gnu.org; Wed, 16 Feb 2022 16:13:46 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:40720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKRcN-0003fX-OI for 53878@debbugs.gnu.org; Wed, 16 Feb 2022 16:13:44 -0500 Received: by mail-qv1-f47.google.com with SMTP id v10so4412913qvk.7 for <53878@debbugs.gnu.org>; Wed, 16 Feb 2022 13:13:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:from:subject:to:references :content-language:in-reply-to:content-transfer-encoding; bh=zdR/tvYn9ZoDfMuR5FA7IKrzN8/iKr3yOv7TiulASMo=; b=jt/yBxs6wKV+ekUNP09mSPB4T+KUeNLeRpfEpyj2IBg0H5XFxYoe/WJa00ivVd6yIH XusXOkbtja8qKTBDvQ5VJMrok/9E5Wb10M9RlUkTHq7FBM2H5BeK7xTbA1ARknsc2u9d KYnNVHmxfTvFZh4X+x1ST4ill/AOV/YPFp6CZ8Zxac2NmknY8pwNMjrK68+sOM8NokKI lUPfFtdYhxCSXFjE7NpRV5jpLyRALuLcFBoArlLwTDvgwDp/YXkoXjTGwsKyt5iMFOeb oqmJoRKld34aej5YtTXWMn/7uDyXbEIccjbg9G25ubZGISttrkjI811SuT6n4qkuUa8Q 87Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:references:content-language:in-reply-to :content-transfer-encoding; bh=zdR/tvYn9ZoDfMuR5FA7IKrzN8/iKr3yOv7TiulASMo=; b=5otoTWkP/BkO+3if143XppWImpOBmrSs4W3oatJWuk/ibv7lB3G5NySybePA90zq74 eA2PHYzJaSIc6N1vQ04EOhwnQE4k50DH3ujuB3tVJ4qw7lEg8wt5ux/WZXbKWUFYuWCE 9EnvmpBAITv8sgbzDXzoS1zupUe/TEtOgQZVwElGSDBN3ZL97INniFsxEE3T7AALszVI ENGxPMDs8CMFFUpF5o0UBh/PVJRRcBXoxXFo0mLoN6/08R+iLrkQrNr1qXGFEidD9FUI TuThnudjO8cUhj3c9AQ/TZEv6RDHnPZshyxLOS9JPVlerpmx2dhwlj7UerNXNVklQmPm eWvw== X-Gm-Message-State: AOAM531hA6daJYUi2c/vJhrva3VWpYp2QVAY8OVBsCnsFS2hphOG2FUW C9X07GK64oNvtcpWaEZs42ylwTSIRpIGs3MIvrI= X-Google-Smtp-Source: ABdhPJyfb3Kxw/NAYjpDS3A70q50wVYuG3OdbhDAYFihIwWWYcItaDBM1VO8UvskMMhq7JnPre0edA== X-Received: by 2002:a05:622a:2294:b0:2d7:14b9:c445 with SMTP id ay20-20020a05622a229400b002d714b9c445mr3603524qtb.362.1645046018200; Wed, 16 Feb 2022 13:13:38 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id z23sm2511000qtn.40.2022.02.16.13.13.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Feb 2022 13:13:37 -0800 (PST) Message-ID: <9979ce6c-9583-18e1-43da-098d2d74e741@philipmcgrath.com> Date: Wed, 16 Feb 2022 16:13:36 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: Philip McGrath Subject: Re: [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-8-philip@philipmcgrath.com> <7a5ff55f7c05308cac7bb2aae5dbe0a16b8fa9b9.camel@ist.tugraz.at> Content-Language: en-US In-Reply-To: <7a5ff55f7c05308cac7bb2aae5dbe0a16b8fa9b9.camel@ist.tugraz.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/14/22 09:54, Liliana Marie Prikler wrote: > Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: >> This might seem a bit silly in isolation, but it makes the structure >> of the upstream Chez Scheme package the same as for the Racket >> variant, it sets things up for (one day, hopefully) actually being >> able to bootstrap the upstream Chez Scheme bootfiles, and it may be >> useful for cross-compilation and adding support for architectures >> without pre-built bootfiles from upstream. >> >> * gnu/packages/chez-and-racket-bootstrap.scm >> (chez-scheme-bootstrap-bootfiles): New variable. >> (chez-scheme)[native-inputs]: Add it. >> [arguments]: Add new phase 'unpack-bootfiles'. >> [version, source, home-page]: Derive from 'chez-scheme-bootstrap- >> bootfiles'. >> --- > While having chez-scheme-bootstrap-bootfiles (silly name) does make > some kind of sense, making chez-scheme inherit from it does not. Given > that we don't have a chez-scheme bootstrap tower at hand, you should > probably make (chez-scheme-bootstrap) a procedure which takes chez- > scheme's origin as argument and returns the full package. > Making a function is an interesting idea, but I'm not sure I'm quite picturing what you have in mind. I will see if I can figure out something that seems reasonable as I revise this series, if I don't hear from you before then. One reason I like making the bootfiles a package is that a set of bootfiles includes artifacts in addition to the bootfiles themselves, such as generated C headers describing the layout of Scheme objects in memory, some of which are not included as part of an installed Chez Scheme. For example, imagine someone wants to run Chez Scheme on FreeBSD: upstream does not distribute BSD bootfiles, so they must be cross-compiled. Even though Guix doesn't have a C toolchain for FreeBSD (AFAIK), Guix could be used to reproducibly build the needed bootfiles and pack a "source" tarball to be used on a FreeBSD build machine. Also, the process for building bootfiles is largely orthogonal to building the actual `scheme` executable, and it seems like eventually it may be useful to be able to override options separately. There may be other ways to address these sorts of things, and it's true that a lot of this has more to do with my intuition of what might be work well in the future, rather than something that actually works right now. Is there a technical reason to prefer either repeating the home page, license, etc. or writing e.g. `(package-license chez-scheme-bootstrap-bootfiles)` rather than using inheritance? -Philip From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 16 17:55:09 2022 Received: (at 53878) by debbugs.gnu.org; 16 Feb 2022 22:55:09 +0000 Received: from localhost ([127.0.0.1]:49685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKTCW-00004y-OC for submit@debbugs.gnu.org; Wed, 16 Feb 2022 17:55:09 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:37578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKTCU-0008WE-O9 for 53878@debbugs.gnu.org; Wed, 16 Feb 2022 17:55:07 -0500 Received: by mail-qk1-f169.google.com with SMTP id v5so697161qkj.4 for <53878@debbugs.gnu.org>; Wed, 16 Feb 2022 14:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:from:subject:to:references :content-language:in-reply-to:content-transfer-encoding; bh=RiWC+nZS8gp9oVClTgh1UrV0XoLJ0Te4Di48ELScWCE=; b=MMRKDahPZHgaICu4nboSmzp2g3RxW6WMl2kK3VMmltVygevwZEJKfBxQnh2Hpfv71f ZX2Ob3uof5I39klbA3RztIh7FCwQYGJXAW/BOjp7S7hEy/JJ84dvMPVhC8njqETl3Kj7 zn2Vx981F3FKMlZ8FtdjVYa1AgZjiKhomDZ/n653hMb7Vt9qMU6Ck2OmusrG9pvpC7ZU VtSPoqm6ehETHdpct35a+qt5EUbrijiaPNzrSG259DDx+mP4GfYUbaemCYzDvjBs0aaU RlIZBKGjRZukAtraOTY9poRY6k43YF1f8LtLQrcTyaHKs2ac5VZ2ytrICRlcyS19ibdd W6HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:references:content-language:in-reply-to :content-transfer-encoding; bh=RiWC+nZS8gp9oVClTgh1UrV0XoLJ0Te4Di48ELScWCE=; b=wOM9pqgpaksuj1Y8OdcFDjN5oF/E2FU4CmiWgIsqaA9Qp2j6Gw8bGoFYJHEidl8AiS m31gYQ6g5/U/oqZ4fnu+bPwTQRrd/U7sd0AGcxE/fR8jtVISWHTmUsiXUze1AKSMHOjd LaXeT4MNZj/7GLciswLPa+7Ly6v2gKPul/hob0MN9JF/FE+OTzBNwALI+kw0o838P3Ep hlxklhP0KJSEov79ZY6550mSX2OpeK2Wstv82GHuMFI6qlAwMefTB01X/IvkIIVsd0m4 TONsILWmbdLVuTiZZUJfL4XGPudrtiAxaB/AjrPmllY/WVsFh42BmRiE0kXPMy4iWPE0 t8Tw== X-Gm-Message-State: AOAM5339PbuWNzXURX9r9GBTzlArF/8bc8yAJ2nLyS7Vd1kJ0IGtrnRA 2+GbNKcCirilGgarnCYop3L+BoKnTyjm1Da73VQ= X-Google-Smtp-Source: ABdhPJz9768dVPmEKnZrTa7l9nA6lVQhPk3IsnpXtGlg/5ia+ECbq1DIXM01fuIE/NoEmr38SIOZrA== X-Received: by 2002:a37:e217:0:b0:508:b8a5:5713 with SMTP id g23-20020a37e217000000b00508b8a55713mr56504qki.618.1645052101123; Wed, 16 Feb 2022 14:55:01 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id i12sm20721386qkn.83.2022.02.16.14.54.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Feb 2022 14:55:00 -0800 (PST) Message-ID: <220923bf-f243-8760-a0cf-1c77a26023cf@philipmcgrath.com> Date: Wed, 16 Feb 2022 17:54:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 From: Philip McGrath Subject: Re: [PATCH 04/11] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-5-philip@philipmcgrath.com> <20ade6d2f82b20f25d0eb1c8b2b5c409c189d05a.camel@ist.tugraz.at> Content-Language: en-US In-Reply-To: <20ade6d2f82b20f25d0eb1c8b2b5c409c189d05a.camel@ist.tugraz.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/14/22 09:34, Liliana Marie Prikler wrote: > Hi, > > Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: >> [...] >> +(define (chez-machine->upstream-restriction mach) >> +  "Given a string MACH naming a Chez Scheme machine type, returns a >> symbol >> +naming a restriction on the upstream Chez Scheme implementation >> compared to >> +the Racket variant, or @code{#f} if no such restriction exists.  The >> +restriction is reported for the architecture--OS pair, regardless of >> whether >> +MACH specifies a threaded or an unthreaded variant. >> + >> +Possible restrictions currently include: >> +@itemize @bullet >> +@item >> +@code{'no-threads}: Support for native threads is not available >> upstream. >> +@item >> +@code{'no-support}: The upstream release doesn't claim to support >> this >> +architecture--OS combination at all. >> +@end itemize >> + >> +See @code{chez-machine->nix-system} for more details about >> acceptable values >> +for MACH." >> +  (let ((mach (chez-machine->unthreaded mach))) >> +    (cond >> +     ((string-prefix? "arm64" mach) >> +      'no-support) >> +     ((string-prefix? "arm32" mach) >> +      (if (string-suffix? "le" mach) >> +          'no-threads >> +          'no-support)) >> +     ((string-prefix? "ppc32" mach) >> +      (if (string-suffix? "le" mach) >> +          #f >> +          'no-support)) >> +     (else >> +      #f)))) > -> is a conversion operator, not an "accessor". I thought of this as a conversion more than an accessor. > "upstream-restriction" sounds rather negative, I'd rather have (chez- > machine-features), which yields #f if the machine is unsupported and a > (possibly empty) list of features otherwise, such as '(threads). > > I'm also not quite sure what the point is behind using chez machines > here. Why not simply test the systems with the predicates we already > have, i.e. target-arm64?, target-arm32?, target-linux?, target-ppc32?, > ... I agree that the name of this procedure should avoid sounding negative: 'restriction' was the best I'd come up with so far. I think I like 'chez-machine-features' somewhat better, but with a few reservations. Using predicates like 'target-arm32?' makes some sense overall, and I'll try it. One subtly is that systems supported by neither upstream nor Racket are currently handled by `and=>` in clients. Also, I guess it's odd to have this function operate on Chez Scheme machine types anyway, since a machine type specifies threaded or unthreaded. I'm currently thinking something like: --8<---------------cut here---------------start------------->8--- (define* (chez-upstream-features-for-system #:optional (system (or (%current-target-system) (%current-system)))) (cond ((not (nix-system->chez-machine system)) #f) ((target-arm64? system) #f) ((target-arm32? system) (and (target-linux? system) '())) ((target-ppc32? system) (and (target-linux? system) '(threads))) (else '(threads)))) --8<---------------cut here---------------end--------------->8--- Alternatively, there could be an argument called something like "variant", where the default would be 'upstream or maybe #f, and supplying 'racket would always return '(threads). (Racket CS requires the threaded version of Chez Scheme, so the chez-scheme-for-racket has consistently added thread support immediately upon adding any new target.) > > And as a minor pet peeve, you ought to spell out machine. > Ok, will do. > >> +(define* (nix-system->chez-machine #:optional (system (%current- >> system)) This should have been (or (%current-target-system) (%current-system)). >> +                                   #:key (threads? 'always)) >> +  "Return the Chez Scheme machine type corresponding to the Nix >> system >> +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a >> Chez Scheme >> +machine type is undefined. >> + >> +When THREADS? is @code{'always} (the default), the threaded variant >> of the >> +machine type will be returned: note that the package returned by >> +@code{chez-scheme-for-system} will always support native threads. >> When >> +THREADS? is @code{#f}, the unthreaded machine type will be >> returned.  If >> +THREADS? is @code{'upstream} (the default), the threaded variant of >> the >> +machine type will be returned if and only if it is supported by >> upstream Chez >> +Scheme (see @code{chez-machine->upstream-restriction}).  If THREADS? >> is any >> +other value, an exception is raised." > What's the point in having THREADS? 'always? In any case, assuming > chez-machine-features is to be exported, this can easily be checked -- > even if not, we can add the check internally by writing > #:key (threads? (chez-supports-threads? system)) > >> +  (let* ((hyphen (string-index system #\-)) >> +         (nix-arch (substring system 0 hyphen)) >> +         (nix-os (substring system (+ 1 hyphen))) >> +         (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) >> +         (chez-os (assoc-ref %nix-os-to-chez-alist nix-os)) >> +         (mach (and chez-arch chez-os (string-append chez-arch chez- >> os)))) > This series of let-bindings should probably be done in a separate > function called nix-system->chez-machine. On the one hand, the result of 'chez-scheme-for-system' will always support threads, so being threaded by default is convenient. On the other hand, it looks like I've reduced the use of this function (by searching for files rather than coding in the machine type directory) enough that it doesn't have a big impact either way. It will be more important when we support cross-compilation, and I think we should keep these functions internal and defer as much as possible of their API design until then. For now, I think I'll say that it's unspecified whether the result is a threaded or unthreaded machine type and add `chez-machine->{un,}threaded` as needed. -Philip From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 02:10:22 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 07:10:22 +0000 Received: from localhost ([127.0.0.1]:49957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKavm-0006Wn-GK for submit@debbugs.gnu.org; Thu, 17 Feb 2022 02:10:22 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:26723) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKavk-0006We-Ak for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 02:10:21 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4JzmDn0hHnz3wZs; Thu, 17 Feb 2022 08:10:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645081817; bh=sbkrDGY1eVsuQ4ov7jb9gD4FClK/bDziUKDkBgkTXq8=; h=Subject:From:To:Date:In-Reply-To:References; b=scDTJ96cgU4nDlZMyI25DNecVQDqunqqIp5b9gXS4EMXrSvnwSWuGsPtZucYwqKiN ELlOyISduXnnDqbwiwCm1pZKjzWuHtryPT/DgCAzQYnKCmXaHsuEjo9SnuxkEwL16W txVhgUgmMy9zt2kGZcSWv7junpxH7r8Jhcj9afn4= Message-ID: Subject: Re: [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Thu, 17 Feb 2022 08:10:16 +0100 In-Reply-To: <9979ce6c-9583-18e1-43da-098d2d74e741@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-8-philip@philipmcgrath.com> <7a5ff55f7c05308cac7bb2aae5dbe0a16b8fa9b9.camel@ist.tugraz.at> <9979ce6c-9583-18e1-43da-098d2d74e741@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Mittwoch, dem 16.02.2022 um 16:13 -0500 schrieb Philip McGrath: > Hi, > > On 2/14/22 09:54, Liliana Marie Prikler wrote: > > Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: > > > This might seem a bit silly in isolation, but it makes the > > > structure of the upstream Chez Scheme package the same as for the > > > Racket variant, it sets things up for (one day, hopefully) > > > actually being able to bootstrap the upstream Chez Scheme > > > bootfiles, and it may be useful for cross-compilation and adding > > > support for architectures without pre-built bootfiles from > > > upstream. > > > > > > * gnu/packages/chez-and-racket-bootstrap.scm > > > (chez-scheme-bootstrap-bootfiles): New variable. > > > (chez-scheme)[native-inputs]: Add it. > > > [arguments]: Add new phase 'unpack-bootfiles'. > > > [version, source, home-page]: Derive from 'chez-scheme-bootstrap- > > > bootfiles'. > > > --- > > While having chez-scheme-bootstrap-bootfiles (silly name) does make > > some kind of sense, making chez-scheme inherit from it does not.  > > Given that we don't have a chez-scheme bootstrap tower at hand, you > > should probably make (chez-scheme-bootstrap) a procedure which > > takes chez-scheme's origin as argument and returns the full > > package. > > > Making a function is an interesting idea, but I'm not sure I'm quite > picturing what you have in mind. I will see if I can figure out > something that seems reasonable as I revise this series, if I don't > hear from you before then. I was picturing something like (define chez-bootfiles (chez ...) (package/inherit chez (inputs ...) (native-inputs ...) (build-system ...) (arguments ...))) > One reason I like making the bootfiles a package is that a set of > bootfiles includes artifacts in addition to the bootfiles themselves, > such as generated C headers describing the layout of Scheme objects > in memory, some of which are not included as part of an installed > Chez Scheme. For example, imagine someone wants to run Chez Scheme on > FreeBSD: upstream does not distribute BSD bootfiles, so they must be > cross-compiled. Even though Guix doesn't have a C toolchain for > FreeBSD (AFAIK), Guix could be used to reproducibly build the needed > bootfiles and pack a "source" tarball to be used on a FreeBSD build > machine. > > Also, the process for building bootfiles is largely orthogonal to > building the actual `scheme` executable, and it seems like eventually > it may be useful to be able to override options separately. Again, I'm with you on making chez-bootfiles a package and your rationale sounds reasonable, but I don't think it's correct to say that chez inherits from them. IIUC it is rather the other way around; the bootfiles contain precompiled versions of Chez among other things. > Is there a technical reason to prefer either repeating the home page, > license, etc. or writing e.g. `(package-license > chez-scheme-bootstrap-bootfiles)` rather than using inheritance? You should not write (package-license chez-scheme-bootstrap-files), that's the point! For one, that's exactly what inheritance would do unless you specify the field (technical reason), but more importantly, as a reader, using (package-license this-other-chez-thing) sends me on a journey to track down this-other-chez-thing while determining the license of chez! That's just silly (social reason). Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 02:24:52 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 07:24:52 +0000 Received: from localhost ([127.0.0.1]:49972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKb9n-0006t4-A8 for submit@debbugs.gnu.org; Thu, 17 Feb 2022 02:24:51 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:23410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKb9X-0006sb-6A for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 02:24:50 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4JzmY54c80z3wCX; Thu, 17 Feb 2022 08:24:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645082665; bh=pOAaC5bx7eDOl9mANas8M/i4XMtgOHuYO9FknFu8mDc=; h=Subject:From:To:Date:In-Reply-To:References; b=Iv4/E9D498rllX9akhBqtmvRJQI3OQ9y5rT9IqJo7s//xI9/IyLogmSntOhmSRgyY MZ8y/1j0jir13XngDQwyA2inLhfl7/G/YcgjnhxDu3wNDPRafCqUh/HZPok2e1R+Nm 1mBK2LaeKu2X/XtnOdluDQ5l6auyfiV1u73yQYU0= Message-ID: Subject: Re: [PATCH 04/11] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Thu, 17 Feb 2022 08:24:24 +0100 In-Reply-To: <220923bf-f243-8760-a0cf-1c77a26023cf@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-5-philip@philipmcgrath.com> <20ade6d2f82b20f25d0eb1c8b2b5c409c189d05a.camel@ist.tugraz.at> <220923bf-f243-8760-a0cf-1c77a26023cf@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Mittwoch, dem 16.02.2022 um 17:54 -0500 schrieb Philip McGrath: > > > +See @code{chez-machine->nix-system} for more details about > > > acceptable values > > > +for MACH." > > > +  (let ((mach (chez-machine->unthreaded mach))) > > > +    (cond > > > +     ((string-prefix? "arm64" mach) > > > +      'no-support) > > > +     ((string-prefix? "arm32" mach) > > > +      (if (string-suffix? "le" mach) > > > +          'no-threads > > > +          'no-support)) > > > +     ((string-prefix? "ppc32" mach) > > > +      (if (string-suffix? "le" mach) > > > +          #f > > > +          'no-support)) > > > +     (else > > > +      #f)))) > > -> is a conversion operator, not an "accessor". > > I thought of this as a conversion more than an accessor. Conversion follows the lines of "is (roughly) a", whereas this is a "has a" relation, which would imply accessing things. > > "upstream-restriction" sounds rather negative, I'd rather have > > (chez-machine-features), which yields #f if the machine is > > unsupported and a (possibly empty) list of features otherwise, such > > as '(threads). > > > > I'm also not quite sure what the point is behind using chez > > machines here.  Why not simply test the systems with the predicates > > we already have, i.e. target-arm64?, target-arm32?, target-linux?, > > target-ppc32?, > > ... > > I agree that the name of this procedure should avoid sounding > negative: 'restriction' was the best I'd come up with so far. I > think I like 'chez-machine-features' somewhat better, but with a few > reservations. > > Using predicates like 'target-arm32?' makes some sense overall, and > I'll try it. One subtly (sic) is that systems supported by neither > upstream nor Racket are currently handled by `and=>` in clients. > > Also, I guess it's odd to have this function operate on Chez Scheme > machine types anyway, since a machine type specifies threaded or > unthreaded. Not sure how to deal with these reservations or what they'd imply, so following along. > I'm currently thinking something like: > > --8<---------------cut here---------------start------------->8--- > (define* (chez-upstream-features-for-system #:optional >                                              (system (or > (%current-target-system) >   > (%current-system)))) >    (cond >     ((not (nix-system->chez-machine system)) >      #f) >     ((target-arm64? system) >      #f) >     ((target-arm32? system) >      (and (target-linux? system) >           '())) >     ((target-ppc32? system) >      (and (target-linux? system) >           '(threads))) >     (else >      '(threads)))) > --8<---------------cut here---------------end--------------->8--- Haven't tested this, but LGTM. > Alternatively, there could be an argument called something like > "variant", where the default would be 'upstream or maybe #f, and > supplying 'racket would always return '(threads). (Racket CS requires > the threaded version of Chez Scheme, so the chez-scheme-for-racket > has consistently added thread support immediately upon adding any new > target.) I don't think delegating to racket this soon is a good idea. > > And as a minor pet peeve, you ought to spell out machine. > > > > Ok, will do. > > > > > > +(define* (nix-system->chez-machine #:optional (system (%current- > > > system)) > > This should have been (or (%current-target-system) (%current- > system)). > > > > +                                   #:key (threads? 'always)) > > > +  "Return the Chez Scheme machine type corresponding to the Nix > > > system > > > +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to > > > a > > > Chez Scheme > > > +machine type is undefined. > > > + > > > +When THREADS? is @code{'always} (the default), the threaded > > > variant > > > of the > > > +machine type will be returned: note that the package returned by > > > +@code{chez-scheme-for-system} will always support native > > > threads. > > > When > > > +THREADS? is @code{#f}, the unthreaded machine type will be > > > returned.  If > > > +THREADS? is @code{'upstream} (the default), the threaded variant > > > of > > > the > > > +machine type will be returned if and only if it is supported by > > > upstream Chez > > > +Scheme (see @code{chez-machine->upstream-restriction}).  If > > > THREADS? > > > is any > > > +other value, an exception is raised." > > What's the point in having THREADS? 'always?  In any case, assuming > > chez-machine-features is to be exported, this can easily be checked > > -- > > even if not, we can add the check internally by writing > >    #:key (threads? (chez-supports-threads? system)) > > > > > +  (let* ((hyphen (string-index system #\-)) > > > +         (nix-arch (substring system 0 hyphen)) > > > +         (nix-os (substring system (+ 1 hyphen))) > > > +         (chez-arch (assoc-ref %nix-arch-to-chez-alist nix- > > > arch)) > > > +         (chez-os (assoc-ref %nix-os-to-chez-alist nix-os)) > > > +         (mach (and chez-arch chez-os (string-append chez-arch > > > chez- > > > os)))) > > This series of let-bindings should probably be done in a separate > > function called nix-system->chez-machine. > > On the one hand, the result of 'chez-scheme-for-system' will always > support threads, so being threaded by default is convenient. On the > other hand, it looks like I've reduced the use of this function (by > searching for files rather than coding in the machine type directory) > enough that it doesn't have a big impact either way. It will be more > important when we support cross-compilation, and I think we should > keep these functions internal and defer as much as possible of their > API design until then. > > For now, I think I'll say that it's unspecified whether the result is > a threaded or unthreaded machine type and add > `chez-machine->{un,}threaded` as needed. I think you can keep (chez-supports-threads? system) hidden even when using it to instantiate defaults. I currently don't see the relation between chez-scheme-for-system and nix-system->chez-machine, so if that's relevant, you'd have to clarify. Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 02:38:12 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 07:38:12 +0000 Received: from localhost ([127.0.0.1]:49977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKbMY-0007De-Un for submit@debbugs.gnu.org; Thu, 17 Feb 2022 02:38:12 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:43938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKbMW-0007D5-32 for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 02:38:01 -0500 Received: by mail-qk1-f169.google.com with SMTP id j24so3945618qkk.10 for <53878@debbugs.gnu.org>; Wed, 16 Feb 2022 23:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=TsoCJboF8ZKBXx8QDjqiCn0SND4g2l9KdDr0MZ+suK0=; b=dPi7sPnfXtjj7pxMQDA0ejoKEyqFscL7rm5N0/b2Z+nj5fR2RpWpO2LabCPOb2ELcq OW/6EqlbQvu7ocoT0CrUZ2hU5ose3xSMmpoLxCvD36xP+218X4bbKfjT9tA0rTxnK3To PKBFH2GzwLJZCHXENc5pJNsnjLhAVLt0KkJVrWz9k8mNZbkLALHwcKV0jaRcnLHj+Z3o BvzniIUPZPeBGsq+2HHwSyDwt4oEHCUPs+GqrWncPBVm6TVieanXhZfsNVtZLOojAaSS SKnQuU7Z8gZ0FTl5aLiCvDWCLeO8VDlN73zMg6nPJkkrm/ptgmGGhxeDuFDml7/YUlDT vQmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=TsoCJboF8ZKBXx8QDjqiCn0SND4g2l9KdDr0MZ+suK0=; b=ImoYjAXrK6OoObU7vIdxcsEhBZVzZgNInHym9bzwbhY66BMvBa+DiJCcmeoSmCmhu+ sVbaXZJ/gZEmk3CVMECoNjAujnQD6ZN685hbsmulOQvhrEVkL0BDrggs1pwhdND3H+Q/ v5R2fL0vqvDJLnp8uFmiwSMClgfZlldzOKM9BQ0jJlP3BRbaXZs+K2EvNB+l9aWTz7xG Xl7nlWvzTDKdwMa92t4Q/7Hv+bcGHPPXmz1jIDughounx4WChZNowN+PFLmDDyLWivQX wiFaSCMh3If3tmblm99LfQ2D5tnP+lANHljrjS148QXPOeHm5fcMuPUOWvh47UmERJWj SzKA== X-Gm-Message-State: AOAM531/HisDBuvEoM0NOBqS+4q95jpHdpxj3xrAq4hwJYxaMh+/BxrL wwiEJh7BnEJ4ahp78msPLubrk1tNgE458Ozspy8= X-Google-Smtp-Source: ABdhPJwOLtmz/IFptD0Mamev+8Tz7rGTzYjO2tLFgD49N0YEElzdmtEedpdaJhcpU7JyNfSRVgma+w== X-Received: by 2002:a37:946:0:b0:47d:6768:edcc with SMTP id 67-20020a370946000000b0047d6768edccmr807398qkj.120.1645083474399; Wed, 16 Feb 2022 23:37:54 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id 185sm1588789qkd.49.2022.02.16.23.37.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Feb 2022 23:37:54 -0800 (PST) Message-ID: <3fe28b09-37f5-d854-dfc1-1a2ab8952055@philipmcgrath.com> Date: Thu, 17 Feb 2022 02:37:53 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 04/11] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. Content-Language: en-US To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-5-philip@philipmcgrath.com> <20ade6d2f82b20f25d0eb1c8b2b5c409c189d05a.camel@ist.tugraz.at> <220923bf-f243-8760-a0cf-1c77a26023cf@philipmcgrath.com> From: Philip McGrath In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/17/22 02:24, Liliana Marie Prikler wrote: > I currently don't see the relation > between chez-scheme-for-system and nix-system->chez-machine, so if > that's relevant, you'd have to clarify. It's relevant only in that, unless you as a user have done some transformation to specifically build an unthreaded variant, you will be using the threaded machine type. -Philip From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 03:06:36 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 08:06:36 +0000 Received: from localhost ([127.0.0.1]:50026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKboC-0007zU-6v for submit@debbugs.gnu.org; Thu, 17 Feb 2022 03:06:36 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:44929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKboA-0007zG-Vk for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 03:06:35 -0500 Received: by mail-qv1-f53.google.com with SMTP id p7so6796630qvk.11 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 00:06:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=CptnHaW8eb+oQzMjcBx24EXqPdjvT/H2Yur6O7bv0MA=; b=BUzft39XbtdCR4mMY8/qnFj4AeYZL9jVkY37SXjGmdauMMfJ9E9y5QqKvTcjHZyqcA rbePJoZyAfrNGZiTPr29A2Innwum/h54VdxtARbY0O1ut0aIZ9y2OxqqZhKgIDZZSgCu HZ9bc0hHnQQe7cgqgT97P4d2gMDnqh1Lha5nCwZmL/68fbir6EQ9j6kp1vKQXbqoaMlf 7l+C6U4914cj9guDSTDd/TOPW3cYqgxJ8+0pO2c5mojg1+APZaFNrOf/e+KaZDgsE36V +Qur8VYNz8SyxMvO9X3UCGya9G1OKJmAsrlSaQUbBKfb9o/bv9I2lrSeHL1hYHM6mzHY NwIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=CptnHaW8eb+oQzMjcBx24EXqPdjvT/H2Yur6O7bv0MA=; b=JpovdOmcqAC6yLmEAkxfJMEa5ykWcb8EQkit53vZOiF5E8gNqo/AmSpk0CwTCWKrAf 7nvf522U5s4+hJEmEef31FDqXi60jgyYvBkqI7/7UgZwDeKNdoXhnxyYUXtXlumlL+pi Zquvas1jksP9t+AcD64ugCEumgRe+sgQ38LFhxox5SVuVWM+iHxSdf/fC0tgeA0ld88h BZL6TJzVCbhhR9uS7XxgvQN/qUocC4A5vDKNI26Fc6ZhTH/p5MlM+WeMzk3rcw+rVUqx 5l7ACO1DkbWcnJ+sZ6ydGlDfnKBMaUoMu3ozbMIyTjN77nDBlbBiP37wNamKycCo5erb H1Fg== X-Gm-Message-State: AOAM531BIo2x59kZxeMue30M5t5eIuRZg317nudHSJ1a1ovJ36RHlfkQ hkn86P76+ICObaxGsKKOTQfYj2oqOghbO7KKN64= X-Google-Smtp-Source: ABdhPJxFCOLC5lxuH1MO+CeJKCTqbSyTn9pse6OQCHrhlRK5QzYumROT/a4MYHfH7Ml42XH44aRknA== X-Received: by 2002:ac8:5b82:0:b0:2cf:232d:b1f8 with SMTP id a2-20020ac85b82000000b002cf232db1f8mr1409573qta.58.1645085189334; Thu, 17 Feb 2022 00:06:29 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id c21sm23296102qte.68.2022.02.17.00.06.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 00:06:29 -0800 (PST) Message-ID: <0a2fdc03-5b05-02e4-ab0f-d9ef23d6460e@philipmcgrath.com> Date: Thu, 17 Feb 2022 03:06:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Content-Language: en-US To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-8-philip@philipmcgrath.com> <7a5ff55f7c05308cac7bb2aae5dbe0a16b8fa9b9.camel@ist.tugraz.at> <9979ce6c-9583-18e1-43da-098d2d74e741@philipmcgrath.com> From: Philip McGrath In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/17/22 02:10, Liliana Marie Prikler wrote: > Hi, > > Am Mittwoch, dem 16.02.2022 um 16:13 -0500 schrieb Philip McGrath: >> Hi, >> >> On 2/14/22 09:54, Liliana Marie Prikler wrote: >>> Am Sonntag, dem 13.02.2022 um 16:51 -0500 schrieb Philip McGrath: >>>> This might seem a bit silly in isolation, but it makes the >>>> structure of the upstream Chez Scheme package the same as for the >>>> Racket variant, it sets things up for (one day, hopefully) >>>> actually being able to bootstrap the upstream Chez Scheme >>>> bootfiles, and it may be useful for cross-compilation and adding >>>> support for architectures without pre-built bootfiles from >>>> upstream. >>>> >>>> * gnu/packages/chez-and-racket-bootstrap.scm >>>> (chez-scheme-bootstrap-bootfiles): New variable. >>>> (chez-scheme)[native-inputs]: Add it. >>>> [arguments]: Add new phase 'unpack-bootfiles'. >>>> [version, source, home-page]: Derive from 'chez-scheme-bootstrap- >>>> bootfiles'. >>>> --- >>> While having chez-scheme-bootstrap-bootfiles (silly name) does make >>> some kind of sense, making chez-scheme inherit from it does not. >>> Given that we don't have a chez-scheme bootstrap tower at hand, you >>> should probably make (chez-scheme-bootstrap) a procedure which >>> takes chez-scheme's origin as argument and returns the full >>> package. >>> >> Making a function is an interesting idea, but I'm not sure I'm quite >> picturing what you have in mind. I will see if I can figure out >> something that seems reasonable as I revise this series, if I don't >> hear from you before then. > I was picturing something like > > (define chez-bootfiles (chez ...) > (package/inherit chez > (inputs ...) > (native-inputs ...) > (build-system ...) > (arguments ...))) > Sorry, I still don't think I'm following. Would this rely on the `mative-inputs` being thunked to let the result of this function be an input to `chez-scheme`? What commonality is the function abstracting over, compared to having 'chez-scheme-for-racket-bootstrap-bootfiles' inherit from 'chez-scheme-bootstrap-bootfiles'? (I'm using "-bootstrap-bootfiles" because there are also other kinds of bootfiles: applications can create their own bootfiles, e.g. "racket.boot", and using Chez as a cross-compiler also involves more bootfiles.) >> Is there a technical reason to prefer either repeating the home page, >> license, etc. or writing e.g. `(package-license >> chez-scheme-bootstrap-bootfiles)` rather than using inheritance? > You should not write (package-license chez-scheme-bootstrap-files), > that's the point! For one, that's exactly what inheritance would do > unless you specify the field (technical reason), but more importantly, > as a reader, using (package-license this-other-chez-thing) sends me on > a journey to track down this-other-chez-thing while determining the > license of chez! That's just silly (social reason). That makes some sense with respect to the license and home page, but what about 'package-source' and 'package-version'? -Philip From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 03:19:32 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 08:19:32 +0000 Received: from localhost ([127.0.0.1]:50061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKc0h-0008JW-TL for submit@debbugs.gnu.org; Thu, 17 Feb 2022 03:19:32 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:17806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKc0f-0008JJ-0V for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 03:19:30 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4JznmY2k5Zz1LZWB; Thu, 17 Feb 2022 09:19:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4JznmY2k5Zz1LZWB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645085965; bh=ET9Hyo30T0JpUPe1pBDKw9RDJtlnEdtEe7S2Rc3GoTo=; h=Subject:From:To:Date:In-Reply-To:References:From; b=F45xzEwom0aT0ZHDcvZtYYiYcrVlDrtN18Y2ZKlCsyBnhJ1REOLZkTjwWxeqE1/xB Zh9dw4qFjq2J6EeH4MwWTYp7wHngJrPG8wIddYeyW2/AvP6a4KMh1cFSx7DP+0ni+q Fs5kXSXegdM/bRvRrKvhXDxdH01HpttwIdK6d334= Message-ID: <19a00f93e793a062f3004f1a4f452701fb3234d3.camel@ist.tugraz.at> Subject: Re: [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Thu, 17 Feb 2022 09:19:24 +0100 In-Reply-To: <0a2fdc03-5b05-02e4-ab0f-d9ef23d6460e@philipmcgrath.com> References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-8-philip@philipmcgrath.com> <7a5ff55f7c05308cac7bb2aae5dbe0a16b8fa9b9.camel@ist.tugraz.at> <9979ce6c-9583-18e1-43da-098d2d74e741@philipmcgrath.com> <0a2fdc03-5b05-02e4-ab0f-d9ef23d6460e@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Donnerstag, dem 17.02.2022 um 03:06 -0500 schrieb Philip McGrath: > Hi, > > On 2/17/22 02:10, Liliana Marie Prikler wrote: > > [...] > > I was picturing something like > > > > (define chez-bootfiles (chez ...) > >    (package/inherit chez > >      (inputs ...) > >      (native-inputs ...) > >      (build-system ...) > >      (arguments ...))) > > > > Sorry, I still don't think I'm following. Would this rely on the > `mative-inputs` being thunked to let the result of this function be > an input to `chez-scheme`?  Yes. > What commonality is the function abstracting over, compared to having > 'chez-scheme-for-racket-bootstrap-bootfiles' inherit from 'chez- > scheme-bootstrap-bootfiles'? At the moment version, source, home-page and license. I don't really think bootstrap files ought to be a part of chez' source, so if you wanted to do this really cleanly, you'd have to drop them from chez and add restrict chez-bootstrap to them, which would imply you'd have to use (version (package-version chez-scheme)) explicitly – for now I don't want to add too much burden to that patch and you can assume source to be the same between the two. > (I'm using "-bootstrap-bootfiles" because there are also other kinds > of bootfiles: applications can create their own bootfiles, e.g. > "racket.boot", and using Chez as a cross-compiler also involves more > bootfiles.) I have no idea how useful that feature is or how widely it is used, but if those are just binary blobs needed to get chez scheme running, we ought to treat them as that. That makes some sense with respect to the license and home page, but > > > That makes some sense with respect to the license and home page, but > what about 'package-source' and 'package-version'? Your patch currently makes them the same for both, so you tell me :P See above for long-term plans. Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 03:40:52 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 08:40:52 +0000 Received: from localhost ([127.0.0.1]:50080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKcLM-0000OY-0W for submit@debbugs.gnu.org; Thu, 17 Feb 2022 03:40:52 -0500 Received: from mail-qk1-f176.google.com ([209.85.222.176]:36814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKcLK-0000OM-9U for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 03:40:50 -0500 Received: by mail-qk1-f176.google.com with SMTP id g24so4080306qkl.3 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 00:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=DHvd6SY/MKKrGG+UfdoEmFONmSShbZqBUTHQoZ1rb6A=; b=gZ58p8fEGb7kyE8A19YMFk28PRsQ24MrGAbqzrs6uh9+IODZJAaRHF8g3e/37Kd6+u IVC4Y/L6lWmCk4PWMJEslGVRgpai8fn7EAbXKi2WTUi1TeqIyY/CkdfTw80JPz3oeRiN 6NwLUxJFAdjBG51jDMtOHd+BT2H6qqinkMivA4sA9OZVutncg7/bBh4i98Xpyod3VdQ2 TOLEAbKZgKN+PHlaPn+HkOa9O+7a7/aPTc3mGFUyOnmkx19mbENqiy8zb+QZKiJJ87aV K0QeirbxXKUmpQ5SLtvyGANEdsAMXaeDBLr5EsC3MimTDoOdWUTBlEE6hy/TIXrh+ScM xqAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=DHvd6SY/MKKrGG+UfdoEmFONmSShbZqBUTHQoZ1rb6A=; b=htwSn3lPghAPa4rzqL8TTOUhNfH8hHAEX8AhFfJ5gMHpiqGO7hBXyI2KEnCMyj0Ok7 MT1iJ16xlTpbrchRS3XfT4Lghnvlrwmun9GeegMGNRfnGtju7c7xXI6wFNtee4pBCP4O ztVCOzS5Y8iZ/USF3ljoGxx0mMw7KUo6tvKYsa4sQ+kfguYB88onQoQB8UrU8a1as0KM NBgG8mHDb1hsPsBhirldepYz+dQ7sNlWzRh55HE+2iFAOvXTr7vgmHjSlLvR3hlk0lhg GgtYL/0K4UXQfHu/JT1pYyol16Q4OIg+++BCt+xVc3lp9Zwrm6cfL8HjZJmRewkdFY5w VTJQ== X-Gm-Message-State: AOAM531X5/8//+6rok1vT4qud0Xrktl302YdFqPyk/tRc4GwHzUmoSl6 q38xWW6xFp060hgcQF2mYLUCbUB9ywdj1twUWg0= X-Google-Smtp-Source: ABdhPJwj/7Ex72ydwxU12cF/q64LN5EdB9IMRdGj9yuoa7blfqDKyXlgJbd0mWJZxtFFbmbx+yGo3Q== X-Received: by 2002:a37:b95:0:b0:5f1:8711:c404 with SMTP id 143-20020a370b95000000b005f18711c404mr860423qkl.27.1645087244629; Thu, 17 Feb 2022 00:40:44 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id bk19sm19599234qkb.125.2022.02.17.00.40.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 00:40:44 -0800 (PST) Message-ID: Date: Thu, 17 Feb 2022 03:40:43 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Content-Language: en-US To: Liliana Marie Prikler , 53878@debbugs.gnu.org References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-8-philip@philipmcgrath.com> <7a5ff55f7c05308cac7bb2aae5dbe0a16b8fa9b9.camel@ist.tugraz.at> <9979ce6c-9583-18e1-43da-098d2d74e741@philipmcgrath.com> <0a2fdc03-5b05-02e4-ab0f-d9ef23d6460e@philipmcgrath.com> <19a00f93e793a062f3004f1a4f452701fb3234d3.camel@ist.tugraz.at> From: Philip McGrath In-Reply-To: <19a00f93e793a062f3004f1a4f452701fb3234d3.camel@ist.tugraz.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On 2/17/22 03:19, Liliana Marie Prikler wrote: > Hi, > > Am Donnerstag, dem 17.02.2022 um 03:06 -0500 schrieb Philip McGrath: >> Hi, >> >> On 2/17/22 02:10, Liliana Marie Prikler wrote: >>> [...] >>> I was picturing something like >>> >>> (define chez-bootfiles (chez ...) >>>    (package/inherit chez >>>      (inputs ...) >>>      (native-inputs ...) >>>      (build-system ...) >>>      (arguments ...))) >>> >> >> Sorry, I still don't think I'm following. Would this rely on the >> `mative-inputs` being thunked to let the result of this function be >> an input to `chez-scheme`? > Yes. > >> What commonality is the function abstracting over, compared to having >> 'chez-scheme-for-racket-bootstrap-bootfiles' inherit from 'chez- >> scheme-bootstrap-bootfiles'? > At the moment version, source, home-page and license. I don't really > think bootstrap files ought to be a part of chez' source, so if you > wanted to do this really cleanly, you'd have to drop them from chez and > add restrict chez-bootstrap to them, which would imply you'd have to > use (version (package-version chez-scheme)) explicitly – for now I > don't want to add too much burden to that patch and you can assume > source to be the same between the two. > Ok, this helps, I think. I'll give it a try. In you argued---and convinced me---that we should keep the pre-built bootfiles in the origin until we actually don't need them. With 'chez-scheme-for-racket', that's already true, and there aren't bootfiles in that origin anyway. When someday we can actually bootstrap upstream Chez Scheme, presumably we'll add a snippet to delete the pre-built bootfiles from the origin, at which point the it will still be the same origin for both. -Philip From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 03:46:43 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 08:46:43 +0000 Received: from localhost ([127.0.0.1]:50084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKcR0-0000Xr-PG for submit@debbugs.gnu.org; Thu, 17 Feb 2022 03:46:43 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:34043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKcQy-0000Xh-Vo for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 03:46:42 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4JzpMt1ckpz1LZWB; Thu, 17 Feb 2022 09:46:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4JzpMt1ckpz1LZWB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645087594; bh=wca93WSEVkg/t9cVDYwVzsxnkC0n7OEbhF9NM49fA8o=; h=Subject:From:To:Date:In-Reply-To:References:From; b=XJoyvwpgotyiVoz6s8PvG4bRI1nVPp6pFY9dIOZCyz8lzo9PxJang2NBP94P8QxFN Jn7FqYy1E4gCwVMGvb30570i+30u4Pi2s1lRbqD4h1WhgtXNhkBeaGk9IiY2EtAi4q 5RDHNNsvSjKqu3PEGYpLuUerlYOSIn405EtN/7zU= Message-ID: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> Subject: Re: [PATCH 07/11] gnu: chez-scheme: Explicitly package bootstrap bootfiles. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Thu, 17 Feb 2022 09:46:33 +0100 In-Reply-To: References: <20220213215127.218952-1-philip@philipmcgrath.com> <20220213215127.218952-8-philip@philipmcgrath.com> <7a5ff55f7c05308cac7bb2aae5dbe0a16b8fa9b9.camel@ist.tugraz.at> <9979ce6c-9583-18e1-43da-098d2d74e741@philipmcgrath.com> <0a2fdc03-5b05-02e4-ab0f-d9ef23d6460e@philipmcgrath.com> <19a00f93e793a062f3004f1a4f452701fb3234d3.camel@ist.tugraz.at> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Donnerstag, dem 17.02.2022 um 03:40 -0500 schrieb Philip McGrath: > Hi, > > On 2/17/22 03:19, Liliana Marie Prikler wrote: > > Hi, > > > > Am Donnerstag, dem 17.02.2022 um 03:06 -0500 schrieb Philip > > McGrath: > > > Hi, > > > > > > On 2/17/22 02:10, Liliana Marie Prikler wrote: > > > > [...] > > > > I was picturing something like > > > > > > > > (define chez-bootfiles (chez ...) > > > >     (package/inherit chez > > > >       (inputs ...) > > > >       (native-inputs ...) > > > >       (build-system ...) > > > >       (arguments ...))) > > > > > > > > > > Sorry, I still don't think I'm following. Would this rely on the > > > `mative-inputs` being thunked to let the result of this function > > > be > > > an input to `chez-scheme`? > > Yes. > > > > > What commonality is the function abstracting over, compared to > > > having > > > 'chez-scheme-for-racket-bootstrap-bootfiles' inherit from 'chez- > > > scheme-bootstrap-bootfiles'? > > At the moment version, source, home-page and license.  I don't > > really > > think bootstrap files ought to be a part of chez' source, so if you > > wanted to do this really cleanly, you'd have to drop them from chez > > and > > add restrict chez-bootstrap to them, which would imply you'd have > > to > > use (version (package-version chez-scheme)) explicitly – for now I > > don't want to add too much burden to that patch and you can assume > > source to be the same between the two. > > > > Ok, this helps, I think. I'll give it a try. > > In you argued---and convinced > me---that we should keep the pre-built bootfiles in the origin until > we actually don't need them. With 'chez-scheme-for-racket', that's > already true, and there aren't bootfiles in that origin anyway. When > someday we can actually bootstrap upstream Chez Scheme, presumably > we'll add a snippet to delete the pre-built bootfiles from the > origin, at which point the it will still be the same origin for both. This concerns schez-scheme-for-racket, not the current chez-scheme for which we are packaging the bootfiles, am I right? Given that we build a set of bootfiles that would be enough to go forward, we no longer need the original bootfiles beyond that point, i.e. the "bootstrap bootfiles" would only be needed inside chez-bootstrap, but not chez itself (which can instead use the native-input). Am I missing something here? From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:51:28 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:51:28 +0000 Received: from localhost ([127.0.0.1]:52751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkO-0003TY-Ba for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:28 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:39679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkN-0003TM-GQ for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:27 -0500 Received: by mail-qv1-f50.google.com with SMTP id f19so10726162qvb.6 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:51:27 -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=uoHdZxZpY1valwDoLrqwP9grwaOCPoeq/NYabQn2dG4=; b=E1ThpEjf186HQHScsmNBQNmjmi4+xCg4lQVHWFkLn3u261YDY6hkg6iffIalrJ4sUU 71VVWFumqJemyR7Qt1pmP6uh43Lb06692b5iZ4p2yrHMVyAVkVeFNJyyBuQc7v9lWYOp NE/wqkBlFYwGB1bAvcH1jcNYdD97xjV1zkKWk8cvJ0MSierqfbp7uyIDAombf/+jiVJB aJAfqM3zGDbxRgE3Ysx6aSeTmiy/L9eXQUOCCBvg8Wwzkz/q8oEqYLMbnQKzybJR/c0p 08oLVdH9Wwr3kTf1tI/xZzY4p5oW/Ap5Q8veSCx8Dp98C1RhYTOP2tbgjWAdyWhJYmMp jI6w== 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=uoHdZxZpY1valwDoLrqwP9grwaOCPoeq/NYabQn2dG4=; b=mThfqYcj5QcZL6M5ZXptmfDY+BO39bUesDMmylP+sKJxyc4c8kJvfGitTrXEvQPdkg +YNBUG+ucf4BdAKnZCUI5+pdwGFV8waMlGhlbMp04HS9ledrcoxcNXoTRmAayO7dAQj2 NZmVDiVBINptioB5n3oFSPqslhLZkD1hyP8ovbQSeG/Y1AAmIiTkQtIKeR4JJnid28Hr PsBjG33VOk5EDHg5jGPxRwZrmIQSkf1cRY0xYE/znVLAw6jTVHdC/3vuXQhvWxj1qi2W FzZ3Q7nKhO02DiRt7I/GNLteAw/GF5g1CWtZkKGqH4lnDd2NLAKScZ6ZWQR+/JenptYW mmUA== X-Gm-Message-State: AOAM532PIsyPCJ/zoaNSyoa+hGN5IZVH52y5b8S0SNY7GaEWj3jSlTr+ whTwcYjjgaGIWG1jjt0m3koXXH232bZmlnxX9QU= X-Google-Smtp-Source: ABdhPJwnjZ/a4vWkCvgIw9nM8DYtag6xvvPtiYCg54GU+EOj/xgQFYsIFk9GVIbN80kLDUpwO0jcyA== X-Received: by 2002:ac8:5dcd:0:b0:2cb:9749:c82 with SMTP id e13-20020ac85dcd000000b002cb97490c82mr4137577qtx.146.1645131081643; Thu, 17 Feb 2022 12:51:21 -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 x17sm689873qtr.69.2022.02.17.12.51.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:21 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 00/15] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Thu, 17 Feb 2022 15:50:33 -0500 Message-Id: <20220217205048.967383-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, Here is a v2! Liliana, I tried using a function to generate the bootfile packages as you suggested, but I didn't like the result---though it is very possible I still didn't properly understand what you had in mind. I hope what I've done in this version addresses the concerns you raised about inverted inheritance and such anyway: if you'd like to compare the two, in the repository at I've tagged this series as `guix-issue-53878-v2` and the alternate as `guix-issue-53878-v2-bootfiles-proc`. I'll also include the diff below. Other than that, I hope I've addressed all your comments. > diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm > index 3e90a15d94..cbdddb1e98 100644 > --- a/gnu/packages/chez-and-racket-bootstrap.scm > +++ b/gnu/packages/chez-and-racket-bootstrap.scm > @@ -720,21 +720,18 @@ (define* (stex-make #:optional (suffix "")) > and 32-bit PowerPC architectures.") > (license license:asl2.0))) > > -(define (bootfiles-for-chez chez) > - (package/inherit chez > - (outputs '("out")) > +(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")))))) > - > -(define-public chez-scheme-bootstrap-bootfiles > - (package > - (inherit (bootfiles-for-chez chez-scheme)) > - (name "chez-scheme-bootstrap-bootfiles") > + #~`(("boot/" "lib/chez-scheme-bootfiles")))) > (supported-systems > ;; Upstream only distributes pre-built bootfiles for > ;; arm32le and t?(i3|a6)(le|nt|osx) > @@ -822,28 +819,34 @@ (define-public chez-scheme-for-racket > (license license:asl2.0))) > > (define-public chez-scheme-for-racket-bootstrap-bootfiles > - (let ((chez (bootfiles-for-chez chez-scheme-for-racket))) > - (package > - (inherit (bootfiles-for-chez chez)) > - (name "chez-scheme-for-racket-bootstrap-bootfiles") > - (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) > - (arguments > - (substitute-keyword-arguments (package-arguments chez) > - ((#:phases those-phases #~%standard-phases) > - #~(modify-phases #$those-phases > - (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) > - (invoke (search-input-file (or native-inputs inputs) > - "/opt/racket-vm/bin/racket") > - "rktboot/main.rkt"))))))) > - (synopsis "Chez Scheme bootfiles bootstrapped by Racket") > - (description "Chez Scheme is a self-hosting compiler: building it > + (package > + (inherit chez-scheme-bootstrap-bootfiles) > + (name "chez-scheme-for-racket-bootstrap-bootfiles") > + (version (package-version chez-scheme-for-racket)) > + (source (package-source chez-scheme-for-racket)) > + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) > + (arguments > + (substitute-keyword-arguments > + (package-arguments chez-scheme-bootstrap-bootfiles) > + ((#:phases those-phases #~%standard-phases) > + #~(modify-phases #$those-phases > + (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) > + (invoke (search-input-file (or native-inputs inputs) > + "/opt/racket-vm/bin/racket") > + "rktboot/main.rkt"))))))) > + (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 "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 > supported platforms.) > @@ -857,7 +860,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles > > 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.")))) > +Chez Scheme."))) > > ;; > ;; Chez's bootstrap dependencies: -Philip Philip McGrath (15): gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. gnu: chez-scheme: Use new package style. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: Add racket-vm-cgc. gnu: Add racket-vm-bc. gnu: Add chez-scheme-for-racket. gnu: Add racket-vm-cs. gnu: chez-mit: Support chez-scheme-for-racket. gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. gnu: racket: Update to 8.4. gnu/local.mk | 5 +- gnu/packages/chez-and-racket-bootstrap.scm | 1070 ++++++++++++ gnu/packages/chez.scm | 628 +++---- gnu/packages/emacs-xyz.scm | 4 +- gnu/packages/loko.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 +++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1553 +++++++++++------ 8 files changed, 2813 insertions(+), 942 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:51:47 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:51:47 +0000 Received: from localhost ([127.0.0.1]:52755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnka-0003Tz-Sz for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:47 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:41849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkW-0003Ti-Fm for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:39 -0500 Received: by mail-qv1-f52.google.com with SMTP id x3so10705336qvd.8 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:51:36 -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=EhT85X9jjqBgfUxiES7WCoevvufxXge+5ByWh5C2XiE=; b=T92uSagIIYwf1d82x/Hzv0YKqX9mwEqGPY8evk9e9v/3C5CIXX7B3HNP4U+CO28Hks 3IlR3eZY942sDqYLyZaM61prLcZMz1G/UxtYMDOLGqfM8gKCwMEhpVxp9fmHVDGw/BcC Izf1MVWCWe9YW5/SOYlOKw3fUWz7K8SNzN/Fa4pf3HskVZ8G5rtHBh7c9jtJtfx/yXRT FxC212wEPMgq7omIIzUbJT4kZOOTHL3IZNAoF4KkH2AL762c+sQFhHT5+TpxNssV6ApQ Xg/IJTnO7ok5q3nMA3PFAATdPGIaoLY2yb9e+JixNLLTJpo7gjykSZ5k6woQOO2RKj7B FdAg== 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=EhT85X9jjqBgfUxiES7WCoevvufxXge+5ByWh5C2XiE=; b=qzH048dSQXesWGtrzP3b0qD8YakSbFL8V0OlEBZXa4gFyf2Tzs8lM1BkOEITlZ6Xkg wDSH+LVHNUzz0ZOcHWHCkgUlOscC1PINa+NE+0Y8dCQOK3T4hQJFEV7cd9KhybRAuaJ8 JFtAfKDKN+BvFNAZ1ggQOOxSLhagK7LVOY7nP5o6E/qJ/7pkEu1L/thjCy0sgRFzxElW amcLdFsrZLPvR0baERpYJVik6fgiPS2PV/8TEv6o3hNVMdNzhKlO/RXV8cSnEGt781+P Db8C/r78/hmXNfbPr+qusIrGY5dRCUWrEz/gXzhYTLj6k8xLHy+45Du6r2/0w3SI0lK8 HyGw== X-Gm-Message-State: AOAM533Kx7Rzf72uy97M3k6pIWjVKDX7Dqyr2IHY9kr+3a067jdzuL7E YdUHI9zPnykqW6SEE8Ft8PlRo9QOk7TdfqWRe+M= X-Google-Smtp-Source: ABdhPJzTBycg/Er9AVQUprHQv8qQf2+c6CpqmA749rkKFOzox9IioLWdBeosyvSP8fNY6iQmfnRb+w== X-Received: by 2002:a0c:f809:0:b0:42c:3fa7:54ff with SMTP id r9-20020a0cf809000000b0042c3fa754ffmr3566743qvn.70.1645131090365; Thu, 17 Feb 2022 12:51:30 -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 u17sm21241012qkp.90.2022.02.17.12.51.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:30 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 01/15] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). Date: Thu, 17 Feb 2022 15:50:34 -0500 Message-Id: <20220217205048.967383-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (nanopass, stex, chez-scheme): Move to ... * gnu/packages/chez-and-racket-bootstrap.scm: ... this new file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/emacs-xyz.scm: Adjust imports accordingly. * gnu/packages/loko.scm: Likewise. * gnu/packages/racket.scm: Likewise. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 278 +++++++++++++++++++++ gnu/packages/chez.scm | 225 +---------------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- gnu/packages/racket.scm | 2 +- 6 files changed, 283 insertions(+), 227 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm diff --git a/gnu/local.mk b/gnu/local.mk index 1252643dc0..fa3a89e7a8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -144,6 +144,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/certs.scm \ %D%/packages/check.scm \ %D%/packages/chemistry.scm \ + %D%/packages/chez-and-racket-bootstrap.scm \ %D%/packages/chez.scm \ %D%/packages/chicken.scm \ %D%/packages/chromium.scm \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm new file mode 100644 index 0000000000..f102b099fb --- /dev/null +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -0,0 +1,278 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Federico Beffa +;;; Copyright © 2016 Efraim Flashner +;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2019 Brett Gilio +;;; Copyright © 2020 Brendan Tildesley +;;; Copyright © 2021, 2022 Philip McGrath +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages chez-and-racket-bootstrap) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages compression) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages linux) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages netpbm) + #:use-module (gnu packages tex) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) + +;; Commentary: +;; +;; Alphabetically and chronologically, Chez comes before Racket. +;; +;; 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. +;; +;; Putting the relevant definitions together in this module avoids having to +;; work around dependency cycles. +;; +;; Code: + +(define nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) + +(define stex + ;; This commit includes a fix, which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (version "1.2.2") + (version (git-version version "1" commit))) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name "stex" version))))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version "9.5.6") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet + ;; Remove bundled libraries. + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib"))))))) + (build-system gnu-build-system) + (inputs + `(("libuuid" ,util-linux "lib") + ("zlib" ,zlib) + ("zlib:static" ,zlib "static") + ("lz4" ,lz4) + ("lz4:static" ,lz4 "static") + ;; for expeditor: + ("ncurses" ,ncurses) + ;; for X11 clipboard support in expeditor: + ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 + ("libx11" ,libx11))) + (native-inputs + `(("nanopass" ,nanopass) ; source only + ;; for docs + ("stex" ,stex) + ("xorg-rgb" ,xorg-rgb) + ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek))) + ("ghostscript" ,ghostscript) + ("netpbm" ,netpbm))) + (native-search-paths + (list (search-path-specification + (variable "CHEZSCHEMELIBDIRS") + (files (list (string-append "lib/csv" version "-site")))))) + (outputs '("out" "doc")) + (arguments + `(#:modules + ((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match)) + #:test-target "test" + #:configure-flags + '("--threads") ;; TODO when we fix armhf, it doesn't support --threads + #:phases + (modify-phases %standard-phases + ;; put these where configure expects them to be + (add-after 'unpack 'unpack-nanopass+stex + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (for-each (lambda (dep) + (define src + (assoc-ref (or native-inputs inputs) dep)) + (copy-recursively src dep + #:keep-mtime? #t)) + '("nanopass" "stex")))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs outputs + (configure-flags '()) + #:allow-other-keys) + (let* ((zlib-static (assoc-ref inputs "zlib:static")) + (lz4-static (assoc-ref inputs "lz4:static")) + (out (assoc-ref outputs "out")) + ;; add flags which are always required: + (flags (cons* + (string-append "--installprefix=" out) + (string-append "ZLIB=" zlib-static "/lib/libz.a") + (string-append "LZ4=" lz4-static "/lib/liblz4.a") + ;; Guix will do compress man pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" ,(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke + "./configure" + 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* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib")) + (name "chez-scheme")) + (symlink (string-append bin "/scheme") + (string-append bin "/" name)) + (map (lambda (file) + (symlink file (string-append (dirname file) + "/" name ".boot"))) + (find-files lib "scheme.boot"))))) + ;; Building explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (stex-output "/tmp") + (doc-dir (string-append stex-output + "/share/doc/" + stex+version))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/" + stex+version) + (string-append "Scheme=" + (assoc-ref outputs "out") + "/bin/scheme")) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((chez+version (strip-store-file-name + (assoc-ref outputs "out"))) + (stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + (scheme (string-append (assoc-ref outputs "out") + "/bin/scheme")) + ;; see note on stex-output in phase build-stex, above: + (stexlib (string-append "/tmp" + "/lib/" + stex+version)) + (doc-dir (string-append (assoc-ref outputs "doc") + "/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))) + ;; Chez Scheme does not have a MIPS backend. + ;; FIXME: Debian backports patches to get armhf working. + ;; We should too. It is the Chez machine type arm32le + ;; (no threaded version upstream yet, though there is in + ;; Racket's fork), more specifically (per the release notes) ARMv6. + (supported-systems (fold delete %supported-systems + '("mips64el-linux" "armhf-linux"))) + (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 license:asl2.0))) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 47904e7b4e..caf61a95f5 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,6 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Brendan Tildesley -;;; Copyright © 2021 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,234 +31,12 @@ (define-module (gnu packages chez) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (guix build-system gnu) - #:use-module (gnu packages compression) - #:use-module (gnu packages ncurses) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages ghostscript) - #:use-module (gnu packages linux) - #:use-module (gnu packages netpbm) #:use-module (gnu packages tex) - #:use-module (gnu packages compression) - #:use-module (gnu packages image) - #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) -(define nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - -(define-public chez-scheme - (package - (name "chez-scheme") - (version "9.5.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) - (build-system gnu-build-system) - (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) - (native-inputs - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) - (native-search-paths - (list (search-path-specification - (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) - (outputs '("out" "doc")) - (arguments - `(#:modules - ((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw) - (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) - ;; Chez Scheme does not have a MIPS backend. - ;; FIXME: Debian backports patches to get armhf working. - ;; We should too. It is the Chez machine type arm32le - ;; (no threaded version upstream yet, though there is in - ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) - (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-public chez-srfi (package (name "chez-srfi") diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index a6e5409ff5..56697858e6 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -145,7 +145,7 @@ (define-module (gnu packages emacs-xyz) #:use-module (gnu packages aspell) #:use-module (gnu packages audio) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages cmake) #:use-module (gnu packages code) #:use-module (gnu packages cpp) diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index ef9312afe3..74a649b8a1 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -24,7 +24,7 @@ (define-module (gnu packages loko) #:use-module (gnu packages package-management) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) - #:use-module (gnu packages chez)) + #:use-module (gnu packages chez-and-racket-bootstrap)) (define-public loko-scheme (package diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d0a5ca494b..865fdff70f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -34,7 +34,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages fontutils) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:51:51 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:51:51 +0000 Received: from localhost ([127.0.0.1]:52758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkh-0003UO-PQ for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:51 -0500 Received: from mail-qk1-f175.google.com ([209.85.222.175]:46971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnka-0003Tn-HH for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:41 -0500 Received: by mail-qk1-f175.google.com with SMTP id de39so5928673qkb.13 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:51:40 -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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=VURcBx3RZQdEMw7oEwV3933/RVhuyJ+UEpRl4aSjTFathde+82Bz+hsOKNdRX2j8IB QIBLxXYI4nBdWLPc+eve5QvYbHNYwUneJcVMerWsDZjppwaDx812ao0c0bNS9aZoA8M0 RCtfwutNIYI1P2TMb0ANf256hahZt/MBYhA8+Q2MGzbKmFKg/9qWeEIeFvbKDAwrtygU XGnu4cSzb0/WS2YZfeeebxiie8s5BuhtG0AzYmDT9DOfrFn0S0QaectQl9JygfFj3RQG CMuFgfCvNElscIyFB+DmGAGjCqQ5sZ4F+x9/6aR430lkCQE9u8bZx20ua8mMa6M1ch/J GxFQ== 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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=YQzyz0tVRFsjcXphG98U809KZu5bM73bVXRE7KNJZgoQrR7ct6to9PWbGvlafBdZne W51G8V/y4EtfPZ3scbbeIZdXDkKdYz7EGEB88MlaBgCf+E90vUqrlb8MY93/lxDsvIO2 2yb/LTS25Km0Zz/AD/MwtXwIgdUifqY4KhO4d/Y8MH5MzwCHr+DK5/Dg7tnmLLYqSWzl sHQiVGmUO3BMP+fDip3hBsOFiuxMB73PjMACPzfYFnSn2yaIc1WgKNm7sO2BSM2bnTYe 9dva9lmMbYlzAYjsGx7qDx7nb/lSdl4ad5ZICXvt0ojIXRcGiydd05tsuFqs1zV4HHor rPFQ== X-Gm-Message-State: AOAM533JD7MhXvgLWhULAsboIjY3l3BUda9m9F6IcHbTMloir3yBz/xN ibgLyjCgpcH2iJiGqv1N+2F5L9FsB/xG7Dqaa9w= X-Google-Smtp-Source: ABdhPJysLIwMhCTjy5bu4ORhYjGfbgBPE/JM8URrBHH3fYjoBbUZ7a913fSfO1ELfXTZemxAZfriAw== X-Received: by 2002:ae9:c010:0:b0:4e1:194f:9f0c with SMTP id u16-20020ae9c010000000b004e1194f9f0cmr2739085qkk.780.1645131094470; Thu, 17 Feb 2022 12:51:34 -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 185sm2467251qkd.49.2022.02.17.12.51.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:34 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 02/15] gnu: chez-scheme: Use "lib/chez-scheme" for search path. Date: Thu, 17 Feb 2022 15:50:35 -0500 Message-Id: <20220217205048.967383-3-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". * gnu/packages/chez.scm (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Update accordingly. Also, remove input labels and use G-expressions. --- gnu/packages/chez-and-racket-bootstrap.scm | 2 +- gnu/packages/chez.scm | 373 +++++++++++---------- 2 files changed, 191 insertions(+), 184 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index f102b099fb..1ed4631ced 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -136,7 +136,7 @@ (define-public chez-scheme (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) + (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments `(#:modules diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index caf61a95f5..54bbee7923 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -37,6 +37,28 @@ (define-module (gnu packages chez) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) + +;; Help function for Chez Scheme to add the current path to +;; CHEZSCHEMELIBDIRS. +(define chez-configure + #~(lambda _ + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) + (setenv "CHEZSCHEMELIBDIRS" + (if chez-env + (string-append ".:" chez-env) + "."))))) + +;; Help function to define make flags for some Chez Scheme custom make +;; files. +(define (chez-make-flags name version) + #~(let ((out #$output)) + (list + ;; Set 'schemedir' so that libraries are installed in + ;; 'lib/chez-scheme' like Chez's 'native-search-paths' expects. + (string-append "schemedir=" out "/lib/chez-scheme") + (string-append "PREFIX=" out) + (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) + (define-public chez-srfi (package (name "chez-srfi") @@ -54,13 +76,11 @@ (define-public chez-srfi (native-inputs (list chez-scheme)) (arguments - `(#:make-flags (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out) - "CHEZ=chez-scheme --libdirs ./" - (string-append "chezversion=" ,(package-version chez-scheme)))) - #:test-target "test" - #:phases (modify-phases %standard-phases - (delete 'configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -85,42 +105,48 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("ghostscript" ,ghostscript) - ("texlive" ,(texlive-updmap.cfg (list texlive-oberdiek - texlive-epsf - texlive-metapost - texlive-charter - texlive-pdftex - texlive-context - texlive-cm - texlive-tex-plain))))) + (list chez-scheme + ghostscript + ;; FIXME: This package fails to build with the error: + ;; mktexpk: don't know how to create bitmap font for bchr8r + ;; Replacing the following with `texlive` fixes it. + ;; What is missing? + (texlive-updmap.cfg (list texlive-oberdiek + texlive-epsf + texlive-metapost + texlive-charter + texlive-pdftex + texlive-context + texlive-cm + texlive-tex-plain)))) (arguments - `(#:make-flags (list (string-append "PREFIX=" %output) - (string-append "DOCDIR=" %output "/share/doc/" - ,name "-" ,version) - (string-append "LIBDIR=" %output "/lib/chezweb") - (string-append "TEXDIR=" %output "/share/texmf-local")) - #:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - ;; This package has a custom "bootstrap" script that - ;; is meant to be run from the Makefile. - (delete 'bootstrap) - (replace 'configure - (lambda* _ - (copy-file "config.mk.template" "config.mk") - (substitute* "tangleit" - (("\\./cheztangle\\.ss" all) - (string-append "chez-scheme --program " all))) - (substitute* "weaveit" - (("mpost chezweb\\.mp") - "mpost --tex=tex chezweb.mp") - (("\\./chezweave" all) - (string-append "chez-scheme --program " all))) - (substitute* "installit" - (("-g \\$GROUP -o \\$OWNER") "")) - #t))))) + (list + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "DOCDIR=" #$output "/share/doc/" + #$name "-" #$version) + ;; lib/chez-scheme/chezweb ??? + (string-append "LIBDIR=" #$output "/lib/chezweb") + (string-append "TEXDIR=" #$output "/share/texmf-local")) + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + ;; This package has a custom "bootstrap" script that + ;; is meant to be run from the Makefile. + (delete 'bootstrap) + (replace 'configure + (lambda* _ + (copy-file "config.mk.template" "config.mk") + (substitute* "tangleit" + (("\\./cheztangle\\.ss" all) + (string-append "scheme --program " all))) + (substitute* "weaveit" + (("mpost chezweb\\.mp") + "mpost --tex=tex chezweb.mp") + (("\\./chezweave" all) + (string-append "scheme --program " all))) + (substitute* "installit" + (("-g \\$GROUP -o \\$OWNER") ""))))))) (home-page "https://github.com/arcfide/ChezWEB") (synopsis "Hygienic Literate Programming for Chez Scheme") (description "ChezWEB is a system for doing Knuthian style WEB @@ -144,95 +170,74 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("chez-web" ,chez-web) - ("texlive" ,(texlive-updmap.cfg (list texlive-pdftex))))) + (list chez-scheme + chez-web + (texlive-updmap.cfg (list texlive-pdftex)))) (arguments - `(#:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-web (assoc-ref inputs "chez-web")) - (chez (assoc-ref inputs "chez-scheme")) - (chez-h (dirname (car (find-files chez "scheme\\.h"))))) - (substitute* "Makefile" - (("(SCHEMEH=).*$" all var) - (string-append var chez-h))) - #t))) - (add-before 'build 'tangle - (lambda* (#:key inputs #:allow-other-keys) - (setenv "TEXINPUTS" - (string-append - (getcwd) ":" - (assoc-ref inputs "chez-web") "/share/texmf-local/tex/generic:" - ":")) - ;; just using "make" tries to build the .c files before - ;; they are created. - (and (invoke "make" "sockets") - (invoke "make")))) - (replace 'build - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - ;; make sure Chez Scheme can find the shared libraries. - (substitute* "sockets.ss" - (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" - all cmd so) - (string-append cmd " \"" chez-site "/" so "\"")) - (("sockets-stub\\.[sd][oy].*" all) - (string-append chez-site "/" all))) - ;; to compile chez-sockets, the .so files must be - ;; installed (because of the absolute path we - ;; inserted above). - (for-each (lambda (f d) (install-file f d)) - '("socket-ffi-values.so" "sockets-stub.so") - (list chez-site chez-site)) - (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) - (replace 'install - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/chez-sockets")) - (doc (string-append out "/share/doc/" ,name "-" ,version)) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - (for-each (lambda (f d) (install-file f d)) - '("sockets.pdf" "sockets.so") - (list doc chez-site)) - #t)))))) + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((scheme (search-input-file (or native-inputs inputs) + "/bin/scheme")) + (lib (string-append (dirname scheme) "/../lib")) + (header-file (car (find-files lib "scheme\\.h"))) + (include-dir (dirname header-file))) + (substitute* "Makefile" + (("(SCHEMEH=).*$" _ var) + (string-append var include-dir)))))) + (add-before 'build 'tangle + (lambda* (#:key inputs #:allow-other-keys) + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" + (assoc-ref inputs "chez-web") + "/share/texmf-local/tex/generic:" + ":")) + ;; just using "make" tries to build the .c files before + ;; they are created. + (and (invoke "make" "sockets") + (invoke "make")))) + (replace 'build + (lambda args + (let ((chez-site (string-append #$output + "/lib/chez-scheme/arcfide"))) + ;; make sure Chez Scheme can find the shared libraries. + (substitute* "sockets.ss" + (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post)) + (("(\")(sockets-stub\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post))) + ;; to compile chez-sockets, the .so files must be + ;; installed (because of the absolute path we + ;; inserted above). + (for-each (lambda (f) + (install-file f chez-site)) + '("socket-ffi-values.so" + "sockets-stub.so")) + (invoke "bash" + "-c" + (format #f "echo '~s' | scheme -q" + '(compile-file "sockets.sls")))))) + (replace 'install + (lambda args + (install-file "sockets.so" + (string-append #$output + "/lib/chez-scheme/arcfide")) + (install-file "sockets.pdf" + (string-append #$output + "/share/doc/" + #$name "-" #$version))))))) (home-page "https://github.com/arcfide/chez-sockets") (synopsis "Extensible sockets library for Chez Scheme") (description "Chez-sockets is an extensible sockets library for Chez Scheme.") (license expat)))) -;; Help function for Chez Scheme to add the current path to -;; CHEZSCHEMELIBDIRS. -(define chez-configure - '(lambda _ - (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) - (setenv "CHEZSCHEMELIBDIRS" - (if chez-env - (string-append ".:" chez-env) - ".")) - #t))) - -;; Help function to define make flags for some Chez Scheme custom make -;; files. -(define (chez-make-flags name version) - `(let ((out (assoc-ref %outputs "out"))) - (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" ,(package-version chez-scheme)) - (string-append "PREFIX=" out) - (string-append "DOCDIR=" out "/share/doc/" - ,name "-" ,version)))) - (define-public chez-matchable (package (name "chez-matchable") @@ -253,10 +258,11 @@ (define-public chez-matchable (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -284,10 +290,11 @@ (define-public chez-irregex (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -314,17 +321,18 @@ (define-public chez-fmt (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "chez-check" - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - (replace 'build - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-build" make-flags))) - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-install" make-flags)))))) + (list #:make-flags (chez-make-flags name version) + #:test-target "chez-check" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-build" make-flags))) + (replace 'install + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-install" make-flags)))))) (home-page "http://synthcode.com/scheme/fmt") (synopsis "Combinator formatting library for Chez Scheme") (description "This package provides a library of procedures for @@ -354,10 +362,11 @@ (define-public chez-mit (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -386,46 +395,44 @@ (define-public chez-scmutils (propagated-inputs (list chez-mit chez-srfi)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:tests? #f ; no test suite - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - ;; 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 - ;; in turn requires us to compile the files in the final - ;; destination. - (delete 'build) - (add-after 'install 'install-src - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-src" make-flags))) - (add-after 'install-src 'absolute-path-in-scm-files - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils") - (string-append "include \"" (dirname file))))) - (find-files out "\\.sls")) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils/simplify") - (string-append "include \"" (dirname file))))) - (find-files out "fbe-syntax\\.scm")) - #t))) + (list + #:make-flags (chez-make-flags name version) + #:tests? #f ; no test suite + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + ;; 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 + ;; in turn requires us to compile the files in the final + ;; destination. + (delete 'build) + (add-after 'install 'install-src + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "install-src" make-flags))) + (add-after 'install-src 'absolute-path-in-scm-files + (lambda* (#:key #:allow-other-keys) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils") + (string-append "include \"" (dirname file))))) + (find-files #$output "\\.sls")) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils/simplify") + (string-append "include \"" (dirname file))))) + (find-files #$output "fbe-syntax\\.scm")))) (add-after 'absolute-path-in-scm-files 'build - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (mk-file (car (find-files out "Makefile")))) + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (let ((mk-file (car (find-files #$output "Makefile")))) (with-directory-excursion (dirname mk-file) (apply invoke "make" "build" make-flags))))) (add-after 'build 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (for-each delete-file - (find-files out "Makefile|compile-all\\.ss")) - #t)))))) + (lambda args + (for-each delete-file + (find-files #$output + "Makefile|compile-all\\.ss"))))))) (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") (description "This package provides a port of the MIT/GNU Scheme Scmutils program to Chez Scheme. The port consists of a set of -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:51:51 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:51:51 +0000 Received: from localhost ([127.0.0.1]:52761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkl-0003UU-7k for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:51 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:41869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnke-0003Tr-6C for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:44 -0500 Received: by mail-qv1-f47.google.com with SMTP id x3so10705975qvd.8 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:51:44 -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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=d75eZuWDpG0Xo8REZER5QZ3Aj707v/oG4QwoThxMJ20X69y7dbE7FL3aKJQbk2tATC QZo/FeyQJ7l24qN7qjEVuQjMzjgdHFiyhstZMDg3UkEpYnrzAwIJN7S7hXuSAZztUo5f NMn+P+zNwyEyZIYwMkSn98Fqz5tsof0RdigbMeDEyB7akDYWJitOqz0O5vSXx8cS9EE8 UEP8geQpyi9NOvHxmIvBETyBQyznFl28mwWEPrdcpUHYtVikCLgCXHpuerwQx1EGANHO 0AxdP2XwDtU1FI4l7fsGTiZm9tX4Ye+oXXky0JjsvYDkd09sgpQCvYQXtdmT3gRLb5hD o5Og== 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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=0rBkOY8nxm9FaXc35o6M6UvO1meQN6pZ2vBYVdpsxtJoWIdVaPqtNvqYo/UBvnoPmA nEVTYdA9JbVlSu+hgBZ9v0KUM5sL3TcfigmgzzXTfvRscqK81C4UxWHVZUkQ3aHLUz9a 5DDy60sYj+//a8Hio3KZibyiuiQsVGw6so/4n8b/NkjxrLm2bDvgT8YEF+JU3fFfgVtC Qd0lBs2ojoSzSKHx+bC0jL8blPClm1lYvBDZ06CVjrNd+4VHjSexg2U6vGtbFuM2Y9La AsE93lHNFyXQvkHqbApJi/DjiowNjtWJPB9YxN5dmSev8ZQI57MhrlISZrmIRx69F5cd DpNw== X-Gm-Message-State: AOAM531iHvi8UUdTcdPxy8MvoCIVlur1Y8PedxpUzdR4u/W5HeKzOBst g12QePePFrK5Q1++AUkk7guXJqbWKT5zxVqgOFY= X-Google-Smtp-Source: ABdhPJzDT5YlUxb8rDSZLDoVcjsO7Xwmh52A36fy3DAziZH/uprpWs2ICSuMFO54sawIUZDBqdZf6A== X-Received: by 2002:a05:6214:85:b0:42c:1422:517c with SMTP id n5-20020a056214008500b0042c1422517cmr3488004qvr.72.1645131098627; Thu, 17 Feb 2022 12:51:38 -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 g11sm24525305qtg.49.2022.02.17.12.51.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:38 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 03/15] gnu: chez-scheme: Use shared zlib and lz4. Date: Thu, 17 Feb 2022 15:50:36 -0500 Message-Id: <20220217205048.967383-4-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez-and-racket-bootstrap (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 1ed4631ced..11d570059b 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -114,9 +114,7 @@ (define-public chez-scheme (inputs `(("libuuid" ,util-linux "lib") ("zlib" ,zlib) - ("zlib:static" ,zlib "static") ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") ;; for expeditor: ("ncurses" ,ncurses) ;; for X11 clipboard support in expeditor: @@ -169,14 +167,14 @@ (define src (lz4-static (assoc-ref inputs "lz4:static")) (out (assoc-ref outputs "out")) ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) + (flags (cons* (string-append "--installprefix=" out) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do compress-man-pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) (format #t "configure flags: ~s~%" flags) ;; Some makefiles (for tests) don't seem to propagate CC ;; properly, so we take it out of their hands: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:51:56 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:51:56 +0000 Received: from localhost ([127.0.0.1]:52764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkp-0003Uy-RF for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:56 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:45905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnki-0003U8-EM for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:52 -0500 Received: by mail-qk1-f172.google.com with SMTP id b22so5934562qkk.12 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:51:48 -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=voen33luSuZnifO97fQiqSCtXHVzAz6OmjDwr/H6AjE=; b=UPg7jnkZ61Qd23NYkZskT0KiELRSi4xkunI1jhgFGIa5M3CZnujB7NDxzRtA8o0MVm fHd51aiFjEY5AZ1C+M4vzqzkXSG4C8k5cIDSGp9aEhlLJ6/uq4xU3BbMea/PRB495Zxx XrjstVvFD8XgsGZ7lqxOV4iCmQgVvctQvOaNWynn8bTZiMrAHR2TnOfeY2IBezGfqFBb XxzqcTaDDsYFChGRKZPdrTLGSUuhXqADqeAkijgA00U0Oz6A4cAjtRVmIjH2QQGDFXVZ IFS7DaMUix2y/eoEkDwrkKMorxKTNB8nOEBJ7UBWwdSNprZZ0BPRZJiIttc18GLLLjAi RHWA== 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=voen33luSuZnifO97fQiqSCtXHVzAz6OmjDwr/H6AjE=; b=G/ORYXXgAA5gaYJ/qHGlwXiq81oMn9KZeQ581ZmNgCmg72XnBkPO9NYyAu89aN4oLf 5htXru8HWbuIN2antulUZyKa8Z7mz5YbdVtWMfVWebfhXH/0dvghwtX32uDpOF3dNWvg 6/ZUZy/R636Gtxj7Gx9LSFHWjwxrwhz85vWv4eQ0ZxAMnbSCH3BDB0rPEMndqM6NQwg9 DvePru/fRS1yhClQLvZRpShN06Bx0H7wg6tDcUWvsHe/O9Sc9oq3vjw36XKndrh8s1du UTPtZ0HcK1Bd3oMnakVNnwHlckvx4LmyPGPhutzvo3pW29P5sm3srqtR2fKjOt7NlF1q Ujsg== X-Gm-Message-State: AOAM5305oGrfKviGnduKCaR2isFy9/UQLrS4ZsLotMpROn5mJbNagGf7 kI2ohxaPiBDKg1ic1ReMCGwsvE7ruQ17LYlEYzY= X-Google-Smtp-Source: ABdhPJzsPFOW9qkgVW3HtwyfwUEG5qLJr+FLzx//ZCNFRtf1ZAo8iu1dYQOfDtv937xB/NMOVSsEHA== X-Received: by 2002:a37:a38b:0:b0:47d:bcad:2f49 with SMTP id m133-20020a37a38b000000b0047dbcad2f49mr2848223qke.504.1645131102725; Thu, 17 Feb 2022 12:51:42 -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 w10sm25355944qtj.73.2022.02.17.12.51.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:42 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 04/15] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. Date: Thu, 17 Feb 2022 15:50:37 -0500 Message-Id: <20220217205048.967383-5-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system, nix-system->chez-machine, chez-upstream-features-for-system): New private functions. (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private constants. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. --- gnu/packages/chez-and-racket-bootstrap.scm | 118 ++++++++++++++++++++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 11d570059b..1a923fe62d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -28,7 +28,9 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -61,6 +63,115 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; 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 +MACHINE. The returned string may share storage with MACHINE." + ;; Chez Scheme documentation consistently uses "nonthreaded" rather than + ;; e.g. "unthreaded" + (if (eqv? #\t (string-ref machine 0)) + (substring machine 1) + machine)) +(define (chez-machine->threaded machine) + "Like @code{chez-machine->nonthreaded}, but returns the threaded machine +type." + (if (eqv? #\t (string-ref machine 0)) + machine + (string-append "t" machine))) + +;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt +;; in https://github.com/racket/raco-cross. +;; For supported platforms, refer to release_notes/release_notes.stex in the +;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md +;; in https://github.com/racket/racket. +(define %nix-arch-to-chez-alist + `(("x86_64" . "a6") + ("i386" . "i3") + ("aarch64" . "arm64") + ("armhf" . "arm32") ;; Chez supports ARM v6+ + ("ppc" . "ppc32"))) +(define %nix-os-to-chez-alist + `(("w64-mingw32" . "nt") + ("darwin" . "osx") + ("linux" . "le") + ("freebsd" . "fb") + ("openbsd" . "ob") + ("netbsd" . "nb") + ("solaris" . "s2"))) + +(define (chez-machine->nix-system machine) + "Return the Nix system type corresponding to the Chez Scheme machine type +MACHINE. If MACHINE is not a string representing a known machine type, an +exception is raised. This function does not distinguish between threaded and +nonthreaded variants of MACHINE. + +Note that this function only handles Chez Scheme machine types in the +strictest sense, not other kinds of descriptors sometimes used in place of a +Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or +@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type +for the host system is often still relevant.)" + (let ((machine (chez-machine->nonthreaded machine))) + (let find-arch ((alist %nix-arch-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (string-prefix? chez machine) + (string-append + nix "-" (let ((machine-os + (substring machine (string-length chez)))) + (let find-os ((alist %nix-os-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (equal? chez machine-os) + nix + (find-os alist))))))) + (find-arch alist))))))) + +(define* (nix-system->chez-machine #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return the Chez Scheme machine type corresponding to the Nix system +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme +machine type is undefined. + +It is unspecified whether the resulting string will name a threaded or a +nonthreaded machine type: when the distinction is relevant, use +@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust +the result." + (let* ((hyphen (string-index system #\-)) + (nix-arch (substring system 0 hyphen)) + (nix-os (substring system (+ 1 hyphen))) + (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) + (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) + (and chez-arch chez-os (string-append chez-arch chez-os)))) + +(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}. Other feature symbols may be added in the future." + (cond + ((not (nix-system->chez-machine system)) + #f) + ((target-aarch64? system) + #f) + ((target-arm32? system) + (and (target-linux? system) + '())) + ((target-ppc32? system) + (and (target-linux? system) + '(threads))) + (else + '(threads)))) + +;; +;; Chez Scheme: +;; + (define nanopass (let ((version "1.9.2")) (origin @@ -264,8 +375,11 @@ (define* (stex-make #:optional (suffix "")) ;; We should too. It is the Chez machine type arm32le ;; (no threaded version upstream yet, though there is in ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) + (supported-systems + (delete + "armhf-linux" ;; <-- should work, but reportedly broken + (filter chez-upstream-features-for-system + %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:51:57 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:51:57 +0000 Received: from localhost ([127.0.0.1]:52766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkq-0003V1-Cf for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:57 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:36456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkm-0003UI-JX for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:53 -0500 Received: by mail-qv1-f53.google.com with SMTP id o5so10735074qvm.3 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:51:52 -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=Z6O01Amx/ewJ7uRd32p4WRm3ZvNkC1Vw/5sR2RDUzBs=; b=VUzVEOjRB4duC8zUuGbjX1/GOnNZlZPFRRc9ikQy2m3URL1smNT4We4GSih3ZMlXLs sW46PwTY1vibiFicNEvPRC/3a4LVCBMxmYfengYkajxNbDVktuz8a5/9ftFouNJQqFKV lkesiUTvW9/AXqN4Zu+OhTmlIOjmzpNuyILu+TQNJqUfbgAAERpfaZ9ERQk2Ugk5NZiW YPgdUMQzt1STGhLSjsdoRFpFEERnXFTohf3ZcMgpPTZEpXVAs9YqR/tkpYvf0u8CE8Zd I2yUFr2Kn4h+qjI4QR+GR7WeAb4fsfoVoWhrNfCVeJt91lPz5wbihrNEohtyQeUiudG6 kYXw== 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=Z6O01Amx/ewJ7uRd32p4WRm3ZvNkC1Vw/5sR2RDUzBs=; b=8C3CsCAvTtWXBzzPnoYD3tTDxmSGOxGUrqe1mASnGtxWZXa8fUEa7P+y8ClMAWj/Ck zjvJCpIi7ZhZ6wkSqkk4mcojbnW7XNohb4XgRVdZdQCUJhmGsQnyzfhJbrFCS1MbJKzH iidB0Jhf1TMLNLCg/rgC00pUk/fKh1Rs/67lDWL6xLoaHOB2H+t8XAAjlcMjP1rCmYUb ggXmQnwRtgHW8qoE92lyEcTly56u+S2HEaKZinKXK/aPx07WAlljU5tkoFlp2QOTY0ZL NCBUWJX1AQHWfkRKrMRyL1o5DNxCjy55CkqY6kxzV0sdLCNkEI2t/D42rWJk1LmucVc6 U77w== X-Gm-Message-State: AOAM531LA2dxsdXRsrBo4g0mgGn4UCqTTIllEi7KVcdavBZbtLCwHlkN 14gh7MAgFO5PweLtyAbMMsxgVqDXQfTC9+BSdzI= X-Google-Smtp-Source: ABdhPJzulc3iD+XYHe1x4WnVuT3Z8oKP8ZuvfguRXXVii6WbxFNm6W1UTGDvQ7PIeleNXv5zWuy1Zw== X-Received: by 2002:ac8:59d4:0:b0:2d5:a086:e9fd with SMTP id f20-20020ac859d4000000b002d5a086e9fdmr4030414qtf.347.1645131106874; Thu, 17 Feb 2022 12:51:46 -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 185sm2467503qkd.49.2022.02.17.12.51.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:46 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 05/15] gnu: chez-scheme: Use new package style. Date: Thu, 17 Feb 2022 15:50:38 -0500 Message-Id: <20220217205048.967383-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[inputs, native-inputs]: Remove labels. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass, stex): Make public as a temporary workaround for Racket. * gnu/packages/racket/scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 288 ++++++++++----------- gnu/packages/racket.scm | 5 +- 2 files changed, 137 insertions(+), 156 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 1a923fe62d..81ac8f0774 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -172,7 +172,7 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define nanopass +(define-public nanopass (let ((version "1.9.2")) (origin (method git-fetch) @@ -182,7 +182,7 @@ (define nanopass (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) (file-name (git-file-name "nanopass" version))))) -(define stex +(define-public stex ;; This commit includes a fix, which we would otherwise want to use as ;; patch. Let's revert to tagged releases as soon as one becomes available. (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") @@ -199,86 +199,80 @@ (define stex (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.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))))) (build-system gnu-build-system) (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("lz4" ,lz4) - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) + (list + `(,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 - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) + (list nanopass ; source only + ;; for docs + stex + xorg-rgb + (texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* (string-append "--installprefix=" out) + #:test-target "test" + ;; TODO when we fix armhf, it may not support --threads + #:configure-flags #~'("--threads") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (copy-recursively #$nanopass + "nanopass" + #:keep-mtime? #t) + (copy-recursively #$stex + "stex" + #:keep-mtime? #t))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) + ;; add flags which are always required: + (let ((flags (cons* (string-append "--installprefix=" #$output) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" @@ -286,90 +280,78 @@ (define src ;; and letting Chez try causes an error "--nogzip-man-pages" configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke "./configure" 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* ((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 explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (let* ((stex-output "/tmp") + (doc-dir (string-append stex-output "/share/doc/stex"))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/stex") + (string-append "Scheme=" + (search-input-file outputs + "/bin/scheme"))) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (match (assoc-ref outputs "doc") + (#f + (format #t "not installing docs~%")) + (doc-prefix + (let* ((chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib "/tmp/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 865fdff70f..a1ba57cca3 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,9 +333,8 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) "stex")) - ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) - "nanopass")))) + ("stex" ,stex) + ("nanopass" ,nanopass))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:06 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:06 +0000 Received: from localhost ([127.0.0.1]:52777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkz-0003Wa-Hz for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:06 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:37864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnkq-0003Uc-PG for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:51:57 -0500 Received: by mail-qv1-f47.google.com with SMTP id a19so10740263qvm.4 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:51:56 -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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=KcCJBDq2jWD3Yxwfk9BN4dJLu1o6yv/biOCpMh7l+Wots6eMSBeWBfMaJc7+XhQmAB SdGsJO2+IuCTmFkTZf6lfrkE0JpTf316esF03+uBekzlq2BiMj8XA5rWpas9IL+6QA5n YwzxcuoZuVtoEmvNqkBJmHy3BFCk74LQX5F/ZOQQXhjizT87e+g4+b05iBlOdE+b5MUV e+MX/lq5lTkDWxih3n0gbgY/DPC8szJ5kQcwv9aNtTu7NMLmTf1awZfyVhMGESxPIdqH Y0va3MS/Cm9LlHmkytUX/paMYcPxh170bkK1MR0EX/JTYKogj6UiL24ylpX1AQkWEySy imaA== 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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=1kNLuE7Txt3YEen/gqKlaWU2LZ4u57uw2lwHvzx9GG3zHJ5IoM6C2zxCtoRiDkxtQM gcGFmIucIejg5IkLwTYwsJB7r99gKy1nOJv1Ak1r8ON+AK8KYtTqRbZqcbjcWCf/wmwl icdFBo21ph62tpVMZGKIEOuq/586qAJg7MwG+gDRb+72nWxJS6jvKr+tfO/d21uCY1hZ CBeDmXUuAVgZFyGH2ItHPLrsSI0qABs61EKIyB7LDa1kgyY6T3pvVla7QasGLvQyMNWK eAlw1C80UE3vBBLeh7F8MdsiaOCDTNcODVY/3rpe5z2cCvhaL719LFyWMIO3YmxTulVX yPNA== X-Gm-Message-State: AOAM53102hnxJ0JEtxREi6Mjr4Gj9TZGyRf+YV2iWgMmt7BTYBtDvwMH fK9sSV92zCGowq/tFhfjq85/cstwQU7JHCDmEc0= X-Google-Smtp-Source: ABdhPJy6rbVY2UySe3wPyYMkjfCfZKgGCKhpoZ3Tw8HLOCsfUqxvPg+N2905NpvtXsGnmDe1HaDa3Q== X-Received: by 2002:ac8:5bd6:0:b0:2dd:92e7:bd1b with SMTP id b22-20020ac85bd6000000b002dd92e7bd1bmr1290179qtb.208.1645131111180; Thu, 17 Feb 2022 12:51:51 -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 az38sm20851773qkb.124.2022.02.17.12.51.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:50 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 06/15] gnu: Add stex. Date: Thu, 17 Feb 2022 15:50:39 -0500 Message-Id: <20220217205048.967383-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap'. (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies of stex-bootstrap. [arguments]<#:phases>: Remove 'prepare-stex'. Adjust 'unpack-nanopass+stex' and 'install-doc'. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 215 +++++++++++++++------ gnu/packages/racket.scm | 2 +- 2 files changed, 155 insertions(+), 62 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 81ac8f0774..83bf15b5fb 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -31,6 +31,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -172,30 +173,6 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define-public stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - (define-public chez-scheme (package (name "chez-scheme") @@ -232,15 +209,7 @@ (define-public chez-scheme libx11)) (native-inputs (list nanopass ; source only - ;; for docs - stex - xorg-rgb - (texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek)) - ghostscript - netpbm)) + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -263,9 +232,11 @@ (define-public chez-scheme (copy-recursively #$nanopass "nanopass" #:keep-mtime? #t) - (copy-recursively #$stex - "stex" - #: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"))))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -301,32 +272,9 @@ (define-public chez-scheme (symlink scheme.boot (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (let* ((stex-output "/tmp") - (doc-dir (string-append stex-output "/share/doc/stex"))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/stex") - (string-append "Scheme=" - (search-input-file outputs - "/bin/scheme"))) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) ;; Building the documentation requires stex and a running scheme. ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc + (add-after 'install-symlink 'install-doc (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (match (assoc-ref outputs "doc") (#f @@ -334,7 +282,9 @@ (define-public chez-scheme (doc-prefix (let* ((chez+version (strip-store-file-name #$output)) (scheme (search-input-file outputs "/bin/scheme")) - (stexlib "/tmp/lib/stex") + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) (doc-dir (string-append doc-prefix "/share/doc/" chez+version))) @@ -370,3 +320,146 @@ (define* (stex-make #:optional (suffix "")) generates native code for each target processor, with support for x86, x86_64, and 32-bit PowerPC architectures.") (license license:asl2.0))) + +;; +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + #$(chez-machine->threaded + (nix-system->chez-machine))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine "\\."))))) + (else + ;; for bootstrapping, can run without ahead-of-time + ;; compilation + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is referenced in the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license license:expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (outputs '("out" "doc")) + (properties '()))) + +(define-public nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index a1ba57cca3..d8338bcd6f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,7 +333,7 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,stex) + ("stex" ,(package-source stex)) ("nanopass" ,nanopass))) (arguments `(#:phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:06 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:06 +0000 Received: from localhost ([127.0.0.1]:52779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnl0-0003We-7o for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:06 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:43698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnku-0003Ux-U9 for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:01 -0500 Received: by mail-qk1-f182.google.com with SMTP id z66so193634qke.10 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:00 -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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=VZUWLcmh90wWzcu/fh/Me74DacccZt1nEAGbTLFNQk0Jx1O2BPuCWdCdYrN2Jeta+f GP9ObkBYIunqeTj8G5YzlVpj8pFn9O0ihmt19cdhDYC/yu3WtaX7kCFyFGgn2ZtJ9knL 4OPZ08UuNgfLuw7+ZpDMYVNKMxZJE4YTXMdczvsZ0i9M6g+bbjV+3/tXFv4PSQoq0/JI gsDs1rTW/ZFjSYKSRhXnI5TV7vNylfKVIxjkcag5BvS4hFhl3zItt9UQSzO9gRH+BDBk m2Bc+XZMxAvQMgpY15eZrSYFzcxRkHuWxoIZ86uBCvydL0ejQMNfvMH4akMOo7LsQ6h1 NnbA== 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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=OFIGJE9ySIOSMlfi/nq3eUJK9Os1JRdnj/AYhovQGeOLq9rrYC3ntDuAEDBqxWPLSZ ZaDaOSihPUwvGjFJ3VbRDmtQq7d3bhMEofQ3JzeqCn+6e8lBPvUiL+0sYqIpq9ygUKSL E/kdWJEvMwm6FRXkUX35ejNA+RZN3VFfEdaCbCEnnpfRA40qwUyBnLe5TZB6wpI3i5lU NkXu5Xif+jLFBA4AjInIGvsTTzgIoAtki3lNXhERQWN3k7oCTIV1x6UN8Vbe75yblg2R WZ5NVqFSZfn4TWtNnIov4/be3NJMxboYIS3z7VYGDpi436ZxnpiNMSAOiPyX6G1T1PMY GQow== X-Gm-Message-State: AOAM532LbLCeqqxFjkrtUcI3CU4DZIKSSbtPuLHZBybaZxHZpvB7rARO XfJ0+N+N5XbL1N0CmA6XIVBDblv9jQbv3OnE2TI= X-Google-Smtp-Source: ABdhPJyTQ8TTUYYU4hZRa4DSJbNU7KZzmb11TxM0puqLnSJeDZHEaHcw2xwvJyVCM8JayMOpXm1GMg== X-Received: by 2002:a37:a7d7:0:b0:5f1:9141:9c0c with SMTP id q206-20020a37a7d7000000b005f191419c0cmr2722540qke.783.1645131115323; Thu, 17 Feb 2022 12:51:55 -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 p15sm24460629qtk.56.2022.02.17.12.51.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:55 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 07/15] gnu: Add chez-nanopass. Date: Thu, 17 Feb 2022 15:50:40 -0500 Message-Id: <20220217205048.967383-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Adapt 'unpack-nanopass+stex'. (chez-nanopass): New variable. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Adapt accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 96 ++++++++++++++++++---- gnu/packages/racket.scm | 2 +- 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 83bf15b5fb..d66955d50d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -207,9 +207,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs - (list nanopass ; source only - stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -228,10 +226,12 @@ (define-public chez-scheme #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (copy-recursively #$nanopass - "nanopass" - #:keep-mtime? #t) + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (copy-recursively + (dirname (search-input-file (or native-inputs inputs) + "lib/chez-scheme/nanopass.ss")) + "nanopass" + #:keep-mtime? #t) (mkdir-p "stex") (with-output-to-file "stex/Mf-stex" (lambda () @@ -454,12 +454,76 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license license:expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d8338bcd6f..e8d016c07b 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -334,7 +334,7 @@ (define-public racket-bootstrap-chez-bootfiles racket-minimal racket-minimal-bc-3m)) ("stex" ,(package-source stex)) - ("nanopass" ,nanopass))) + ("nanopass" ,(package-source chez-nanopass)))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:14 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:14 +0000 Received: from localhost ([127.0.0.1]:52782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnl7-0003X3-PD for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:14 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:39798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnky-0003VL-Vz for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:05 -0500 Received: by mail-qv1-f50.google.com with SMTP id f19so10729469qvb.6 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:04 -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=KNOUjMT3+W/jjCU6TuR4VoZo9rnrj3vaZE3pLMma7YQ=; b=kPgwpMIsLHiqdrTSyFVnO42y4sgYOcXcjUgUPBu2Cs3V8qXD/IAJCMXN30V6NUOaub fkn0ldRkYXrmpE5c03Ux5KkecCOaQHBOumCcUD6wpHksncZ+bp/pNB5jMCExnUWA8Dp/ PRR+1B3UdwjGhgtd87csERXdpq4ta+ghRA1hIfRB/1XLNov8W9jR9IPDviJfDjEqU+s5 eQN6OcwYATzwSnxfIbBJ8FHymI9K5/OkesCvaxnsRHIq1tj7JPSB+kdjMlZrna38EFgW yNKvjS2r04EJBUKe3lQFqGBSxpcSQDYv4uLcLR7kGs6p2o7/Ip3rNNm7vAx7Wz6D0yA4 IbEA== 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=KNOUjMT3+W/jjCU6TuR4VoZo9rnrj3vaZE3pLMma7YQ=; b=fvujr1J66j2xevmchGReFENfXdmgvnJkgqwSP5oSqSCCy+ftBGtEcztodBSUaiG2pp Up0E8R+xiRUkZccwHQNAJhIQxqOq4MCJJWBfF+nYsdSB35PltLn5x13kgui1tG3sTWzd yjWtDK2isoejp+SqyG0TDSiOvek9pzJDyozH9rW+jnifOLYcjmgsqAlueKL1SFD8DeNN J9GGpjIutbkk3Q/EpBzTqZCaONzDn94Ekx+9ixNXZhEDX6fu829OaX8CllLfDzIcoJzQ VvVQMP2v8p0johK3CIWCbOXiUIeOKApkiQ1AzLu2JR+yw5igJ7zTFN8gvdMXoEN6JHKa Nqrw== X-Gm-Message-State: AOAM5332Z6RByLPitO4vViOxSu+fSBgwhrklyjviA/Wrv5LW0Rmo/dPX swRfl4zxTKxK+UQsL2sLeIXG6d6SSb9ByxGORoE= X-Google-Smtp-Source: ABdhPJwK2WMDB1tdJGxUGiEoc74nd1b/1AnggH/0aydJi4/FmdsBAgqZ7Y6Xgjrjk8+l8Fq0C9moAg== X-Received: by 2002:a05:6214:f0e:b0:42d:88a:63b3 with SMTP id gw14-20020a0562140f0e00b0042d088a63b3mr3591017qvb.124.1645131119430; Thu, 17 Feb 2022 12:51:59 -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 x4sm3901813qkh.42.2022.02.17.12.51.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:51:59 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 08/15] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Thu, 17 Feb 2022 15:50:41 -0500 Message-Id: <20220217205048.967383-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This might seem a bit silly in isolation, but it makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. --- gnu/packages/chez-and-racket-bootstrap.scm | 51 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index d66955d50d..366815634d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -187,7 +187,7 @@ (define-public chez-scheme (sha256 (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) + (file-name (git-file-name "chez-scheme" version)) (snippet #~(begin (use-modules (guix build utils)) (for-each (lambda (dir) @@ -207,7 +207,9 @@ (define-public chez-scheme ;; 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-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -237,6 +239,14 @@ (define-public chez-scheme (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 (or native-inputs 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`. @@ -321,6 +331,43 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license 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 + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %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 upsream +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: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:22 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:22 +0000 Received: from localhost ([127.0.0.1]:52785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnl8-0003X6-6h for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:22 -0500 Received: from mail-ua1-f44.google.com ([209.85.222.44]:46662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnl4-0003WR-0p for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:12 -0500 Received: by mail-ua1-f44.google.com with SMTP id c36so3244828uae.13 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:09 -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=iIgbL0+A8pHOAhnC8e3Ywe+aZn7xD8hqdtZyYM3kw+Q=; b=AxKJaWe8uKWnXLdkCHFtqHrBNwMCRP80je5LZov9kCJP8FiUdlPy/jr8eqWDmOXe2G F/WRHrKWmyb6FGPjPhXLHHQgEtrZjPKItCF2mAlmKN6B9oYAD/EUIH5U1eTJi8znXpCu ESraQ85Q64QqnsVQ1A0p2WItE/N8HBBzcCJvPlUI2RnWBSVBSX68sv+5ZoeLqJ789A9X eQ1fDvGcQaWu+Lpk9ouNmUSRSvBp59tTVW5B+21oPsD5cQnHMMUhVuXKlgnoowUwKm++ r8VhqWKEa/JoL6SA65g21lNQvrA2fhg7Zm6ASM5O/eYY1ZzJKLVmALuNengzrl6MEM/q rFRA== 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=iIgbL0+A8pHOAhnC8e3Ywe+aZn7xD8hqdtZyYM3kw+Q=; b=gzzsNdA+E76eZLsi4FtK5qxctZQtrN349GVO3RDkHnOodZrW1u9dMCUmZb/OhYqh81 fKUvC0PhoGBsMy82KKPPP2Axv8V8YKOfzQOepCn1TfjwguG9qh82VMr1Jin4wdQzrrOQ K45fDq7k+oZrChKkNYc+AIAMubi3bu5xGMN4kG8MX3Db0TfL2uzBSRoVNhdzWRsEWM7f 6DqoWMuPSqS3HWAOu/DTO5wp2nBWuqIVbxSoWjqHKpZvX9j5rbA9uPXgRZWXpkfJFfKr v6rcS1LQq5HDV43uFRjZJjzkm9coRYoz4Rc7/IB4nXIF8GDF0MNKgzZyV75JDRu+vOKa r9+g== X-Gm-Message-State: AOAM532HoNIRWfmr7RDfEiAXO0hHu5K8gN4fRzbhP/g1xDWwympVbCwN C+ch8Iv9j+gKJXjwwDvm8n+LKe51w+G06rmQK+0= X-Google-Smtp-Source: ABdhPJyvGGfH86WFvlEoeqePb6zhj953cs80WJTGRm2fNMmFf9H62x8Bsvp5pv9H5zQ5QC1GTc8O6A== X-Received: by 2002:a9f:3dc7:0:b0:33d:1812:15ac with SMTP id e7-20020a9f3dc7000000b0033d181215acmr1976955uaj.79.1645131123736; Thu, 17 Feb 2022 12:52:03 -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 k66sm768400vka.44.2022.02.17.12.52.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:52:03 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 09/15] gnu: Add racket-vm-cgc. Date: Thu, 17 Feb 2022 15:50:42 -0500 Message-Id: <20220217205048.967383-10-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/patches/racket-enable-scheme-backport.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (unbundle-chez-submodules, racket-vm-cgc): New variables. (chez-scheme)[source]: Use 'unbundle-chez-submodules'. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 315 +++++++++++- .../racket-enable-scheme-backport.patch | 465 ++++++++++++++++++ 3 files changed, 772 insertions(+), 9 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index fa3a89e7a8..aaecbc7898 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1752,6 +1752,7 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-enable-scheme-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 366815634d..0dd5f4bb68 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -34,8 +34,11 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages ncurses) #:use-module (gnu packages netpbm) @@ -62,6 +65,136 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; Putting the relevant definitions together in this module avoids having to ;; work around dependency cycles. ;; +;; Anatomy of Racket: +;; ------------------ +;; +;; The main Racket Git repository () is +;; organized broadly like this: +;; +;; . +;; ├── Makefile +;; ├── pkgs/ +;; └── racket/ +;; ├── collects/ +;; └── src/ +;; ├── configure +;; ├── Makefile.in +;; ├── bc/ +;; ├── cs/ +;; ├── ChezScheme/ +;; └── ... +;; +;; The 'racket/src/' directory contains the source of the runtime system, core +;; compiler, and primitives for the major Racket implementations: this layer +;; is called the ``Racket VM''. It is basically a normal autotools +;; project. (Even when Racket VM implementations use components implemented in +;; Racket, they are compiled in special modes to produce VM primitives.) +;; (There are or have been experimental Racket VM implementations elsewhere, +;; e.g. .) +;; +;; The 'racket/collects/' directory contains ``built in'' Racket libraries +;; that are not part of any package, including the implementation of +;; 'racket/base': in particular, it must contain enough to implement `raco pkg +;; install'. It is theoretically possible to use the Racket VM layer without +;; the main collections, but it is not stable or useful. +;; +;; The 'pkgs/' directory contains Racket packages that are especially closely +;; tied to the implementation of the Racket VM, including 'compiler-lib', +;; 'racket-doc', and 'racket-test'. Some of these packages depend on Racket +;; packages that are developed in other Git repositories, predominantly but +;; not exclusively under the 'racket' GitHub organization. Conversely, not all +;; of the packages developed in the main Git repository are part of the main +;; Racket distribution. (Additionally, components of the Racket VM that are +;; implemented in Racket can be installed as packages, mostly for ease of +;; development.) +;; +;; The top-level 'Makefile' is more like a directory of scripts: it has +;; convienience targets for developing Racket, and it cooperates with the +;; 'distro-build' package to assemble custom Racket distributions. 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. +;; +;; A ''minimal Racket'' installation includes two packages: 'base', which is a +;; sort of bridge between the current ``built-in'' collections and the package +;; system's model of dependencies, and 'racket-lib', which, for installations +;; that can not rely on a system package manager, pulls in the SQLite and +;; OpenSSL shared libraries as platform-specific dependencies for use by the +;; ``built-in'' collections. +;; +;; The main Racket distribution consists of installing the 'main-distribution' +;; package and all of its dependencies. +;; +;; The default mode when building Racket (or installing it with the released +;; installers) is an ``in-place build'', which produces a self-contained, +;; relocatable, roughly FHS-like directory. (Racket also supports +;; ``Unix-style'' installations, which rearrange the parts of an in-place +;; build into Racket-specific subdirectories and generally tries to work for +;; installation into an FHS-based system.) Certain tools, e.g. 'distro-build' +;; and 'raco cross', are able to work with an in-place Racket build. +;; +;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and +;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and +;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store +;; output. The function 'racket-vm-for-system' returns the recomended Racket +;; VM package for a given system. +;; +;; The file 'racket.scm' builds on these packages to define 'racket-minimal' +;; and 'racket' packages. These use Racket's support for ``layered +;; installations'', which allow an immutable base layer to be extended with +;; additional packages. They use the layer configuration directly provide +;; ready-to-install FHS-like trees, rather than relying on the built in +;; ``Unix-style install'' mechanism. +;; +;; Bootstrapping Racket: +;; --------------------- +;; +;; Here's how bootstrapping Racket works: +;; +;; - Racket BC [CGC] can be built with only a C compiler (except for +;; one caveat discussed below). +;; - 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 +;; 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. +;; +;; So, we build CGC to build 3M to build bootfiles and CS. +;; +;; (Note: since the CGC variant is basically only for bootstrapping, we +;; often use "BC" to mean "3M", consistent with `(banner)` and the +;; suffixes used on executables when more than one variant co-exists.) +;; +;; 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 +;; README file applies to all such subsystems: +;; +;; The Racket version must be practically the same as the current Racket +;; verson, although it can be the Racket BC implementation (instead of +;; the Racket CS implementation). +;; +;; Unlike Chez Scheme boot files, the files generated in "schemified" +;; are human-readable and -editable Scheme code. That provides a way +;; out of bootstrapping black holes, even without BC. +;; +;; However, other Racket subsystems implemented in Racket for Racket CS +;; use older C implementations for Racket BC, whereas the reader, expander, +;; and module system were completely replaced with the Racket implementation +;; +;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) +;; are embeded in C as a static string constant. Eventually, they are further +;; compiled by the C-implemented Racket BC bytecode and JIT compilers. +;; (On platforms where Racket BC's JIT is not supported, yet another compiler +;; instead compiles the linklets to C code, but this is not a bootstrapping +;; issue.) +;; ;; Code: (define (chez-machine->nonthreaded machine) @@ -169,6 +302,178 @@ (define* (chez-upstream-features-for-system #:optional (else '(threads)))) +;; +;; Chez auxiliary G-expressions: +;; + +(define unbundle-chez-submodules + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))) + +;; +;; Racket VM: +;; + +(define (racket-vm-common-configure-flags) + ;; under a lambda extraction to avoid evaluating bash-minimal too early + #~`(,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/libtool")) + => (lambda (libtool) + (list (string-append "--enable-lt=" libtool)))) + (else + '())) + ,@(cond + ((false-if-exception + (search-input-file %build-inputs "/opt/racket-vm/bin/racket")) + => (lambda (racket) + (list (string-append "--enable-racket=" racket)))) + (else + '())) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")) + "--disable-strip" + "--enable-origtree")) + +(define-public racket-vm-cgc + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (hidden-package + (package + (name "racket-vm-cgc") + (version "8.4") + ;; ^ Remember to also update the version of + ;; chez-scheme-for-racket-bootstrap-bootfiles + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racket") + (commit (string-append "v" version)))) + (sha256 + (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (file-name (git-file-name "racket" version)) + (patches (search-patches "racket-minimal-sh-via-rktio.patch" + ;; Remove by Racket 8.5: + "racket-enable-scheme-backport.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Unbundle Chez submodules. + (with-directory-excursion "racket/src/ChezScheme" + #$unbundle-chez-submodules) + ;; Unbundle libffi. + (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + (inputs (list ncurses ;; <- common to all variants (for #%terminal) + bash-minimal ;; <- common to all variants (for `system`) + libffi)) ;; <- only for BC variants + (native-inputs (list libtool)) ;; <- only for BC variants + (outputs '("out" "debug")) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) + (guix build gnu-build-system) + (guix build utils)) + #:strip-directories #~'("opt/racket-vm/bin" + "opt/racket-vm/lib") + #:phases + #~(let () + (define* ((wrap-racket-vm-outputs phase) . args) + (apply + phase + (let loop ((args args)) + (match args + ((#:outputs outputs . args) + `(#:outputs + ,(let loop ((outputs outputs)) + (match outputs + ((("out" . out) . outputs) + `(("out" . ,(string-append out "/opt/racket-vm/")) + ,@outputs)) + ((other . outputs) + (cons other (loop outputs))))) + ,@args)) + ((arg . args) + (cons arg (loop args))))))) + (modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (replace 'configure + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'configure))) + (replace 'patch-shebangs + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-shebangs))) + (replace 'validate-runpath + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'validate-runpath))) + (replace 'make-dynamic-linker-cache + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) + (replace 'patch-dot-desktop-files + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) + (home-page "https://racket-lang.org") + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. + +Racket CGC is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat))))) + ;; ;; Chez Scheme: ;; @@ -188,15 +493,7 @@ (define-public chez-scheme (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) (file-name (git-file-name "chez-scheme" version)) - (snippet #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib")))))) + (snippet unbundle-chez-submodules))) (build-system gnu-build-system) (inputs (list diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch new file mode 100644 index 0000000000..3a5a4a3d82 --- /dev/null +++ b/gnu/packages/patches/racket-enable-scheme-backport.patch @@ -0,0 +1,465 @@ +From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 10:36:09 -0700 +Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` + +(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) + +(Fixed conflicts by dropping pbchunks and pbarch changes.) +--- + racket/src/ChezScheme/configure | 15 ++++++++++++++- + racket/src/ChezScheme/s/Mf-base | 4 ++-- + racket/src/ChezScheme/s/Mf-cross | 4 +++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 4515ffc105..0098829091 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -45,6 +45,7 @@ threads=yes + nothreads=no + temproot="" + help=no ++forceworkarea=no + gzipmanpages=yes + installowner="" + installgroup="" +@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do + --pb) + pb=yes + ;; ++ --force) ++ forceworkarea=yes ++ ;; + --installprefix=*) + installprefix=`echo $1 | sed -e 's/^--installprefix=//'` + ;; +@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then + echo " --toolprefix= prefix tool (compiler, linker, ...) names" + echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" + echo " --workarea= build directory ($w)" ++ echo " --force configure even without boot files" + echo " CC= C compiler" + echo " CPPFLAGS= C preprocessor flags" + echo " CFLAGS= C compiler flags" +@@ -721,8 +726,16 @@ case "${flagsmuni}" in + ;; + esac + ++if [ "$w" = "$m" ] ; then ++ configuringin="" ++else ++ configuringin=" in $w" ++fi ++ + if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then +- echo "Configuring for $m" ++ echo "Configuring for $m$configuringin" ++elif [ "$forceworkarea" = yes ] ; then ++ echo "Configuring for $m$configuringin despite missing boot files" + else + if [ "$m" = "" ] ; then + maybem="" +diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base +index cc6178c973..1f4a967998 100644 +--- a/racket/src/ChezScheme/s/Mf-base ++++ b/racket/src/ChezScheme/s/Mf-base +@@ -94,7 +94,7 @@ endif + # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme + # implementation + Scheme = ../bin/$m/scheme${ExeSuffix} +-export SCHEMEHEAPDIRS=../boot/%m ++export SCHEMEHEAPDIRS=../boot/$m + export CHEZSCHEMELIBDIRS=. + + # Define the libdirs separator character +@@ -691,4 +691,4 @@ reset-one: + + .PHONY: run + run: +- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) ++ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) +diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross +index d796cbb459..397af59a28 100644 +--- a/racket/src/ChezScheme/s/Mf-cross ++++ b/racket/src/ChezScheme/s/Mf-cross +@@ -43,5 +43,7 @@ x$(xm).$(m): + $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch + mv xpatch x$(xm).$(m) + ++ifneq ($(SCHEMEHEAPDIRS),:) + # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed +-nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++endif +-- +2.32.0 + + +From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 11:03:30 -0700 +Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable + +When the same Chez Scheme version as used by Racket is already +available, then `--enable-scheme=...` can supply an executable. For +cross builds, `--enable-scheme=...` can still supply a build +directory, instead, as before. + +(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) +--- + racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ + racket/src/README.txt | 30 +++++++++++--- + racket/src/configure | 8 +++- + racket/src/cs/README.txt | 6 ++- + racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- + racket/src/cs/c/configure | 24 +++++++++-- + racket/src/cs/c/configure.ac | 21 ++++++++-- + 7 files changed, 112 insertions(+), 24 deletions(-) + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index c396efc851..3998ef9ccd 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -59,6 +59,9 @@ reset: + %.boot: + (cd $(workarea) && $(MAKE) $*.boot) + ++auto.boot: ++ (cd $(workarea) && $(MAKE) $(defaultm).boot) ++ + # .bootquick to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine +diff --git a/racket/src/README.txt b/racket/src/README.txt +index 98647aebce..d77310b4a4 100644 +--- a/racket/src/README.txt ++++ b/racket/src/README.txt +@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of + ======================================================================== + + Cross-compilation requires at least two flags to `configure`: ++`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) ++`--enable-scheme-SCHEME`. ++ ++More information: + + * `--host=OS`, where OS is something like `i386-gnu-linux` to + indicate the target platform. +@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: + run `configure` again (with no arguments) in a "local" subdirectory + to create a build for the current platform. + +-An additional flag is needed for building Racket CS, unless the flag +-`--enable-racket=auto` is used: +- +- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" +- directory where Chez Scheme is built for the host system. ++ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable ++ executable that runs on the build platform; the executable must be ++ the same version as used in Racket built for the target platform. ++ ++ Supplying `--enable-scheme=DIR` is also supported in cross-build ++ mode, where DIR is a path that has a "ChezScheme" directory where ++ Chez Scheme is built for the host system. ++ ++The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are ++allowed for non-cross builds, too: ++ ++ * For Racket CS, supplying either selects a Racket or Chez Scheme ++ implementation used to create boot files to the build platform. ++ Suppling Chez Scheme is a much more direct path, but when Racket is ++ supplied, its version does not have to match the version being ++ built. ++ ++ * For Racket BC, `--enable-racket=RACKET` selects a Racket for ++ prepare C sources to cooperate with garbage collection. Its version ++ needs to be close to the one being built, and potentially exactly ++ the same version. + + Some less commonly needed `configure` flags are for Racket BC: + +diff --git a/racket/src/configure b/racket/src/configure +index c9f3ba4419..1b53ec7ce2 100755 +--- a/racket/src/configure ++++ b/racket/src/configure +@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" + use_cs=maybe + use_bc=maybe + supplied_racket=no ++supplied_scheme=no + enable_boothelp= + + # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, +@@ -34,6 +35,9 @@ for arg in $*; do + --enable-racket=*) + supplied_racket=yes + ;; ++ --enable-scheme=*) ++ supplied_scheme=yes ++ ;; + --help | -h) + echo $0: + echo see --help-bc or --help-cs, since the Racket CS build and the +@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then + fi + + if test "$use_cs" = "yes" ; then +- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then +- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly ++ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then ++ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly + exit 1 + fi + +diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt +index 2ece417b78..8e6fc57b74 100644 +--- a/racket/src/cs/README.txt ++++ b/racket/src/cs/README.txt +@@ -39,6 +39,11 @@ build: + installed in the "../ChezScheme/boot/pb" directory as described by + "../ChezScheme/BUILDING". + ++ Supplying `--enable-scheme=...` is also an option if you alerady ++ have the same version of Chez Scheme built on the current platform. ++ Another build will be created, anyway, but more quickly than ++ without Chez Scheme. ++ + * Racket is needed to generate the files in the "schemified" + directory from the sources in sibling directories like "../io". The + Racket version must be practically the same as the current Racket +@@ -48,7 +53,6 @@ build: + Unlike Chez Scheme boot files, the files generated in "schemified" + are human-readable and -editable Scheme code. That provides a way + out of bootstrapping black holes, even without BC. +- + + + ======================================================================== +diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in +index 54a644a1d9..d73993f0fc 100644 +--- a/racket/src/cs/c/Makefile.in ++++ b/racket/src/cs/c/Makefile.in +@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ + SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) + SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme + SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) +-SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_existing = @MAKE_SCHEME_SCHEME@ ++SCHEME = $(SCHEME@USE_SCHEME_MODE@) + + TARGET_MACH = @TARGET_MACH@ + SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) +@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. + @INCLUDEDEP@ @srcdir@/../../version/version.mak + + cs: +- $(MAKE) scheme@T_CROSS_MODE@ ++ $(MAKE) scheme@MAKE_SCHEME_MODE@ + $(MAKE) racket-so + cd rktio; $(MAKE) + $(MAKE) racketcs +@@ -121,9 +123,13 @@ racket-so: + + RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ + ++TARGET_MACH_built = $(TARGET_MACH) ++TARGET_MACH_existing = xc-$(TARGET_MACH) ++XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch ++ + CS_PROGS = SCHEME="$(SCHEME)" + CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ +-CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" ++CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" + PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" + + build-racket-so: +@@ -163,6 +169,15 @@ pb-bootquick: + cd $(SCHEME_WORKAREA) && $(MAKE) reset + $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) + ++scheme-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot ++ $(MAKE) mach-make ++ ++$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: ++ mkdir -p $(SCHEME_WORKAREA) ++ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" ++ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all ++ + mach-make: + $(MAKE) config-scheme + cd $(SCHEME_WORKAREA) && $(MAKE) +@@ -182,24 +197,33 @@ config-scheme: + + scheme-cross: + env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt ++ $(MAKE) finish-scheme-cross ++ ++finish-scheme-cross: + $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) + cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) + cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t +- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch ++ $(MAKE) $(XPATCH_FILE) ++ ++scheme-cross-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) ++ $(MAKE) finish-scheme-cross + + # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older +-# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files +-XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ +- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot ++# than the build- use as Racket for build; or "auto" to create +- --enable-scheme= use as host's build directory for cross ++ --enable-scheme= use as host build for cross + --enable-mach= use Chez Scheme machine type + --enable-target= cross-build for Chez Scheme machine type + --enable-portable prefer portable to host-specific +@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" + show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' + + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + show_explicitly_enabled "${enable_portable}" "portable" +@@ -4745,9 +4748,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags + + + ++ ++ ++ + + + +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 464ebe1760..aaee88156d 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev + AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) + m4_include(../ac/path_arg.m4) + AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket for build; or "auto" to create]) +-AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host's build directory for cross]) ++AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host build for cross]) + AC_ARG_ENABLE(mach, [ --enable-mach= use Chez Scheme machine type ]) + AC_ARG_ENABLE(target, [ --enable-target= cross-build for Chez Scheme machine type ]) + m4_include(../ac/portable_arg.m4) +@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" + show_explicitly_enabled "${enable_xonx}" "Unix style" + m4_include(../ac/path_show.m4) + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + m4_include(../ac/portable_show.m4) +@@ -504,9 +504,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) + AC_SUBST(CROSS_MODE) + AC_SUBST(T_CROSS_MODE) + AC_SUBST(TT_CROSS_MODE) ++AC_SUBST(MAKE_SCHEME_MODE) ++AC_SUBST(MAKE_SCHEME_SCHEME) ++AC_SUBST(USE_SCHEME_MODE) + AC_SUBST(SETUP_BOOT_MODE) + AC_SUBST(OSX) + AC_SUBST(NOT_OSX) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:24 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:24 +0000 Received: from localhost ([127.0.0.1]:52789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlH-0003Xo-SR for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:24 -0500 Received: from mail-vs1-f49.google.com ([209.85.217.49]:37517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnl7-0003Ws-Rd for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:14 -0500 Received: by mail-vs1-f49.google.com with SMTP id t22so7722233vsa.4 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:13 -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=xiJ1uhj9bLPjhTnXSqjLzmCiEo+fJYoycLYcK5E5rFg=; b=IPulhSAnEM+KOXjCRitlWVlxd7qXUDtOaIoSNteb4YWgQmyVN6Y6wpZNEWKLJX38Yd E7SwqC84V9WzgsBNdHgrpLJmlrLrxp5q4gatsgIN50ES4o2Bd/huw7wg+bHf3qeprMzT SbI5lfDQND8drA6OMSHbAQdBQVgYtVt1sGSY38DmpWIT6nQ7uUSIKRrsXkkm3X6b0kFN LihdBRzzyHngahRk/a8b/ueFxsui6i3tEYwQRwG60UDEFsK4qR4QsSCKbt1poCSnzvL7 LcUyAmZLSO1pOTaH/KcKagXh4S8b4hqdCadVR5FnKUn/Rl4Sd22S23SE9evWPCw+aj6n KO3Q== 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=xiJ1uhj9bLPjhTnXSqjLzmCiEo+fJYoycLYcK5E5rFg=; b=qd/hRZTkLk3kCk3GD8tlL5fdI1WSaKsUo73zHbXpjnfbkA39250Dq9i2sfQjLFpY9Q uVa8uB8UdCZcGriQZ5+v8kFZ2vQFmvBFMQNio2IgjLEEaKOFJvtSac/sBAzEzdBEdb0N DzpYw83bhzwI+A5jHzlfj/Ou2gcEt1Z9EJPC6/jA3tEDBQtmFo4ejs1RhnhJ8fYCGM0j rzdH4dnVFUzQB5N3t/QwSAEv9m0ZAZQ9nQGdgnp8jLDzyn/WilSwaNuAgFlry6q4weqa 3FHHA/EeIsH0ES2Hw3GRHNvraerAI6cE+dHq6AJIJgs95io8bdgeThYNrH1dsVB7DLqt EwsA== X-Gm-Message-State: AOAM530U6fV7vFbL79l2WAbP23SCS8ZIMsvPbxmHU5LjcMNsOSFs444C A6D4FAxadP/ZIe5j+Ych7ILkMN+Trdr2ccgiAIo= X-Google-Smtp-Source: ABdhPJwMmuijtlKKEd4//AOrgV4rA9fpeyDT6BRKii3TtNj0OpDrokVfhkDIMhqizg+Q6d9apxwu+A== X-Received: by 2002:a67:d589:0:b0:31b:5561:b18e with SMTP id m9-20020a67d589000000b0031b5561b18emr2074581vsj.53.1645131128098; Thu, 17 Feb 2022 12:52:08 -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 r26sm4421804uaw.12.2022.02.17.12.52.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:52:07 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 10/15] gnu: Add racket-vm-bc. Date: Thu, 17 Feb 2022 15:50:43 -0500 Message-Id: <20220217205048.967383-11-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-bc): New variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 0dd5f4bb68..dc87e090cb 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -474,6 +474,29 @@ (define maybe-release-catalog ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) +(define-public racket-vm-bc + (package + (inherit racket-vm-cgc) + (name "racket-vm-bc") + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc))) + (arguments + (substitute-keyword-arguments (package-arguments racket-vm-cgc) + ((#:configure-flags _ '()) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket BC [3M] implementation") + (description "The Racket BC (``before Chez'' or ``bytecode'') +implementation was the default before Racket 8.0. It uses a compiler written +in C targeting architecture-independent bytecode, plus a JIT compiler on most +platforms. Racket BC has a different C API and supports a slightly different +set of architectures than the current default runtime system, Racket CS (based +on ``Chez Scheme''). It is the recommended implementation for architectures +that Racket CS doesn't support. + +This package is the normal implementation of Racket BC with a precise garbage +collector, 3M (``Moving Memory Manager'')."))) ;; ;; Chez Scheme: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:24 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:24 +0000 Received: from localhost ([127.0.0.1]:52791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlI-0003Xr-5E for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:24 -0500 Received: from mail-vs1-f49.google.com ([209.85.217.49]:41801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlB-0003Wx-RJ for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:18 -0500 Received: by mail-vs1-f49.google.com with SMTP id y26so3786858vsq.8 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:17 -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=VOaybbGLJVdU27W9iEo9ekB9ot/Re1EERY/mio0sog4=; b=RAUfJHek+yBbvKmQSVy9hKVqlslRsQlNNiFZLfpwRWkHNvJkZ42DNkir7kYtwERGCH wBnMTvnxIrceAMhjDAXQSwkSXX5zDmzit2I5HiL5aS7mw6+8nwm7mEUAaeY5YiDrYty0 ASCSlImOaxhSZUC+oliLZ7F6+niMWj5IeghAVlsPwNAZ8O4X4U+ZsLhjwYlmiZB/J9Zp qCEQTdAMsIah5TyQCFFiqkdWgPXZgMDcchhZgVGpBzGq2a/BRTV6AA2pdHKBKAKObiJQ oxhWva1XAnbGd4/fY/4g+p2InYk86LCk86kUi4smrePyAmvHngNsmExhBwZfAm07mQ4+ GvAw== 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=VOaybbGLJVdU27W9iEo9ekB9ot/Re1EERY/mio0sog4=; b=yIHOByNvhsZX7XNAt7nWDZ6MiN0r4goG8I1+IfOIRIR4zGNE+sxOq1NSpQE6BjtYnh jfO22i8vYwy2z1rWSyHP6+H0gRW0W06JZpHJi4ucXVgqs0bjtdAQK7DK1TAdfVDhfbZo l/dWlJtwFhNGJWvmlo/6acx+cU+Y/qUMyc8Tf2rZyprP+CtQbLZ+cqwORF7rs1eRce8D CI6s2V3E2F4cJ/eJr7c+Olmn2Y0xQnnDop9v87umM8cDx7qXsvxL/CZ7WXQJ4UR6xE0M icoJdnteYHGlBEdFnfBEiI75fTLnEMQrpK7/ECM4vhThqCAcQjtkXwcIHSpbxr64lynu G1Qw== X-Gm-Message-State: AOAM531wysXCbBPTEfenPvNvQTc3c/oPdzZ3+G9GGmS69423c4WQbYR/ 1R7AiJAlODKGFRf+2IGArNvUvuP2iMuPO9Yf+uc= X-Google-Smtp-Source: ABdhPJzqoTJeNZG1rnErRPJH5G5y9DFgiwWaZTMAYdtsQCnqBevORQITfTSojqmpjf5JoJhpsK95GA== X-Received: by 2002:a05:6102:5494:b0:31b:7af4:1d5a with SMTP id bk20-20020a056102549400b0031b7af41d5amr2283868vsb.40.1645131132300; Thu, 17 Feb 2022 12:52:12 -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 y187sm1135721vkf.13.2022.02.17.12.52.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:52:12 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 11/15] gnu: Add chez-scheme-for-racket. Date: Thu, 17 Feb 2022 15:50:44 -0500 Message-Id: <20220217205048.967383-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) The Racket variant of Chez Scheme can be used to support platforms that are not yet supported by upstream Chez Scheme. * gnu/packages/chez-and-racket-bootstrap.scm (unpack-nanopass+stex): (chez-scheme-for-racket): (chez-scheme-for-racket-bootstrap-bootfiles): New variables. (chez-scheme)[arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase to use the eponymous new variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 131 +++++++++++++++++++-- 1 file changed, 120 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index dc87e090cb..dea49b7e89 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -317,6 +317,19 @@ (define unbundle-chez-submodules "lz4" "zlib")))) +(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"))))) + ;; ;; Racket VM: ;; @@ -548,17 +561,8 @@ (define-public chez-scheme #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (copy-recursively - (dirname (search-input-file (or native-inputs 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"))))) + (lambda args + #$unpack-nanopass+stex)) (add-after 'unpack-nanopass+stex 'unpack-bootfiles (lambda* (#:key native-inputs inputs #:allow-other-keys) (when (directory-exists? "boot") @@ -688,6 +692,111 @@ (define-public chez-scheme-bootstrap-bootfiles work with upstream Chez Scheme so that we can bootstrap these files from source."))) +(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! + (source (package-source racket-vm-cgc)) + (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) + #~(modify-phases #$those-phases + (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 license:asl2.0))) + +(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 (package-source chez-scheme-for-racket)) + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) + (arguments + (substitute-keyword-arguments + (package-arguments chez-scheme-bootstrap-bootfiles) + ((#:phases those-phases #~%standard-phases) + #~(modify-phases #$those-phases + (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) + (invoke (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "rktboot/main.rkt"))))))) + (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 "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 +supported platforms.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +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."))) + ;; ;; Chez's bootstrap dependencies: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:25 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:25 +0000 Received: from localhost ([127.0.0.1]:52793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlI-0003Xy-Np for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:25 -0500 Received: from mail-ua1-f45.google.com ([209.85.222.45]:43909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlG-0003XO-4Z for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:22 -0500 Received: by mail-ua1-f45.google.com with SMTP id w37so1324217uad.10 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:22 -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=42QC9hhqnYID4Uah/W7fmaJRGRfkU/rRtTS9pgrC2hE=; b=WJoshlQGxdL8ZHs5uoAd+7fzcHhm4vcjO2WPf/heJSD2n5bfWdSrj3eF1NTE1QQscb hqOkiQl9D0uUeJDC5PN2EfnXFNeolR6wR2L1rtuyDMhANHt6lFKLctIJAAoDedYEO7KR lMM9jWagLDte+f7Imvc/S92oKsarc6VCl38kbziTNQsp2svK7JHR3E28yxsrg+b5LZKY lLaaFkCtMJXiWFBmyYTF1OJKPePyDrKKQtzPL1lEgj3dc+BHxedSFh2g9c7wZxoNySeM mgoETFlWn3P53OZliYCecwvevCxUzw2ytbqCsfOzYmccAII+u/Tn0yktTvskmO5NyWuh Qtfw== 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=42QC9hhqnYID4Uah/W7fmaJRGRfkU/rRtTS9pgrC2hE=; b=OF7nx4ap1zFIjK5sq+OgcSOJrzoFHamYpptiNbSwpQ24K0yXnfnCL4xcDwH6Cz+ZBH r74+DuM3Oj24tva/YUHINBt+zUM7JwZkd3vtbicjOOKT0eFMIh/69m7Hwy3ZUUf5Yx1d 9zysoTbZCUZ5oLsqj8MttPH5Aipbj19cnZ1fMwUremyeKYuC+TunCZqhCiHwzNiaHZxD XIxe4aYAPAKYzyT6E373NnMGxPzcoZTnyx85+m2pgf3vEdAgkdir3Td6MLFu/Z8ETS46 nRCdWO1A+RFp6oadbAGqmzVGMGkDcPh1btMui9xnAAz7+hG1v4A/MNUxd5B6rSqAkzh/ GEWg== X-Gm-Message-State: AOAM531HQn/jL7sWLQQ4UT/KqU4jTqbVvDbOU/LqXjRxzO3ztgKykWEK T4Msv7BuldH/TNIcIncP7ItP1FvnWCvJPuaApvA= X-Google-Smtp-Source: ABdhPJyxpzXXrF2HOMxfvbDN0Mt23pT+QIj4ZGIhwWDfyTLBySkXNmKrO/iA7xCSCFMZoP2YjZUGkQ== X-Received: by 2002:a9f:202c:0:b0:341:8a70:bccc with SMTP id 41-20020a9f202c000000b003418a70bcccmr292672uam.137.1645131136600; Thu, 17 Feb 2022 12:52:16 -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 z62sm6987786vkg.43.2022.02.17.12.52.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:52:16 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 12/15] gnu: Add racket-vm-cs. Date: Thu, 17 Feb 2022 15:50:45 -0500 Message-Id: <20220217205048.967383-13-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cs): New variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index dea49b7e89..aa0eab4646 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -510,6 +510,50 @@ (define-public racket-vm-bc This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'')."))) + +(define-public racket-vm-cs + (package + (inherit racket-vm-bc) + (name "racket-vm-cs") + (inputs + (modify-inputs (package-inputs racket-vm-cgc) + (prepend zlib lz4) + (delete "libffi"))) + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (delete "libtool") + (prepend chez-scheme-for-racket + chez-nanopass-bootstrap + racket-vm-bc))) + (arguments + (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))))) + ((#:configure-flags _ '()) + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + (string-append "--enable-scheme=" + #$(this-package-native-input + "chez-scheme-for-racket") + "/bin/scheme") + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket CS implementation") + (description "The Racket CS implementation, which uses ``Chez Scheme'' as +its core compiler and runtime system, has been the default Racket VM +implemetation since Racket 8.0. It performs better than the Racket BC +implementation for most programs. + +Using the Racket VM packages directly is not recommended: instead, install the +@code{racket-minimal} or @code{racket} packages.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) + ;; ;; Chez Scheme: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:36 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:36 +0000 Received: from localhost ([127.0.0.1]:52797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlU-0003YY-70 for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:36 -0500 Received: from mail-ua1-f44.google.com ([209.85.222.44]:46027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlK-0003XZ-5W for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:26 -0500 Received: by mail-ua1-f44.google.com with SMTP id b37so3249229uad.12 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:26 -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=ZRi6asVXV+QTTkm+7nvM8RjAeYcMCR/ik7tKnX79K+k=; b=ZZ+DraLyNKYpVO3KxaYdtTEcwpp87/41jZx688cbVyD9VBYpeKvN6NWsm9M2xbopTk eTiGdZOrrLUZe0RDMrRaUFrNBKhitWHJOyd61tC3usTrg3UZp7ZGYpVQp16M8i+nl8nA mO6RyMQZ4F4vy0umiJFTUkgoChQHnXW7Ggd8pqvxJdvnlv5y3ZTeqMc75fHPTbQPvICY fJuEDC7M8u7yprZAiX0GjMxrieEUBRPbomXq3jlVHjuIH3zfSnN+Lvx4+3G69Wtc7M3g Q/lAfSw4NgvCeT1QzSnmekRIlGqQagc0uL5u3YS/tjlIqvYhEwwDRgKqh2VBFdiJ7yCc T/Ww== 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=ZRi6asVXV+QTTkm+7nvM8RjAeYcMCR/ik7tKnX79K+k=; b=pzNHXyiPztPtr54Nwg3J62Rx7MWGrj3fWKwvg6gh8DsCwM4KZ2mtHlc/1uhU4LDDPM GIHdVB6Fo3XPOLLwgLjfg4bGbm94d8aaVObUcSDLbl/oUJz5cMuvS0KVYS3k4hDf/ZTE Xwd+hwLU9JF5hcbu/eJHR+9BJvH2Qe3/GAR/2/F8alyJRmVydR4zMKASxNFY1jFJ1KFG n2qdj9l8VA6XIuXIlgYG+aKIlqLz9LFW0IF+QqXi7aDSVWEnm1ZGv9OPVGXYOJjHQdp8 G5AoOldNnqad8L/1Su5hM7j1PcCFARGZ4BgrRsyM6PwL5f+Uh1neULj846aZu7h4l2b0 /gvg== X-Gm-Message-State: AOAM531DP1wuB7QFnED7R/Ob8b3WgDQno4TexDXXr3yOrcpCp4KyevP0 s+3gpMOW+k0uFY6bCa06mWmVuw1fqZXShj3UUa4= X-Google-Smtp-Source: ABdhPJwU0/3uWOm1rUYmCd9yh8DY4y8/aYmMFf/PeipgkIOW4FgpLETn0gEoTMHYK6X2fJLIKyMsgQ== X-Received: by 2002:a9f:2008:0:b0:33d:b3:a3de with SMTP id 8-20020a9f2008000000b0033d00b3a3demr2051366uam.71.1645131140690; Thu, 17 Feb 2022 12:52:20 -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 k45sm3674562uae.14.2022.02.17.12.52.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:52:20 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 13/15] gnu: chez-mit: Support chez-scheme-for-racket. Date: Thu, 17 Feb 2022 15:50:46 -0500 Message-Id: <20220217205048.967383-14-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 54bbee7923..be251798c3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -355,7 +355,29 @@ (define-public chez-mit (commit (string-append "v" version)))) (sha256 (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (snippet + ;; Workaround for chez-scheme-for-racket. + ;; See: https://github.com/racket/racket/issues/4151 + #~(begin + (use-modules (guix build utils)) + (substitute* "mit/core.sls" + (("[(]import ") + "(import (only (chezscheme) import)\n") + (("[(]define string->uninterned-symbol gensym[)]") + (format #f "~s" + '(begin + (import (only (chezscheme) + meta-cond + library-exports)) + (meta-cond + ((memq 'string->uninterned-symbol + (library-exports '(chezscheme))) + (import (only (chezscheme) + string->uninterned-symbol))) + (else + (define string->uninterned-symbol + gensym))))))))))) (build-system gnu-build-system) (inputs (list chez-srfi)) ; for tests -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:37 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:37 +0000 Received: from localhost ([127.0.0.1]:52800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlU-0003Ya-Iv for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:37 -0500 Received: from mail-vs1-f53.google.com ([209.85.217.53]:35428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlO-0003YA-F9 for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:30 -0500 Received: by mail-vs1-f53.google.com with SMTP id q9so2246896vsg.2 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:30 -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=QbK5LZXu0V4UjXnpEDfyzgsdVLZskkGk0jXCYGbYDQY=; b=Nd2wyLV/cNsuDppI0TGh4W1VvNjx4P9oxbnIjl+jfnZKhLbrCX7sUIMt31JAppdi6g WOthPL1lqx1DBUq9fNklr3btklkV4IxtUV0Ol45uHvwmVd67L/cIvWbFiffjxrWCEGl8 JaR1yo+5vj5/gZ2CnSZf7TnQa2yHT4JOS0jgh5u2AbUf/xl4ecbjfAc25DHYjW7ykWI9 4EXJsBqjZsi81dEUPxfsHILNx2srweg+b6q5B5us9M0zc+Q9AFZbG0f2yXcKz3dW/MI/ RvthTBr3P7j6/L22K2lZTiOGVW5sMSXR3m1ZFVlrAeRn6zaofK53iiOqrmzJ9H6iF+Qw JDfA== 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=QbK5LZXu0V4UjXnpEDfyzgsdVLZskkGk0jXCYGbYDQY=; b=ZJi/8711pPTpvMchdWLaXauXkl4vdVdlEsO1ZL8e4dZCgXpfKnis1RnOQMwoWqjzQX S4bE2NTgTDz+AC0QvxEqkOAyrBs0cuJzn1LqHBdd2kM5uTyPo+uP9FeNVIAbR9UZ6M3P atDlAI/bTSlHHVH1oc1ubQyv7Fc7MliJhVKb8rJbDvm+RoP8mBVrspjw6cdb5ufc2tWR Rs0ZR06KY5uWcriPrPevpLM4paBnp/WfLVeje76DN6TA7y71Y+miZPGR83zhgkkbV9aw 7r+NHVHuF1FPXAsjpnxae9L/5Lsud5tv+Ouxm6CMdjSidGCBkh9sjkfSPgX/ONs087rY fSrA== X-Gm-Message-State: AOAM530AX9pg0AF5TXi33bZ8BeTin7oyFkjxiOXPr59TjebkBC8kyzm5 HfCIyIFvhyyBZcDTPcOiiUmcMOJegNEVyWvqHAs= X-Google-Smtp-Source: ABdhPJyC9d4xkwc+GAw0kkpfnoELE/ZsF5qMz6hJstF/an3gcquuaVOahLMwc1oG86GHQgbzqYe/tA== X-Received: by 2002:a05:6102:ed3:b0:31b:aaa5:48d3 with SMTP id m19-20020a0561020ed300b0031baaa548d3mr2069695vst.17.1645131144883; Thu, 17 Feb 2022 12:52:24 -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 z6sm2302059vsk.15.2022.02.17.12.52.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:52:24 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 14/15] gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. Date: Thu, 17 Feb 2022 15:50:47 -0500 Message-Id: <20220217205048.967383-15-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-for-system): New procedure. * gnu/packages/loko.scm (loko-scheme): Use 'chez-scheme-for-system'. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise * gnu/packages/chez.scm (chez-srfi): (chez-web): (chez-sockets): (chez-matchable): (chez-irregex): (chez-fmt): (chez-mit): (chez-scmutils): Likewise. --- gnu/packages/chez-and-racket-bootstrap.scm | 14 +++++++++++++- gnu/packages/chez.scm | 16 ++++++++-------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index aa0eab4646..876c963293 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -45,7 +45,8 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages tex) #:use-module (gnu packages xorg) #:use-module ((guix licenses) - #:prefix license:)) + #:prefix license:) + #:export (chez-scheme-for-system)) ;; Commentary: ;; @@ -197,6 +198,17 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; Code: +(define* (chez-scheme-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, +including support for native threads." + (if (and (nix-system->chez-machine system) + (not (and=> (chez-upstream-features-for-system system) + (cut memq 'threads <>)))) + chez-scheme-for-racket + chez-scheme)) + (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 diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index be251798c3..d5007e0cfd 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -74,7 +74,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -105,7 +105,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) ghostscript ;; FIXME: This package fails to build with the error: ;; mktexpk: don't know how to create bitmap font for bchr8r @@ -170,7 +170,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) chez-web (texlive-updmap.cfg (list texlive-pdftex)))) (arguments @@ -256,7 +256,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -288,7 +288,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -319,7 +319,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -382,7 +382,7 @@ (define string->uninterned-symbol (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -413,7 +413,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 56697858e6..55f55a2f32 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -451,7 +451,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index 74a649b8a1..a7ab12a0c4 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -71,7 +71,7 @@ (define-public loko-scheme #t))))) (native-inputs `(("akku" ,akku) - ("chez-scheme" ,chez-scheme) + ("chez-scheme" ,(chez-scheme-for-system)) ("struct" ,guile-struct-pack) ("laesare" ,guile-laesare) ("pfds" ,guile-pfds) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 17 15:52:54 2022 Received: (at 53878) by debbugs.gnu.org; 17 Feb 2022 20:52:54 +0000 Received: from localhost ([127.0.0.1]:52802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnle-0003Z2-9v for submit@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:54 -0500 Received: from mail-vk1-f177.google.com ([209.85.221.177]:45644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKnlU-0003YS-7M for 53878@debbugs.gnu.org; Thu, 17 Feb 2022 15:52:44 -0500 Received: by mail-vk1-f177.google.com with SMTP id j17so3399383vkd.12 for <53878@debbugs.gnu.org>; Thu, 17 Feb 2022 12:52:36 -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=S3IrNX2N1w96a1rBY0sM+FyeAnc7oWfgiRjrZo1eAtQ=; b=f2ruEKaG84ecwo585VuMTQsy2yuq0PpU7GSso6BV+B8iXaHpmzCso+l2ZBu/KRsyob CUsU/RalSh53UHRcquyAGAE7+cJBQjULSL2jyEw+o7Q4RKIkoj+eS+nNYO5OeuQTudCo mEM+8vd3OsaDRyvmGaDjx+wV9LayBQVzCiosP2kUhS7V4SbIkgMJJqv2ooGHw+T3b8/9 R7QV9KLbEw5/xa9yCXMNlDUDFW52hB5RVcCplp+D3fKE49DBnGrP76x9u1vg/HLXidwR dGfp791vNuQHSkR8P/dLIdPt9qrqXRkfWD9/u4aOSVi2AjHcZJ/TXOIWgd7WloXtCeDq A14Q== 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=S3IrNX2N1w96a1rBY0sM+FyeAnc7oWfgiRjrZo1eAtQ=; b=5D4/fHgeOF6Tj7wbLkaN/jNjf/iG1uJngWqu5Bsu3eqDC2kzbkMAnHpR8VWzmtGvTr uwkffNe291H2FXSfRrD8B6dd2A1YIAgqtOV9asrVOCcEWiMwoa2pWSnMO3s6pqINrKAg leSvqVO9dNfCPxA7PwPGKoLl3riBJdW+gu9C7SlElrT5Q3Hp34sTGUFY7zcjPDnoI7AA 9RuKqX+fc5gwzL8jzUnAt97aRbPRRGvxKilmGTCOhjmtlyrE77CLLs1MJ7MO9CklvAIA 1tTAEkHeRg0kIwAoVKLeE8WjaBdw34n2NgFFepn5nZC7ME6/pm0LUBnCQVsE6X8YgqLx rWpA== X-Gm-Message-State: AOAM53399yymCUDE2anoo+a7u6tms8VwOjA816UrIYYyel7ru4k3wk3E 3jyxtgXG5kz0SQBQitGgenxWmG9io331X63P+po= X-Google-Smtp-Source: ABdhPJxIKuFyNP2kdtagT8HZZ1NgppZlK3WCEKBcTnpmkNXnsISEP/44Dtnw8feCtURtbtKzaXvhZw== X-Received: by 2002:a05:6122:788:b0:331:2063:3645 with SMTP id k8-20020a056122078800b0033120633645mr2231744vkr.10.1645131149249; Thu, 17 Feb 2022 12:52:29 -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 t24sm2402015vsk.27.2022.02.17.12.52.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 12:52:29 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org Subject: [PATCH v2 15/15] gnu: racket: Update to 8.4. Date: Thu, 17 Feb 2022 15:50:48 -0500 Message-Id: <20220217205048.967383-16-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220217205048.967383-1-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedu [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.177 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.177 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , zimoun , Ludovic =?utf-8?Q?Court=C3=A8s?= , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedu [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedure. * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.4. Rewrite to use 'racket-vm-for-system', label-less inputs, G-expressions, and Git origins for main-distribution packages. --- gnu/local.mk | 3 +- gnu/packages/chez-and-racket-bootstrap.scm | 11 +- ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1550 +++++++++++------ 4 files changed, 1064 insertions(+), 526 deletions(-) create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index aaecbc7898..6f4ddd3645 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright © 2020 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan -# Copyright © 2021 Philip McGrath +# Copyright © 2021, 2022 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher # Copyright © 2021 Dmitry Polyakov @@ -1753,6 +1753,7 @@ dist_patch_DATA = \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-enable-scheme-backport.patch \ + %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 876c963293..cbdddb1e98 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -46,7 +46,8 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:) - #:export (chez-scheme-for-system)) + #:export (chez-scheme-for-system + racket-vm-for-system)) ;; Commentary: ;; @@ -209,6 +210,14 @@ (define* (chez-scheme-for-system #:optional chez-scheme-for-racket chez-scheme)) +(define* (racket-vm-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." + (if (nix-system->chez-machine system) + racket-vm-cs + racket-vm-bc)) + (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 diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch new file mode 100644 index 0000000000..1e018eaa79 --- /dev/null +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -0,0 +1,26 @@ +From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Mon, 31 Jan 2022 15:31:22 -0700 +Subject: [PATCH] fix creation of tethered launchers + +Related to racket/racket#4133 + +(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) +--- + gui-lib/mred/installer.rkt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt +index b1691472..9ef06c53 100644 +--- a/gui-lib/mred/installer.rkt ++++ b/gui-lib/mred/installer.rkt +@@ -72,4 +72,5 @@ + (list "-A" (path->string (find-system-path 'addon-dir))))) + + (define (config-flags) +- (list "-G" (path->string (find-config-dir)))) ++ (list "-X" (path->string (find-collects-dir)) ++ "-G" (path->string (find-config-dir)))) +-- +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index e8d016c07b..d66ff996cb 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021 Philip McGrath +;;; Copyright © 2021, 2022 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -21,8 +21,6 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages racket) - #:use-module ((guix licenses) - #:select (asl2.0 expat lgpl3+)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -30,7 +28,10 @@ (define-module (gnu packages racket) #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) + #:use-module (ice-9 exceptions) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) @@ -47,200 +48,87 @@ (define-module (gnu packages racket) #:use-module (gnu packages multiprecision) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages xorg)) - -;; Commentary: -;; -;; Here's how bootstrapping minimal Racket works: -;; -;; - Racket BC [CGC] can be built with only a C compiler (except for -;; one caveat discussed below). -;; - 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 -;; 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. -;; -;; So, we build CGC to build 3M to build bootfiles and CS. -;; -;; 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 -;; README file applies to all such subsystems: -;; -;; The Racket version must be practically the same as the current Racket -;; verson, although it can be the Racket BC implementation (instead of -;; the Racket CS implementation). -;; -;; Unlike Chez Scheme boot files, the files generated in "schemified" -;; are human-readable and -editable Scheme code. That provides a way -;; out of bootstrapping black holes, even without BC. -;; -;; However, other Racket subsystems implemented in Racket for Racket CS -;; use older C implementations for Racket BC, whereas the reader, expander, -;; and module system were completely replaced with the Racket implementation -;; as of Racket 7.0. -;; -;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) -;; are embeded in C as a static string constant. Eventually, they are further -;; compiled by the C-implemented Racket BC bytecode and JIT compilers. -;; (On platforms where Racket BC's JIT is not supported, yet another compiler -;; instead compiles the linklets to C code, but this is not a bootstrapping -;; issue.) -;; -;; Code: - -(define cfg-flag:sh-for-rktio - `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - (assoc-ref %build-inputs "sh") - "/bin/sh")) -(define cfg-flag:enable-lt - `(string-append "--enable-lt=" - (assoc-ref %build-inputs "libtool") - "/bin/libtool")) -(define cfg-flag:enable-racket - `(let ((racket (assoc-ref %build-inputs "racket"))) - (string-append "--enable-racket=" - racket - "/bin/racket"))) - -(define unpack-nanopass+stex - ;; Copied from chez-scheme. - ;; TODO: Eventually, we should refactor Chez Scheme - ;; enough to share more directly, so that we can make - ;; Racket's version of Chez avalable as a Guix package, - ;; e.g. for architectures not supported upstream. - ;; For now, we let Racket drive the Chez build process - ;; other than this step. - `(for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex"))) - + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) (define-public racket-minimal (package (name "racket-minimal") - (version "8.3") ; note: remember to also update racket! - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit (string-append "v" version)))) - (sha256 - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") - (file-name (git-file-name name version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) - (modules '((guix build utils))) - (snippet - (with-imported-modules '((guix build utils)) - #~(begin - ;; Unbundle Chez submodules. - (with-directory-excursion "racket/src/ChezScheme" - ;; Remove bundled libraries (copied from 'chez-scheme'). - (for-each delete-file-recursively - '("stex" - "nanopass" - "lz4" - "zlib"))) - ;; Unbundle libffi. - (delete-file-recursively "racket/src/bc/foreign/libffi")))))) - (inputs - `(;; common to all racket-minimal variants: - ("openssl" ,openssl) - ("sqlite" ,sqlite) - ("sh" ,bash-minimal) - ;; only for CS - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static"))) - (native-inputs - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) + (version (package-version (racket-vm-for-system))) + (source (package-source (racket-vm-for-system))) + ;; For cross-compilation, Matthew Flatt recommends reusing + ;; as much of `raco cross` as possible. So, put that off until + ;; we have a build system for Racket packages. + (inputs (list openssl sqlite (racket-vm-for-system))) (build-system gnu-build-system) (arguments - `(#:configure-flags - (list "--enable-csonly" - "--enable-libz" - "--enable-liblz4" - ,cfg-flag:enable-racket - ,cfg-flag:sh-for-rktio) - #:out-of-source? #true - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main distribution. - #:tests? #f - #:modules ((ice-9 match) - (guix build gnu-build-system) - (guix build utils)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (string-append (assoc-ref inputs "bootfiles") "/boot") - "boot")) - #t)) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f ,@(map (lambda (lib) - (string-append (assoc-ref inputs lib) - "/lib")) - '("openssl" - "sqlite")))) - (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - ,version - "/catalog/") - #f)))))) - #t)) - (add-before 'configure 'change-directory - (lambda _ - (chdir "racket/src") - #t)) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda* (#:key outputs #:allow-other-keys) - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append (assoc-ref outputs "out") - "/share/racket/pkgs")) - #t))))) + (list + #:configure-flags + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + (list #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib")))) + #:make-flags #~`("base") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (ice-9 match)) + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs configure-flags make-flags + #:allow-other-keys) + (let* ((vm-dir (search-input-directory inputs "opt/racket-vm")) + (racket (string-append vm-dir "/bin/racket"))) + (apply invoke + racket + #$make-installation-layer.rkt + `(,@(cond + ((false-if-exception + (search-input-file + inputs "etc/racket/config.rktd")) + => (lambda (file) + `("--parent" + ,(dirname (dirname (dirname file)))))) + (else + '())) + ,@configure-flags + ,vm-dir + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p (string-append #$output "/lib/racket/pkgs")) + (for-each (lambda (name) + (copy-recursively + (string-append "pkgs/" name) + (string-append #$output "/lib/racket/pkgs/" name))) + '("base" "racket-lib")))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket + (search-input-file inputs "/opt/racket-vm/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) (home-page "https://racket-lang.org") (synopsis "Racket without bundled packages such as DrRacket") (description @@ -254,280 +142,77 @@ (define (write-racket-hash alist) DrRacket IDE, are not included.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list asl2.0 expat)))) - - -(define-public racket-minimal-bc-3m - (hidden-package - (package - (inherit racket-minimal) - (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (delete "zlib" "zlib:static" "lz4" "lz4:static") - (prepend libffi ;; <- only for BC variants - ))) - (native-inputs - `(("libtool" ,libtool) - ("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc)))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) - ((#:configure-flags _ '()) - `(list "--enable-bconly" - ,cfg-flag:enable-racket - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)) - ((#:phases usual-phases) - `(modify-phases ,usual-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") - (description "The Racket BC (``before Chez'' or ``bytecode'') -implementation was the default before Racket 8.0. It uses a compiler written -in C targeting architecture-independent bytecode, plus a JIT compiler on most -platforms. Racket BC has a different C API and supports a slightly different -set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). - -This package is the normal implementation of Racket BC with a precise garbage -collector, 3M (``Moving Memory Manager'').") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list lgpl3+ asl2.0 expat))))) - - -(define-public racket-minimal-bc-cgc - (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs - (alist-delete "racket" (package-native-inputs racket-minimal-bc-3m))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:configure-flags _ '()) - `(list "--enable-cgcdefault" - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the -Racket CS implementation. - -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) - - -(define-public racket-bootstrap-chez-bootfiles - (hidden-package - (package - (inherit racket-minimal) - (name "racket-bootstrap-chez-bootfiles") - (inputs `()) - (native-inputs - `(("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-3m)) - ("stex" ,(package-source stex)) - ("nanopass" ,(package-source chez-nanopass)))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (delete 'configure) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (invoke (string-append (assoc-ref inputs "racket") - "/bin/racket") - "rktboot/main.rkt" - "--dest" (assoc-ref outputs "out"))) - #t)) - (delete 'check) - (delete 'install)))) - (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 -supported platforms.) - -The Racket package @code{cs-bootstrap} (part of the main Racket Git -repository) implements enough of a Chez Scheme simulation to load the Chez -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.") - (license (list asl2.0))))) - - -(define %installer-mirrors - ;; Source: - ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58 - ;; Matthew Flatt says: "note that many are commented out" - ;; INVARIANT: End with a trailing "/"! - '("https://mirror.racket-lang.org/installers/" - "https://www.cs.utah.edu/plt/installers/" - "https://plt.cs.northwestern.edu/racket-mirror/" - "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" - ;; Universität Tübingen is using a self-signed HTTPS certificate: - "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" - "https://racket.infogroep.be/" - )) - -(define %main-repo-main-distribution-pkgs - ;; These are the packages developed in the main Racket Git repository - ;; that are part of the main distribution. - '("at-exp-lib" - "base" - "compiler-lib" - ;; NOT "compiler-test" - "compiler" - "net-doc" - "net-lib" - ;; NOT "net-test" - "net" - ;; NOT "plt-services" - ;; NOT "racket-benchmarks" - ;; NOT "racket-build-guide" - "racket-doc" - "racket-index" - "racket-lib" - ;; NOT "racket-test-core" - ;; NOT "racket-test-extra" - ;; NOT "racket-test" - "zo-lib")) - + (license (list license:asl2.0 license:expat)))) (define-public racket (package (inherit racket-minimal) (name "racket") - (version (package-version racket-minimal)) ; needed for origin uri to work - (source - (origin - (method url-fetch) - (uri (map (lambda (base) - (string-append base version "/racket-src.tgz")) - %installer-mirrors)) - (sha256 - (base32 - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) - (snippet - #~(begin - (use-modules (guix build utils) - (ice-9 match) - (ice-9 regex)) - ;; unbundle minimal Racket - (for-each delete-file-recursively - '("collects" - "doc" - "etc" - "README" - "src")) - ;; unbundle package sources included elsewhere - (with-directory-excursion "share/pkgs" - (for-each delete-file-recursively - '#+%main-repo-main-distribution-pkgs)) - #t)))) + (source #f) (inputs - `(("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("glib" ,glib) - ("glu" ,glu) - ("gmp" ,gmp) - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("mpfr" ,mpfr) - ("pango" ,pango) - ("unixodbc" ,unixodbc) - ("libedit" ,libedit))) - (native-inputs - `(("racket" ,racket-minimal) - ("extend-layer" ,extend-layer) - ("main-repo" ,(package-source racket-minimal)))) + (list cairo + fontconfig + glib + glu + gmp + gtk+ ;; propagates gdk-pixbuf+svg + libjpeg-turbo + libpng + libx11 ;; ?? wayland ?? + mesa + mpfr + pango + unixodbc + libedit ;; TODO reconsider in light of expeditor and readline-gpl + racket-minimal ;; <-- TODO non-tethered layer + (racket-vm-for-system))) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'configure 'unpack-packages - (let ((unpack (assoc-ref %standard-phases 'unpack))) - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out")) - (pkgs-dir (string-append prefix "/share/racket/pkgs"))) - (mkdir-p pkgs-dir) - (copy-recursively - "share/links.rktd" - (string-append prefix "/share/racket/links.rktd")) - (copy-recursively "share/pkgs" pkgs-dir) - ;; NOTE: unpack changes the working directory - (unpack #:source (assoc-ref (or native-inputs inputs) - "main-repo")) - (for-each (lambda (pkg) - (define dest (string-append pkgs-dir "/" pkg)) - (mkdir-p dest) - (copy-recursively (string-append "pkgs/" pkg) - dest)) - ',%main-repo-main-distribution-pkgs) - #t)))) - (replace 'configure - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out"))) - (apply invoke - (string-append racket "/bin/racket") - (assoc-ref inputs "extend-layer") - racket - prefix - (map - (lambda (lib) - (string-append (assoc-ref inputs lib) "/lib")) - '("cairo" - "fontconfig" - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))) - #t))) - (replace 'build - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) - "racket") - "/bin/racket") - "--config" - (string-append (assoc-ref outputs "out") - "/etc/racket") - "-l" - "raco" - "setup") - #t)) - (delete 'install)) - ;; we still don't have these: - #:tests? #f)) + (substitute-keyword-arguments (package-arguments racket-minimal) + ((#:configure-flags _ '()) + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit")))))) + ((#:make-flags _ '()) + #~`("main-distribution")) + ((#:phases parent-phases #~%standard-phases) + #~(modify-phases #$parent-phases + (delete 'unpack) + (replace 'build + (lambda args + (mkdir-p (string-append #$output "/lib/racket/pkgs")) + (for-each + (match-lambda + ((name src) + (copy-recursively + src + (string-append #$output "/lib/racket/pkgs/" name)))) + '(#$@main-distribution-packages)))))))) (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -539,82 +224,899 @@ (define dest (string-append pkgs-dir "/" pkg)) DrRacket IDE, libraries for GUI and web programming, and implementations of languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) - -(define extend-layer +(define make-installation-layer.rkt (scheme-file - "extend-layer.rkt" + "make-installation-layer.rkt" `(module - extend-layer racket/base + make-installation-layer racket/base (require racket/cmdline racket/match racket/file + racket/port racket/list racket/pretty) - (define config-file-pth - "etc/racket/config.rktd") (define (build-path-string . args) (path->string (apply build-path args))) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) - (command-line - #:args (parent-layer prefix . lib-dir*) - (let* ([config - (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) - (hash-set* - config - main-key - (build-path-string prefix pth) - search-key - (list* #f - (hash-ref config - main-key - (build-path-string parent-layer pth)) - (filter values (hash-ref config search-key null)))))] - [config - (hash-set config - 'apps-dir - (build-path-string prefix "share/applications"))] - [config - ;; place new foreign lib-search-dirs before old - ;; foreign dirs, but after Racket layers - (let-values - ([(rkt extra) - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - (hash-ref config 'lib-search-dirs))]) - (hash-set config + (define tethered? #f) + (define parent #f) + (define extra-foreign-lib-search-dirs '()) + (define-values [vm-dir prefix] + (command-line + #:once-each + [("--tethered") "create a tethered layer" + (set! tethered? #t)] + [("--parent") dir "path of parent layer, if any" + (set! parent dir)] + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (vm-dir prefix) + (values vm-dir prefix))) + (let* ([config + (for/fold + ([config (file->value + (if parent + (build-path parent "etc/racket/config.rktd") + (build-path vm-dir "etc/config.rktd")))]) + ([spec + (in-list + '((lib-dir lib-search-dirs "lib/racket" "lib") + (share-dir share-search-dirs "share/racket" "share") + (links-file links-search-files + "lib/racket/links.rktd" + "share/links.rktd") + (pkgs-dir pkgs-search-dirs "lib/racket/pkgs" "share/pkgs") + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(bin-dir bin-search-dirs "bin" "bin") + (bin-dir bin-search-dirs "unused-untethered-bin" "bin") + (man-dir man-search-dirs "share/man" "share/man") + (doc-dir doc-search-dirs "share/doc/racket" "doc") + (include-dir include-search-dirs + "include/racket" + "include")))]) + (match-define (list main-key search-key pth vm-pth) spec) + (hash-set* + config + main-key + (build-path-string prefix pth) + search-key + (list* #f + (hash-ref config + main-key + (lambda () + (if parent + (build-path-string parent pth) + (build-path-string vm-dir vm-pth)))) + (filter values (hash-ref config search-key null)))))] + [config + (hash-update config 'lib-search-dirs - (append rkt - lib-dir* - extra)))] - [bin-dir - (hash-ref config 'bin-dir)] - [config - (hash-set* config - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) - (make-parent-directory* new-config-pth) - (call-with-output-file* - new-config-pth - (lambda (out) - (pretty-write config out)))))))) + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] + [config + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaroung Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] + [config + (cond + [tethered? + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(define bin-dir (hash-ref config 'bin-dir)) + (define bin-dir (build-path-string prefix "bin")) + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [else + config])]) + (define new-config-pth + (build-path prefix "etc/racket/config.rktd")) + (make-parent-directory* new-config-pth) + (call-with-output-file* + new-config-pth + (lambda (out) + (pretty-write config out))))))) + +(define-public main-distribution-packages + (let* ((%racket-version (package-version (racket-vm-for-system))) + (%racket-commit (string-append "v" %racket-version))) + (append-map + (match-lambda + ((source . pkgs) + (map (match-lambda + ((? string? name) + (list name (file-append source (string-append "/" name)))) + ((name ".") + (list name source)) + ((name rel-path) + (list name (file-append source (string-append "/" rel-path))))) + pkgs))) + `((,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/2d") + (commit %racket-commit))) + (sha256 (base32 + "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) + (file-name + (git-file-name "racket-2d" %racket-version))) + "2d" "2d-doc" "2d-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/algol60") + (commit %racket-commit))) + (sha256 (base32 + "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx")) + (file-name + (git-file-name "racket-algol60" %racket-version))) + ("algol60" ".")) + (,(package-source (racket-vm-for-system)) + ("at-exp-lib" "pkgs/at-exp-lib") + ("compiler" "pkgs/compiler") + ("compiler-lib" "pkgs/compiler-lib") + ("net" "pkgs/net") + ("net-doc" "pkgs/net-doc") + ("net-lib" "pkgs/net-lib") + ("racket-doc" "pkgs/racket-doc") + ("racket-index" "pkgs/racket-index") + ("sandbox-lib" "pkgs/sandbox-lib") + ("zo-lib" "pkgs/zo-lib")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/cext-lib") + (commit %racket-commit))) + (sha256 (base32 + "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341")) + (file-name (git-file-name "racket-cext-lib" %racket-version))) + "cext-lib" "dynext-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/class-iop") + (commit %racket-commit))) + (sha256 (base32 + "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l")) + (file-name (git-file-name "racket-class-iop" %racket-version))) + "class-iop-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/compatibility") + (commit "37f11132cdad7ef27386b68383d073f275d67c31"))) + (sha256 (base32 + "0bfqwscjpyi325br5pa6g62g9c8lq18a80zp5g3d2qzn3n3mi6x0")) + (file-name (git-file-name "racket-compatibility" %racket-version))) + "compatibility" "compatibility-doc" "compatibility-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/contract-profile") + (commit "95d980a076126b8e4e4284e912f2a7d9d3ab6860"))) + (sha256 (base32 + "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3")) + (file-name + (git-file-name "racket-contract-profile" %racket-version))) + ("contract-profile" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/data") + (commit "e32d012b394e32e102e8a9adfcc885bb0541ab51"))) + (sha256 (base32 + "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55")) + (file-name (git-file-name "racket-data" %racket-version))) + "data" "data-doc" "data-enumerate-lib" "data-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/datalog") + (commit "7d160a86451af8298093d07674a2eb0e1a0161a4"))) + (sha256 (base32 + "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp")) + (file-name (git-file-name "racket-datalog" %racket-version))) + ("datalog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/db") + (commit %racket-commit))) + (sha256 (base32 + "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5")) + (file-name (git-file-name "racket-db" %racket-version))) + "db" "db-doc" "db-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/deinprogramm") + (commit %racket-commit))) + (sha256 (base32 + "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd")) + (file-name (git-file-name "racket-deinprogramm" %racket-version))) + "deinprogramm" "deinprogramm-signature") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/distributed-places") + (commit %racket-commit))) + (sha256 (base32 + "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0")) + (file-name + (git-file-name "racket-distributed-places" %racket-version))) + "distributed-places" "distributed-places-doc" "distributed-places-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/draw") + (commit %racket-commit))) + (sha256 (base32 + "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly")) + (file-name (git-file-name "racket-draw" %racket-version))) + "draw" "draw-doc" "draw-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/drracket") + (commit %racket-commit))) + (sha256 (base32 + "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c")) + (file-name (git-file-name "racket-drracket" %racket-version))) + "drracket" + "drracket-plugin-lib" + "drracket-tool" + "drracket-tool-doc" + "drracket-tool-lib" + "drracket-tool-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/ds-store") + (commit "949ca63dd00522b3ab8aec2d71c543ece8266872"))) + (sha256 (base32 + "0ajr27kipp4dr1qlisaghsb3h7lhhjwrfw2r79b5myczsa1mp661")) + (file-name (git-file-name "racket-ds-store" %racket-version))) + "ds-store" "ds-store-doc" "ds-store-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eli-tester") + (commit "036e07d43a1f478ea1750881d5591d983ce1ffaf"))) + (sha256 (base32 + "0icx6wn14gjm8kdmq1jppqgq87sxkras4qb5xmdr6wigxafhjqyk")) + (file-name (git-file-name "racket-eli-tester" %racket-version))) + ("eli-tester" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eopl") + (commit %racket-commit))) + (sha256 (base32 + "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s")) + (file-name (git-file-name "racket-eopl" %racket-version))) + ("eopl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/errortrace") + (commit %racket-commit))) + (sha256 (base32 + "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip")) + (file-name (git-file-name "racket-errortrace" + (package-version (racket-vm-for-system))))) + "errortrace" "errortrace-doc" "errortrace-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/expeditor") + (commit %racket-commit))) + (sha256 (base32 + "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf")) + (file-name (git-file-name "racket-expeditor" %racket-version))) + "expeditor" "expeditor-doc" "expeditor-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/frtime") + (commit %racket-commit))) + (sha256 (base32 + "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5")) + (file-name (git-file-name "racket-frtime" %racket-version))) + ("frtime" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/future-visualizer") + (commit %racket-commit))) + (sha256 (base32 + "1758qq769m0r14xf64sl2ix2l9z340kvapar0j7s5kdg42lmvnhm")) + (file-name + (git-file-name "racket-future-visualizer" %racket-version))) + "future-visualizer" "future-visualizer-pict" "future-visualizer-typed") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/games") + + (commit %racket-commit))) + (sha256 (base32 + "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d")) + (file-name (git-file-name "racket-games" %racket-version))) + ("games" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui") + (commit %racket-commit))) + (sha256 (base32 + "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) + (file-name (git-file-name "racket-gui" %racket-version))) + "gui" "gui-doc" "gui-lib" "tex-table") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui-pkg-manager") + (commit %racket-commit))) + (sha256 (base32 + "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5")) + (file-name + (git-file-name "racket-gui-pkg-manager" %racket-version))) + "gui-pkg-manager-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/htdp") + (commit %racket-commit))) + (sha256 (base32 + "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl")) + (file-name (git-file-name "racket-htdp" %racket-version))) + "htdp" "htdp-doc" "htdp-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/html") + (commit %racket-commit))) + (sha256 (base32 + "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x")) + (file-name (git-file-name "racket-html" %racket-version))) + "html" "html-doc" "html-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/icons") + (commit %racket-commit))) + (sha256 (base32 + "1s5a6j11fg3fdr6b7vm2q7q178d7q8b8igy73bs211r27qrd1gg7")) + (file-name (git-file-name "racket-icons" %racket-version))) + ("icons" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/images") + (commit %racket-commit))) + (sha256 (base32 + "0rpjxqw34bq5m08kh1ldl1mr7s9z1lyydxxcyzb292kqh9qiqvfl")) + (file-name (git-file-name "racket-images" %racket-version))) + "images" "images-doc" "images-gui-lib" "images-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/lazy") + (commit %racket-commit))) + (sha256 (base32 + "176ylzgbdsbmqknpihaz519afq71pyjkv1h87j5v8jfbpbddyfsf")) + (file-name (git-file-name "racket-lazy" %racket-version))) + ("lazy" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/macro-debugger") + (commit %racket-commit))) + (sha256 (base32 + "14hyrwbkffr61fk44l02xb47bhv5zccw0ymaa9kxld86hvyqhqbm")) + (file-name (git-file-name "racket-macro-debugger" %racket-version))) + "macro-debugger" "macro-debugger-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/main-distribution") + (commit %racket-commit))) + (sha256 (base32 + "0m2n9s32s8a4a2gn4ywrm9l8jycdm5ayi5w9kh5wchhrrw7qzq7y")) + (file-name + (git-file-name "racket-main-distribution" %racket-version))) + ("main-distribution" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/make") + (commit %racket-commit))) + (sha256 (base32 + "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa")) + (file-name (git-file-name "racket-make" %racket-version))) + ("make" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/math") + (commit %racket-commit))) + (sha256 (base32 + "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac")) + (file-name (git-file-name "racket-math" %racket-version))) + "math" "math-doc" "math-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mysterx") + (commit %racket-commit))) + (sha256 (base32 + "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48")) + (file-name (git-file-name "racket-mysterx" %racket-version))) + ("mysterx" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzcom") + (commit %racket-commit))) + (sha256 (base32 + "0rc9pfj7gwm5azghqvcibz6si1x5s2v8mr2yngk7ssq9gzfbi6a4")) + (file-name (git-file-name "racket-mzcom" %racket-version))) + ("mzcom" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzscheme") + (commit %racket-commit))) + (sha256 (base32 + "192c52zi726h5wjamxrhivjw2waq1im0zpyxhbrkrxknm8x84bs9")) + (file-name (git-file-name "racket-mzscheme" %racket-version))) + "mzscheme" "mzscheme-doc" "mzscheme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RenaissanceBug/racket-cookies") + (commit %racket-commit))) + (sha256 (base32 + "0k0hifxhywl5c3hjcaiizc098dpyk001d981p572gly116yvjxc1")) + (file-name + (git-file-name "RenaissanceBug-racket-cookies" %racket-version))) + "net-cookies" "net-cookies-doc" "net-cookies-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stamourv/optimization-coach") + (commit %racket-commit))) + (sha256 (base32 + "0b27sw48d7rhz0hin88c7rbr9vpg1c23sn82nd4jkmq54h6gasr1")) + (file-name + (git-file-name "stamourv-optimization-coach" %racket-version))) + ("optimization-coach" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/option-contract") + (commit %racket-commit))) + (sha256 (base32 + "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk")) + (file-name + (git-file-name "racket-option-contract" %racket-version))) + "option-contract" "option-contract-doc" "option-contract-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/parser-tools") + (commit %racket-commit))) + (sha256 (base32 + "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3")) + (file-name (git-file-name "racket-parser-tools" %racket-version))) + "parser-tools" "parser-tools-doc" "parser-tools-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pconvert") + (commit %racket-commit))) + (sha256 (base32 + "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1")) + (file-name (git-file-name "racket-pconvert" %racket-version))) + "pconvert-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict") + (commit %racket-commit))) + (sha256 (base32 + "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x")) + (file-name (git-file-name "racket-pict" %racket-version))) + "pict" "pict-doc" "pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict-snip") + (commit %racket-commit))) + (sha256 (base32 + "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x")) + (file-name (git-file-name "racket-pict-snip" %racket-version))) + "pict-snip" "pict-snip-doc" "pict-snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/picturing-programs") + (commit %racket-commit))) + (sha256 (base32 + "1g6xr39hx1j03gb3d4dljm3v91xcj2gfpq3dgy5xvplzr6cmmxgr")) + (file-name + (git-file-name "racket-picturing-programs" %racket-version))) + ("picturing-programs" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plai") + (commit %racket-commit))) + (sha256 (base32 + "0i983sh0r0zm2ng4j44m5aw9669kh5fhp91bzpc9jm280rfcqvyl")) + (file-name (git-file-name "racket-plai" %racket-version))) + "plai" "plai-doc" "plai-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/planet") + (commit %racket-commit))) + (sha256 (base32 + "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9")) + (file-name (git-file-name "racket-planet" %racket-version))) + "planet" "planet-doc" "planet-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plot") + (commit %racket-commit))) + (sha256 (base32 + "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7")) + (file-name (git-file-name "racket-plot" %racket-version))) + "plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/preprocessor") + (commit %racket-commit))) + (sha256 (base32 + "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg")) + (file-name (git-file-name "racket-preprocessor" %racket-version))) + ("preprocessor" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/profile") + (commit %racket-commit))) + (sha256 (base32 + "179i86lyby29nywz60l4vnadi02w8b12h7501nm5h5g4pq9jjmbb")) + (file-name (git-file-name "racket-profile" %racket-version))) + "profile" "profile-doc" "profile-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Metaxal/quickscript") + (commit %racket-commit))) + (sha256 (base32 + "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + (file-name (git-file-name "Metaxal-quickscript" %racket-version))) + ("quickscript" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r5rs") + (commit %racket-commit))) + (sha256 (base32 + "1g3cysj7z88r38vkzvi8g2fb2hn4yg1fdhy5smxw303jxgl3inp6")) + (file-name (git-file-name "racket-r5rs" %racket-version))) + "r5rs" "r5rs-doc" "r5rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r6rs") + (commit %racket-commit))) + (sha256 (base32 + "0b1ymzdp10r0flw2acbidjsh5ma1pm5hy54jss37sxf89z3xbvm4")) + (file-name (git-file-name "racket-r6rs" %racket-version))) + "r6rs" "r6rs-doc" "r6rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeapostrophe/racket-cheat") + (commit %racket-commit))) + (sha256 (base32 + "06wcj558rzkbl2bwkmikyspya9v1f4iwlzwnwxpkc33h2xapwabr")) + (file-name + (git-file-name "jeapostrophe-racket-cheat" %racket-version))) + ("racket-cheat" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racklog") + (commit %racket-commit))) + (sha256 (base32 + "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb")) + (file-name (git-file-name "racket-racklog" %racket-version))) + ("racklog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/rackunit") + (commit %racket-commit))) + (sha256 (base32 + "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p")) + (file-name (git-file-name "racket-rackunit" %racket-version))) + "rackunit" + "rackunit-doc" + "rackunit-gui" + "rackunit-lib" + "rackunit-plugin-lib" + "rackunit-typed" + "schemeunit" + "testing-util-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/readline") + (commit %racket-commit))) + (sha256 (base32 + "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn")) + (file-name (git-file-name "racket-readline" %racket-version))) + "readline" "readline-doc" "readline-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/realm") + (commit %racket-commit))) + (sha256 (base32 + "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi")) + (file-name (git-file-name "racket-realm" %racket-version))) + ("realm" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/redex") + (commit %racket-commit))) + (sha256 (base32 + "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f")) + (file-name (git-file-name "racket-redex" %racket-version))) + "redex" + "redex-benchmark" + "redex-doc" + "redex-examples" + "redex-gui-lib" + "redex-lib" + "redex-pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sasl") + (commit %racket-commit))) + (sha256 (base32 + "0ibh4wb4gn8pggx6gkv4vk4d6rwzn5nrvjibhvkzhaynf6lhb824")) + (file-name (git-file-name "racket-sasl" %racket-version))) + "sasl" "sasl-doc" "sasl-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scheme-lib") + (commit %racket-commit))) + (sha256 (base32 + "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x")) + (file-name (git-file-name "racket-scheme-lib" %racket-version))) + ("scheme-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scribble") + (commit %racket-commit))) + (sha256 (base32 + "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm")) + (file-name (git-file-name "racket-scribble" %racket-version))) + "scribble" + "scribble-doc" + "scribble-html-lib" + "scribble-lib" + "scribble-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/serialize-cstruct-lib") + (commit %racket-commit))) + (sha256 (base32 + "1rq3n1fa7ldjwx3lrh9ybhig7jlsw1crpzyklbzp3xqdw6jymfnz")) + (file-name + (git-file-name "racket-serialize-cstruct-lib" %racket-version))) + ("serialize-cstruct-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sgl") + (commit %racket-commit))) + (sha256 (base32 + "0nkymhdyjrwi5h199j4w5zh7y3x3ai42gsiwxzh0hy7yqrqqg9zv")) + (file-name (git-file-name "racket-sgl" %racket-version))) + ("sgl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/shell-completion") + (commit %racket-commit))) + (sha256 (base32 + "04m144gy2mp4fiq6rcbf12wjr8mws8k9scfhg9lc38vqppp4lxsj")) + (file-name + (git-file-name "racket-shell-completion" %racket-version))) + ("shell-completion" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/simple-tree-text-markup") + (commit %racket-commit))) + (sha256 (base32 + "0fyd9gfz6bnv0m1901wv5mnhc05rm8hw9i6ddrqx33hs6qsg2zqr")) + (file-name + (git-file-name "racket-simple-tree-text-markup" %racket-version))) + "simple-tree-text-markup" + "simple-tree-text-markup-doc" + "simple-tree-text-markup-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slatex") + (commit "47e1d3e3e33d826bc2b26f9e8998eb235b23a9a5"))) + (sha256 (base32 + "0pkm2isbbdk63slrbsxcql7rr0wdrw5kapw1xq4ps5k8dhlzv8x0")) + (file-name (git-file-name "racket-slatex" %racket-version))) + ("slatex" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slideshow") + (commit %racket-commit))) + (sha256 (base32 + "1znv1i2d0610hhy71q932xy7wka00q3q50in1xfnk8ibg7nzkagm")) + (file-name (git-file-name "racket-slideshow" %racket-version))) + "slideshow" "slideshow-doc" "slideshow-exe" "slideshow-lib" + "slideshow-plugin") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/snip") + (commit %racket-commit))) + (sha256 (base32 + "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj")) + (file-name (git-file-name "racket-snip" %racket-version))) + "snip" "snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/typed-racket") + (commit %racket-commit))) + (sha256 (base32 + "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv")) + (file-name (git-file-name "racket-typed-racket" %racket-version))) + "source-syntax" + "typed-racket" + "typed-racket-compatibility" + "typed-racket-doc" + "typed-racket-lib" + "typed-racket-more") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/srfi") + ;; Includes an FSDG fix: return to %racket-commit in 8.5. + ;; See . + (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) + (sha256 (base32 + "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) + ;; Use the relevant version for srfi-doc and srfi-lib, + ;; since we're using a newer commit than the v8.4 tag. + (file-name (git-file-name "racket-srfi" "1.1"))) + "srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/string-constants") + (commit %racket-commit))) + (sha256 (base32 + "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6")) + (file-name + (git-file-name "racket-string-constants" %racket-version))) + "string-constants" "string-constants-doc" "string-constants-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/swindle") + (commit %racket-commit))) + (sha256 (base32 + "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67")) + (file-name (git-file-name "racket-swindle" %racket-version))) + ("swindle" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/syntax-color") + (commit %racket-commit))) + (sha256 (base32 + "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp")) + (file-name (git-file-name "racket-syntax-color" %racket-version))) + "syntax-color" "syntax-color-doc" "syntax-color-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/trace") + (commit %racket-commit))) + (sha256 (base32 + "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia")) + (file-name (git-file-name "racket-trace" %racket-version))) + ("trace" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/unix-socket") + (commit %racket-commit))) + (sha256 (base32 + "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y")) + (file-name (git-file-name "racket-unix-socket" %racket-version))) + "unix-socket" "unix-socket-doc" "unix-socket-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/web-server") + (commit %racket-commit))) + (sha256 (base32 + "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn")) + (file-name (git-file-name "racket-web-server" %racket-version))) + "web-server" "web-server-doc" "web-server-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/wxme") + (commit %racket-commit))) + (sha256 (base32 + "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b")) + (file-name (git-file-name "racket-wxme" %racket-version))) + "wxme" "wxme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/xrepl") + (commit %racket-commit))) + (sha256 (base32 + "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3")) + (file-name (git-file-name "racket-xrepl" %racket-version))) + "xrepl" "xrepl-doc" "xrepl-lib"))))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 01:50:13 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 06:50:13 +0000 Received: from localhost ([127.0.0.1]:53201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKx5o-0000Fq-QY for submit@debbugs.gnu.org; Fri, 18 Feb 2022 01:50:12 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:59400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKx5l-0000Fa-US for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 01:50:12 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K0Mkv4Vfhz3xZg; Fri, 18 Feb 2022 07:49:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645167000; bh=Ft5N0DmiHtuZwYGKRte2h3W+vqeedJZc9jpg8xg6EIs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=nkB2Lv4hWY6ZKUews8jyV5PFiay/E4Rcx1A8UFK0RLR7XZtNco1V+PJGr4PyhUu6S p0GN2UcMIL6f/ytUzwNtk91mKOua9srJcb1UUNQLC3LULRT3ddmhBUwYtMvpH/Wrv0 f4qiCVcGZXDJqrfjXJw07LxWf52Sa+t8HwQdxEvo= Message-ID: <20ea5c875903418d71731643c96bff3f1d15fd23.camel@ist.tugraz.at> Subject: Re: [PATCH v2 04/15] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Fri, 18 Feb 2022 07:49:59 +0100 In-Reply-To: <20220217205048.967383-5-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> <20220217205048.967383-5-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > * gnu/packages/chez-and-racket-bootstrap.scm (chez-machine- > >nonthreaded, > chez-machine->threaded, chez-machine->nix-system, nix-system->chez- > machine, > chez-upstream-features-for-system): New private functions. > (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private > constants. > (chez-scheme)[supported-systems]: Compute based on > 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. AFAIK we don't distinguish between private/public and function (should be "procedure"), constant or variable. It's all "variable". Otherwise LGTM. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 01:57:26 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 06:57:26 +0000 Received: from localhost ([127.0.0.1]:53216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxCo-0000Qd-AR for submit@debbugs.gnu.org; Fri, 18 Feb 2022 01:57:26 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:8135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxCm-0000QW-Os for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 01:57:25 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K0MvP6M4Nz3wDL; Fri, 18 Feb 2022 07:57:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645167442; bh=G026ugQIbhHv9qDv1+DlqQQUtK26hn8RL9mGyR4WSYg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=BmsRsnD/oVna580UI2yuYSmjP3xVE8vZVwNPD+0y1jMOVcxJFdykVKeP0dEQ2W5A0 DtEBwjBUPKVDmuv3eJ8J8sw7IOPKnBjDHDHwIvNsbQ5qcUC2iYB9kWHDTKW00+hhoU 0yijWIDuymj4dmfe6HfVzsZSWMHljdACcwileCqM= Message-ID: <93433d1f9a527be2ede5da4443fbbd914cc938d5.camel@ist.tugraz.at> Subject: Re: [PATCH v2 01/15] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Fri, 18 Feb 2022 07:57:22 +0100 In-Reply-To: <20220217205048.967383-2-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> <20220217205048.967383-2-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > * gnu/packages/chez.scm (nanopass, stex, chez-scheme): Move to ... > * gnu/packages/chez-and-racket-bootstrap.scm: ... this new file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. > * gnu/packages/emacs-xyz.scm: Adjust imports accordingly. > * gnu/packages/loko.scm: Likewise. > * gnu/packages/racket.scm: Likewise. For the record, why is chez-scheme moved to bootstrap? W.r.t. the adjusted imports it might be a good idea to re-export it from chez.scm instead, but I'd need confirmation from the others on that. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 02:08:52 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 07:08:52 +0000 Received: from localhost ([127.0.0.1]:53255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxNs-0000jq-19 for submit@debbugs.gnu.org; Fri, 18 Feb 2022 02:08:52 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:18736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxNp-0000jh-My for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 02:08:50 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K0N8Z1fPRz1LZWn; Fri, 18 Feb 2022 08:08:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4K0N8Z1fPRz1LZWn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645168126; bh=3kkHg/M1tYByj7obvgfzsPQgoH+XvJM7fwEvNpI5DbI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=RjKwidRNt7J1eA7+4U9fzGCOdMjA20ThALulVU2w848TQMtxcNbb6Q1DH0QYx93gV +ZaHJXrlrRSFSV6uBCDBGJwTsMfHYbWn5MDHTqFbqA2JfKZ7ES7N/3LrSsMrdnKv97 tj/Vck4tdcNehlkPevOQT0zI83Pwwtr/1xtIqIro= Message-ID: <72bb2b48f7c2fae26c60db8c13cff34a0b01347b.camel@ist.tugraz.at> Subject: Re: [PATCH v2 08/15] gnu: chez-scheme: Explicitly package bootstrap bootfiles. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Fri, 18 Feb 2022 08:08:46 +0100 In-Reply-To: <20220217205048.967383-9-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> <20220217205048.967383-9-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > +(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 This TODO might be moved one line up, since you wouldn't be able to do cross-compilation with just copy-build-system, would you? > +    (arguments > +     (list #:install-plan > +           #~`(("boot/" "lib/chez-scheme-bootfiles")))) > +    (supported-systems > +     ;; Upstream only distributes pre-built bootfiles for > +     ;; arm32le and t?(i3|a6)(le|nt|osx) > +     (filter (lambda (system) > +               (let ((machine (and=> (nix-system->chez-machine > system) > +                                     chez-machine->nonthreaded))) > +                 (or (equal? "arm32le" machine) > +                     (and machine > +                          (member (substring machine 0 2) '("i3" > "a6")) > +                          (or-map (cut string-suffix? <> machine) > +                                  '("le" "nt" "osx")))))) > +             %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 upsream > +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."))) > + Now to explain the difference between my suggestion and what you implemented. Mine would be to (define-public (chez-scheme-bootstrap-bootfiles chez-scheme) ...) where ... is the code you already have. This would not only work for other chez-schemes than the one we have packaged, but might also make it possible to cross module boundaries, i.e. keep chez-scheme in chez.scm. WDYT? From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 02:15:36 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 07:15:36 +0000 Received: from localhost ([127.0.0.1]:53278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxUO-0000ud-AA for submit@debbugs.gnu.org; Fri, 18 Feb 2022 02:15:36 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:11880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxUM-0000uT-Of for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 02:15:35 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K0NJN350dz1LB1y; Fri, 18 Feb 2022 08:15:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4K0NJN350dz1LB1y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645168532; bh=EJotFG4S8rsrW651CYJU/8nnillTC6a/lrDS2ehnQyo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Jlx8vd234sPmRtkW7AVMf/UnqB1oOJ5t/xWPG2XWdGvvXuigsKT8P4RASAkdFbh5m IgciFzeZMOPLNdlN43ADC2gl1iEybQxJ3DYOYTp9nNuxnO5rJOVhZJUuq9FVjLk04A iKXM/yKTxM71CwYoUj+Locotu29SIDaW/qmJU65M= Message-ID: <9059f062eff0dc9c9f911797007f580289bb43e6.camel@ist.tugraz.at> Subject: Re: [PATCH v2 05/15] gnu: chez-scheme: Use new package style. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Fri, 18 Feb 2022 08:15:32 +0100 In-Reply-To: <20220217205048.967383-6-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> <20220217205048.967383-6-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[inputs, > native-inputs]: Remove labels. > [arguments]: Use G-expressions. > <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. If nothing else is preventing you from doing so, I'd cut this patch in two here. Also > (nanopass, stex): Make public as a temporary workaround for Racket. You might want to make them public at the point of moving them to bootstrap and then hide them once you're done. If you want to prevent the user from installing them, use hidden-package instead. > * gnu/packages/racket/scm .scm > (racket-bootstrap-chez-bootfiles)[native-inputs]: > Update accordingly. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 02:21:31 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 07:21:31 +0000 Received: from localhost ([127.0.0.1]:53290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxa6-000141-Oc for submit@debbugs.gnu.org; Fri, 18 Feb 2022 02:21:31 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:38699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxa5-00013t-AQ for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 02:21:29 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K0NRB1mkVz3xZB; Fri, 18 Feb 2022 08:21:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645168886; bh=aCQS7FLdpSw7yvRSvZvyECcN10PD3vGCOigRkKzH6po=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=WAZymMv/ZEmTu2QaBFOSwS2UiePJqcUXiaQMokW6AaGwNLmA9/xEc0pnaGGNZLUpU yvDj+CFPrNZMZNAkM+4rMmu9i+DjD3qxHIFFICY/hDoHeAnw3iXnosou5UaNVql8ey X+QwDM0YQ0kVvp7KNIK3YOuLw0i/425awtcqoZE4= Message-ID: <845a930a8d61fabd7227c57e8e35f926dceefecb.camel@ist.tugraz.at> Subject: Re: [PATCH v2 09/15] gnu: Add racket-vm-cgc. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Fri, 18 Feb 2022 08:21:25 +0100 In-Reply-To: <20220217205048.967383-10-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> <20220217205048.967383-10-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > [...] > +(define-public racket-vm-cgc > +  ;; Eventually, it may make sense for some vm packages to not be > hidden, > +  ;; but this one is especially likely to remain hidden. > +  (hidden-package > +   (package > +     (name "racket-vm-cgc") > +     (version "8.4") > +     ;; ^ Remember to also update the version of > +     ;;   chez-scheme-for-racket-bootstrap-bootfiles > +     (source > +      (origin > +        (method git-fetch) > +        (uri (git-reference > +              (url "https://github.com/racket/racket") > +              (commit (string-append "v" version)))) > +        (sha256 > +         (base32 > "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) > +        (file-name (git-file-name "racket" version)) > +        (patches (search-patches "racket-minimal-sh-via-rktio.patch" > +                                 ;; Remove by Racket 8.5: > [...] As with the Scheme bootstrap chain, if this all depends on the same racket origin, you might want to inherit from the racket package or just  (define %racket-version "8.4") (define %racket-origin (origin ...)) and use them across the packages. Making them procedures to pass version and source to would also work imo. Cheers From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 02:39:00 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 07:39:00 +0000 Received: from localhost ([127.0.0.1]:53326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxr1-0001Ul-Lu for submit@debbugs.gnu.org; Fri, 18 Feb 2022 02:39:00 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:20833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKxqz-0001Uc-Ev for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 02:38:59 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K0NqK3yfwz1LXsR; Fri, 18 Feb 2022 08:38:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4K0NqK3yfwz1LXsR DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645169933; bh=ktT9QU4MzIYwm3BSlw5R2d5OGAhC2u5IxOnB86EnEyE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=kBN7FmiK26/6ofeQtLRT8cdpKDZRhD74ZT1brtrGg3hvtEcTYAmqmGeScL4HUVzSE DJra2yde4rF0Uz51xLWWSeEjcLKOsnUL6u1BdW7Rj7jlHoJn+M8+WKpEDxC043lodR +js/SL33y0dgZeac04tx5giYsb87qHoGM76NJd4Y= Message-ID: Subject: Re: [PATCH v2 15/15] gnu: racket: Update to 8.4. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Fri, 18 Feb 2022 08:38:52 +0100 In-Reply-To: <20220217205048.967383-16-philip@philipmcgrath.com> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-1-philip@philipmcgrath.com> <20220217205048.967383-16-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > -;; Commentary: > -;; > -;; Here's how bootstrapping minimal Racket works: > -;; > -;;   - Racket BC [CGC] can be built with only a C compiler (except > for > -;;     one caveat discussed below). > -;;   - 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 > -;;     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. > -;; > -;; So, we build CGC to build 3M to build bootfiles and CS. > -;; > -;; 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 > -;; README file applies to all such subsystems: > -;; > -;;     The Racket version must be practically the same as the > current Racket > -;;     verson, although it can be the Racket BC implementation > (instead of > -;;     the Racket CS implementation). > -;; > -;;     Unlike Chez Scheme boot files, the files generated in > "schemified" > -;;     are human-readable and -editable Scheme code. That provides a > way > -;;     out of bootstrapping black holes, even without BC. > -;; > -;; However, other Racket subsystems implemented in Racket for Racket > CS > -;; use older C implementations for Racket BC, whereas the reader, > expander, > -;; and module system were completely replaced with the Racket > implementation > -;; as of Racket 7.0. > -;; > -;; For Racket BC, the compiled "linklet" s-expressions (primitive > modules) > -;; are embeded in C as a static string constant. Eventually, they > are further > -;; compiled by the C-implemented Racket BC bytecode and JIT > compilers. > -;; (On platforms where Racket BC's JIT is not supported, yet another > compiler > -;; instead compiles the linklets to C code, but this is not a > bootstrapping > -;; issue.) I think it'd be clearer if this commentary was moved along with the bootstrapping code. Is there a reason why we can't use (racket-vm-for- system) before updating Racket to 8.4? This looks like another of those "two things at once" patches.   >  (define-public racket-minimal >    (package >      (name "racket-minimal") > -    (version "8.3")            ; note: remember to also update > racket! > -    (source > -     (origin > -       (method git-fetch) > -       (uri (git-reference > -             (url "https://github.com/racket/racket") > -             (commit (string-append "v" version)))) > -       (sha256 > -        "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") > -       (file-name (git-file-name name version)) > -       (patches (search-patches "racket-minimal-sh-via- > rktio.patch")) > -       (modules '((guix build utils))) > -       (snippet > -        (with-imported-modules '((guix build utils)) > -          #~(begin > -              ;; Unbundle Chez submodules. > -              (with-directory-excursion "racket/src/ChezScheme" > -                ;; Remove bundled libraries (copied from 'chez- > scheme'). > -                (for-each delete-file-recursively > -                          '("stex" > -                            "nanopass" > -                            "lz4" > -                            "zlib"))) > -              ;; Unbundle libffi. > -              (delete-file-recursively > "racket/src/bc/foreign/libffi")))))) > -    (inputs > -     `(;; common to all racket-minimal variants: > -       ("openssl" ,openssl) > -       ("sqlite" ,sqlite) > -       ("sh" ,bash-minimal) > -       ;; only for CS > -       ("zlib" ,zlib) > -       ("zlib:static" ,zlib "static") > -       ("lz4" ,lz4) > -       ("lz4:static" ,lz4 "static"))) > -    (native-inputs > -     `(("bootfiles" ,racket-bootstrap-chez-bootfiles) > -       ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) > +    (version (package-version (racket-vm-for-system))) > +    (source (package-source (racket-vm-for-system))) > +    ;; For cross-compilation, Matthew Flatt recommends reusing > +    ;; as much of `raco cross` as possible. So, put that off until > +    ;; we have a build system for Racket packages. > +    (inputs (list openssl sqlite (racket-vm-for-system))) As outlined earlier, I believe Racket should define its version, not racket-vm-for-system. > [...] > (define-public racket >    (package >      (inherit racket-minimal) >      (name "racket") > -    (version (package-version racket-minimal)) ; needed for origin > uri to work > -    (source > -     (origin > -       (method url-fetch) > -       (uri (map (lambda (base) > -                   (string-append base version "/racket-src.tgz")) > -                 %installer-mirrors)) > -       (sha256 > -        (base32 > -         "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) > -       (snippet > -        #~(begin > -            (use-modules (guix build utils) > -                         (ice-9 match) > -                         (ice-9 regex)) > -            ;; unbundle minimal Racket > -            (for-each delete-file-recursively > -                      '("collects" > -                        "doc" > -                        "etc" > -                        "README" > -                        "src")) > -            ;; unbundle package sources included elsewhere > -            (with-directory-excursion "share/pkgs" > -              (for-each delete-file-recursively > -                        '#+%main-repo-main-distribution-pkgs)) > -            #t)))) > +    (source #f) Why? >      (inputs > -     `(("cairo" ,cairo) > -       ("fontconfig" ,fontconfig) > -       ("glib" ,glib) > -       ("glu" ,glu) > -       ("gmp" ,gmp) > -       ("gtk+" ,gtk+)                   ; propagates gdk-pixbuf+svg > -       ("libjpeg" ,libjpeg-turbo) > -       ("libpng" ,libpng) > -       ("libx11" ,libx11) > -       ("mesa" ,mesa) > -       ("mpfr" ,mpfr) > -       ("pango" ,pango) > -       ("unixodbc" ,unixodbc) > -       ("libedit" ,libedit))) > -    (native-inputs > -     `(("racket" ,racket-minimal) > -       ("extend-layer" ,extend-layer) > -       ("main-repo" ,(package-source racket-minimal)))) > +     (list cairo > +           fontconfig > +           glib > +           glu > +           gmp > +           gtk+ ;; propagates gdk-pixbuf+svg > +           libjpeg-turbo > +           libpng > +           libx11 ;; ?? wayland ?? > +           mesa > +           mpfr > +           pango > +           unixodbc > +           libedit ;; TODO reconsider in light of expeditor and > readline-gpl > +           racket-minimal ;; <-- TODO non-tethered layer > +           (racket-vm-for-system))) >      (arguments > -     `(#:phases > -       (modify-phases %standard-phases > -         (add-before 'configure 'unpack-packages > -           (let ((unpack (assoc-ref %standard-phases 'unpack))) > -             (lambda* (#:key  native-inputs inputs outputs #:allow- > other-keys) > -               (let* ((racket (assoc-ref (or native-inputs inputs) > "racket")) > -                      (prefix (assoc-ref outputs "out")) > -                      (pkgs-dir (string-append prefix > "/share/racket/pkgs"))) > -                 (mkdir-p pkgs-dir) > -                 (copy-recursively > -                  "share/links.rktd" > -                  (string-append prefix "/share/racket/links.rktd")) > -                 (copy-recursively "share/pkgs" pkgs-dir) > -                 ;; NOTE: unpack changes the working directory > -                 (unpack #:source (assoc-ref (or native-inputs > inputs) > -                                             "main-repo")) > -                 (for-each (lambda (pkg) > -                             (define dest (string-append pkgs-dir > "/" pkg)) > -                             (mkdir-p dest) > -                             (copy-recursively (string-append > "pkgs/" pkg) > -                                               dest)) > -                           ',%main-repo-main-distribution-pkgs) > -                 #t)))) > -         (replace 'configure > -           (lambda* (#:key native-inputs inputs outputs #:allow- > other-keys) > -             (let ((racket (assoc-ref (or native-inputs inputs) > "racket")) > -                   (prefix (assoc-ref outputs "out"))) > -               (apply invoke > -                      (string-append racket "/bin/racket") > -                      (assoc-ref inputs "extend-layer") > -                      racket > -                      prefix > -                      (map > -                       (lambda (lib) > -                         (string-append (assoc-ref inputs lib) > "/lib")) > -                       '("cairo" > -                         "fontconfig" > -                         "glib" > -                         "glu" > -                         "gmp" > -                         "gtk+" > -                         "libjpeg" > -                         "libpng" > -                         "libx11" > -                         "mesa" > -                         "mpfr" > -                         "pango" > -                         "unixodbc" > -                         "libedit"))) > -               #t))) > -         (replace 'build > -           (lambda* (#:key native-inputs inputs outputs #:allow- > other-keys) > -             (invoke (string-append (assoc-ref (or native-inputs > inputs) > -                                               "racket") > -                                    "/bin/racket") > -                     "--config" > -                     (string-append (assoc-ref outputs "out") > -                                    "/etc/racket") > -                     "-l" > -                     "raco" > -                     "setup") > -             #t)) > -         (delete 'install)) > -       ;; we still don't have these: > -       #:tests? #f)) > +     (substitute-keyword-arguments (package-arguments racket- > minimal) > +       ((#:configure-flags _ '()) > +        #~`("--tethered" > +            "--extra-foreign-lib-search-dirs" > +            ,(format #f "~s" > +                     '(#$@(map (lambda (name) > +                                 (cond > +                                  ((this-package-input name) > +                                   => (cut file-append <> "/lib")) > +                                  (else > +                                   (raise-exception > +                                    (make-exception > +                                     (make-assertion-failure) > +                                     (make-exception-with-message > +                                      "missing input to the 'racket' > package") > +                                     (make-exception-with-irritants > +                                      (list name))))))) > +                               '("cairo" > +                                 "fontconfig-minimal" ;; aka > fontconfig > +                                 "glib" > +                                 "glu" > +                                 "gmp" > +                                 "gtk+" > +                                 "libjpeg-turbo" > +                                 "libpng" > +                                 "libx11" > +                                 "mesa" > +                                 "mpfr" > +                                 "pango" > +                                 "unixodbc" > +                                 "libedit")))))) > +       ((#:make-flags _ '()) > +        #~`("main-distribution")) > +       ((#:phases parent-phases #~%standard-phases) > +        #~(modify-phases #$parent-phases > +            (delete 'unpack) > +            (replace 'build > +              (lambda args > +                (mkdir-p (string-append #$output > "/lib/racket/pkgs")) > +                (for-each > +                 (match-lambda > +                   ((name src) > +                    (copy-recursively > +                     src > +                     (string-append #$output "/lib/racket/pkgs/" > name)))) > +                 '(#$@main-distribution-packages)))))))) >      (synopsis "Programmable programming language in the Scheme > family") >      (description >       "Racket is a general-purpose programming language in the Scheme > family, > @@ -539,82 +224,899 @@ (define dest (string-append pkgs-dir "/" pkg)) >  DrRacket IDE, libraries for GUI and web programming, and > implementations of >  languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and > Datalog."))) This looks like a very weird way of phrasing union-build. Is there a reason to do this rather than union-build? Cheers From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 17:21:22 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 22:21:22 +0000 Received: from localhost ([127.0.0.1]:56506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLBcv-0008HF-M9 for submit@debbugs.gnu.org; Fri, 18 Feb 2022 17:21:22 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:54613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLBcu-0008Gu-H1 for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 17:21:20 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 6D11E58015D; Fri, 18 Feb 2022 17:21:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 18 Feb 2022 17:21:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=sE4QBKUn8VDGSV 9/0LKFHlxyf8yJ+biR5V3LiGt2DVw=; b=s9flV5MglHGTHukztR8d2nhQGJht1y jS857euoK4et30AG2jPzVhbiSLtagyYUhKOnviYpb4mVqL3BdO7NUH5HhmkSvUJD /zyFjM+KczPTlARLAdgM0AQvLYAG1lxl3Wc8L52Mhy+VZn53MI9hysDwg6AcWTbm VxyEzDcdQilP0iOyEk5WETU1bx0g+jaYxbIE9EGJjuPUlpq6QgwSlzrXgzZ8LPSo xLa8p/UqwOGY/72gjmuahpJViZ+6ZTrlB7YyCcm7eImcZhAjE0JcyHvUlEfliLI8 25vmuGsGeb81r+qw0s1bsPvONC2roAO1KJsXHGDoH4PP4D5exAqXotNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=sE4QBKUn8VDGSV9/0 LKFHlxyf8yJ+biR5V3LiGt2DVw=; b=oPqYO3ZqPZ6VDGbeELtGJ7H+cYII8lQsL cj/8NagqdQZEu9QOKdgoFmzNfNwokhH+rkUeTwwztgXt0FhDDBkgpkncwbChPFi4 BnLZrPRG0DOk+xF3SRHPw8MDFqeifdtAGuMZC4qn98KnnGTgyQIxd9lnHwxRnSXl cZys6p/Kv8SGtr8U6NjItKHyyP2c0cSv8vy05mfqgKtCwk1di6ShxKr4lM7ncrE1 2teGpp/hOb2RlohSPE3OqxnoPnc4q4DsYvYw5PBa5D9Hw9OHr1PWXFW1Av4coSyI SRWa31wcJrNAfGxfaiqBJbYM82nTEE+ThyV9jlch1lV7GbCGlJMHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedtgdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhggtgesghdtreertddtjeenucfhrhhomheprfhhihhlihhp ucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhmqe enucggtffrrghtthgvrhhnpedtueduuefhkedufefgvdetgfekudevtedvlefgudfhhfeh ffeiiedviefghffgtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Feb 2022 17:21:12 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: Re: [PATCH v2 01/15] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). Date: Fri, 18 Feb 2022 17:12:01 -0500 Message-ID: <3134236.SJR2elNmQ3@bastet> In-Reply-To: <93433d1f9a527be2ede5da4443fbbd914cc938d5.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-2-philip@philipmcgrath.com> <93433d1f9a527be2ede5da4443fbbd914cc938d5.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1773853.CZYodgJVQZ"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart1773853.CZYodgJVQZ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , zimoun , Malte Gerdes Subject: Re: [PATCH v2 01/15] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). Date: Fri, 18 Feb 2022 17:12:01 -0500 Message-ID: <3134236.SJR2elNmQ3@bastet> In-Reply-To: <93433d1f9a527be2ede5da4443fbbd914cc938d5.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-2-philip@philipmcgrath.com> <93433d1f9a527be2ede5da4443fbbd914cc938d5.camel@ist.tugraz.at> Hi, On Friday, February 18, 2022 1:57:22 AM EST Liliana Marie Prikler wrote: > Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > > * gnu/packages/chez.scm (nanopass, stex, chez-scheme): Move to ... > > * gnu/packages/chez-and-racket-bootstrap.scm: ... this new file. > > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. > > * gnu/packages/emacs-xyz.scm: Adjust imports accordingly. > > * gnu/packages/loko.scm: Likewise. > > * gnu/packages/racket.scm: Likewise. >=20 > For the record, why is chez-scheme moved to bootstrap? W.r.t. the > adjusted imports it might be a good idea to re-export it from chez.scm > instead, but I'd need confirmation from the others on that. Prior to this commit, there was logically a dependency cycle involving "gnu/ packages/chez.scm" and "gnu/packages/racket.scm". While it is possible, wit= h=20 great care, to avoid premature variable references that trigger Guile=20 exceptions, it is easy to get wrong. At least twice Guix has ended up needi= ng=20 repairs, in: > commit c094e574f2b78b2f090aa740c1284418c16b2fcd > Author: raingloom > Date: Fri May 28 03:59:16 2021 +0200 >=20 > gnu: Break up import loop between (gnu packages racket) and (gnu > packages chez). > =20 > * gnu/packages/racket.scm: Remove (gnu packages chez) import. > =20 > Signed-off-by: Ludovic Court=C3=A8s and again in: > commit 96db2ff145ecbd962206eae815b065bda7ed3d9f > Author: Ludovic Court=C3=A8s > Date: Tue Sep 7 15:11:46 2021 +0200 >=20 > gnu: racket-minimal: Remove top-level reference to 'chez-scheme'. > =20 > This could cause build errors; for instance, doing: > make && touch gnu/packages/chez.scm && make > =20 > would trigger a "chez-scheme: unbound variable" error. > =20 > * gnu/packages/racket.scm (racket-minimal)[source]: Add 'modules' > field. In 'snippet', remove top-level reference to CHEZ-SCHEME, which > could cause build errors. Simplify snippet. The logical cycle will only get more tangled when we can actually bootstrap= =20 Chez, as upstream Chez will then need Racket as a native input, like `chez- scheme-for-racket` does now. So, in this commit, I moved everything involved in that cycle into "chez-an= d- racket-bootstrap.scm". Since building the Chez Scheme and Racket compilers = is=20 almost entirely unlike building packages that use the one of the compilers,= =20 there's some logic to it organizationally, as well, but the motivation is t= o=20 try to make it harder to break Guix in practice. I did try to have `(gnu packages chez)` re-export `chez-scheme`, but that=20 caused build errors=E2=80=94rather illustrating the point. It does seem pos= sible that,=20 with the introduction of `chez-scheme-for-system`, the extra level of lambd= a=20 extraction might be enough that it could be reexported from `(gnu packages= =20 chez)`. But I think it would be better for someone with a far deeper=20 understanding of the potential pitfalls than mine to do that as a separate= =20 commit, if it seems worth doing. =2DPhilip --nextPart1773853.CZYodgJVQZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIQGbEACgkQygNjjfo/ HHr0kw/+KISHJUecxgH/TRvOdYAiN/JZBk9hGv0PS25ouvyjIz60hjhplKkcyUB5 QRPOx5AAoVFjwDvnwXOz2bE9gyvl+s46sYfMx39ZczLolJ4bu5xrRRRBYReUHOyq muos0AgU5WzfYaEUVybafeIoC//oHevA8egSZoe/Uvfq1b2hpaOkx3ZRoHB8c4Bb OpkIOD+ah3HDsN7+6dUVmxSJBuOTjk37ywPnNq+XdTw//50s09om3gHQ8pkRhukv HJmHob7Kq4tDoi/YoblvR8QH3eMyand7z0LDJ8jpNhLlkkRqJa24T5LfNxDbIqRw 0kEUOGVpp0uHb7Ccm8ZmISDL7ub/ohC6C2S+ul+A/li+hEtSiW4pqJIXKNtgKNVR RNjbemF5ZGyilW7exAPMkba/hqilIVNDWGTjP+iK2owsYWCUMGTr3r+hb4XbwmqH sPpW2h6+QrrQ7gDd3vvrFI7D2OO2U+qyojM8AbUH3DuLsvrzcbHr8SVEJ0WJ4gtI oL/FuFWG4hLGd6MjUr7eqYdqBcnrk2nmH7zofnzUQVZhdtCs2RohDFaI4dHzj/0+ eMnKBng55k3DGmaRivFYvtqUV1NPjyN/mpr2onoa8xfqYzRGFoAieZSevZnFxlzl +DtixBEKTEgtBFyhNbQN7o0LOTnidST3OSno29gtOIw8NdB/6Wo= =Q2K8 -----END PGP SIGNATURE----- --nextPart1773853.CZYodgJVQZ-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 17:32:28 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 22:32:28 +0000 Received: from localhost ([127.0.0.1]:56514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLBnf-00007F-SU for submit@debbugs.gnu.org; Fri, 18 Feb 2022 17:32:28 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:60921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLBnc-000071-ND for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 17:32:25 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 979AC58016C; Fri, 18 Feb 2022 17:32:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 18 Feb 2022 17:32:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=uzU1huR52e68XJ f5px6LbIg2xrJ9YtG8Icy81yunLq4=; b=SwmBjpj39swfzbySrZ6UTt27k+/pCB yxJq16XrPiOEP/UPoCxCr1fjfnIe3eEMiHfMSsCKnQ/X9YCzh//44tiBGmAKN6yW Y0o2VP15hxpmGXmnUC5DPTipM5Wx4DKEsKNsAfT8rmy4653hJZthnMBBMIDPrO98 xg7/GfGdQE0BcTPNNe6fcLKJxi752XFcS20BIIGYtC06DYsY3+HkP/9Fpr9OZ/dY XVeLAIjWPO3Dfh5TUP05hHFtMIZAfk3ItwMtntt5cPK+qlZdgWumONii6n4K5MHq fkXXfgsigXVVlaE9HqrohGsT4gGSH1ALtfMsr0IjH1562gccCp5GCdqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=uzU1huR52e68XJf5p x6LbIg2xrJ9YtG8Icy81yunLq4=; b=avmM/yxhwZutre60huegGLr/Ccy3KRAIM RJXng5DK1ab/Ian9WQ40Pw26EKzuAb4J0/EcdDTJA6ZBKMb0BbNjl2sVATVMZ2Dz eIKGQJVnnUca2I+u0/A+BT66FxfqCcquCYuHbGU8KaTTXag6FAhqEtAhgfJxDfEX w6aqas3X3NZHuB2UZBDENfdmEitIfYBFiFu+83NG1VZWSSqsy6OCQZssaTvbxEnS kwAazzW3kXVo1kpn1JdMvXTPe4E7K47nHwRzpwsp2DOT2GIREDl1lDqC7yB1BB68 VjBw9r240mjlWPC+p9ZLYx3P0eUPpbnihkIcZyMyD75vFkoAPRgdA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedtgdduheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhggtgesghdtreertddtjeenucfhrhhomheprfhhihhlihhp ucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhmqe enucggtffrrghtthgvrhhnpedtueduuefhkedufefgvdetgfekudevtedvlefgudfhhfeh ffeiiedviefghffgtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Feb 2022 17:32:18 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: Re: [PATCH v2 04/15] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. Date: Fri, 18 Feb 2022 17:32:12 -0500 Message-ID: <4044783.jdjgpRbQjl@bastet> In-Reply-To: <20ea5c875903418d71731643c96bff3f1d15fd23.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-5-philip@philipmcgrath.com> <20ea5c875903418d71731643c96bff3f1d15fd23.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4519834.kI4RK6TYju"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart4519834.kI4RK6TYju Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , zimoun , Malte Gerdes Subject: Re: [PATCH v2 04/15] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. Date: Fri, 18 Feb 2022 17:32:12 -0500 Message-ID: <4044783.jdjgpRbQjl@bastet> In-Reply-To: <20ea5c875903418d71731643c96bff3f1d15fd23.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-5-philip@philipmcgrath.com> <20ea5c875903418d71731643c96bff3f1d15fd23.camel@ist.tugraz.at> Hi, On Friday, February 18, 2022 1:49:59 AM EST Liliana Marie Prikler wrote: > Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > > * gnu/packages/chez-and-racket-bootstrap.scm (chez-machine- > >=20 > > >nonthreaded, > >=20 > > chez-machine->threaded, chez-machine->nix-system, nix-system->chez- > > machine, > > chez-upstream-features-for-system): New private functions. > > (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private > > constants. > > (chez-scheme)[supported-systems]: Compute based on > > 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. >=20 > AFAIK we don't distinguish between private/public and function (should > be "procedure"), constant or variable. It's all "variable". >=20 >=20 > Otherwise LGTM. There are existing commits like: > commit 9e3355d2a35796276d17af13ac45814dbf6c4203 > Author: Tobias Geerinckx-Rice > Date: Sun Oct 3 13:50:10 2021 +0200 >=20 > bash completion: Complete =E2=80=98guix build=E2=80=99 file names. > =20 > * etc/completion/bash/guix > (_guix_complete_available_package_or_store_file): New function. > (_guix_complete): Call it in place of _guix_complete_available_package > after the =E2=80=98build=E2=80=99 command. and: > commit 273cf0378d6ddfcf8b882decd796ad8f9699f343 > Author: Maxim Cournoyer > Date: Tue Jul 3 09:04:02 2018 -0400 >=20 > gnu: Add iso-8879-entities. > =20 > * gnu/packages/docbook.scm (iso-8879-entities): New private variable. But feel free to fix it if it's wrong! =2DPhilip --nextPart4519834.kI4RK6TYju Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIQHmwACgkQygNjjfo/ HHog0g//UdVvq8IYmW8D6xIELDTmEoCK/c62G+5A0EQ/DgVBVN/QbBTAS5KYoh3A tKe4Cy08gTODoQOKTxELp+PuD9WFB3YxcBqhJDBvuBabEhWCCyYhM5PT8GjTa+39 TafYN0NCPSzaKurRRM1xyBkWJHulxbt6rzo3nryGBG8ZOFmTuIdq+SEkdiozURBp C9XN6VqVper+cKKw5FZg1f4wQyrAoyap7pREP2dmzf+4YIiKJfyP2D8DoJp3CE8v wEIWJ8KVppIrBcOA8vEXrujZK6NXWYS9D2S9bnlFA48fVyDoq2nbJ3RBI+lxlq9g wMjkpKI9F771vdVw8/wZvsW0O1H4ksikcjToCwwhf+Mt8ZqRuFXSVieWYuqK8mad F9bLtkS5Ku91RNrYESxvpxFdk7zgJlg06cMR+7yfjNID3CzuV8hWrvp4gTlWrVi2 bgZ0ZlBKgNm4zM/8BUPG67UQsFwLUakJyXWxK7ozF9wrq59WibJzj1JjTHq0RHWG UKnOGTm9iRgFVU7OKHF7YVkeWxR8RP0heJQUWK4eA/hJ81lWqaKxd4Be8bnqOOg3 KALAQjQvp4Fk+TumcbG8JNzu3zDI1RnO3lc9YVros1FyrPuqEdzD3l/qLANEimHi /Yjiw5w5ZJCAMi0e8bYtekrxTAqT179akpSTnykR9c4CCeAUbTA= =QP8I -----END PGP SIGNATURE----- --nextPart4519834.kI4RK6TYju-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 17:43:53 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 22:43:53 +0000 Received: from localhost ([127.0.0.1]:56528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLByi-0000O5-OM for submit@debbugs.gnu.org; Fri, 18 Feb 2022 17:43:53 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:48283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLByg-0000Ns-E7 for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 17:43:50 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 4D9675801BD; Fri, 18 Feb 2022 17:43:45 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 18 Feb 2022 17:43:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=zlNkuaGkWmkfrh diG3DqJcYw4A4NZ26kjP4lxbr8Bnc=; b=l/vxdW9FlmAjQCcJLK4as3Va31l8WE b7kDr1yI5dPqBCPIQnoUy7/hgFuzVS+8fP3lT2n12AggFJwdZM7QeCAU3Ny3U+O0 Gd+/KHZRQ2DWXjrTPjIE44Ns2zoV4c/+rwN/eirCWYbiJnJkp35j508+L0vaB7/2 yotQZS1UL1fSqAsXPIzQPq44Q2fHDv/5IphS9NEfW7gODLWSGUqZqWzl0NaFMvO/ qsUSiOyePIEBGW/ssZiIx3SrcKH/jmNRdFQ2vFIb7g/l6Xa0XPKNnv09uMflnYOG ij2A2vnbfsXbHRK3INtfmFIwADlAuTRSX3e30TUp9L4AkV/YFkX3tAmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zlNkuaGkWmkfrhdiG 3DqJcYw4A4NZ26kjP4lxbr8Bnc=; b=UJlssfZ4fklJmeGL5oRt/Fjp1+Nr/uBRm sYUhEzhL6PVY8qw08Z9lZEb9p9V1O5OEd1yymz40hQFTr78yniKyGleD822H1xFM 5T2KjdLRjOyZrI6xXNBwBe4rlztqAyoDf9XQbOPZ4jFUKrmcy8UDp9ElgKeWqmbr WMqF7cak1uqAYRzrhKbiJGL8QG9Rd4vkQJsd7U3CUT/lYZeu3b+z3bbvr/FwS+ef KtiFnNz68boXDjdu3pRqYN/fP1VN1lvB6WjTtwPAH0wrbZDq/dt4KHV+4GOcX5aF r9x+lOHOI9818KjtI9dj1a6GV/VqYr0N1nwSgWEoQvLIFSY29dXgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedugddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnheptdeuudeuhfekudefgfdvtefgkeduveetvdelgfduhffhheff ieeivdeigffhgfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Feb 2022 17:43:44 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: Re: [PATCH v2 05/15] gnu: chez-scheme: Use new package style. Date: Fri, 18 Feb 2022 17:43:38 -0500 Message-ID: <5319547.TsuRgl07K4@bastet> In-Reply-To: <9059f062eff0dc9c9f911797007f580289bb43e6.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-6-philip@philipmcgrath.com> <9059f062eff0dc9c9f911797007f580289bb43e6.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart12382479.A3DmX1dbQ3"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart12382479.A3DmX1dbQ3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , zimoun , Malte Gerdes Subject: Re: [PATCH v2 05/15] gnu: chez-scheme: Use new package style. Date: Fri, 18 Feb 2022 17:43:38 -0500 Message-ID: <5319547.TsuRgl07K4@bastet> In-Reply-To: <9059f062eff0dc9c9f911797007f580289bb43e6.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-6-philip@philipmcgrath.com> <9059f062eff0dc9c9f911797007f580289bb43e6.camel@ist.tugraz.at> Hi, On Friday, February 18, 2022 2:15:32 AM EST Liliana Marie Prikler wrote: > Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > > * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[inputs, > > native-inputs]: Remove labels. > > [arguments]: Use G-expressions. > > <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. >=20 > If nothing else is preventing you from doing so, I'd cut this patch in > two here. Also >=20 > > (nanopass, stex): Make public as a temporary workaround for Racket. >=20 > You might want to make them public at the point of moving them to > bootstrap and then hide them once you're done. If you want to prevent > the user from installing them, use hidden-package instead. Racket would be broken if the patch were cut in two there: it was using=20 `assoc-ref` to extract them from the inputs of Chez, in part to work around= =20 the cyclic dependency issues, but that didn't work with the removal of inpu= t=20 labels. In the commit that moved them to chez-and-racket-bootstrap.scm, I deliberat= ely=20 just cut and paste the definitions without changing anything, so I definite= ly=20 wouldn't do this in that patch. Also, there was no reason to make them publ= ic=20 until converting Chez to the new package style broke the existing workaroun= d. >=20 > > * gnu/packages/racket/scm >=20 > .scm >=20 Thanks=E2=80=94feel free to fix it when applying, unless a v3 ends up being= needed. =2DPhilip --nextPart12382479.A3DmX1dbQ3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIQIRoACgkQygNjjfo/ HHqNthAAlA72GoMz7EkBpdIe0bkWZ29AqsBT3A8G9+qg2LdpAOqRT540UwsAWkjS ayMutILVfmIUt5jaCkRdj1kJj2eedvZc7631TQnUdGoxXkS19jvLnkLtMgDUJzzg KnHxUuw7DoSqvfIJBcjjWWEge7Lu+1XjeNmmFzkfIExalsezCchcwth+S9MteroP HngCoYmK7ZHd7FX7VnZoWg99s0Z2khomifGdv7d7aVH4Kr6Ji1auDXK9z/XiXoS6 BNdLCQDgSofxSToCCenEp0tZoc8LV7NC8KXX8NEDLdnZ4Ckb+WFbWoPJBDY2j0MH 1n71e8oG6TKs0wBUGPduWqSmD+emInUaMwNh/LuYjGzyWo+PF9k2rE1hPEB6Dd67 rzJ8ppGPrOufE8Qn/ZZXmggghg6IKGTOifnfGCX3/BSZxIB4EF0wZuia6ob5LqeT bIWaXpxRGtklQbnYXkjcfe2XZUS/thCdSEjFN6trZQSwYxRv0xEgXhTtH/Q4kfCH 2oVUDrel5UqywaNa83E96WHLZa7r6fveC1baqGv6lKC/d2GVWkTf0eYiNy2olA4c 8I004+V9t3+5uePPra/CoEKfuyTKFkkpHGx3B+DvQWK4FwnkNFc22h3nzgxcjMrJ bjwvsMNxj9iDHU403sOQwOR7+cJzMJdGaaK5DSYqZ6SyqkFw/Y4= =jUpV -----END PGP SIGNATURE----- --nextPart12382479.A3DmX1dbQ3-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 18:20:24 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 23:20:24 +0000 Received: from localhost ([127.0.0.1]:56556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLCY3-0001LU-Qb for submit@debbugs.gnu.org; Fri, 18 Feb 2022 18:20:24 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:35723) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLCY1-0001LE-EK for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 18:20:22 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 58EFC58020B; Fri, 18 Feb 2022 18:20:16 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 18 Feb 2022 18:20:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=32WbKUEvaju+nV eWes4ib/OJiMnT1GNDOCYg6XVxF2w=; b=e+1UW07ztT9TEd6PWYzx0/FeOqM0kn MfSBJ4Ba60KqNJKYMrLI+dcQxxh8hFgfy2sb88vG7M5k5Ux0OXLdIUGC0jdk4jjA 05dfVTKfQdiq4UXAzkCH0S4wXj2+dfJbtVvTA650rCsBlInPRyl6bukI/UX99Rnv 5LLGbCQIFBodSSJZdekN7hrm1WLr7Q37TxuaFuYFnwwWSVQs/JC4XmiXV7jIhVpk xxojnwZ9Urfi3q5Yd/2NKPERKQgLF8GV0uCHbYFxPmpsfD/eOKizeWI+WE26qHd8 02SIteg7SPR+8pEGaE5Qz+Mmn9r7I90ziqHRiHCOSa1s4+21eWs90A2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=32WbKUEvaju+nVeWe s4ib/OJiMnT1GNDOCYg6XVxF2w=; b=FTfZYcwloiUednpswVJU7JJ41wvlLlh0i p1LiCwTt+uRt4jyc+Y1XeDpoQ6B2vQGArqpJ6BeZIMumxmEbMqf7g9ubEqIqTB8+ 2bgmNGpiyL7rlV6ynRPx4L6zjxPRjh9XfBjhEhjQj9IfXy7olVxELzjQ6wlVXCY7 ayVlIym/fTdwF7sUFXqRg8vaQFrNw24/3F71TlON4SkVvW6C6JiNVCi08TIRGB97 8XssizUO+UVKUCF8W1fuXMX1ivxhK/+oUV1BxqzYIKbNDmSxbm1jKG/Mwpx/qnkI E1b01EUJvlLDIkQK9hCLdMZ3XoVbK4CMEZ0V2swM1DefuEaB/F1Vw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedugddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttddvnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhepleefgeegieehgedtveeiffehkeejtdefudetvdeigfekfeef udfffeejveekveelnecuffhomhgrihhnpehgnhhurdhorhhgpdhgihhtlhgrsgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhi lhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Feb 2022 18:20:15 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: Re: [PATCH v2 08/15] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Fri, 18 Feb 2022 18:20:08 -0500 Message-ID: <4034931.zyubqINhsf@bastet> In-Reply-To: <72bb2b48f7c2fae26c60db8c13cff34a0b01347b.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-9-philip@philipmcgrath.com> <72bb2b48f7c2fae26c60db8c13cff34a0b01347b.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2203087.bQLt5E2yDt"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart2203087.bQLt5E2yDt Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , zimoun , Malte Gerdes Subject: Re: [PATCH v2 08/15] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Fri, 18 Feb 2022 18:20:08 -0500 Message-ID: <4034931.zyubqINhsf@bastet> In-Reply-To: <72bb2b48f7c2fae26c60db8c13cff34a0b01347b.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-9-philip@philipmcgrath.com> <72bb2b48f7c2fae26c60db8c13cff34a0b01347b.camel@ist.tugraz.at> Hi, On Friday, February 18, 2022 2:08:46 AM EST Liliana Marie Prikler wrote: > Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > > +(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 > > This TODO might be moved one line up, since you wouldn't be able to do > cross-compilation with just copy-build-system, would you? > Actually, for the bootfiles, I would do cross-compilation with `copy-build- system`: the extra parts of `gnu-build-system` would just have to be deleted anyway. With the definition of `chez-scheme-for-racket-bootstrap-bootfiles` in patch v2 11/15, you could get a kind of cross compilation just by changing: (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) (invoke (search-input-file (or native-inputs inputs) "/opt/racket-vm/bin/racket") "rktboot/main.rkt"))) to: (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) (invoke (search-input-file (or native-inputs inputs) "/opt/racket-vm/bin/racket") "rktboot/main.rkt" "--machine" (chez-maching->threaded (chez-machine-for-system)))))) (I don't recommend that: for one thing, it would be about ten times slower than taking Chez Scheme as a native input when cross-compiling. More significantly, the harder questions about cross-compilation are in the Chez Scheme package itself, not the bootfiles. Perhaps we will end up wanting packages like `chez-scheme-bootstrap-bootfiles-ta6le` and `chez-scheme- bootstrap-bootfiles-ti3le`, analogous to e.g. `gcc-cross-sans-libc-arm-none- eabi` and `binutils-cross-x86_64-w64-mingw32`. Or maybe it will make sense to have one package build bootfiles for all supported machine types in separate outputs, and a variant of that for bootstrapping that goes through Racket for just the current machine type. Those are questions for another day.) > > + (arguments > > + (list #:install-plan > > + #~`(("boot/" "lib/chez-scheme-bootfiles")))) > > + (supported-systems > > + ;; Upstream only distributes pre-built bootfiles for > > + ;; arm32le and t?(i3|a6)(le|nt|osx) > > + (filter (lambda (system) > > + (let ((machine (and=> (nix-system->chez-machine > > system) > > + chez-machine->nonthreaded))) > > + (or (equal? "arm32le" machine) > > + (and machine > > + (member (substring machine 0 2) '("i3" > > "a6")) > > + (or-map (cut string-suffix? <> machine) > > + '("le" "nt" "osx")))))) > > + %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 upsream > > +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."))) > > + > > Now to explain the difference between my suggestion and what you > implemented. Mine would be to > (define-public (chez-scheme-bootstrap-bootfiles chez-scheme) > ...) > where ... is the code you already have. This would not only work for > other chez-schemes than the one we have packaged, but might also make > it possible to cross module boundaries, i.e. keep chez-scheme in > chez.scm. WDYT? I still don't think I understand. How would this avoid having to override almost everything for both the upstream and Racket variants of the package, as was the case in my attempt in (also at )? I mean, you could put the upstream stuff under the `lambda` for now, but eventually it will also need a build phase and some inputs. I just don't see what the benefit all that would achieve, or what the problem is (if there is one) with this patch. -Philip --nextPart2203087.bQLt5E2yDt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIQKagACgkQygNjjfo/ HHpd7w/+ImKOAIH+enBrQ+ZNf0QBsdt67Dk1enEBHL8iPNvrYIZOEKEnSwbKKTFW d8wxgqWASH2+RWnieSU+ssphCkh4X917fzi9Gcjav1cQwu0uUpPeDM76ME7jTLdg 4wD5v/e/oGPwgtdnzS2xFOLeqAih6WOvJSB/smgPQfVO01PEvS8mz/akxtS8u88G zWKHv5qS2MDQKw87WNGBDwnaP7O51nocWn25pN+aHnsoG7WXw0D4bx4FvI6F7EPZ QzdSHpwLuOFsXUWug3lFCfJcMK7WFWbvMN67kKz8jJ/cCz17J3CjCcpe5Zfpy5SH VxrnL/U9Qd9w4TFIhZGZLS2agdKRBeNZYJ72Q2+MsjcXxO+ZGXA3QQtO7GOqpNnL VLYXJUeIr0AKIc4UPdOIRQewasYZ22eN5hQXsMEIBcHPigAwjW1meOOtWj06c2fu i8UzTu1tvX1tWt30oh1rmZrOJ7W2WkXRmimKBupGp1M7KSi5/Rv+C+7mQkhFY3JH 3u3tUDPq6X0rt3CZ5+1/Zy8Azd1UCtzkZ6n73qmmXh6pKTjtObw9bTau9/J3A7n6 TNicyobKn+pwkfzHzsdxRZDxXMiHOGYtwGDBWuNJnHk76dm+W7GC3bd6T2+2sVSv TZYRmLFTaPD25hMjiy282z1DiFq2fRxBE/bTNIVZz5vEPTzAjmY= =EgUI -----END PGP SIGNATURE----- --nextPart2203087.bQLt5E2yDt-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 18:40:56 2022 Received: (at 53878) by debbugs.gnu.org; 18 Feb 2022 23:40:56 +0000 Received: from localhost ([127.0.0.1]:56564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLCrv-0001qC-QR for submit@debbugs.gnu.org; Fri, 18 Feb 2022 18:40:56 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:54697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLCru-0001py-74 for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 18:40:54 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id E95585800E2; Fri, 18 Feb 2022 18:40:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 18 Feb 2022 18:40:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=0ARLccLpn4WHdV uexU8nk/lLNUj8FYYn1+Roa3GibBM=; b=d3Acia6sAn9LUfmuA9I7zBRW+u1AzO M55sEu+Z1ASe9Av+h6ZI+zP9hgtAIQflIXaJSvekJ4ULO3pCWldCGKk0GGK0S5uN I7hDHpru108p5CVJ6lFJn8EVRUflkrCso/eyniO3dexq21vxLhlreQUStg95eqlb 4xZ8MQS4nD9OCGtM10leS6oBElnsvj28j/C5qwwx1ltCp7PEbb+FNKH9HRKCDnrQ m1USQ++k8PA/wgRp845CMAhEb3B50+oiCdk59QPuweqvzgYWDoW9WVQGZMyH0oYF vk7epgb0Fh/eAFS2K+q7t0EknjpUrSDu+DAVFur4efNR0q923ayRtJlA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=0ARLccLpn4WHdVuex U8nk/lLNUj8FYYn1+Roa3GibBM=; b=QPns1cbdFgVDMfSEWf1LhjpfQVSV0dJt9 NbMCpGFupcHKTm5bHoXA8auMgYeH5XtOz5TPZ5ml+nx+AELNdqBv6/4VsKCqiBDg qxANDxBySyLIQZnpaWRIaFBWPINf9+yDE1hjL1wVeN96cLBw2TX8i1JidslzGjiS kfv1pXIXp+Oq7D0Tq9Mud4Ftbb39Frzdc0QLt0g2nH9YUCy8Qr6M5YxLZ2g7ytXv lhv2l1M1byu7uSt1W46RxAFpqEjlbi62NuXUENFcyNvqQJkf8h5vQMIqG6QRtKb9 vk881lJ10iX3UMgdRdCkyc+Ql+TWt4N14jDH5NvANVyCQPn4JM6/w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedugddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhepkeethfejieeitddvtdeiteejteffteevhefgteeikeefvdfg teekhfffueehhfeknecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhl ihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Feb 2022 18:40:47 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: Re: [PATCH v2 09/15] gnu: Add racket-vm-cgc. Date: Fri, 18 Feb 2022 18:40:39 -0500 Message-ID: <2174301.Biq5ZIP7C4@bastet> In-Reply-To: <845a930a8d61fabd7227c57e8e35f926dceefecb.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-10-philip@philipmcgrath.com> <845a930a8d61fabd7227c57e8e35f926dceefecb.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart17702992.WpQvaZL8Qf"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart17702992.WpQvaZL8Qf Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , zimoun , Malte Gerdes Subject: Re: [PATCH v2 09/15] gnu: Add racket-vm-cgc. Date: Fri, 18 Feb 2022 18:40:39 -0500 Message-ID: <2174301.Biq5ZIP7C4@bastet> In-Reply-To: <845a930a8d61fabd7227c57e8e35f926dceefecb.camel@ist.tugraz.at> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-10-philip@philipmcgrath.com> <845a930a8d61fabd7227c57e8e35f926dceefecb.camel@ist.tugraz.at> Hi, On Friday, February 18, 2022 2:21:25 AM EST Liliana Marie Prikler wrote: > Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > > [...] > > +(define-public racket-vm-cgc > > + ;; Eventually, it may make sense for some vm packages to not be > > hidden, > > + ;; but this one is especially likely to remain hidden. > > + (hidden-package > > + (package > > + (name "racket-vm-cgc") > > + (version "8.4") > > + ;; ^ Remember to also update the version of > > + ;; chez-scheme-for-racket-bootstrap-bootfiles > > + (source > > + (origin > > + (method git-fetch) > > + (uri (git-reference > > + (url "https://github.com/racket/racket") > > + (commit (string-append "v" version)))) > > + (sha256 > > + (base32 > > "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) > > + (file-name (git-file-name "racket" version)) > > + (patches (search-patches "racket-minimal-sh-via-rktio.patch" > >=20 > > + ;; Remove by Racket 8.5: > > [...] >=20 > As with the Scheme bootstrap chain, if this all depends on the same > racket origin, you might want to inherit from the racket package or > just=20 > (define %racket-version "8.4") > (define %racket-origin (origin ...)) > and use them across the packages. Making them procedures to pass > version and source to would also work imo. I think the `racket` package is emphatically not the right place to define = the=20 version and origin for Racket: I'll explain in more detail in reply to your= =20 comments on patch v2 15/15. I'm not opposed to `%racket-version` and `%racket-origin`=E2=80=94actually,= I kind of=20 like that approach. If we went that way, I'd suggest defining `%scheme-fork- version-number` (the version of `chez-scheme-for-racket`) in the same place= ,=20 because it seems like it would be easy for someone to forget to update that= at=20 the same time. It should be an easy change, so I guess I'll send a v3 doing that after I=20 reply to your other comments, rather than wait to debate it. =2DPhilip --nextPart17702992.WpQvaZL8Qf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIQLncACgkQygNjjfo/ HHr6eA//fxR6d/IPHIC1UTKChODQ69Q6ITI5RqDTXGG3IEbsH4GeL57BPC6QpyS2 pRQC7SfNFNEvZ3zeN7tUIDAxMD8KXR/MNXDqkihYAr+2U5yDlp6hvqr2r2eg08w0 gqp77f6RABjkk6RDI2hzxLxmloeAF6pN3YxO1UzggN/946Sk/s2KEHHbn201Sk7L BkzFoK7/mlLMgjQYKypFScf1zQqMY0jAWf4tk9OXGcHqxg91hJ50MwEEzNmoCRQ3 F9+4YJIrsRxKp04lYQau+3hLy4OkLD7PWSouOi3DGLFbYDpY03bfjAjZQRyRz374 /2zNTbCw0sHs0gwEgS/vyNlkGfJ/49tmreXl4g6+9ux6egn+mHPHroAIIStZSrzW jitiNARpadwAlQwWmEFCoWkuoqJzimTso/Xc6KFAGBWYw3ORbNbHNRA4Cswvjwwh NawLDkMIwvM8zHA8nmK+AQa3PlrUhVqOg7iQwuDJEJ37WB9fmM3VQxGwy1608c+v nHiH9Fi4arnB865tmPdoyUcATY7G8pCrynJtV1HvkkkmMQuPcA1ujVq3ASjJ7PfC FTZM9TNYTouiyVL75Hpy/iIbbFR8TQfJ8w819zkedLAsu6waIdTzmFFrdTxXgdZt D8w91CLnA7psiMyTYAC5AcDzs++XNj9/f9XiCNlAkmBIgqrExlI= =f0E8 -----END PGP SIGNATURE----- --nextPart17702992.WpQvaZL8Qf-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 21:08:03 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 02:08:03 +0000 Received: from localhost ([127.0.0.1]:56635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLFAI-0005a3-IC for submit@debbugs.gnu.org; Fri, 18 Feb 2022 21:08:03 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:53749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLFAF-0005ZS-VH for 53878@debbugs.gnu.org; Fri, 18 Feb 2022 21:08:00 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id D813D5801E4; Fri, 18 Feb 2022 21:07:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 18 Feb 2022 21:07:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=gg7rWAbnEipuTw UmqCD/9HNJcOh7lVe1WqeSbKc2EA0=; b=drY16DJxlMk52PdqqpuNdacLQNcRTZ pnFJJLVhGFn2ZaRRjnLUd8orIPgOIwzp8xeihKq7Tao6oKFzvwVxWfo/lgQnK8jd UGkrFu3Vqgs2YSDMDkIva3Gjgas1XYKh2r1+HmkEJ38QQOCGaCL+a9RJOm55vxxZ f8pYiKZ3JrGNlkp9jJjH6G8mEGgjI1k0ctNaPFvLvKLL+Dh6lvs6O7pfwGpl0kXy NqDNM/c39UK6rkU1NGheQGpQ6bwHx1aG9cWo0wNFFyqcLhb/FpCqosqEaeRI/pWZ de1RhEA9eVST7qzp563jq3n2zNb0IafcDGicP4NE1QEDFTvbSRE8u9yw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=gg7rWAbnEipuTwUmq CD/9HNJcOh7lVe1WqeSbKc2EA0=; b=lvkIN58UxVntXPmyKIifOouP7H7TvK+f3 L5UEQS1rtrMI7eH/CERk7hBe/0laNl/sSy8C2Q8k43zA6WcqJIgcVu4C747K7XYq 8+ojiUu57PTm8pHG8LwVx+2OMfoQyV0knOZWV2BbkIhnx2GnfW7+dxOO56Q1LV/X mp+ckFdFDZhZGuEFLoOKf44n5mTpPoDESKw1t8RiZ+Rrhnj++nkJbPrvjldSF8eR CzZz/QVckFLKgs2raHrtygheGZzBEATEmzYeJjT2jn5yLe0PT7cbUuQWM4Q70yYz KXuo/+rutmeAAIPQ8nx+Y93lskhWVZL2pgx17pvyg2pwWiNwsQ21w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedugdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhepfedtkedtudelhedvjeeluefhffeiteevffevjefghfefffet keevjeeuleefleevnecuffhomhgrihhnpehgihhthhhusgdrtghomhdprhgrtghkvghtqd hlrghnghdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Feb 2022 21:07:52 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: Re: [PATCH v2 15/15] gnu: racket: Update to 8.4. Date: Fri, 18 Feb 2022 21:07:45 -0500 Message-ID: <4115207.GWgNnq4OGx@bastet> In-Reply-To: References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-16-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2939840.usEhuI6WJi"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart2939840.usEhuI6WJi Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , zimoun , Malte Gerdes Subject: Re: [PATCH v2 15/15] gnu: racket: Update to 8.4. Date: Fri, 18 Feb 2022 21:07:45 -0500 Message-ID: <4115207.GWgNnq4OGx@bastet> In-Reply-To: References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-16-philip@philipmcgrath.com> Hi, On Friday, February 18, 2022 2:38:52 AM EST Liliana Marie Prikler wrote: > Hi, >=20 > Am Donnerstag, dem 17.02.2022 um 15:50 -0500 schrieb Philip McGrath: > > -;; Commentary: > > -;; > > -;; Here's how bootstrapping minimal Racket works: > > -;; > > -;; - Racket BC [CGC] can be built with only a C compiler (except > > for > > -;; one caveat discussed below). > > -;; - 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 > > -;; 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. > > -;; > > -;; So, we build CGC to build 3M to build bootfiles and CS. > > -;; > > -;; 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 > > -;; README file applies to all such subsystems: > > -;; > > -;; The Racket version must be practically the same as the > > current Racket > > -;; verson, although it can be the Racket BC implementation > > (instead of > > -;; the Racket CS implementation). > > -;; > > -;; Unlike Chez Scheme boot files, the files generated in > > "schemified" > > -;; are human-readable and -editable Scheme code. That provides a > > way > > -;; out of bootstrapping black holes, even without BC. > > -;; > > -;; However, other Racket subsystems implemented in Racket for Racket > > CS > > -;; use older C implementations for Racket BC, whereas the reader, > > expander, > > -;; and module system were completely replaced with the Racket > > implementation > > -;; as of Racket 7.0. > > -;; > > -;; For Racket BC, the compiled "linklet" s-expressions (primitive > > modules) > > -;; are embeded in C as a static string constant. Eventually, they > > are further > > -;; compiled by the C-implemented Racket BC bytecode and JIT > > compilers. > > -;; (On platforms where Racket BC's JIT is not supported, yet another > > compiler > > -;; instead compiles the linklets to C code, but this is not a > > bootstrapping > > -;; issue.) >=20 > I think it'd be clearer if this commentary was moved along with the > bootstrapping code. I did add it to "chez-and-racket-bootstrap.scm" at the same time as I added= =20 the Racket bootstrapping code there. But I didn't delete the bootstrapping= =20 code from this file until this commit, so I deleted the associated comment = at=20 the same time. > Is there a reason why we can't use (racket-vm-for- > system) before updating Racket to 8.4? This looks like another of > those "two things at once" patches. > =20 The whole series based on `racket-vm-*` would not work with Racket 8.3 with= out=20 backporting at least some things: off the top of my head, at a minimum, we= =20 would need b53090140596cc8522037f4c812325c71648df7a and=20 2b282d9c48df811cd4678cdbaed8258cdef23946 to be able to build "chez-scheme-f= or- racket:doc". Maybe it will seem less like "two things at once" if I explain more explici= tly=20 that "racket-minimal@8.3" is actually the same content that is now in "rack= et- vm-cs@8.4" (just installed into different directories), and does *not* cont= ain=20 anything that is now in "racket-minimal@8.4".=20 Shortly before the release of Racket 8.3, it came to light from the=20 intersection of a few conversations (scattered across several places, but=20 summarised in and the following two comments) that the conte= nts=20 of a "minimal Racket" were inconsistent. On Windows, Mac OS, and "x86_64- linux-natipkg" (a special configuration that avoids relying on a system pac= kage=20 manager, e.g. for CI), minimal Racket had "racket-lib", "base", and package= s=20 providing native libraries (e.g. OpenSSL and SQLite). On other systems,=20 whether using pre-built binaries or building from source using the released= =20 tarballs, "minimal Racket" would end up with only the "racket-lib" package,= =20 because "base" was pulled in only as a dependency of the native library=20 packages. However, when building minimal Racket from the Git sources in the= =20 way Guix was, "minimal Racket" ended up with no packages installed at all. Matthew Flatt's conclusion was that, starting after the 8.3 release (to all= ow=20 more time for testing), "racket-lib" should directly depend on "base", and= =20 "minimal Racket" should always explicitly install "racket-lib". (That fits = the=20 semantic roles of those packages, which represent the current always-availa= ble=20 native libraries and the current "built in" collections in the Racket packa= ge=20 system's model of dependencies and compatibility.) That works out especially nicely for Guix, as it gives us a clean boundary= =20 between the core Racket VM and compiler, with all of the bootstrapping=20 involved, and building Racket packages and installation layers, which can b= e=20 handled in a nice, uniform way and eventually turned into a `racket-build- system`. > > (define-public racket-minimal > > (package > > (name "racket-minimal") > > - (version "8.3") ; note: remember to also update > > racket! > > - (source > > - (origin > > - (method git-fetch) > > - (uri (git-reference > > - (url "https://github.com/racket/racket") > > - (commit (string-append "v" version)))) > > - (sha256 > > - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") > > - (file-name (git-file-name name version)) > > - (patches (search-patches "racket-minimal-sh-via- > > rktio.patch")) > > - (modules '((guix build utils))) > > - (snippet > > - (with-imported-modules '((guix build utils)) > > - #~(begin > > - ;; Unbundle Chez submodules. > > - (with-directory-excursion "racket/src/ChezScheme" > > - ;; Remove bundled libraries (copied from 'chez- > > scheme'). > > - (for-each delete-file-recursively > > - '("stex" > > - "nanopass" > > - "lz4" > > - "zlib"))) > > - ;; Unbundle libffi. > > - (delete-file-recursively > > "racket/src/bc/foreign/libffi")))))) > > - (inputs > > - `(;; common to all racket-minimal variants: > > - ("openssl" ,openssl) > > - ("sqlite" ,sqlite) > > - ("sh" ,bash-minimal) > > - ;; only for CS > > - ("zlib" ,zlib) > > - ("zlib:static" ,zlib "static") > > - ("lz4" ,lz4) > > - ("lz4:static" ,lz4 "static"))) > > - (native-inputs > > - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) > > - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) > > + (version (package-version (racket-vm-for-system))) > > + (source (package-source (racket-vm-for-system))) > > + ;; For cross-compilation, Matthew Flatt recommends reusing > > + ;; as much of `raco cross` as possible. So, put that off until > > + ;; we have a build system for Racket packages. > > + (inputs (list openssl sqlite (racket-vm-for-system))) >=20 > As outlined earlier, I believe Racket should define its version, not > racket-vm-for-system. >=20 As I said, I'll send a v3 with %racket-version. But the reason I think the `racket` packages would be a particularly bad pl= ace=20 to define this for reasons related to what I was just describing. Once we h= ave=20 a `racket-build-system`=E2=80=94and we are getting ever closer=E2=80=94`rac= ket-minimal` will=20 simply be a tethered installation layer with two packages (ignoring=20 "natipkg"), assembled with something somewhat like the `texlive-udpmap.cfg`= =20 function. The `racket` package will likewise be a tethered installation lay= er=20 with 203 packages, two of which will be shared by `racket-minimal`. We will= =20 want to have others, both larger (e.g. "main-distribution-test" and all of = its=20 dependencies) and smaller (e.g. some people like just "drracket" without so= me=20 of the more niche dependencies of "main-distribution", like the support=20 libraries for the textbook, "Schreibe Dein Programm!"). A major motivation = for=20 the whole design of the Racket package system (actually, its second package= =20 system) is that the "main-distribution" package and the Racket distribution= =20 based on it should not be in any way special or built in: it happens to be= =20 released at download.racket-lang.org, but there can be many Racket=20 distributions. Some might go so far as to argue that any special status of= =20 "main-distribution" falls under the category of weaknesses and restrictions= =20 that should be removed. > > (define-public racket > >=20 > > (package > > (inherit racket-minimal) > > (name "racket") > > - (version (package-version racket-minimal)) ; needed for origin > > uri to work > > - (source > > - (origin > > - (method url-fetch) > > - (uri (map (lambda (base) > > - (string-append base version "/racket-src.tgz")) > > - %installer-mirrors)) > > - (sha256 > > - (base32 > > - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) > > - (snippet > > - #~(begin > > - (use-modules (guix build utils) > > - (ice-9 match) > > - (ice-9 regex)) > > - ;; unbundle minimal Racket > > - (for-each delete-file-recursively > > - '("collects" > > - "doc" > > - "etc" > > - "README" > > - "src")) > > - ;; unbundle package sources included elsewhere > > - (with-directory-excursion "share/pkgs" > > - (for-each delete-file-recursively > > - '#+%main-repo-main-distribution-pkgs)) > > - #t)))) > > + (source #f) >=20 > Why? >=20 The vast majority of package in `racket` are not developed in the repository. For that matter, the source of the "m= ain=20 distribution" package itself is =20 (and, under the Racket package system's notion of versions, it is at versio= n=20 "0.0"). > > (inputs > > - `(("cairo" ,cairo) > > - ("fontconfig" ,fontconfig) > > - ("glib" ,glib) > > - ("glu" ,glu) > > - ("gmp" ,gmp) > > - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg > > - ("libjpeg" ,libjpeg-turbo) > > - ("libpng" ,libpng) > > - ("libx11" ,libx11) > > - ("mesa" ,mesa) > > - ("mpfr" ,mpfr) > > - ("pango" ,pango) > > - ("unixodbc" ,unixodbc) > > - ("libedit" ,libedit))) > > - (native-inputs > > - `(("racket" ,racket-minimal) > > - ("extend-layer" ,extend-layer) > > - ("main-repo" ,(package-source racket-minimal)))) > > + (list cairo > > + fontconfig > > + glib > > + glu > > + gmp > > + gtk+ ;; propagates gdk-pixbuf+svg > > + libjpeg-turbo > > + libpng > > + libx11 ;; ?? wayland ?? > > + mesa > > + mpfr > > + pango > > + unixodbc > > + libedit ;; TODO reconsider in light of expeditor and > > readline-gpl > > + racket-minimal ;; <-- TODO non-tethered layer > > + (racket-vm-for-system))) > > (arguments > > - `(#:phases > > - (modify-phases %standard-phases > > - (add-before 'configure 'unpack-packages > > - (let ((unpack (assoc-ref %standard-phases 'unpack))) > > - (lambda* (#:key native-inputs inputs outputs #:allow- > > other-keys) > > - (let* ((racket (assoc-ref (or native-inputs inputs) > > "racket")) > > - (prefix (assoc-ref outputs "out")) > > - (pkgs-dir (string-append prefix > > "/share/racket/pkgs"))) > > - (mkdir-p pkgs-dir) > > - (copy-recursively > > - "share/links.rktd" > > - (string-append prefix "/share/racket/links.rktd")) > > - (copy-recursively "share/pkgs" pkgs-dir) > > - ;; NOTE: unpack changes the working directory > > - (unpack #:source (assoc-ref (or native-inputs > > inputs) > > - "main-repo")) > > - (for-each (lambda (pkg) > > - (define dest (string-append pkgs-dir > > "/" pkg)) > > - (mkdir-p dest) > > - (copy-recursively (string-append > > "pkgs/" pkg) > > - dest)) > > - ',%main-repo-main-distribution-pkgs) > > - #t)))) > > - (replace 'configure > > - (lambda* (#:key native-inputs inputs outputs #:allow- > > other-keys) > > - (let ((racket (assoc-ref (or native-inputs inputs) > > "racket")) > > - (prefix (assoc-ref outputs "out"))) > > - (apply invoke > > - (string-append racket "/bin/racket") > > - (assoc-ref inputs "extend-layer") > > - racket > > - prefix > > - (map > > - (lambda (lib) > > - (string-append (assoc-ref inputs lib) > > "/lib")) > > - '("cairo" > > - "fontconfig" > > - "glib" > > - "glu" > > - "gmp" > > - "gtk+" > > - "libjpeg" > > - "libpng" > > - "libx11" > > - "mesa" > > - "mpfr" > > - "pango" > > - "unixodbc" > > - "libedit"))) > > - #t))) > > - (replace 'build > > - (lambda* (#:key native-inputs inputs outputs #:allow- > > other-keys) > > - (invoke (string-append (assoc-ref (or native-inputs > > inputs) > > - "racket") > > - "/bin/racket") > > - "--config" > > - (string-append (assoc-ref outputs "out") > > - "/etc/racket") > > - "-l" > > - "raco" > > - "setup") > > - #t)) > > - (delete 'install)) > > - ;; we still don't have these: > > - #:tests? #f)) > > + (substitute-keyword-arguments (package-arguments racket- > > minimal) > > + ((#:configure-flags _ '()) > > + #~`("--tethered" > > + "--extra-foreign-lib-search-dirs" > > + ,(format #f "~s" > > + '(#$@(map (lambda (name) > > + (cond > > + ((this-package-input name) > > + =3D> (cut file-append <> "/lib")) > > + (else > > + (raise-exception > > + (make-exception > > + (make-assertion-failure) > > + (make-exception-with-message > > + "missing input to the 'racket' > > package") > > + (make-exception-with-irritants > > + (list name))))))) > > + '("cairo" > > + "fontconfig-minimal" ;; aka > > fontconfig > > + "glib" > > + "glu" > > + "gmp" > > + "gtk+" > > + "libjpeg-turbo" > > + "libpng" > > + "libx11" > > + "mesa" > > + "mpfr" > > + "pango" > > + "unixodbc" > > + "libedit")))))) > > + ((#:make-flags _ '()) > > + #~`("main-distribution")) > > + ((#:phases parent-phases #~%standard-phases) > > + #~(modify-phases #$parent-phases > > + (delete 'unpack) > > + (replace 'build > > + (lambda args > > + (mkdir-p (string-append #$output > > "/lib/racket/pkgs")) > > + (for-each > > + (match-lambda > > + ((name src) > > + (copy-recursively > > + src > > + (string-append #$output "/lib/racket/pkgs/" > > name)))) > > + '(#$@main-distribution-packages)))))))) > > (synopsis "Programmable programming language in the Scheme > > family") > > (description > > "Racket is a general-purpose programming language in the Scheme > > family, > > @@ -539,82 +224,899 @@ (define dest (string-append pkgs-dir "/" pkg)) > > DrRacket IDE, libraries for GUI and web programming, and > > implementations of > > languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and > > Datalog."))) >=20 > This looks like a very weird way of phrasing union-build. Is there a > reason to do this rather than union-build? >=20 IIUC, packages aren't supposed to install symbolic links into their sources= ,=20 as `union-build` would do=E2=80=94wouldn't that prevent all of the extraneo= us files in=20 those origins from being GCed? There's also the fact that `name` may be=20 different from the name of the last element of `src`: in particular, in a=20 significant number of cases, `src` will be something like "/gnu/store/ x22awqf0rbcyyk88kj82zihmdgkfhgza-racket-main-distribution-8.4-checkout" whe= n=20 `name` is "main-distribution". =2DPhilip --nextPart2939840.usEhuI6WJi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIQUPEACgkQygNjjfo/ HHrP1RAAs6nEAIOFtlcE17af4Fdr+qf0nEn60f4UbZd8bpHMU2BwecLk/JWyN28P bP8i9PkJ0xhW/OdSFRz5My+EopD36x/J5P+uMgmg2X7wss+SCIvl/YlXuWM4EILD gU40n3Hxs5cj0070niM9bzMTSgs8OAKuqxJsYFxaf+RK+dBZ9WBW3MADKMcnEt9M 6n2YugHJwMlN7+DHusjtHHpEFURT/RPnhgXwaLS4GWpYEX+gKe3x7Zc2Rrerlvrf ReZay5iPkItuUn7bfXkcz+Ryw87wTt/oJSnyy8ChN6WdIhHohgKr89haVNNurOeE iqFqe/AYaHAt8A+E39r8JJKDHVpdLweNJ5sT11bY/gPNrTStSrn0YvX89hqPqJE/ bOBRH4xb35wvVZoFoXB/gOXtJ9IFfdmzDo41uinGrhFw7VwlROG7bBAGI9u9cA5g YrbKCh4mQx0AF2P1FMGg/5KHmnYCzRmjJqb7+NaPy1FdzoRUU4Uwoac10qeySfxR KPRzBu7Xl1cG+Ec1XyDnCYtThCHmUtRefdgst0f+KZ+4zMMoFPKCEL4XePrfUocl DpfqDlT9xHVrpTA9vSRKvIhfN3eHAGAcgY5IWiwgGv9AXhpMz98oCkTeYeHxe5/Q YFDFkkFrczA86Lrgy8iOAMkrrYvCvzB9K2cEkmD41bBiT7YFTe8= =h3wd -----END PGP SIGNATURE----- --nextPart2939840.usEhuI6WJi-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:01 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:01 +0000 Received: from localhost ([127.0.0.1]:56710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSM-0004ho-9S for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:01 -0500 Received: from mail-qv1-f51.google.com ([209.85.219.51]:35488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSK-0004hU-N6 for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:42:57 -0500 Received: by mail-qv1-f51.google.com with SMTP id d7so19201580qvk.2 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:42:56 -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=0FdcXTfTZHFxmJA5fbQDWgiqdSSGXKklZE+IGHTNvQQ=; b=JTRDq2cHVdJ9dSa4otMvG4JD3FRFgU/yw358CjVurRXRdQV7sAGSsch9KcAW0P7OC0 gLln09nn4f6ovMiXHPKl1ymcLDLP+3wElz24RxMnQxpJ+/O/yCYLx57SAr5bxgYwkptJ uHUDhEHfOx9s9m9VIEL3F7Yp9sxY96o2Ncj7/nbJG7H816H9Fz2Sbjt5QJ1oCJ6vVR2L VXyC8Zvg9qphFoJ54nvfxlhZDDlhrBZWXRg26juirtM+xtA6Q3PAcBdHV9rjd6ZJ+pI0 BXTMjON0kr69oF/ch9Yh/thPWDYckZdOZQfm6KUGlb0rauk8JF3c3xKXSLhy/M5b6zBC AzhQ== 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=0FdcXTfTZHFxmJA5fbQDWgiqdSSGXKklZE+IGHTNvQQ=; b=ecnEvyxwezOraUQrlgBjjSJaZdORafa2CWe9Dl+VwMES+SCsuSdlykvd26cXz8FR4g iOd2nUaKqhPZYA6utdjvvlkFNzhM/ByosPrg7ovsfQX1qh0nS/UhGLq3l5bGTZNDMNmd eGBhOzxpFT3rBymxZqNK2FUN69Yn5ApHOwJayRRsyxm+RyprOWicwqI2p/Jqtwi0aJ2Y Jqjdw4jEQf7YgvhuIAS36VhtzyiFLDz9YT4oBOxqDT62jTkFBxQ/mIT3Lkl1rjrlh4FL BPlVs4EOEFpyBdIPj2Lv+t/G3RUoVlwYov015i7V6JMrFPBICl6QaA2akxAp529clV0/ cKdg== X-Gm-Message-State: AOAM531o6bG0pTi79Z33mcGeUa7EwbPP2cLTH4TqmzokzRpz1MDtRJsu oFAhy0ntK3ZXqfJiyD8v5Fj1qLDrTNNUMh3bp0A= X-Google-Smtp-Source: ABdhPJyIRhMzUVSb2LNRZaKb79VzIYTb69CAtyaiDqpZHjm0ZMcEK4+l+xAYrUtPSzWRdSBVaPGouw== X-Received: by 2002:a05:622a:1195:b0:2cd:5c2d:80f1 with SMTP id m21-20020a05622a119500b002cd5c2d80f1mr9616339qtk.573.1645252970903; Fri, 18 Feb 2022 22:42:50 -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 bp37sm22196115qkb.135.2022.02.18.22.42.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:42:50 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 00/15] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sat, 19 Feb 2022 01:42:13 -0500 Message-Id: <20220219064228.246917-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151316.1897345-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, As promised, here is v3! Changes since v2: * 05/15: Fix typo in commit message. * 09/15: Add `%racket-version` and `%racket-origin`. * 11/15: Add `%chez-scheme-for-racket-version`. * 15/15: Use `%racket-version` and `%racket-origin`. Also: * `racket-minimal`: The package to install explicitly is "racket-lib" ("base" is implicit). * `make-installation-layer.rkt`: Adjust workaround for , because `racket` (but not `racket-minimal`) ends up actually creating the bogus untethered "bin" directory. I've also put these patches up at -Philip Philip McGrath (15): gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. gnu: chez-scheme: Use new package style. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: Add racket-vm-cgc. gnu: Add racket-vm-bc. gnu: Add chez-scheme-for-racket. gnu: Add racket-vm-cs. gnu: chez-mit: Support chez-scheme-for-racket. gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. gnu: racket: Update to 8.4. gnu/local.mk | 5 +- gnu/packages/chez-and-racket-bootstrap.scm | 1074 ++++++++++++ gnu/packages/chez.scm | 628 +++---- gnu/packages/emacs-xyz.scm | 4 +- gnu/packages/loko.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 +++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1557 +++++++++++------ 8 files changed, 2821 insertions(+), 942 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:17 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:17 +0000 Received: from localhost ([127.0.0.1]:56714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSY-0004ig-Io for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:17 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:44668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSV-0004iI-Kv for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:08 -0500 Received: by mail-qv1-f43.google.com with SMTP id p7so19163331qvk.11 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:07 -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=9TFpLa7k7XGuzLjw5MhAd6ZkZsu9Mpyj+PYroFamV6w=; b=EH3X6+8mdjQLKLFJqf0qmr9RbEFcWyaMQIzRX7nfdc7OTwCGKfhJuv/Kkj/C0X/9FU 0XSLQPAodmztPAWyvBJXZ1yuNAsu7L6hwQPwg6svb6fZKo4JYZrj1S5QlRpTgvqg7XNs dpImVK27M2c5F65p8x5nJ7Ir9Z6EwU89kvzrezphD3MajDQ6rj1VGlPPty5UJU5vmleX NijlDm2Vem7/LYuJqRiS1fq8zTTFq1IgWdruBNyPeOxEYkCo+gW/FIQVk4ZZ8iSmEHWl TUDLG9a+3kWuxiv8QNiQ+NqAJiJcRMEMAlmGdxkQVwKvz++0ypy6+mI9hOxE0r/cnwS9 lPvg== 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=9TFpLa7k7XGuzLjw5MhAd6ZkZsu9Mpyj+PYroFamV6w=; b=cBDbHVIkvykWN0x04oxoyd98gN/hBH8D+kb8MUbmTcy+oZB/rfMflIyax6+r1QZf3r Tvo3WSEkGTUCEFflU0HIRR/dwJcNJLW07C1KcyFesrvX57yS4xr7fKJe6389DWBPeCtf WW810YlZiFcENR4hsJfG40s8Q+lxRtmWYTgZTZFfxiS7lChNw8GiWgjY4rwqeBEjSWNd Hqmv6Zxkus6x9kmVMoCQvxLXR/qwFhsG9b12x2zKCYLkQfhWAa+qqwcXRyibiV2p8gEw b81nkZIVkReEuy05OjgWOGC9GwuzID3pqLJIoIIlQAj3AV43eqQsUEoEMhYzEeAxFqv+ +WTg== X-Gm-Message-State: AOAM533va2QYgEGd0afRa/rQNXg7i2IIHHW3IT8uuVpciW7YKXLo9Kpa ZyFThzXmnfNDbqO45L4niKy2qQqPP0ZCqXAvOMk= X-Google-Smtp-Source: ABdhPJzCkKs3yrpn1SHygrYbBwEcjZ9WMrvzJdba8m5l8Hb0ce56elTgOGlvmf0PNqlJX6qaijscaQ== X-Received: by 2002:ac8:57c8:0:b0:2dc:e1e1:c3c6 with SMTP id w8-20020ac857c8000000b002dce1e1c3c6mr9754312qta.268.1645252981725; Fri, 18 Feb 2022 22:43:01 -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 d6sm26482096qtb.55.2022.02.18.22.43.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:01 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 01/15] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). Date: Sat, 19 Feb 2022 01:42:14 -0500 Message-Id: <20220219064228.246917-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (nanopass, stex, chez-scheme): Move to ... * gnu/packages/chez-and-racket-bootstrap.scm: ... this new file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/emacs-xyz.scm: Adjust imports accordingly. * gnu/packages/loko.scm: Likewise. * gnu/packages/racket.scm: Likewise. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 278 +++++++++++++++++++++ gnu/packages/chez.scm | 225 +---------------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- gnu/packages/racket.scm | 2 +- 6 files changed, 283 insertions(+), 227 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm diff --git a/gnu/local.mk b/gnu/local.mk index 7e781d8126..d963625a63 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -144,6 +144,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/certs.scm \ %D%/packages/check.scm \ %D%/packages/chemistry.scm \ + %D%/packages/chez-and-racket-bootstrap.scm \ %D%/packages/chez.scm \ %D%/packages/chicken.scm \ %D%/packages/chromium.scm \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm new file mode 100644 index 0000000000..f102b099fb --- /dev/null +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -0,0 +1,278 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Federico Beffa +;;; Copyright © 2016 Efraim Flashner +;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2019 Brett Gilio +;;; Copyright © 2020 Brendan Tildesley +;;; Copyright © 2021, 2022 Philip McGrath +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages chez-and-racket-bootstrap) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages compression) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages linux) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages netpbm) + #:use-module (gnu packages tex) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) + +;; Commentary: +;; +;; Alphabetically and chronologically, Chez comes before Racket. +;; +;; 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. +;; +;; Putting the relevant definitions together in this module avoids having to +;; work around dependency cycles. +;; +;; Code: + +(define nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) + +(define stex + ;; This commit includes a fix, which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (version "1.2.2") + (version (git-version version "1" commit))) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name "stex" version))))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version "9.5.6") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet + ;; Remove bundled libraries. + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib"))))))) + (build-system gnu-build-system) + (inputs + `(("libuuid" ,util-linux "lib") + ("zlib" ,zlib) + ("zlib:static" ,zlib "static") + ("lz4" ,lz4) + ("lz4:static" ,lz4 "static") + ;; for expeditor: + ("ncurses" ,ncurses) + ;; for X11 clipboard support in expeditor: + ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 + ("libx11" ,libx11))) + (native-inputs + `(("nanopass" ,nanopass) ; source only + ;; for docs + ("stex" ,stex) + ("xorg-rgb" ,xorg-rgb) + ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek))) + ("ghostscript" ,ghostscript) + ("netpbm" ,netpbm))) + (native-search-paths + (list (search-path-specification + (variable "CHEZSCHEMELIBDIRS") + (files (list (string-append "lib/csv" version "-site")))))) + (outputs '("out" "doc")) + (arguments + `(#:modules + ((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match)) + #:test-target "test" + #:configure-flags + '("--threads") ;; TODO when we fix armhf, it doesn't support --threads + #:phases + (modify-phases %standard-phases + ;; put these where configure expects them to be + (add-after 'unpack 'unpack-nanopass+stex + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (for-each (lambda (dep) + (define src + (assoc-ref (or native-inputs inputs) dep)) + (copy-recursively src dep + #:keep-mtime? #t)) + '("nanopass" "stex")))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs outputs + (configure-flags '()) + #:allow-other-keys) + (let* ((zlib-static (assoc-ref inputs "zlib:static")) + (lz4-static (assoc-ref inputs "lz4:static")) + (out (assoc-ref outputs "out")) + ;; add flags which are always required: + (flags (cons* + (string-append "--installprefix=" out) + (string-append "ZLIB=" zlib-static "/lib/libz.a") + (string-append "LZ4=" lz4-static "/lib/liblz4.a") + ;; Guix will do compress man pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" ,(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke + "./configure" + 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* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib")) + (name "chez-scheme")) + (symlink (string-append bin "/scheme") + (string-append bin "/" name)) + (map (lambda (file) + (symlink file (string-append (dirname file) + "/" name ".boot"))) + (find-files lib "scheme.boot"))))) + ;; Building explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (stex-output "/tmp") + (doc-dir (string-append stex-output + "/share/doc/" + stex+version))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/" + stex+version) + (string-append "Scheme=" + (assoc-ref outputs "out") + "/bin/scheme")) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((chez+version (strip-store-file-name + (assoc-ref outputs "out"))) + (stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + (scheme (string-append (assoc-ref outputs "out") + "/bin/scheme")) + ;; see note on stex-output in phase build-stex, above: + (stexlib (string-append "/tmp" + "/lib/" + stex+version)) + (doc-dir (string-append (assoc-ref outputs "doc") + "/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))) + ;; Chez Scheme does not have a MIPS backend. + ;; FIXME: Debian backports patches to get armhf working. + ;; We should too. It is the Chez machine type arm32le + ;; (no threaded version upstream yet, though there is in + ;; Racket's fork), more specifically (per the release notes) ARMv6. + (supported-systems (fold delete %supported-systems + '("mips64el-linux" "armhf-linux"))) + (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 license:asl2.0))) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 47904e7b4e..caf61a95f5 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,6 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Brendan Tildesley -;;; Copyright © 2021 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,234 +31,12 @@ (define-module (gnu packages chez) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (guix build-system gnu) - #:use-module (gnu packages compression) - #:use-module (gnu packages ncurses) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages ghostscript) - #:use-module (gnu packages linux) - #:use-module (gnu packages netpbm) #:use-module (gnu packages tex) - #:use-module (gnu packages compression) - #:use-module (gnu packages image) - #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) -(define nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - -(define-public chez-scheme - (package - (name "chez-scheme") - (version "9.5.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) - (build-system gnu-build-system) - (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) - (native-inputs - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) - (native-search-paths - (list (search-path-specification - (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) - (outputs '("out" "doc")) - (arguments - `(#:modules - ((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw) - (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) - ;; Chez Scheme does not have a MIPS backend. - ;; FIXME: Debian backports patches to get armhf working. - ;; We should too. It is the Chez machine type arm32le - ;; (no threaded version upstream yet, though there is in - ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) - (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-public chez-srfi (package (name "chez-srfi") diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 50232fcbbc..cb7d4425af 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -145,7 +145,7 @@ (define-module (gnu packages emacs-xyz) #:use-module (gnu packages aspell) #:use-module (gnu packages audio) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages cmake) #:use-module (gnu packages code) #:use-module (gnu packages cpp) diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index ef9312afe3..74a649b8a1 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -24,7 +24,7 @@ (define-module (gnu packages loko) #:use-module (gnu packages package-management) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) - #:use-module (gnu packages chez)) + #:use-module (gnu packages chez-and-racket-bootstrap)) (define-public loko-scheme (package diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d0a5ca494b..865fdff70f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -34,7 +34,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages fontutils) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:19 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:20 +0000 Received: from localhost ([127.0.0.1]:56718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSh-0004jH-Ir for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:19 -0500 Received: from mail-qk1-f178.google.com ([209.85.222.178]:40689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSd-0004ii-PZ for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:17 -0500 Received: by mail-qk1-f178.google.com with SMTP id c7so8001049qka.7 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:15 -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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=gDSW1Pp3CBqzEkE2cZVrNJcJKDZ0I2YL2BinTbUPTtCTig85TXZkg6j0uLct/Gh/xL /YxesmYca/d+TsRIGe4KHqIkrh0Frk3wxeKLZeEqyL8M92RBDwfi6cb4a7pZQzAzHzfc QDhpxoGqUYha5RNl1o3t+q9aDE10UINB6vkfjKqaHPwDLpF8b4LiVfYts+kYW03osiAC xmpt19FwDy6wCfJuoAHBaeZsweeZWozGe27tbhnnXekNubfZ2LvwrP2HYJfHpxR/ioKS 0XSsLNwOaLMEvQr6qkboKZm5+3cKgF67ZlnxHR8rlt4i0P+LWCLfuHFBusiQmLo5CZRI O4GQ== 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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=AQ1M0eNBYNND62bp0tUbYIwbRj9nHR8YzWwkg8x5N9gNeAnSwjFZ1Bj1kV2u+l64zk 2i5dBNpOhLdKLeg6T53pTR/IHr1MjHvlShh2kCdNynnUqM5L7qpiS4tVrPUtTyRjU8FN MSRyHdAQCw+khmf9ru//CwuOhK3p+dfjE8Y1ZdkZXAtOPmoteCNaw3HeJZN+/MX9VEAm sf2myrwfN7ov65Kaf00V2yNtFsRsrcgVDB3Y7s3F8jz25GYMzY587nphfaaR0vrL8JXI Cje7+p8+1Th/LnDjM2rqU/W8mS9agDaroozF4ks6JQ5Zmz6b49ZXXl6KnuuUSlNFCruF zDLw== X-Gm-Message-State: AOAM530X35SLd3pJFbj7rXO3jK+F/KCTuAUdXs88Zh/W6KL+Ut0TZ+tw uCPOwChWzpawN5on6C8MeKf/fdKsx7qaNrEiij4= X-Google-Smtp-Source: ABdhPJzUY/AqncNKqq3BS5zW5jYPdSAZhUbbbxmt5VBOKBfXcoPFeJ+88M4k2yfpCtFbbYtg1YUf1g== X-Received: by 2002:a37:bc45:0:b0:47e:292:4b8d with SMTP id m66-20020a37bc45000000b0047e02924b8dmr6797070qkf.484.1645252990143; Fri, 18 Feb 2022 22:43:10 -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 i4sm24884088qkn.13.2022.02.18.22.43.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:09 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 03/15] gnu: chez-scheme: Use shared zlib and lz4. Date: Sat, 19 Feb 2022 01:42:16 -0500 Message-Id: <20220219064228.246917-4-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez-and-racket-bootstrap (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 1ed4631ced..11d570059b 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -114,9 +114,7 @@ (define-public chez-scheme (inputs `(("libuuid" ,util-linux "lib") ("zlib" ,zlib) - ("zlib:static" ,zlib "static") ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") ;; for expeditor: ("ncurses" ,ncurses) ;; for X11 clipboard support in expeditor: @@ -169,14 +167,14 @@ (define src (lz4-static (assoc-ref inputs "lz4:static")) (out (assoc-ref outputs "out")) ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) + (flags (cons* (string-append "--installprefix=" out) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do compress-man-pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) (format #t "configure flags: ~s~%" flags) ;; Some makefiles (for tests) don't seem to propagate CC ;; properly, so we take it out of their hands: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:28 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:28 +0000 Received: from localhost ([127.0.0.1]:56722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSm-0004jc-TD for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:28 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:44672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSZ-0004iV-U7 for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:19 -0500 Received: by mail-qv1-f41.google.com with SMTP id p7so19163574qvk.11 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:11 -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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=R0tHLA6lNv3EChN7zZEm3ppSR7Hp9bctSPHi1aZfjbr8wXarQwtCKaPMxjOcTPP46d aTwZZF77BjJVFA4aaOK5UzxuVoCZyKZN7R01M4YHEkiFj6ccavAQMY7UPnX0fYjKpLkd fEfUyep9EMfNoc8VNj8mLmSgnZgykIO9b5EZg7+iKF5dsZKDCAejJpDxa5n2Xg+YRV9h Syb4qCzarc9Lb0yHP3/JXmPa8Dc3M7NyHvDTCDqB2Y6RGd7g9+sJGXMecgXo0t/eUlEp iYxlWWeGLIq19S1wmJmx3rxzIc+/z/nh4d7jGlpHzlkt+koooTrmKkQidLUkaE7fNpil OAwg== 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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=1dxuYAzDRyCrXQNzFSYEY0/KSTDSk9bduGgTT8Bd3ztj6/AzTkV16E5BxVPUcpyyTD WX35jS/9j8CZXpot+EZoy6Um295gc4rFrKC6hq/F+WkKLBnxAwoUseMMdYr3dQ0y06zc fXEuaTf0Brlxyn0EOY21GCDRMwwflUOvVHUPJ0vb5YPi4gNC/JQRvweNKoJGnutu6/CI 1G+nBNG4No+/S3DudnkmEkoRZH3NpGFjm89VF/exZSkPatyabolTM3av4+J9oPNGvKPA NUsw9Q6A6fwqRjrOfhSszPvAQbp1D7x4nxCCgvK06RVb3vi2FX2c/9sStwqybIvBvTEh kwzA== X-Gm-Message-State: AOAM532mGMDEKDQ7F1oB03zNIUewNiWIfbo4s7HtAdpY4ijUahb7ngvD Y1IJXjg5a5kUka+kI1746RInYa49pCpuOC0JQ5I= X-Google-Smtp-Source: ABdhPJzrz8Vqm6O2ZWSjWfNQRXfnRbYnq1Ip+I/ILKaSU9F9HNS0m2ee2zun+5oex4ky6FSIAYB0Ow== X-Received: by 2002:ac8:7d10:0:b0:2dc:ec79:889b with SMTP id g16-20020ac87d10000000b002dcec79889bmr9974221qtb.162.1645252985959; Fri, 18 Feb 2022 22:43:05 -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 b189sm2257868qkc.81.2022.02.18.22.43.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:05 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 02/15] gnu: chez-scheme: Use "lib/chez-scheme" for search path. Date: Sat, 19 Feb 2022 01:42:15 -0500 Message-Id: <20220219064228.246917-3-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". * gnu/packages/chez.scm (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Update accordingly. Also, remove input labels and use G-expressions. --- gnu/packages/chez-and-racket-bootstrap.scm | 2 +- gnu/packages/chez.scm | 373 +++++++++++---------- 2 files changed, 191 insertions(+), 184 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index f102b099fb..1ed4631ced 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -136,7 +136,7 @@ (define-public chez-scheme (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) + (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments `(#:modules diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index caf61a95f5..54bbee7923 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -37,6 +37,28 @@ (define-module (gnu packages chez) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) + +;; Help function for Chez Scheme to add the current path to +;; CHEZSCHEMELIBDIRS. +(define chez-configure + #~(lambda _ + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) + (setenv "CHEZSCHEMELIBDIRS" + (if chez-env + (string-append ".:" chez-env) + "."))))) + +;; Help function to define make flags for some Chez Scheme custom make +;; files. +(define (chez-make-flags name version) + #~(let ((out #$output)) + (list + ;; Set 'schemedir' so that libraries are installed in + ;; 'lib/chez-scheme' like Chez's 'native-search-paths' expects. + (string-append "schemedir=" out "/lib/chez-scheme") + (string-append "PREFIX=" out) + (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) + (define-public chez-srfi (package (name "chez-srfi") @@ -54,13 +76,11 @@ (define-public chez-srfi (native-inputs (list chez-scheme)) (arguments - `(#:make-flags (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out) - "CHEZ=chez-scheme --libdirs ./" - (string-append "chezversion=" ,(package-version chez-scheme)))) - #:test-target "test" - #:phases (modify-phases %standard-phases - (delete 'configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -85,42 +105,48 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("ghostscript" ,ghostscript) - ("texlive" ,(texlive-updmap.cfg (list texlive-oberdiek - texlive-epsf - texlive-metapost - texlive-charter - texlive-pdftex - texlive-context - texlive-cm - texlive-tex-plain))))) + (list chez-scheme + ghostscript + ;; FIXME: This package fails to build with the error: + ;; mktexpk: don't know how to create bitmap font for bchr8r + ;; Replacing the following with `texlive` fixes it. + ;; What is missing? + (texlive-updmap.cfg (list texlive-oberdiek + texlive-epsf + texlive-metapost + texlive-charter + texlive-pdftex + texlive-context + texlive-cm + texlive-tex-plain)))) (arguments - `(#:make-flags (list (string-append "PREFIX=" %output) - (string-append "DOCDIR=" %output "/share/doc/" - ,name "-" ,version) - (string-append "LIBDIR=" %output "/lib/chezweb") - (string-append "TEXDIR=" %output "/share/texmf-local")) - #:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - ;; This package has a custom "bootstrap" script that - ;; is meant to be run from the Makefile. - (delete 'bootstrap) - (replace 'configure - (lambda* _ - (copy-file "config.mk.template" "config.mk") - (substitute* "tangleit" - (("\\./cheztangle\\.ss" all) - (string-append "chez-scheme --program " all))) - (substitute* "weaveit" - (("mpost chezweb\\.mp") - "mpost --tex=tex chezweb.mp") - (("\\./chezweave" all) - (string-append "chez-scheme --program " all))) - (substitute* "installit" - (("-g \\$GROUP -o \\$OWNER") "")) - #t))))) + (list + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "DOCDIR=" #$output "/share/doc/" + #$name "-" #$version) + ;; lib/chez-scheme/chezweb ??? + (string-append "LIBDIR=" #$output "/lib/chezweb") + (string-append "TEXDIR=" #$output "/share/texmf-local")) + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + ;; This package has a custom "bootstrap" script that + ;; is meant to be run from the Makefile. + (delete 'bootstrap) + (replace 'configure + (lambda* _ + (copy-file "config.mk.template" "config.mk") + (substitute* "tangleit" + (("\\./cheztangle\\.ss" all) + (string-append "scheme --program " all))) + (substitute* "weaveit" + (("mpost chezweb\\.mp") + "mpost --tex=tex chezweb.mp") + (("\\./chezweave" all) + (string-append "scheme --program " all))) + (substitute* "installit" + (("-g \\$GROUP -o \\$OWNER") ""))))))) (home-page "https://github.com/arcfide/ChezWEB") (synopsis "Hygienic Literate Programming for Chez Scheme") (description "ChezWEB is a system for doing Knuthian style WEB @@ -144,95 +170,74 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("chez-web" ,chez-web) - ("texlive" ,(texlive-updmap.cfg (list texlive-pdftex))))) + (list chez-scheme + chez-web + (texlive-updmap.cfg (list texlive-pdftex)))) (arguments - `(#:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-web (assoc-ref inputs "chez-web")) - (chez (assoc-ref inputs "chez-scheme")) - (chez-h (dirname (car (find-files chez "scheme\\.h"))))) - (substitute* "Makefile" - (("(SCHEMEH=).*$" all var) - (string-append var chez-h))) - #t))) - (add-before 'build 'tangle - (lambda* (#:key inputs #:allow-other-keys) - (setenv "TEXINPUTS" - (string-append - (getcwd) ":" - (assoc-ref inputs "chez-web") "/share/texmf-local/tex/generic:" - ":")) - ;; just using "make" tries to build the .c files before - ;; they are created. - (and (invoke "make" "sockets") - (invoke "make")))) - (replace 'build - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - ;; make sure Chez Scheme can find the shared libraries. - (substitute* "sockets.ss" - (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" - all cmd so) - (string-append cmd " \"" chez-site "/" so "\"")) - (("sockets-stub\\.[sd][oy].*" all) - (string-append chez-site "/" all))) - ;; to compile chez-sockets, the .so files must be - ;; installed (because of the absolute path we - ;; inserted above). - (for-each (lambda (f d) (install-file f d)) - '("socket-ffi-values.so" "sockets-stub.so") - (list chez-site chez-site)) - (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) - (replace 'install - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/chez-sockets")) - (doc (string-append out "/share/doc/" ,name "-" ,version)) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - (for-each (lambda (f d) (install-file f d)) - '("sockets.pdf" "sockets.so") - (list doc chez-site)) - #t)))))) + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((scheme (search-input-file (or native-inputs inputs) + "/bin/scheme")) + (lib (string-append (dirname scheme) "/../lib")) + (header-file (car (find-files lib "scheme\\.h"))) + (include-dir (dirname header-file))) + (substitute* "Makefile" + (("(SCHEMEH=).*$" _ var) + (string-append var include-dir)))))) + (add-before 'build 'tangle + (lambda* (#:key inputs #:allow-other-keys) + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" + (assoc-ref inputs "chez-web") + "/share/texmf-local/tex/generic:" + ":")) + ;; just using "make" tries to build the .c files before + ;; they are created. + (and (invoke "make" "sockets") + (invoke "make")))) + (replace 'build + (lambda args + (let ((chez-site (string-append #$output + "/lib/chez-scheme/arcfide"))) + ;; make sure Chez Scheme can find the shared libraries. + (substitute* "sockets.ss" + (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post)) + (("(\")(sockets-stub\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post))) + ;; to compile chez-sockets, the .so files must be + ;; installed (because of the absolute path we + ;; inserted above). + (for-each (lambda (f) + (install-file f chez-site)) + '("socket-ffi-values.so" + "sockets-stub.so")) + (invoke "bash" + "-c" + (format #f "echo '~s' | scheme -q" + '(compile-file "sockets.sls")))))) + (replace 'install + (lambda args + (install-file "sockets.so" + (string-append #$output + "/lib/chez-scheme/arcfide")) + (install-file "sockets.pdf" + (string-append #$output + "/share/doc/" + #$name "-" #$version))))))) (home-page "https://github.com/arcfide/chez-sockets") (synopsis "Extensible sockets library for Chez Scheme") (description "Chez-sockets is an extensible sockets library for Chez Scheme.") (license expat)))) -;; Help function for Chez Scheme to add the current path to -;; CHEZSCHEMELIBDIRS. -(define chez-configure - '(lambda _ - (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) - (setenv "CHEZSCHEMELIBDIRS" - (if chez-env - (string-append ".:" chez-env) - ".")) - #t))) - -;; Help function to define make flags for some Chez Scheme custom make -;; files. -(define (chez-make-flags name version) - `(let ((out (assoc-ref %outputs "out"))) - (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" ,(package-version chez-scheme)) - (string-append "PREFIX=" out) - (string-append "DOCDIR=" out "/share/doc/" - ,name "-" ,version)))) - (define-public chez-matchable (package (name "chez-matchable") @@ -253,10 +258,11 @@ (define-public chez-matchable (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -284,10 +290,11 @@ (define-public chez-irregex (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -314,17 +321,18 @@ (define-public chez-fmt (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "chez-check" - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - (replace 'build - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-build" make-flags))) - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-install" make-flags)))))) + (list #:make-flags (chez-make-flags name version) + #:test-target "chez-check" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-build" make-flags))) + (replace 'install + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-install" make-flags)))))) (home-page "http://synthcode.com/scheme/fmt") (synopsis "Combinator formatting library for Chez Scheme") (description "This package provides a library of procedures for @@ -354,10 +362,11 @@ (define-public chez-mit (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -386,46 +395,44 @@ (define-public chez-scmutils (propagated-inputs (list chez-mit chez-srfi)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:tests? #f ; no test suite - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - ;; 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 - ;; in turn requires us to compile the files in the final - ;; destination. - (delete 'build) - (add-after 'install 'install-src - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-src" make-flags))) - (add-after 'install-src 'absolute-path-in-scm-files - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils") - (string-append "include \"" (dirname file))))) - (find-files out "\\.sls")) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils/simplify") - (string-append "include \"" (dirname file))))) - (find-files out "fbe-syntax\\.scm")) - #t))) + (list + #:make-flags (chez-make-flags name version) + #:tests? #f ; no test suite + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + ;; 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 + ;; in turn requires us to compile the files in the final + ;; destination. + (delete 'build) + (add-after 'install 'install-src + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "install-src" make-flags))) + (add-after 'install-src 'absolute-path-in-scm-files + (lambda* (#:key #:allow-other-keys) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils") + (string-append "include \"" (dirname file))))) + (find-files #$output "\\.sls")) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils/simplify") + (string-append "include \"" (dirname file))))) + (find-files #$output "fbe-syntax\\.scm")))) (add-after 'absolute-path-in-scm-files 'build - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (mk-file (car (find-files out "Makefile")))) + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (let ((mk-file (car (find-files #$output "Makefile")))) (with-directory-excursion (dirname mk-file) (apply invoke "make" "build" make-flags))))) (add-after 'build 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (for-each delete-file - (find-files out "Makefile|compile-all\\.ss")) - #t)))))) + (lambda args + (for-each delete-file + (find-files #$output + "Makefile|compile-all\\.ss"))))))) (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") (description "This package provides a port of the MIT/GNU Scheme Scmutils program to Chez Scheme. The port consists of a set of -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:29 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:29 +0000 Received: from localhost ([127.0.0.1]:56724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSq-0004jr-Fl for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:29 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:33719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSi-0004is-0H for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:20 -0500 Received: by mail-qv1-f53.google.com with SMTP id h9so19230783qvm.0 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:19 -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=voen33luSuZnifO97fQiqSCtXHVzAz6OmjDwr/H6AjE=; b=HpPT57jTIJtgvMyUY3e0QDhXdCjn5rKNhwgHP6LGeRQG8+I+buXXu45zMlBQt3DuCH N8TV3LAHYNR7RzlWWU3KckyxRvU7qczcVIQKZyA1Z5cLAbZTU57U/s4kfIHzy/7va7WO mqrJZgS9WTvWmVWhStGhVUtklDaRiKk95kkfWXHXkZyp5G5v8rG+XCrKOUFZ/KeheDqx 0I9N5DCRiUj+Xz8m+K4z0tOhqV6Wf5Lr/RDHszIlmLUNDq8RWjXrrJJHo8zVuUcliu8J CC09k3AI7zCA8urJlyNHGYsHA1v4NtAibedPS0IXV16ib0AGr4OFWHmt2JPwyun3piF2 BwLg== 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=voen33luSuZnifO97fQiqSCtXHVzAz6OmjDwr/H6AjE=; b=sYKlnhLTwYZ56dH+zywqv+TbgGwuPn5OPWrSSdDrTTakGguG7fDszlE3F1c4bEYnck 75PL9hRb4O8FwOJ+MwyaCXSX2I5jVcsMSaMlZgbrkQhMtT7YhJFielcGmyscsBSmEDi1 YnwQJZyVzo5sPo8OpZHyoeCWO0qgP+7Mg0MzcQW1l2/ujoKxpaIx2xMLx2N3R2WRwVwe k0CcDDeGYln99XWKnNUK1dBtbx6gse/x/MsHWIeGJxo2MYF0fmdAmpEP992ADMtK2qZe 0Ns+WwJiOIPZsWeIorFvKp79dlDcG6PUC7IB6U6+tEFEX3AtVbpta5NkhmnO6cf7gCHx H6sQ== X-Gm-Message-State: AOAM530c3wf4WSMkKr0tbm9bFgzYCcLkpJoIobEjC5FbC6lxPxDJnWpN 8O3lspRiylrF1Ihf+vcX/cAAcvcyXF4WIkWHNoI= X-Google-Smtp-Source: ABdhPJwkFW+poFhuJUfTv0w59ACKFFeuavXk78obQTUozjBJ9wD5p4ohztQJCRJyOYkFZtKxmonORQ== X-Received: by 2002:a05:622a:1190:b0:2dc:915a:9ce4 with SMTP id m16-20020a05622a119000b002dc915a9ce4mr9527750qtk.221.1645252994291; Fri, 18 Feb 2022 22:43:14 -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 y20sm26559543qtw.28.2022.02.18.22.43.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:14 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 04/15] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. Date: Sat, 19 Feb 2022 01:42:17 -0500 Message-Id: <20220219064228.246917-5-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system, nix-system->chez-machine, chez-upstream-features-for-system): New private functions. (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private constants. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. --- gnu/packages/chez-and-racket-bootstrap.scm | 118 ++++++++++++++++++++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 11d570059b..1a923fe62d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -28,7 +28,9 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -61,6 +63,115 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; 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 +MACHINE. The returned string may share storage with MACHINE." + ;; Chez Scheme documentation consistently uses "nonthreaded" rather than + ;; e.g. "unthreaded" + (if (eqv? #\t (string-ref machine 0)) + (substring machine 1) + machine)) +(define (chez-machine->threaded machine) + "Like @code{chez-machine->nonthreaded}, but returns the threaded machine +type." + (if (eqv? #\t (string-ref machine 0)) + machine + (string-append "t" machine))) + +;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt +;; in https://github.com/racket/raco-cross. +;; For supported platforms, refer to release_notes/release_notes.stex in the +;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md +;; in https://github.com/racket/racket. +(define %nix-arch-to-chez-alist + `(("x86_64" . "a6") + ("i386" . "i3") + ("aarch64" . "arm64") + ("armhf" . "arm32") ;; Chez supports ARM v6+ + ("ppc" . "ppc32"))) +(define %nix-os-to-chez-alist + `(("w64-mingw32" . "nt") + ("darwin" . "osx") + ("linux" . "le") + ("freebsd" . "fb") + ("openbsd" . "ob") + ("netbsd" . "nb") + ("solaris" . "s2"))) + +(define (chez-machine->nix-system machine) + "Return the Nix system type corresponding to the Chez Scheme machine type +MACHINE. If MACHINE is not a string representing a known machine type, an +exception is raised. This function does not distinguish between threaded and +nonthreaded variants of MACHINE. + +Note that this function only handles Chez Scheme machine types in the +strictest sense, not other kinds of descriptors sometimes used in place of a +Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or +@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type +for the host system is often still relevant.)" + (let ((machine (chez-machine->nonthreaded machine))) + (let find-arch ((alist %nix-arch-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (string-prefix? chez machine) + (string-append + nix "-" (let ((machine-os + (substring machine (string-length chez)))) + (let find-os ((alist %nix-os-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (equal? chez machine-os) + nix + (find-os alist))))))) + (find-arch alist))))))) + +(define* (nix-system->chez-machine #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return the Chez Scheme machine type corresponding to the Nix system +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme +machine type is undefined. + +It is unspecified whether the resulting string will name a threaded or a +nonthreaded machine type: when the distinction is relevant, use +@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust +the result." + (let* ((hyphen (string-index system #\-)) + (nix-arch (substring system 0 hyphen)) + (nix-os (substring system (+ 1 hyphen))) + (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) + (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) + (and chez-arch chez-os (string-append chez-arch chez-os)))) + +(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}. Other feature symbols may be added in the future." + (cond + ((not (nix-system->chez-machine system)) + #f) + ((target-aarch64? system) + #f) + ((target-arm32? system) + (and (target-linux? system) + '())) + ((target-ppc32? system) + (and (target-linux? system) + '(threads))) + (else + '(threads)))) + +;; +;; Chez Scheme: +;; + (define nanopass (let ((version "1.9.2")) (origin @@ -264,8 +375,11 @@ (define* (stex-make #:optional (suffix "")) ;; We should too. It is the Chez machine type arm32le ;; (no threaded version upstream yet, though there is in ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) + (supported-systems + (delete + "armhf-linux" ;; <-- should work, but reportedly broken + (filter chez-upstream-features-for-system + %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:34 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:35 +0000 Received: from localhost ([127.0.0.1]:56728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSw-0004kM-7P for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:34 -0500 Received: from mail-qv1-f54.google.com ([209.85.219.54]:40770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSm-0004jA-8U for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:25 -0500 Received: by mail-qv1-f54.google.com with SMTP id v10so19199696qvk.7 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43: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=JwvfZHyJKETZma/gALezVSuvOV1yuRcg10wvB8l7Pq0=; b=gmLACvoYBiNqo1E/5JUFxLZRBcgShbocYaK+kiHCcJcoiYy5bejJPAo76auZs9V+4P Q/4Zk1R3fjWClRjYjo8nuY7v5j+iA0g0bAOoKnasurFz1x9gEvi+7IY/CLzBSUIaWA6K fTGgAjVFClkP6Y1YH55MGELSGHHdJ6DpxMjxK2F8rgQSVvn8+EZv+njpozvkwSn6MV6E RZd/wIdG5dC6aoM9ssJTSreiXVr1sDrRibOSG1jgxroaKfqy2YT0QEgyMN4IyjuGHwgI m7luN6j7yEneziT/OOSJa5yaON/K+3vmuAExgMynml8B3dzIHdBh6t7i8ARP3iGCGo7z xwmg== 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=JwvfZHyJKETZma/gALezVSuvOV1yuRcg10wvB8l7Pq0=; b=hPDcQqNPlsKsTS4PLjOgwS22vsVmHaHNcgB3DvBGTSaJpdfEVqgAMGzfBt6UD21Nq0 KH8ve3EKutmtl2o51rRUP9Lwuylubgwx2V1PqcxGEbluQFozeDd3+6DbGw6vMQ7hTZpc TDd9OsYRi+oALaqtfz0VVK4Ba6QO3TvjJ1g0OvTb2fyp82WTONi8MjwyRYNtGIq29ed3 NSFuBQsFqThZm29oma4YpYoNEn1RYbzELcidIRYy7SABHVo6RHZFwr5ztVjPyB1fvsVH +Xfe6LwGdBs7b34cYSPzuNYaDxXsTizJHBR2NjAmjlc2j8cM6RvM64HmMYvm7KKJhtKh 56mQ== X-Gm-Message-State: AOAM531gnlnYDJ0ozkvqOVtUWvCyZbp1DV3iZGd6GRzQDAMSzPT3xFQZ aM9sHDkRM5iI+V2+M99R/J0RAHQKAvXEMBSrQm4= X-Google-Smtp-Source: ABdhPJz41wbEH2DFnyojFULQaVjLFaD+oGWXMTNzj6EoTku8cUl/DXXJ3vPAQolixe80U6IgvR5oDw== X-Received: by 2002:ac8:534e:0:b0:2d7:fd81:7e6 with SMTP id d14-20020ac8534e000000b002d7fd8107e6mr10202568qto.382.1645252998577; Fri, 18 Feb 2022 22:43:18 -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 j11sm27053975qtj.74.2022.02.18.22.43.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:18 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 05/15] gnu: chez-scheme: Use new package style. Date: Sat, 19 Feb 2022 01:42:18 -0500 Message-Id: <20220219064228.246917-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[inputs, native-inputs]: Remove labels. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass, stex): Make public as a temporary workaround for Racket. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 288 ++++++++++----------- gnu/packages/racket.scm | 5 +- 2 files changed, 137 insertions(+), 156 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 1a923fe62d..81ac8f0774 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -172,7 +172,7 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define nanopass +(define-public nanopass (let ((version "1.9.2")) (origin (method git-fetch) @@ -182,7 +182,7 @@ (define nanopass (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) (file-name (git-file-name "nanopass" version))))) -(define stex +(define-public stex ;; This commit includes a fix, which we would otherwise want to use as ;; patch. Let's revert to tagged releases as soon as one becomes available. (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") @@ -199,86 +199,80 @@ (define stex (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.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))))) (build-system gnu-build-system) (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("lz4" ,lz4) - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) + (list + `(,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 - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) + (list nanopass ; source only + ;; for docs + stex + xorg-rgb + (texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* (string-append "--installprefix=" out) + #:test-target "test" + ;; TODO when we fix armhf, it may not support --threads + #:configure-flags #~'("--threads") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (copy-recursively #$nanopass + "nanopass" + #:keep-mtime? #t) + (copy-recursively #$stex + "stex" + #:keep-mtime? #t))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) + ;; add flags which are always required: + (let ((flags (cons* (string-append "--installprefix=" #$output) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" @@ -286,90 +280,78 @@ (define src ;; and letting Chez try causes an error "--nogzip-man-pages" configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke "./configure" 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* ((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 explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (let* ((stex-output "/tmp") + (doc-dir (string-append stex-output "/share/doc/stex"))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/stex") + (string-append "Scheme=" + (search-input-file outputs + "/bin/scheme"))) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (match (assoc-ref outputs "doc") + (#f + (format #t "not installing docs~%")) + (doc-prefix + (let* ((chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib "/tmp/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 865fdff70f..a1ba57cca3 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,9 +333,8 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) "stex")) - ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) - "nanopass")))) + ("stex" ,stex) + ("nanopass" ,nanopass))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:35 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:35 +0000 Received: from localhost ([127.0.0.1]:56730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSw-0004kO-Uq for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:35 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:37562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSq-0004ja-Fv for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:29 -0500 Received: by mail-qv1-f52.google.com with SMTP id a19so19202743qvm.4 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:28 -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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=MG86DZlgZ2KwlZS4EeS1UKLX53YcqnJ6M3Pd9G5yb22rfouWQSC0i969JbcxmS2NQ2 wMO/ajWZ5EtMvUujFK7TaZZ1aKR7o0lsRdg2r/R3dOnjT4imyIxVPMPf0WGXWCocmhnf tjVeVxm2X2YC7Lo5bnFXTHKQI66F7pU1qY2nSxPcBhp57nD7RyzJdDmbr4GbyKBIm2Yj u8BCkcbcOsrcyWjNe4jZIS8/PK4fNLzqXYILsr/YG8C6PN4Vik5mXjnaFWdESLvTP0Os XBUD5O+3AOPGBdiZfJXKcneE3Uye2A/ZeowSM+P2Y7geIHgUQ2QUUqJTwTg/kbQhc3sq P/yw== 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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=q6+SE0HVODrPTQt7SRdzu9C0ptoE4qQncx7WG/A6t315+QDhgKaObOm4fGsgYLASr3 ln/iafKfPoRi99uryV4IO/qVu5kESZ3z+4lDXdxabHBObZz8CUUBKPnZh5wpt7KTqoWA zgd2R3x/Eh0rYxS6iJpoua88C1jwZTOKZl05wiKIQSpC6fNcxcq5xAdavPLY0sEiLGJQ TcRJIFkX4NsDLhJ4rW7Qt4i4sSUW/To5zTnhrdKlOmtvyWX+JqrjX0nzVS0yioj+V4Qb 4xQ7x8Of+pgYeF+HyoRmvAA9H9uvC2n0kt5ZAbqzn2TtUXNhTxWTpKD/s2IxjtLH2Bew t6GA== X-Gm-Message-State: AOAM53205RXZCxl1u/xLhSMEEE5+AUdafTy4VFFMHWH9BhaWvczLnBZE BmTGVSvsqIxNgFoCX38zC2Olu6JfvY5GmTl/jTU= X-Google-Smtp-Source: ABdhPJykoLbpZXiJBGvYvqX+JGoayrm6Rlh8GSlY4U07JC/DLOJGj9SHycE5hU+e/YnM1Vwv2yM5YA== X-Received: by 2002:ac8:7d55:0:b0:2d1:985a:5b22 with SMTP id h21-20020ac87d55000000b002d1985a5b22mr9778244qtb.477.1645253002821; Fri, 18 Feb 2022 22:43:22 -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 l1sm5190883qtp.4.2022.02.18.22.43.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:22 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 06/15] gnu: Add stex. Date: Sat, 19 Feb 2022 01:42:19 -0500 Message-Id: <20220219064228.246917-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap'. (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies of stex-bootstrap. [arguments]<#:phases>: Remove 'prepare-stex'. Adjust 'unpack-nanopass+stex' and 'install-doc'. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 215 +++++++++++++++------ gnu/packages/racket.scm | 2 +- 2 files changed, 155 insertions(+), 62 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 81ac8f0774..83bf15b5fb 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -31,6 +31,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -172,30 +173,6 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define-public stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - (define-public chez-scheme (package (name "chez-scheme") @@ -232,15 +209,7 @@ (define-public chez-scheme libx11)) (native-inputs (list nanopass ; source only - ;; for docs - stex - xorg-rgb - (texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek)) - ghostscript - netpbm)) + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -263,9 +232,11 @@ (define-public chez-scheme (copy-recursively #$nanopass "nanopass" #:keep-mtime? #t) - (copy-recursively #$stex - "stex" - #: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"))))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -301,32 +272,9 @@ (define-public chez-scheme (symlink scheme.boot (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (let* ((stex-output "/tmp") - (doc-dir (string-append stex-output "/share/doc/stex"))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/stex") - (string-append "Scheme=" - (search-input-file outputs - "/bin/scheme"))) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) ;; Building the documentation requires stex and a running scheme. ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc + (add-after 'install-symlink 'install-doc (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (match (assoc-ref outputs "doc") (#f @@ -334,7 +282,9 @@ (define-public chez-scheme (doc-prefix (let* ((chez+version (strip-store-file-name #$output)) (scheme (search-input-file outputs "/bin/scheme")) - (stexlib "/tmp/lib/stex") + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) (doc-dir (string-append doc-prefix "/share/doc/" chez+version))) @@ -370,3 +320,146 @@ (define* (stex-make #:optional (suffix "")) generates native code for each target processor, with support for x86, x86_64, and 32-bit PowerPC architectures.") (license license:asl2.0))) + +;; +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + #$(chez-machine->threaded + (nix-system->chez-machine))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine "\\."))))) + (else + ;; for bootstrapping, can run without ahead-of-time + ;; compilation + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is referenced in the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license license:expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (outputs '("out" "doc")) + (properties '()))) + +(define-public nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index a1ba57cca3..d8338bcd6f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,7 +333,7 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,stex) + ("stex" ,(package-source stex)) ("nanopass" ,nanopass))) (arguments `(#:phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:36 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:36 +0000 Received: from localhost ([127.0.0.1]:56732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSx-0004kW-K5 for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:36 -0500 Received: from mail-qv1-f45.google.com ([209.85.219.45]:41586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSu-0004jn-P5 for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:33 -0500 Received: by mail-qv1-f45.google.com with SMTP id x3so19174541qvd.8 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:32 -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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=QbBHSzf4hnZ6Jjrj/8rbponDQC/HIJs6ty7J+dhTRMkV7Y+mwg9UIExqIE6ViNUcJF GPpTK8Wn8yqIzOgg8NTISnzouXxhNm1z9X0rFBY0fnO5EunDg9GmiTk5RUws3NdPoE+7 4/PvQgfvF21/x8kvsYDThuOL2ZiDEyVk+fNTbYb2/50yL8T3SIytL2wURQOvrm01MTm8 oaMxo5vkq8te+pEx9CWSMRjnL5YYENtwoRNLOfuV5QgAZI2RRxyv2DE7CxdRP+ZcpnKH x7AbFxEOpNHcLQjBeXz0YNSXN26I2AZ7Jo4an+30n6dmrJBJRVe6oZM3FZusbzRBxiZO Th9Q== 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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=HJ6dywr+I/kVfim6L9Bh0ZJ2eFCm4J72Se9iES648CN+dAG2mQjfAoM/Sqbk8wD40C SSUmSCJA+7uVA6WwR7LXfdOoKj7GTMYs5i888Jgef9ntwSbkE+H0iBBJlBI6Sd2g0Am8 nt2JdYtY5pE3cwHBojUam8dk6k10DmNfSo44NVBk2RAZ9qqXEUNd8gQCIFEdHXN43C1C WZfeFJNpXqwiWq/2z5jhoC4WJFVcsi3hKnlAUS0TNIRAlkVRmUB0PtInjXJ0m6CyTE/i M9k4c4etThZhtHMBgydXUlU6gng3jhpru+spWECwAH4DDdAqs7MMWvlkHFH0QDZO/q1j CO0Q== X-Gm-Message-State: AOAM531BWmGJseAD1UupjhXy4ldtr7delviN3BVDs03BdQuoITsmbRls mf5aUXl0bf4Povu1En0KqTiQLgls1Y1GhBFq2sA= X-Google-Smtp-Source: ABdhPJw13Bk3i6Toe7XuuVpAt0c2yIBWDbDStP6YwgED/R36PVK/tT15KcMSuE783reh9NcqPIiFww== X-Received: by 2002:a05:622a:5d2:b0:2dd:2d7b:db15 with SMTP id d18-20020a05622a05d200b002dd2d7bdb15mr9837872qtb.570.1645253007094; Fri, 18 Feb 2022 22:43:27 -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 d23sm5805725qka.50.2022.02.18.22.43.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:26 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 07/15] gnu: Add chez-nanopass. Date: Sat, 19 Feb 2022 01:42:20 -0500 Message-Id: <20220219064228.246917-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Adapt 'unpack-nanopass+stex'. (chez-nanopass): New variable. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Adapt accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 96 ++++++++++++++++++---- gnu/packages/racket.scm | 2 +- 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 83bf15b5fb..d66955d50d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -207,9 +207,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs - (list nanopass ; source only - stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -228,10 +226,12 @@ (define-public chez-scheme #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (copy-recursively #$nanopass - "nanopass" - #:keep-mtime? #t) + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (copy-recursively + (dirname (search-input-file (or native-inputs inputs) + "lib/chez-scheme/nanopass.ss")) + "nanopass" + #:keep-mtime? #t) (mkdir-p "stex") (with-output-to-file "stex/Mf-stex" (lambda () @@ -454,12 +454,76 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license license:expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d8338bcd6f..e8d016c07b 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -334,7 +334,7 @@ (define-public racket-bootstrap-chez-bootfiles racket-minimal racket-minimal-bc-3m)) ("stex" ,(package-source stex)) - ("nanopass" ,nanopass))) + ("nanopass" ,(package-source chez-nanopass)))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:48 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:48 +0000 Received: from localhost ([127.0.0.1]:56737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTA-0004lI-5Q for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:48 -0500 Received: from mail-qk1-f178.google.com ([209.85.222.178]:44610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJSy-0004kB-Ro for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:37 -0500 Received: by mail-qk1-f178.google.com with SMTP id q4so8837660qki.11 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:36 -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=KNOUjMT3+W/jjCU6TuR4VoZo9rnrj3vaZE3pLMma7YQ=; b=NslN0ZL1F4uPg67/ViQ6yzxwzopN4gOkmNUYVZET1JYftxjocv+rtr+Cv4+h2wBM0x eeMazf7me2TUCekVYBo4s0IcOr9HmG4G3PU6ZPZEzClVClv0rdIHqaz34doYniBbtgJG wxePAWMa07WYb3aLaxb71B/AGh4tjzbE73vtHrqbLlQP/qp7ZrtsqhGbynG3peFIl0uZ c8ljzrhVlBxl1ELUqPyW2pzl0ZHWinoSla2/cjKwgQ0yir9yUt8qUlOGCraJEgHxvKkk /DjaaGOKxRCmYS3LOCQDNKXpJ1O1l815FGKMKpYsvV5xcyK9fp6Fh5FS8AOOvstaYalk T8ag== 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=KNOUjMT3+W/jjCU6TuR4VoZo9rnrj3vaZE3pLMma7YQ=; b=2JFm7SvNLhEmie7c6s6V1DWm95G89qsnxBwXDDV7PvOttcCS3HsZhCXGqgUqpglbJr W/wimFldRBfWwpQ1zWzpoyrLln9nCTbSEXuM7nH0luF59eoFfxI89C/g6OBZOYQdpYP0 bnneZuw7yi0utHYxCH3l3uYKvMcvHMUZs64l0yDvsq1XeSneGpNt7T8JS628mLDdqFPc nMONHcSL3RDYxgXcZSjSrWZvW1FO9Ekk9kbElMfsgZiT25vjNJtKCs+B0xtExh122/g2 FiDQQcsXOVbsyzVleDLYHJDNiW/sbyFaH8bQzv0Gj5pEotMiJlzCuU+KhciPR0Oa/PPt 3mqw== X-Gm-Message-State: AOAM530x1fSEGf42jDeSfVqjuggdEDedfVWM+pY/koEFZ0G+6CJnslqT jkzHR1+L+firQlf4aJu0WucZvFiZQOHGRuw8X7w= X-Google-Smtp-Source: ABdhPJzxB8XHdqo8PQeH4syXSFk01a7cTLVOUeft8JupuqOB8y3vt3/AXnQq7c0ehhjZXRfIjW1noQ== X-Received: by 2002:ae9:ef58:0:b0:46c:e3c1:71ff with SMTP id d85-20020ae9ef58000000b0046ce3c171ffmr6662639qkg.698.1645253011361; Fri, 18 Feb 2022 22:43:31 -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 z17sm26705721qta.11.2022.02.18.22.43.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:31 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 08/15] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Sat, 19 Feb 2022 01:42:21 -0500 Message-Id: <20220219064228.246917-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This might seem a bit silly in isolation, but it makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. --- gnu/packages/chez-and-racket-bootstrap.scm | 51 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index d66955d50d..366815634d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -187,7 +187,7 @@ (define-public chez-scheme (sha256 (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) + (file-name (git-file-name "chez-scheme" version)) (snippet #~(begin (use-modules (guix build utils)) (for-each (lambda (dir) @@ -207,7 +207,9 @@ (define-public chez-scheme ;; 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-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -237,6 +239,14 @@ (define-public chez-scheme (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 (or native-inputs 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`. @@ -321,6 +331,43 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license 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 + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %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 upsream +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: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:43:48 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:43:48 +0000 Received: from localhost ([127.0.0.1]:56739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTA-0004lL-Gy for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:48 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:43004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJT7-0004ks-85 for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:45 -0500 Received: by mail-qv1-f52.google.com with SMTP id e22so19179495qvf.9 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:45 -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=Wyq76XvZzRbzHzBnE5w+mHUqlFD+yIu8JhzY276hv+E=; b=Th9YJXkho6IVPfjr4ZbaASYk+PAEBZBSjSy6qu0sc+HNRhVfex8qZOvOwD4aVV41uC jYwfkSknYbCo2KeNvwz0TAHQKAzWVNdnp2GwFNNvkjuXmyGqzQ3AcTKbTtVxZtLxejgt wgxXaNk9PIEuiEsy4WcOXwQ8yn95kpGgO4Eb+zNFd6Pu3ZrZNCq++fKzzqTyK+81rV8Q 0omH/st7f/bHhI3GPGjXhqHo0qmffanqPC3nbUmnD5LGa2ql0qe3TyshVfaaUqA36sBL /jmeYt3yFXmYgliyic9jofcond7wjV01/Ar2S58aJ70LOO1mKo5XEnVRPUqKP7Io6y5c GQKw== 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=Wyq76XvZzRbzHzBnE5w+mHUqlFD+yIu8JhzY276hv+E=; b=rkw1r+cqOewLzqQsd2l6APoc5dPtRCpz6CBs5ISlPFcaDoqD8grevI/O8gSjmKo92+ Ssa4HDrRtKqel3tYtyH+mEYKCLnZMZG1XDEwZanf7yx8e1QbhOT53dZa886JfRreipOY 58qU/r0svUNO0ojCZrVMW9FPY38Xgi3hi7GXpqCqwwK9L39hijOQ/ODu/b+Y/gbTaCzE ciC5VBoEubQTLbFahrA5Gmqlkyb1ULfw3C5KTyP0l1o7YsM7Q2iq6Xlb/DndOYKiJW2F 9wnHI9jvO6JxQ47DxM33W7D2MDjS8+UgeJEx92uVjcwfH1Z+P4LO8gxg45HsoeDQY+dZ DhVw== X-Gm-Message-State: AOAM530POWijAJISzvI+skI5V46radfWgXJauGj/vwMC61srquG2Vxi+ O7MlzAQzS/rWam1wJ1tFupzyrtQaFevBnt00/CI= X-Google-Smtp-Source: ABdhPJwspwi+LgYuhb2vhkyvOiMlc5F7nMI1EUi/7SJLql+ytP/C0ATNI6sK9922ObUoC2pdr64EZA== X-Received: by 2002:ac8:4b61:0:b0:2d1:cfc7:2989 with SMTP id g1-20020ac84b61000000b002d1cfc72989mr9771758qts.416.1645253019800; Fri, 18 Feb 2022 22:43:39 -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 b186sm1654290qkd.16.2022.02.18.22.43.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:39 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 10/15] gnu: Add racket-vm-bc. Date: Sat, 19 Feb 2022 01:42:23 -0500 Message-Id: <20220219064228.246917-11-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-bc): New variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 5eedd9a11f..ca76e78b1e 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -477,6 +477,29 @@ (define maybe-release-catalog ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) +(define-public racket-vm-bc + (package + (inherit racket-vm-cgc) + (name "racket-vm-bc") + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc))) + (arguments + (substitute-keyword-arguments (package-arguments racket-vm-cgc) + ((#:configure-flags _ '()) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket BC [3M] implementation") + (description "The Racket BC (``before Chez'' or ``bytecode'') +implementation was the default before Racket 8.0. It uses a compiler written +in C targeting architecture-independent bytecode, plus a JIT compiler on most +platforms. Racket BC has a different C API and supports a slightly different +set of architectures than the current default runtime system, Racket CS (based +on ``Chez Scheme''). It is the recommended implementation for architectures +that Racket CS doesn't support. + +This package is the normal implementation of Racket BC with a precise garbage +collector, 3M (``Moving Memory Manager'')."))) ;; ;; Chez Scheme: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:44:03 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:44:03 +0000 Received: from localhost ([127.0.0.1]:56744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTJ-0004lx-Tb for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:03 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:42989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJT3-0004kj-Qd for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:47 -0500 Received: by mail-qv1-f42.google.com with SMTP id e22so19179355qvf.9 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:41 -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=XdvQNymEqGQiRdQgrvSgQKS9FmoFBkD32arYf4YENJs=; b=IiBrOF93UkKuoPFfoApi0CA5Pq7OeBPPYWbrj9czmCjjBaU2Vmri8VBpw5UREnPwXn FKsMEsaraW3o9j6Gh3sljsv8YVDVEORZJCL7SYF5onKa1K2hoiEZkg7bNs/X0QYYKx+z hRSO7RE/Y9OSPqJwRqiwUfpMt3T0nM0gvrY/WFTBkXwwFQ8AVUhuwREWlH807vWJ/8FN 1WG4zHMLcwNLzfX4XczHzNxp+OfTGTt9IJjcAXjIruVJl4dil26QwxG5II8KIztQCgUv sVgnuljfYpU9jzxNgNwZWriBN2XA8T/BIaJ1xQuj+EVeRoz9p5MVm1A1ovutaNsAdQGU b45g== 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=XdvQNymEqGQiRdQgrvSgQKS9FmoFBkD32arYf4YENJs=; b=E9ZMQLXS88xTb1SWEPEVl8oNfFnhjeN3EVGHLeqsvCiBnwJfnS0mL4GuSHxapAhUYt VZkiZYi0+aWNZoo4iVp8VawhR5RlGLpSZoz8yg/byOEuJCJ4G/S8rIzedPdmSIpytZeu 8BiaMaZornYcPpgW8ol2w3poVSODPJ4XOut+KRqaM3CGdRgtFUugmAdaYqGgFaCDp9hp YoevE5nCwLSTPQZSAv9IC1Z5Amynzr9fkEFaG8CvCtMPC9JCf3gY6uOiCLt/IEK9qYiq GLjTerkHosUcc+eyva8JHKcLBjykeluXcFEF6z3FGQfPEvhvgTavTBZODEvRYUfqHHSc kbsQ== X-Gm-Message-State: AOAM533NSvjyM65cKSDkIJ0qqoPb7gIUtpVj+UOR10cDJTVOOwGqd2Xu C6MIlPr0rAvVcLcEQcxIBnYREn1P1fFpabkVb7Y= X-Google-Smtp-Source: ABdhPJyYa677ZWWYg0XC5Xx3SmyX+gfKJqTiGTwZyG2zNVoJW39J7k7tMKRlEoDyvjyQMaW6bUdz9Q== X-Received: by 2002:ac8:5153:0:b0:2d0:e87c:8160 with SMTP id h19-20020ac85153000000b002d0e87c8160mr9815245qtn.332.1645253015593; Fri, 18 Feb 2022 22:43:35 -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 bq33sm23987209qkb.64.2022.02.18.22.43.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:35 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sat, 19 Feb 2022 01:42:22 -0500 Message-Id: <20220219064228.246917-10-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/patches/racket-enable-scheme-backport.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (unbundle-chez-submodules, %racket-version, %racket-origin, racket-vm-cgc): New variables. (chez-scheme)[source]: Use 'unbundle-chez-submodules'. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 320 +++++++++++- .../racket-enable-scheme-backport.patch | 465 ++++++++++++++++++ 3 files changed, 776 insertions(+), 10 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index d963625a63..3a6a4a48b3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1751,6 +1751,7 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-enable-scheme-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 366815634d..5eedd9a11f 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -34,15 +34,20 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages ncurses) #:use-module (gnu packages netpbm) #:use-module (gnu packages tex) #:use-module (gnu packages xorg) #:use-module ((guix licenses) - #:prefix license:)) + #:prefix license:) + #:export (%racket-version + %racket-origin)) ;; Commentary: ;; @@ -62,6 +67,136 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; Putting the relevant definitions together in this module avoids having to ;; work around dependency cycles. ;; +;; Anatomy of Racket: +;; ------------------ +;; +;; The main Racket Git repository () is +;; organized broadly like this: +;; +;; . +;; ├── Makefile +;; ├── pkgs/ +;; └── racket/ +;; ├── collects/ +;; └── src/ +;; ├── configure +;; ├── Makefile.in +;; ├── bc/ +;; ├── cs/ +;; ├── ChezScheme/ +;; └── ... +;; +;; The 'racket/src/' directory contains the source of the runtime system, core +;; compiler, and primitives for the major Racket implementations: this layer +;; is called the ``Racket VM''. It is basically a normal autotools +;; project. (Even when Racket VM implementations use components implemented in +;; Racket, they are compiled in special modes to produce VM primitives.) +;; (There are or have been experimental Racket VM implementations elsewhere, +;; e.g. .) +;; +;; The 'racket/collects/' directory contains ``built in'' Racket libraries +;; that are not part of any package, including the implementation of +;; 'racket/base': in particular, it must contain enough to implement `raco pkg +;; install'. It is theoretically possible to use the Racket VM layer without +;; the main collections, but it is not stable or useful. +;; +;; The 'pkgs/' directory contains Racket packages that are especially closely +;; tied to the implementation of the Racket VM, including 'compiler-lib', +;; 'racket-doc', and 'racket-test'. Some of these packages depend on Racket +;; packages that are developed in other Git repositories, predominantly but +;; not exclusively under the 'racket' GitHub organization. Conversely, not all +;; of the packages developed in the main Git repository are part of the main +;; Racket distribution. (Additionally, components of the Racket VM that are +;; implemented in Racket can be installed as packages, mostly for ease of +;; development.) +;; +;; The top-level 'Makefile' is more like a directory of scripts: it has +;; convienience targets for developing Racket, and it cooperates with the +;; 'distro-build' package to assemble custom Racket distributions. 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. +;; +;; A ''minimal Racket'' installation includes two packages: 'base', which is a +;; sort of bridge between the current ``built-in'' collections and the package +;; system's model of dependencies, and 'racket-lib', which, for installations +;; that can not rely on a system package manager, pulls in the SQLite and +;; OpenSSL shared libraries as platform-specific dependencies for use by the +;; ``built-in'' collections. +;; +;; The main Racket distribution consists of installing the 'main-distribution' +;; package and all of its dependencies. +;; +;; The default mode when building Racket (or installing it with the released +;; installers) is an ``in-place build'', which produces a self-contained, +;; relocatable, roughly FHS-like directory. (Racket also supports +;; ``Unix-style'' installations, which rearrange the parts of an in-place +;; build into Racket-specific subdirectories and generally tries to work for +;; installation into an FHS-based system.) Certain tools, e.g. 'distro-build' +;; and 'raco cross', are able to work with an in-place Racket build. +;; +;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and +;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and +;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store +;; output. The function 'racket-vm-for-system' returns the recomended Racket +;; VM package for a given system. +;; +;; The file 'racket.scm' builds on these packages to define 'racket-minimal' +;; and 'racket' packages. These use Racket's support for ``layered +;; installations'', which allow an immutable base layer to be extended with +;; additional packages. They use the layer configuration directly provide +;; ready-to-install FHS-like trees, rather than relying on the built in +;; ``Unix-style install'' mechanism. +;; +;; Bootstrapping Racket: +;; --------------------- +;; +;; Here's how bootstrapping Racket works: +;; +;; - Racket BC [CGC] can be built with only a C compiler (except for +;; one caveat discussed below). +;; - 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 +;; 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. +;; +;; So, we build CGC to build 3M to build bootfiles and CS. +;; +;; (Note: since the CGC variant is basically only for bootstrapping, we +;; often use "BC" to mean "3M", consistent with `(banner)` and the +;; suffixes used on executables when more than one variant co-exists.) +;; +;; 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 +;; README file applies to all such subsystems: +;; +;; The Racket version must be practically the same as the current Racket +;; verson, although it can be the Racket BC implementation (instead of +;; the Racket CS implementation). +;; +;; Unlike Chez Scheme boot files, the files generated in "schemified" +;; are human-readable and -editable Scheme code. That provides a way +;; out of bootstrapping black holes, even without BC. +;; +;; However, other Racket subsystems implemented in Racket for Racket CS +;; use older C implementations for Racket BC, whereas the reader, expander, +;; and module system were completely replaced with the Racket implementation +;; +;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) +;; are embeded in C as a static string constant. Eventually, they are further +;; compiled by the C-implemented Racket BC bytecode and JIT compilers. +;; (On platforms where Racket BC's JIT is not supported, yet another compiler +;; instead compiles the linklets to C code, but this is not a bootstrapping +;; issue.) +;; ;; Code: (define (chez-machine->nonthreaded machine) @@ -169,6 +304,179 @@ (define* (chez-upstream-features-for-system #:optional (else '(threads)))) +;; +;; Chez auxiliary G-expressions: +;; + +(define unbundle-chez-submodules + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))) + +;; +;; Racket VM: +;; + +(define %racket-version "8.4") +(define %racket-origin + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racket") + (commit (string-append "v" %racket-version)))) + (sha256 + (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (file-name (git-file-name "racket" %racket-version)) + (patches (search-patches "racket-minimal-sh-via-rktio.patch" + ;; Remove by Racket 8.5: + "racket-enable-scheme-backport.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Unbundle Chez submodules. + (with-directory-excursion "racket/src/ChezScheme" + #$unbundle-chez-submodules) + ;; Unbundle libffi. + (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + +(define (racket-vm-common-configure-flags) + ;; under a lambda extraction to avoid evaluating bash-minimal too early + #~`(,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/libtool")) + => (lambda (libtool) + (list (string-append "--enable-lt=" libtool)))) + (else + '())) + ,@(cond + ((false-if-exception + (search-input-file %build-inputs "/opt/racket-vm/bin/racket")) + => (lambda (racket) + (list (string-append "--enable-racket=" racket)))) + (else + '())) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")) + "--disable-strip" + "--enable-origtree")) + +(define-public racket-vm-cgc + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (hidden-package + (package + (name "racket-vm-cgc") + (version %racket-version) + (source %racket-origin) + (inputs (list ncurses ;; <- common to all variants (for #%terminal) + bash-minimal ;; <- common to all variants (for `system`) + libffi)) ;; <- only for BC variants + (native-inputs (list libtool)) ;; <- only for BC variants + (outputs '("out" "debug")) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) + (guix build gnu-build-system) + (guix build utils)) + #:strip-directories #~'("opt/racket-vm/bin" + "opt/racket-vm/lib") + #:phases + #~(let () + (define* ((wrap-racket-vm-outputs phase) . args) + (apply + phase + (let loop ((args args)) + (match args + ((#:outputs outputs . args) + `(#:outputs + ,(let loop ((outputs outputs)) + (match outputs + ((("out" . out) . outputs) + `(("out" . ,(string-append out "/opt/racket-vm/")) + ,@outputs)) + ((other . outputs) + (cons other (loop outputs))))) + ,@args)) + ((arg . args) + (cons arg (loop args))))))) + (modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (replace 'configure + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'configure))) + (replace 'patch-shebangs + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-shebangs))) + (replace 'validate-runpath + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'validate-runpath))) + (replace 'make-dynamic-linker-cache + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) + (replace 'patch-dot-desktop-files + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) + (home-page "https://racket-lang.org") + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. + +Racket CGC is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat))))) + ;; ;; Chez Scheme: ;; @@ -188,15 +496,7 @@ (define-public chez-scheme (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) (file-name (git-file-name "chez-scheme" version)) - (snippet #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib")))))) + (snippet unbundle-chez-submodules))) (build-system gnu-build-system) (inputs (list diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch new file mode 100644 index 0000000000..3a5a4a3d82 --- /dev/null +++ b/gnu/packages/patches/racket-enable-scheme-backport.patch @@ -0,0 +1,465 @@ +From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 10:36:09 -0700 +Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` + +(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) + +(Fixed conflicts by dropping pbchunks and pbarch changes.) +--- + racket/src/ChezScheme/configure | 15 ++++++++++++++- + racket/src/ChezScheme/s/Mf-base | 4 ++-- + racket/src/ChezScheme/s/Mf-cross | 4 +++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 4515ffc105..0098829091 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -45,6 +45,7 @@ threads=yes + nothreads=no + temproot="" + help=no ++forceworkarea=no + gzipmanpages=yes + installowner="" + installgroup="" +@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do + --pb) + pb=yes + ;; ++ --force) ++ forceworkarea=yes ++ ;; + --installprefix=*) + installprefix=`echo $1 | sed -e 's/^--installprefix=//'` + ;; +@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then + echo " --toolprefix= prefix tool (compiler, linker, ...) names" + echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" + echo " --workarea= build directory ($w)" ++ echo " --force configure even without boot files" + echo " CC= C compiler" + echo " CPPFLAGS= C preprocessor flags" + echo " CFLAGS= C compiler flags" +@@ -721,8 +726,16 @@ case "${flagsmuni}" in + ;; + esac + ++if [ "$w" = "$m" ] ; then ++ configuringin="" ++else ++ configuringin=" in $w" ++fi ++ + if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then +- echo "Configuring for $m" ++ echo "Configuring for $m$configuringin" ++elif [ "$forceworkarea" = yes ] ; then ++ echo "Configuring for $m$configuringin despite missing boot files" + else + if [ "$m" = "" ] ; then + maybem="" +diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base +index cc6178c973..1f4a967998 100644 +--- a/racket/src/ChezScheme/s/Mf-base ++++ b/racket/src/ChezScheme/s/Mf-base +@@ -94,7 +94,7 @@ endif + # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme + # implementation + Scheme = ../bin/$m/scheme${ExeSuffix} +-export SCHEMEHEAPDIRS=../boot/%m ++export SCHEMEHEAPDIRS=../boot/$m + export CHEZSCHEMELIBDIRS=. + + # Define the libdirs separator character +@@ -691,4 +691,4 @@ reset-one: + + .PHONY: run + run: +- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) ++ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) +diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross +index d796cbb459..397af59a28 100644 +--- a/racket/src/ChezScheme/s/Mf-cross ++++ b/racket/src/ChezScheme/s/Mf-cross +@@ -43,5 +43,7 @@ x$(xm).$(m): + $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch + mv xpatch x$(xm).$(m) + ++ifneq ($(SCHEMEHEAPDIRS),:) + # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed +-nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++endif +-- +2.32.0 + + +From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 11:03:30 -0700 +Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable + +When the same Chez Scheme version as used by Racket is already +available, then `--enable-scheme=...` can supply an executable. For +cross builds, `--enable-scheme=...` can still supply a build +directory, instead, as before. + +(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) +--- + racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ + racket/src/README.txt | 30 +++++++++++--- + racket/src/configure | 8 +++- + racket/src/cs/README.txt | 6 ++- + racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- + racket/src/cs/c/configure | 24 +++++++++-- + racket/src/cs/c/configure.ac | 21 ++++++++-- + 7 files changed, 112 insertions(+), 24 deletions(-) + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index c396efc851..3998ef9ccd 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -59,6 +59,9 @@ reset: + %.boot: + (cd $(workarea) && $(MAKE) $*.boot) + ++auto.boot: ++ (cd $(workarea) && $(MAKE) $(defaultm).boot) ++ + # .bootquick to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine +diff --git a/racket/src/README.txt b/racket/src/README.txt +index 98647aebce..d77310b4a4 100644 +--- a/racket/src/README.txt ++++ b/racket/src/README.txt +@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of + ======================================================================== + + Cross-compilation requires at least two flags to `configure`: ++`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) ++`--enable-scheme-SCHEME`. ++ ++More information: + + * `--host=OS`, where OS is something like `i386-gnu-linux` to + indicate the target platform. +@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: + run `configure` again (with no arguments) in a "local" subdirectory + to create a build for the current platform. + +-An additional flag is needed for building Racket CS, unless the flag +-`--enable-racket=auto` is used: +- +- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" +- directory where Chez Scheme is built for the host system. ++ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable ++ executable that runs on the build platform; the executable must be ++ the same version as used in Racket built for the target platform. ++ ++ Supplying `--enable-scheme=DIR` is also supported in cross-build ++ mode, where DIR is a path that has a "ChezScheme" directory where ++ Chez Scheme is built for the host system. ++ ++The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are ++allowed for non-cross builds, too: ++ ++ * For Racket CS, supplying either selects a Racket or Chez Scheme ++ implementation used to create boot files to the build platform. ++ Suppling Chez Scheme is a much more direct path, but when Racket is ++ supplied, its version does not have to match the version being ++ built. ++ ++ * For Racket BC, `--enable-racket=RACKET` selects a Racket for ++ prepare C sources to cooperate with garbage collection. Its version ++ needs to be close to the one being built, and potentially exactly ++ the same version. + + Some less commonly needed `configure` flags are for Racket BC: + +diff --git a/racket/src/configure b/racket/src/configure +index c9f3ba4419..1b53ec7ce2 100755 +--- a/racket/src/configure ++++ b/racket/src/configure +@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" + use_cs=maybe + use_bc=maybe + supplied_racket=no ++supplied_scheme=no + enable_boothelp= + + # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, +@@ -34,6 +35,9 @@ for arg in $*; do + --enable-racket=*) + supplied_racket=yes + ;; ++ --enable-scheme=*) ++ supplied_scheme=yes ++ ;; + --help | -h) + echo $0: + echo see --help-bc or --help-cs, since the Racket CS build and the +@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then + fi + + if test "$use_cs" = "yes" ; then +- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then +- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly ++ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then ++ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly + exit 1 + fi + +diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt +index 2ece417b78..8e6fc57b74 100644 +--- a/racket/src/cs/README.txt ++++ b/racket/src/cs/README.txt +@@ -39,6 +39,11 @@ build: + installed in the "../ChezScheme/boot/pb" directory as described by + "../ChezScheme/BUILDING". + ++ Supplying `--enable-scheme=...` is also an option if you alerady ++ have the same version of Chez Scheme built on the current platform. ++ Another build will be created, anyway, but more quickly than ++ without Chez Scheme. ++ + * Racket is needed to generate the files in the "schemified" + directory from the sources in sibling directories like "../io". The + Racket version must be practically the same as the current Racket +@@ -48,7 +53,6 @@ build: + Unlike Chez Scheme boot files, the files generated in "schemified" + are human-readable and -editable Scheme code. That provides a way + out of bootstrapping black holes, even without BC. +- + + + ======================================================================== +diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in +index 54a644a1d9..d73993f0fc 100644 +--- a/racket/src/cs/c/Makefile.in ++++ b/racket/src/cs/c/Makefile.in +@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ + SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) + SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme + SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) +-SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_existing = @MAKE_SCHEME_SCHEME@ ++SCHEME = $(SCHEME@USE_SCHEME_MODE@) + + TARGET_MACH = @TARGET_MACH@ + SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) +@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. + @INCLUDEDEP@ @srcdir@/../../version/version.mak + + cs: +- $(MAKE) scheme@T_CROSS_MODE@ ++ $(MAKE) scheme@MAKE_SCHEME_MODE@ + $(MAKE) racket-so + cd rktio; $(MAKE) + $(MAKE) racketcs +@@ -121,9 +123,13 @@ racket-so: + + RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ + ++TARGET_MACH_built = $(TARGET_MACH) ++TARGET_MACH_existing = xc-$(TARGET_MACH) ++XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch ++ + CS_PROGS = SCHEME="$(SCHEME)" + CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ +-CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" ++CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" + PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" + + build-racket-so: +@@ -163,6 +169,15 @@ pb-bootquick: + cd $(SCHEME_WORKAREA) && $(MAKE) reset + $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) + ++scheme-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot ++ $(MAKE) mach-make ++ ++$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: ++ mkdir -p $(SCHEME_WORKAREA) ++ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" ++ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all ++ + mach-make: + $(MAKE) config-scheme + cd $(SCHEME_WORKAREA) && $(MAKE) +@@ -182,24 +197,33 @@ config-scheme: + + scheme-cross: + env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt ++ $(MAKE) finish-scheme-cross ++ ++finish-scheme-cross: + $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) + cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) + cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t +- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch ++ $(MAKE) $(XPATCH_FILE) ++ ++scheme-cross-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) ++ $(MAKE) finish-scheme-cross + + # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older +-# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files +-XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ +- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot ++# than the build- use as Racket for build; or "auto" to create +- --enable-scheme= use as host's build directory for cross ++ --enable-scheme= use as host build for cross + --enable-mach= use Chez Scheme machine type + --enable-target= cross-build for Chez Scheme machine type + --enable-portable prefer portable to host-specific +@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" + show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' + + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + show_explicitly_enabled "${enable_portable}" "portable" +@@ -4745,9 +4748,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags + + + ++ ++ ++ + + + +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 464ebe1760..aaee88156d 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev + AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) + m4_include(../ac/path_arg.m4) + AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket for build; or "auto" to create]) +-AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host's build directory for cross]) ++AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host build for cross]) + AC_ARG_ENABLE(mach, [ --enable-mach= use Chez Scheme machine type ]) + AC_ARG_ENABLE(target, [ --enable-target= cross-build for Chez Scheme machine type ]) + m4_include(../ac/portable_arg.m4) +@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" + show_explicitly_enabled "${enable_xonx}" "Unix style" + m4_include(../ac/path_show.m4) + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + m4_include(../ac/portable_show.m4) +@@ -504,9 +504,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) + AC_SUBST(CROSS_MODE) + AC_SUBST(T_CROSS_MODE) + AC_SUBST(TT_CROSS_MODE) ++AC_SUBST(MAKE_SCHEME_MODE) ++AC_SUBST(MAKE_SCHEME_SCHEME) ++AC_SUBST(USE_SCHEME_MODE) + AC_SUBST(SETUP_BOOT_MODE) + AC_SUBST(OSX) + AC_SUBST(NOT_OSX) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:44:04 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:44:04 +0000 Received: from localhost ([127.0.0.1]:56749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTP-0004mm-8h for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:03 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:40803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTB-0004l2-HF for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:50 -0500 Received: by mail-qv1-f49.google.com with SMTP id v10so19200904qvk.7 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:49 -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=3jczH3c6u7DJ3//fjutZXsJPez8NGkdREoswIZMxpW8=; b=gzpMLt0tNY9uAP0yGRmliZq6/o3zyZLXSdZU5v3Lm1lOye+CUvoqfZlbNNWEPlHMaf 4AcKBeHlq6AvwO99h0Oj9HUZBGTb5oLeJv7b1lfYDFJNszCvpcb77IISMqf/3mHhNDoV OGg0wwl2kKzwffQRFZKaaKL06srKUvMNAaIxa6YGaxp/zRh85n0f/l/Vc4iMOZBIhISj CZGERCJq604M9EWCR2gNlBrwoidry7Ky3Le0glB4VYnT14F/7f96KcsQsnaOL0ieBOXJ dMBMEj/SDkXnjVV0MP10yzPmNLUucEL4xZDQuZsRJpfE5YFjYNGoP63G3eq6vO2jdqtB S0zQ== 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=3jczH3c6u7DJ3//fjutZXsJPez8NGkdREoswIZMxpW8=; b=uWd5ptrKMl+ZmgDOSu5FQ7jFcZTSqh4gfaBdQCIIQIlccemQ4lOE2L/YAlPyMz0Ayt 2G1FfH5j6VjxZvf+okYRg7IG4g392e+M9ONgZiEdrfaEGlzks6ZfrqheAc6ULu1glIZy YmefVmO9hhjQxTNQc8sTrUo1KgtpbhP5kIRTuhkjAjthWiuholJs7nF3VGX6/hxRKfBJ GNLQ4LBJQ3PRLY3r4NFxacpJzvRTpsovwj5tAB6ShYq1M79rVYISnNxtmCaxyG/qa38O 2mAsYZBRhVv51s0Ykd6y7qRBYOyOPlkwgEKC9Ddea6huOlCPPFwd8Ky+l8YwGR4+GAV/ dH1Q== X-Gm-Message-State: AOAM53232O41RN6+7KLbLrvwWbLdcrePQ+YjpGAP05FIz2qp/mBekmIo 9wzGeOJGaDBM8v2xR4/3GSfO7D3ZUuDmJsiTleg= X-Google-Smtp-Source: ABdhPJwSyRyZsUvxlgdTuEKaAtwHTmXpV1s+1ulWDoHVeEm511HR5APlb+PsU/KjaXz5jcP+DZq2Hg== X-Received: by 2002:a05:6214:5a3:b0:42c:2c13:759c with SMTP id by3-20020a05621405a300b0042c2c13759cmr8578652qvb.20.1645253023937; Fri, 18 Feb 2022 22:43:43 -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 y9sm17899091qtx.85.2022.02.18.22.43.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:43 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 11/15] gnu: Add chez-scheme-for-racket. Date: Sat, 19 Feb 2022 01:42:24 -0500 Message-Id: <20220219064228.246917-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) The Racket variant of Chez Scheme can be used to support platforms that are not yet supported by upstream Chez Scheme. * gnu/packages/chez-and-racket-bootstrap.scm (unpack-nanopass+stex): (chez-scheme-for-racket): (chez-scheme-for-racket-bootstrap-bootfiles): New variables. (chez-scheme)[arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase to use the eponymous new variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 132 +++++++++++++++++++-- 1 file changed, 121 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index ca76e78b1e..6eddc46e66 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -319,11 +319,28 @@ (define unbundle-chez-submodules "lz4" "zlib")))) +(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"))))) + ;; ;; Racket VM: ;; (define %racket-version "8.4") +(define %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! (define %racket-origin (origin (method git-fetch) @@ -551,17 +568,8 @@ (define-public chez-scheme #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (copy-recursively - (dirname (search-input-file (or native-inputs 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"))))) + (lambda args + #$unpack-nanopass+stex)) (add-after 'unpack-nanopass+stex 'unpack-bootfiles (lambda* (#:key native-inputs inputs #:allow-other-keys) (when (directory-exists? "boot") @@ -691,6 +699,108 @@ (define-public chez-scheme-bootstrap-bootfiles work with upstream Chez Scheme so that we can bootstrap these files from source."))) +(define-public chez-scheme-for-racket + (package + (inherit chez-scheme) + (name "chez-scheme-for-racket") + (version %chez-scheme-for-racket-version) + (source %racket-origin) + (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) + #~(modify-phases #$those-phases + (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 license:asl2.0))) + +(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 (package-source chez-scheme-for-racket)) + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) + (arguments + (substitute-keyword-arguments + (package-arguments chez-scheme-bootstrap-bootfiles) + ((#:phases those-phases #~%standard-phases) + #~(modify-phases #$those-phases + (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) + (invoke (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "rktboot/main.rkt"))))))) + (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 "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 +supported platforms.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +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."))) + ;; ;; Chez's bootstrap dependencies: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:44:04 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:44:04 +0000 Received: from localhost ([127.0.0.1]:56751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTP-0004mx-W8 for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:04 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:43865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTF-0004lJ-HN for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:53 -0500 Received: by mail-qv1-f42.google.com with SMTP id a28so19184521qvb.10 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:53 -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=ammk7t6plnGExrICIZoTKxUS5p9fSg2qR68wsjVECDY=; b=XPwqnWue/+Razx2GNDuKfTh+3ZmrsYdfzC7CNGaLcK+GLY2DbywVbQEah3HaJyA6Md JoN7cMQfUOoysbklzPlNKOreXc5NodRjNLatWS5D11rkySmtAdXgXiwvLjo+7v/3hhni hLO1x4eU6F6aFRgtIAgmNiGbK2KLNJWsVYi1k+R2qSb2+9h/ItQWueDDltIeNyNi4qCu XGTUZo3S1q1HhrQZtEWcO8gSjkOOqihdwBPSFQ1xuR9qV1atuH5cfdO53rUgQFKpMBDM 6OrWj+8eV5Oaw8o50RDV1yysEkFVn2Va/xDndP9IuR3ug1FQ8TjFnugntmEm6Hsy0awo EoJA== 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=ammk7t6plnGExrICIZoTKxUS5p9fSg2qR68wsjVECDY=; b=rmcMytXInB2q9lyxh12uPQf7Yjm4gfAauOFK9wMV3zcYGion4r044Q0RgDASZeyPXM ry/OSRtT/xwBV88xzO1sKIRXOw6+a/zRHFWH9bv7dyHgOb+Wqg8FAlEtC4VNaQ1nBx9f FA8AuC+sdpfmOV0CXSayJCUHtW54W43FkxVni1EmGhu71vUEKSeOlRRqat3py0wHB6aV TaTTW82e6Wy51J81+F3ypmXrl1AlrW2MbuFxGYKiq2UElqUguSuHLdKls7Iuyl4oT3Hx EAl3x/KOl35rsDSNdxtAosS15k2TGZh91NrKx7gsbAFjIkvJu9oZDsxyfjhJQzLIS93k vdGQ== X-Gm-Message-State: AOAM531FASZ0OPz/xeeXEpAPzblKgK4w7jBJKYjgNhUbdNLzvXPTqqL4 v5Slrwl5XPJhIjMVQ9dOI2EWKzGQ1TZ4oyzXs+8= X-Google-Smtp-Source: ABdhPJy7l4zimGTHKEgV+2Cr3KO6u1bHkiMEtSttwEKPfIwpyAUNxlP9jA0cEQ15oMmIfYPitSa15A== X-Received: by 2002:ac8:5a14:0:b0:2d3:a280:9f3d with SMTP id n20-20020ac85a14000000b002d3a2809f3dmr10004444qta.503.1645253028050; Fri, 18 Feb 2022 22:43:48 -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 x3sm21338084qkp.54.2022.02.18.22.43.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:47 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 12/15] gnu: Add racket-vm-cs. Date: Sat, 19 Feb 2022 01:42:25 -0500 Message-Id: <20220219064228.246917-13-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cs): New variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 6eddc46e66..458645f037 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -517,6 +517,50 @@ (define-public racket-vm-bc This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'')."))) + +(define-public racket-vm-cs + (package + (inherit racket-vm-bc) + (name "racket-vm-cs") + (inputs + (modify-inputs (package-inputs racket-vm-cgc) + (prepend zlib lz4) + (delete "libffi"))) + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (delete "libtool") + (prepend chez-scheme-for-racket + chez-nanopass-bootstrap + racket-vm-bc))) + (arguments + (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))))) + ((#:configure-flags _ '()) + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + (string-append "--enable-scheme=" + #$(this-package-native-input + "chez-scheme-for-racket") + "/bin/scheme") + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket CS implementation") + (description "The Racket CS implementation, which uses ``Chez Scheme'' as +its core compiler and runtime system, has been the default Racket VM +implemetation since Racket 8.0. It performs better than the Racket BC +implementation for most programs. + +Using the Racket VM packages directly is not recommended: instead, install the +@code{racket-minimal} or @code{racket} packages.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) + ;; ;; Chez Scheme: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:44:13 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:44:14 +0000 Received: from localhost ([127.0.0.1]:56764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTZ-0004ok-H9 for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:13 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:37518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTJ-0004lg-LU for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:43:58 -0500 Received: by mail-qk1-f179.google.com with SMTP id v5so7826355qkj.4 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:43:57 -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=ZRi6asVXV+QTTkm+7nvM8RjAeYcMCR/ik7tKnX79K+k=; b=jwYX5kv20msMxa96tz28iUosJ2yI2nfPcKQAygm8bAfbfmHGVZ72IkTq2dpEfOHwZP 2+jUmvrYissaQ6rKMYrmYY/GUR1atn+jexeaR6MWs4teYW2IzSIKlUqy0cCW6IJMYmvj O3swAkfCj5BMd5/Z0RncDNt8n/c0x2pw3kS8Mp0nRTu1/bF9mNnndCVAEXqIPJskJFOc VLTHKNgJLyJ2DTev9HbFWtb3eYliQgx8iPynCOUHXiaTkBiKr+l5wyI4Hix7/4QqkSYQ 9I+55w1PLcYQUjDibrckpBSVSp7Vs205GX4kxZUimVfLMtXFw9TjYQUSqKvQsWiybD5F NJJA== 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=ZRi6asVXV+QTTkm+7nvM8RjAeYcMCR/ik7tKnX79K+k=; b=3S4rohbkRsfDfcmCM54NvErsfWx+qH+IQ5w6CtA1BGjdfBMAh04UH3id/MLytgZsXI uN0ygYqMszL9V60RoAs301LHYxvCG37aRk9L7Xc6h+sbWE+y66nip18EPVLrZPx7A0oF zaMyBQBqgO4jRgb5l6bdzJsAki0cE1gRzR1FbXPvLhKM6hGaLXBMHcSZM208ImvfYZu3 Wn+cZ9E6DHJ7ZXC+CxRLTv9tPbp7wxivSRSX3esTIbvE0QSU7ecrTfbyMnfZGX526GXO DR/jN/RsSBgeffCSMwXWLXpsTv97o3erQdSTHGtJcBu0dL7yXVcHMMU5hDPC0CZhBiwS mU/Q== X-Gm-Message-State: AOAM531PvdIf/IogrSbx5jbFlEGc60XTOMYcB+jTwMIZzzqGKOVWn/Qx ioYBXZ+RIEKOsct2C++exy53FkIjM4MwqGSMUxo= X-Google-Smtp-Source: ABdhPJwK7wYCDL1B1x/vmXED7WEkBPzv3umiXLjxkAKBuBoQM3yHxYdfr1g06mRh1CeBOZcs7YlWqQ== X-Received: by 2002:a05:620a:16a6:b0:62c:eb6d:172a with SMTP id s6-20020a05620a16a600b0062ceb6d172amr3005728qkj.147.1645253032109; Fri, 18 Feb 2022 22:43:52 -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 v12sm23434284qkl.74.2022.02.18.22.43.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:51 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 13/15] gnu: chez-mit: Support chez-scheme-for-racket. Date: Sat, 19 Feb 2022 01:42:26 -0500 Message-Id: <20220219064228.246917-14-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 54bbee7923..be251798c3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -355,7 +355,29 @@ (define-public chez-mit (commit (string-append "v" version)))) (sha256 (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (snippet + ;; Workaround for chez-scheme-for-racket. + ;; See: https://github.com/racket/racket/issues/4151 + #~(begin + (use-modules (guix build utils)) + (substitute* "mit/core.sls" + (("[(]import ") + "(import (only (chezscheme) import)\n") + (("[(]define string->uninterned-symbol gensym[)]") + (format #f "~s" + '(begin + (import (only (chezscheme) + meta-cond + library-exports)) + (meta-cond + ((memq 'string->uninterned-symbol + (library-exports '(chezscheme))) + (import (only (chezscheme) + string->uninterned-symbol))) + (else + (define string->uninterned-symbol + gensym))))))))))) (build-system gnu-build-system) (inputs (list chez-srfi)) ; for tests -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:44:14 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:44:14 +0000 Received: from localhost ([127.0.0.1]:56766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTZ-0004om-Rg for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:14 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:38561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTN-0004lv-QG for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:02 -0500 Received: by mail-qv1-f41.google.com with SMTP id d3so19157802qvb.5 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:44:01 -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=U/Dsi/M90+x4hlymBb7FfUjeUstWZIkx1NFHod/Zyhw=; b=iLgLim4BipWy4tRvynuPnVHakion7W4+lOs1ZCo30GjYGkf81gL2Uujn4eGiAEjHf1 YcubUy01DhpH6Uts0OeALmU/6qi2glU3ESTmYMKc7bK+AFDCgWE52lu0lKV9xYTwpADw 1GWKbQkgAuOiMP9YfuzXslqoBHhNXKKYa+2uqWspeA0LqcopddsdUHEp29F+5AHAmfOa PiX17EUOchol5ysN19h3v01wjOSKkIDnpCosA1kFVgwdVjkBMXk8khpvaOec0ISgoFKX bc/9XV3+iTysbp3g+QPljV0qIdJl2IpnyYKQvxkcIg/jqJkHfUiqg8k0F9r3XOAvsR1o FFAA== 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=U/Dsi/M90+x4hlymBb7FfUjeUstWZIkx1NFHod/Zyhw=; b=I2UXCyUZnuCl1wuBp5dcUUVMUT5CTsHpXnXzKy7J0+bYwkGZYWM4adkXmxC5aif0Cd Cy90qxYZqIh5i7NLjM4aVZ2MZzg8sbhiLlYFrJ4N0XwiUuhfYg8juA3w8TaT1BzGb6Kl y3M49N91wO8DnFgHOXUQqO4BaQpIslvOi/E/pbB+/7oXR1QXUTwJYnZaTweMgjiPnjGe 4YIF6ZqZezrpwMyR7DhaAjPEL5HX8ewVrNb3VFj6OSHf2RqQdhQ6nYIzIGRjfyLZmrgP 6cS5mmxKTkD6AFE4PPdgHV7BuQFiTLPacV7N7HmJxaZHILTLhGmkclXohCcMJlqlLyiQ CTiw== X-Gm-Message-State: AOAM533pebirYhKnsz6T/kxjplBSI9wXIwn8VUR5wqUHZaVJ7UoSjop2 RG65UwfroLhYLgpeP9C86P1F4BznJKHEklWs2BU= X-Google-Smtp-Source: ABdhPJy9EQB4XmY8y0Ibhz1vtRaLqM13J/bwZkgd2rJtj8+bWBYlN3PacesgMGMmct3HbbNMcUGIRg== X-Received: by 2002:a05:6214:7ef:b0:42c:51a6:71e2 with SMTP id bp15-20020a05621407ef00b0042c51a671e2mr8539918qvb.116.1645253036271; Fri, 18 Feb 2022 22:43:56 -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 h1sm24083380qkn.71.2022.02.18.22.43.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:43:56 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 14/15] gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. Date: Sat, 19 Feb 2022 01:42:27 -0500 Message-Id: <20220219064228.246917-15-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-for-system): New procedure. * gnu/packages/loko.scm (loko-scheme): Use 'chez-scheme-for-system'. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise * gnu/packages/chez.scm (chez-srfi): (chez-web): (chez-sockets): (chez-matchable): (chez-irregex): (chez-fmt): (chez-mit): (chez-scmutils): Likewise. --- gnu/packages/chez-and-racket-bootstrap.scm | 14 +++++++++++++- gnu/packages/chez.scm | 16 ++++++++-------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 458645f037..51032fc68f 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -46,7 +46,8 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:) - #:export (%racket-version + #:export (chez-scheme-for-system + %racket-version %racket-origin)) ;; Commentary: @@ -199,6 +200,17 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; Code: +(define* (chez-scheme-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, +including support for native threads." + (if (and (nix-system->chez-machine system) + (not (and=> (chez-upstream-features-for-system system) + (cut memq 'threads <>)))) + chez-scheme-for-racket + chez-scheme)) + (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 diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index be251798c3..d5007e0cfd 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -74,7 +74,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -105,7 +105,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) ghostscript ;; FIXME: This package fails to build with the error: ;; mktexpk: don't know how to create bitmap font for bchr8r @@ -170,7 +170,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) chez-web (texlive-updmap.cfg (list texlive-pdftex)))) (arguments @@ -256,7 +256,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -288,7 +288,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -319,7 +319,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -382,7 +382,7 @@ (define string->uninterned-symbol (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -413,7 +413,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index cb7d4425af..24f5b1e9c1 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -450,7 +450,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index 74a649b8a1..a7ab12a0c4 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -71,7 +71,7 @@ (define-public loko-scheme #t))))) (native-inputs `(("akku" ,akku) - ("chez-scheme" ,chez-scheme) + ("chez-scheme" ,(chez-scheme-for-system)) ("struct" ,guile-struct-pack) ("laesare" ,guile-laesare) ("pfds" ,guile-pfds) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 01:44:23 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 06:44:24 +0000 Received: from localhost ([127.0.0.1]:56768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTa-0004ou-DM for submit@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:23 -0500 Received: from mail-qv1-f51.google.com ([209.85.219.51]:42543) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJTS-0004mC-Ux for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 01:44:12 -0500 Received: by mail-qv1-f51.google.com with SMTP id e22so19180590qvf.9 for <53878@debbugs.gnu.org>; Fri, 18 Feb 2022 22:44:06 -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=/kEUrFNY4S3JUpOJluyE5q/9JYdXBmoRIuSABWjdT2I=; b=kJhXv6kdBRmbCe9MuCz5SOAFWHE5Oa3yq2GPKjWUYk33rx3wEpK3xxS7hxdiEE0sYi hA511JMeJ5dLzBgFNSF3UXhCnhCq4xwlaBo2NJl/aNiZkOlfgozivE2ghflDwaB45f8P k9+8YeaLK6V7wHQKh/nxxYpLuV5wIcXJooE6iyPUA9WluYh22ownINGPJ48vazk2jbj9 kB435/CGiW25wPAxxm8zeGbGfQlwZeyjyD8bL8PlsuRhCfJ732qozywBHlPR0cGKSFPT mf8YcJztv9pJcjvWa1RP6KlHhFbsOunhm5bBU8C8nnEt+f3GJdwTevkp58pIFe9TJJOu urxg== 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=/kEUrFNY4S3JUpOJluyE5q/9JYdXBmoRIuSABWjdT2I=; b=EVieUv2QA01ZCsKV4eURDMBvk4gh0cO8tQTFAO2RHBrGMead9F990t1WSssijaxxUU 9yBhmpEZ0qb73qIZo45Aiqwtqq87C77gpcSiq1XQ6v1qgzV05uWZm1HPBiLWNlMApaPF 1hnxcZMX+JXlmSLGeBTz07n303Mc+j4W4dgBIIA8noxN0CtJVTTPaIETOOzjPNCVfyie Msm3LCU5/88gAU1PbHBtmJAPwdLwFLe+AkUHpHtFgi6kqVvKNj9h/inz4388bmTq7RgZ VVdRoMrJARhgNHGnEcA8Bm9IQlhK+OQ62m9LvrVsG3j17XDIAAawfMyncaUX4WczX3/a G14A== X-Gm-Message-State: AOAM533C5VwWXrbfip3t/9Rp1mrxO9j5xXnjij806tw5LR4O8iEI1ta2 CEPla8Yi5es/FrtNm9SX+OLo2oqpAjYKbCwFKnE= X-Google-Smtp-Source: ABdhPJzKj9Nj0SMRJGkc9mjY0pBPtHo7Jzbx+BBu8P8bAzBes/Tz0FGcQ0nm6DhKm7UlW8mka/Ztvg== X-Received: by 2002:ad4:5389:0:b0:42d:a3cf:1b67 with SMTP id i9-20020ad45389000000b0042da3cf1b67mr8513047qvv.129.1645253040458; Fri, 18 Feb 2022 22:44:00 -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 e16sm27323798qty.47.2022.02.18.22.43.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 22:44:00 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: [PATCH v3 15/15] gnu: racket: Update to 8.4. Date: Sat, 19 Feb 2022 01:42:28 -0500 Message-Id: <20220219064228.246917-16-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220219064228.246917-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedu [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.51 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.51 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Philip McGrath , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedu [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedure. * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.4. Rewrite to use 'racket-vm-for-system', label-less inputs, G-expressions, and Git origins for main-distribution packages. --- gnu/local.mk | 3 +- gnu/packages/chez-and-racket-bootstrap.scm | 9 + ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1554 +++++++++++------ 4 files changed, 1067 insertions(+), 525 deletions(-) create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3a6a4a48b3..1efe54f9a2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright © 2020 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan -# Copyright © 2021 Philip McGrath +# Copyright © 2021, 2022 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher # Copyright © 2021 Dmitry Polyakov @@ -1752,6 +1752,7 @@ dist_patch_DATA = \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-enable-scheme-backport.patch \ + %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 51032fc68f..9f501d0eac 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -47,6 +47,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module ((guix licenses) #:prefix license:) #:export (chez-scheme-for-system + racket-vm-for-system %racket-version %racket-origin)) @@ -211,6 +212,14 @@ (define* (chez-scheme-for-system #:optional chez-scheme-for-racket chez-scheme)) +(define* (racket-vm-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." + (if (nix-system->chez-machine system) + racket-vm-cs + racket-vm-bc)) + (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 diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch new file mode 100644 index 0000000000..1e018eaa79 --- /dev/null +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -0,0 +1,26 @@ +From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Mon, 31 Jan 2022 15:31:22 -0700 +Subject: [PATCH] fix creation of tethered launchers + +Related to racket/racket#4133 + +(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) +--- + gui-lib/mred/installer.rkt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt +index b1691472..9ef06c53 100644 +--- a/gui-lib/mred/installer.rkt ++++ b/gui-lib/mred/installer.rkt +@@ -72,4 +72,5 @@ + (list "-A" (path->string (find-system-path 'addon-dir))))) + + (define (config-flags) +- (list "-G" (path->string (find-config-dir)))) ++ (list "-X" (path->string (find-collects-dir)) ++ "-G" (path->string (find-config-dir)))) +-- +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index e8d016c07b..67e22623b3 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021 Philip McGrath +;;; Copyright © 2021, 2022 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -21,8 +21,6 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages racket) - #:use-module ((guix licenses) - #:select (asl2.0 expat lgpl3+)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -30,7 +28,10 @@ (define-module (gnu packages racket) #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) + #:use-module (ice-9 exceptions) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) @@ -47,200 +48,90 @@ (define-module (gnu packages racket) #:use-module (gnu packages multiprecision) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages xorg)) - -;; Commentary: -;; -;; Here's how bootstrapping minimal Racket works: -;; -;; - Racket BC [CGC] can be built with only a C compiler (except for -;; one caveat discussed below). -;; - 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 -;; 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. -;; -;; So, we build CGC to build 3M to build bootfiles and CS. -;; -;; 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 -;; README file applies to all such subsystems: -;; -;; The Racket version must be practically the same as the current Racket -;; verson, although it can be the Racket BC implementation (instead of -;; the Racket CS implementation). -;; -;; Unlike Chez Scheme boot files, the files generated in "schemified" -;; are human-readable and -editable Scheme code. That provides a way -;; out of bootstrapping black holes, even without BC. -;; -;; However, other Racket subsystems implemented in Racket for Racket CS -;; use older C implementations for Racket BC, whereas the reader, expander, -;; and module system were completely replaced with the Racket implementation -;; as of Racket 7.0. -;; -;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) -;; are embeded in C as a static string constant. Eventually, they are further -;; compiled by the C-implemented Racket BC bytecode and JIT compilers. -;; (On platforms where Racket BC's JIT is not supported, yet another compiler -;; instead compiles the linklets to C code, but this is not a bootstrapping -;; issue.) -;; -;; Code: - -(define cfg-flag:sh-for-rktio - `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - (assoc-ref %build-inputs "sh") - "/bin/sh")) -(define cfg-flag:enable-lt - `(string-append "--enable-lt=" - (assoc-ref %build-inputs "libtool") - "/bin/libtool")) -(define cfg-flag:enable-racket - `(let ((racket (assoc-ref %build-inputs "racket"))) - (string-append "--enable-racket=" - racket - "/bin/racket"))) - -(define unpack-nanopass+stex - ;; Copied from chez-scheme. - ;; TODO: Eventually, we should refactor Chez Scheme - ;; enough to share more directly, so that we can make - ;; Racket's version of Chez avalable as a Guix package, - ;; e.g. for architectures not supported upstream. - ;; For now, we let Racket drive the Chez build process - ;; other than this step. - `(for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex"))) - + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) (define-public racket-minimal (package (name "racket-minimal") - (version "8.3") ; note: remember to also update racket! - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit (string-append "v" version)))) - (sha256 - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") - (file-name (git-file-name name version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) - (modules '((guix build utils))) - (snippet - (with-imported-modules '((guix build utils)) - #~(begin - ;; Unbundle Chez submodules. - (with-directory-excursion "racket/src/ChezScheme" - ;; Remove bundled libraries (copied from 'chez-scheme'). - (for-each delete-file-recursively - '("stex" - "nanopass" - "lz4" - "zlib"))) - ;; Unbundle libffi. - (delete-file-recursively "racket/src/bc/foreign/libffi")))))) - (inputs - `(;; common to all racket-minimal variants: - ("openssl" ,openssl) - ("sqlite" ,sqlite) - ("sh" ,bash-minimal) - ;; only for CS - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static"))) - (native-inputs - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) + (version %racket-version) + (source %racket-origin) + ;; For cross-compilation, Matthew Flatt recommends reusing + ;; as much of `raco cross` as possible. So, put that off until + ;; we have a build system for Racket packages. + (inputs (list openssl sqlite (racket-vm-for-system))) (build-system gnu-build-system) (arguments - `(#:configure-flags - (list "--enable-csonly" - "--enable-libz" - "--enable-liblz4" - ,cfg-flag:enable-racket - ,cfg-flag:sh-for-rktio) - #:out-of-source? #true - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main distribution. - #:tests? #f - #:modules ((ice-9 match) - (guix build gnu-build-system) - (guix build utils)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (string-append (assoc-ref inputs "bootfiles") "/boot") - "boot")) - #t)) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f ,@(map (lambda (lib) - (string-append (assoc-ref inputs lib) - "/lib")) - '("openssl" - "sqlite")))) - (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - ,version - "/catalog/") - #f)))))) - #t)) - (add-before 'configure 'change-directory - (lambda _ - (chdir "racket/src") - #t)) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda* (#:key outputs #:allow-other-keys) - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append (assoc-ref outputs "out") - "/share/racket/pkgs")) - #t))))) + ;; Here and for the `racket` package, we're using #:configure-flags + ;; to pass flags for `make-installation-layer.rkt` and #:make-flags + ;; to pass arguments for `raco pkg install` + (list + #:configure-flags + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + (list #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib")))) + #:make-flags #~`("racket-lib") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (ice-9 match)) + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs configure-flags make-flags + #:allow-other-keys) + (let* ((vm-dir (search-input-directory inputs "opt/racket-vm")) + (racket (string-append vm-dir "/bin/racket"))) + (apply invoke + racket + #$make-installation-layer.rkt + `(,@(cond + ((false-if-exception + (search-input-file + inputs "etc/racket/config.rktd")) + => (lambda (file) + `("--parent" + ,(dirname (dirname (dirname file)))))) + (else + '())) + ,@configure-flags + ,vm-dir + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p (string-append #$output "/lib/racket/pkgs")) + (for-each (lambda (name) + (copy-recursively + (string-append "pkgs/" name) + (string-append #$output "/lib/racket/pkgs/" name))) + '("base" "racket-lib")))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket + (search-input-file inputs "/opt/racket-vm/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) (home-page "https://racket-lang.org") (synopsis "Racket without bundled packages such as DrRacket") (description @@ -254,280 +145,77 @@ (define (write-racket-hash alist) DrRacket IDE, are not included.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list asl2.0 expat)))) - - -(define-public racket-minimal-bc-3m - (hidden-package - (package - (inherit racket-minimal) - (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (delete "zlib" "zlib:static" "lz4" "lz4:static") - (prepend libffi ;; <- only for BC variants - ))) - (native-inputs - `(("libtool" ,libtool) - ("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc)))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) - ((#:configure-flags _ '()) - `(list "--enable-bconly" - ,cfg-flag:enable-racket - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)) - ((#:phases usual-phases) - `(modify-phases ,usual-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") - (description "The Racket BC (``before Chez'' or ``bytecode'') -implementation was the default before Racket 8.0. It uses a compiler written -in C targeting architecture-independent bytecode, plus a JIT compiler on most -platforms. Racket BC has a different C API and supports a slightly different -set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). - -This package is the normal implementation of Racket BC with a precise garbage -collector, 3M (``Moving Memory Manager'').") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list lgpl3+ asl2.0 expat))))) - - -(define-public racket-minimal-bc-cgc - (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs - (alist-delete "racket" (package-native-inputs racket-minimal-bc-3m))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:configure-flags _ '()) - `(list "--enable-cgcdefault" - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the -Racket CS implementation. - -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) - - -(define-public racket-bootstrap-chez-bootfiles - (hidden-package - (package - (inherit racket-minimal) - (name "racket-bootstrap-chez-bootfiles") - (inputs `()) - (native-inputs - `(("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-3m)) - ("stex" ,(package-source stex)) - ("nanopass" ,(package-source chez-nanopass)))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (delete 'configure) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (invoke (string-append (assoc-ref inputs "racket") - "/bin/racket") - "rktboot/main.rkt" - "--dest" (assoc-ref outputs "out"))) - #t)) - (delete 'check) - (delete 'install)))) - (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 -supported platforms.) - -The Racket package @code{cs-bootstrap} (part of the main Racket Git -repository) implements enough of a Chez Scheme simulation to load the Chez -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.") - (license (list asl2.0))))) - - -(define %installer-mirrors - ;; Source: - ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58 - ;; Matthew Flatt says: "note that many are commented out" - ;; INVARIANT: End with a trailing "/"! - '("https://mirror.racket-lang.org/installers/" - "https://www.cs.utah.edu/plt/installers/" - "https://plt.cs.northwestern.edu/racket-mirror/" - "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" - ;; Universität Tübingen is using a self-signed HTTPS certificate: - "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" - "https://racket.infogroep.be/" - )) - -(define %main-repo-main-distribution-pkgs - ;; These are the packages developed in the main Racket Git repository - ;; that are part of the main distribution. - '("at-exp-lib" - "base" - "compiler-lib" - ;; NOT "compiler-test" - "compiler" - "net-doc" - "net-lib" - ;; NOT "net-test" - "net" - ;; NOT "plt-services" - ;; NOT "racket-benchmarks" - ;; NOT "racket-build-guide" - "racket-doc" - "racket-index" - "racket-lib" - ;; NOT "racket-test-core" - ;; NOT "racket-test-extra" - ;; NOT "racket-test" - "zo-lib")) - + (license (list license:asl2.0 license:expat)))) (define-public racket (package (inherit racket-minimal) (name "racket") - (version (package-version racket-minimal)) ; needed for origin uri to work - (source - (origin - (method url-fetch) - (uri (map (lambda (base) - (string-append base version "/racket-src.tgz")) - %installer-mirrors)) - (sha256 - (base32 - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) - (snippet - #~(begin - (use-modules (guix build utils) - (ice-9 match) - (ice-9 regex)) - ;; unbundle minimal Racket - (for-each delete-file-recursively - '("collects" - "doc" - "etc" - "README" - "src")) - ;; unbundle package sources included elsewhere - (with-directory-excursion "share/pkgs" - (for-each delete-file-recursively - '#+%main-repo-main-distribution-pkgs)) - #t)))) + (source #f) (inputs - `(("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("glib" ,glib) - ("glu" ,glu) - ("gmp" ,gmp) - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("mpfr" ,mpfr) - ("pango" ,pango) - ("unixodbc" ,unixodbc) - ("libedit" ,libedit))) - (native-inputs - `(("racket" ,racket-minimal) - ("extend-layer" ,extend-layer) - ("main-repo" ,(package-source racket-minimal)))) + (list cairo + fontconfig + glib + glu + gmp + gtk+ ;; propagates gdk-pixbuf+svg + libjpeg-turbo + libpng + libx11 ;; ?? wayland ?? + mesa + mpfr + pango + unixodbc + libedit ;; TODO reconsider in light of expeditor and readline-gpl + racket-minimal ;; <-- TODO non-tethered layer + (racket-vm-for-system))) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'configure 'unpack-packages - (let ((unpack (assoc-ref %standard-phases 'unpack))) - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out")) - (pkgs-dir (string-append prefix "/share/racket/pkgs"))) - (mkdir-p pkgs-dir) - (copy-recursively - "share/links.rktd" - (string-append prefix "/share/racket/links.rktd")) - (copy-recursively "share/pkgs" pkgs-dir) - ;; NOTE: unpack changes the working directory - (unpack #:source (assoc-ref (or native-inputs inputs) - "main-repo")) - (for-each (lambda (pkg) - (define dest (string-append pkgs-dir "/" pkg)) - (mkdir-p dest) - (copy-recursively (string-append "pkgs/" pkg) - dest)) - ',%main-repo-main-distribution-pkgs) - #t)))) - (replace 'configure - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out"))) - (apply invoke - (string-append racket "/bin/racket") - (assoc-ref inputs "extend-layer") - racket - prefix - (map - (lambda (lib) - (string-append (assoc-ref inputs lib) "/lib")) - '("cairo" - "fontconfig" - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))) - #t))) - (replace 'build - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) - "racket") - "/bin/racket") - "--config" - (string-append (assoc-ref outputs "out") - "/etc/racket") - "-l" - "raco" - "setup") - #t)) - (delete 'install)) - ;; we still don't have these: - #:tests? #f)) + (substitute-keyword-arguments (package-arguments racket-minimal) + ((#:configure-flags _ '()) + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit")))))) + ((#:make-flags _ '()) + #~`("main-distribution")) + ((#:phases parent-phases #~%standard-phases) + #~(modify-phases #$parent-phases + (delete 'unpack) + (replace 'build + (lambda args + (mkdir-p (string-append #$output "/lib/racket/pkgs")) + (for-each + (match-lambda + ((name src) + (copy-recursively + src + (string-append #$output "/lib/racket/pkgs/" name)))) + '(#$@main-distribution-packages)))))))) (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -539,82 +227,900 @@ (define dest (string-append pkgs-dir "/" pkg)) DrRacket IDE, libraries for GUI and web programming, and implementations of languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) - -(define extend-layer +(define make-installation-layer.rkt (scheme-file - "extend-layer.rkt" + "make-installation-layer.rkt" `(module - extend-layer racket/base + make-installation-layer racket/base (require racket/cmdline racket/match racket/file + racket/port racket/list racket/pretty) - (define config-file-pth - "etc/racket/config.rktd") (define (build-path-string . args) (path->string (apply build-path args))) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) - (command-line - #:args (parent-layer prefix . lib-dir*) - (let* ([config - (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) - (hash-set* - config - main-key - (build-path-string prefix pth) - search-key - (list* #f - (hash-ref config - main-key - (build-path-string parent-layer pth)) - (filter values (hash-ref config search-key null)))))] - [config - (hash-set config - 'apps-dir - (build-path-string prefix "share/applications"))] - [config - ;; place new foreign lib-search-dirs before old - ;; foreign dirs, but after Racket layers - (let-values - ([(rkt extra) - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - (hash-ref config 'lib-search-dirs))]) - (hash-set config + (define tethered? #f) + (define parent #f) + (define extra-foreign-lib-search-dirs '()) + (define-values [vm-dir prefix] + (command-line + #:once-each + [("--tethered") "create a tethered layer" + (set! tethered? #t)] + [("--parent") dir "path of parent layer, if any" + (set! parent dir)] + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (vm-dir prefix) + (values vm-dir prefix))) + (let* ([config + (for/fold + ([config (file->value + (if parent + (build-path parent "etc/racket/config.rktd") + (build-path vm-dir "etc/config.rktd")))]) + ([spec + (in-list + '((lib-dir lib-search-dirs "lib/racket" "lib") + (share-dir share-search-dirs "share/racket" "share") + (links-file links-search-files + "lib/racket/links.rktd" + "share/links.rktd") + (pkgs-dir pkgs-search-dirs "lib/racket/pkgs" "share/pkgs") + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(bin-dir bin-search-dirs "bin" "bin") + (bin-dir bin-search-dirs + "lib/racket/bogus-untethered-bin" + "bin") + (man-dir man-search-dirs "share/man" "share/man") + (doc-dir doc-search-dirs "share/doc/racket" "doc") + (include-dir include-search-dirs + "include/racket" + "include")))]) + (match-define (list main-key search-key pth vm-pth) spec) + (hash-set* + config + main-key + (build-path-string prefix pth) + search-key + (list* #f + (hash-ref config + main-key + (lambda () + (if parent + (build-path-string parent pth) + (build-path-string vm-dir vm-pth)))) + (filter values (hash-ref config search-key null)))))] + [config + (hash-update config 'lib-search-dirs - (append rkt - lib-dir* - extra)))] - [bin-dir - (hash-ref config 'bin-dir)] - [config - (hash-set* config - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) - (make-parent-directory* new-config-pth) - (call-with-output-file* - new-config-pth - (lambda (out) - (pretty-write config out)))))))) + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] + [config + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaroung Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] + [config + (cond + [tethered? + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(define bin-dir (hash-ref config 'bin-dir)) + (define bin-dir (build-path-string prefix "bin")) + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [else + config])]) + (define new-config-pth + (build-path prefix "etc/racket/config.rktd")) + (make-parent-directory* new-config-pth) + (call-with-output-file* + new-config-pth + (lambda (out) + (pretty-write config out))))))) + +(define-public main-distribution-packages + (let ((%racket-commit (string-append "v" %racket-version))) + (append-map + (match-lambda + ((source . pkgs) + (map (match-lambda + ((? string? name) + (list name (file-append source (string-append "/" name)))) + ((name ".") + (list name source)) + ((name rel-path) + (list name (file-append source (string-append "/" rel-path))))) + pkgs))) + `((,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/2d") + (commit %racket-commit))) + (sha256 (base32 + "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) + (file-name + (git-file-name "racket-2d" %racket-version))) + "2d" "2d-doc" "2d-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/algol60") + (commit %racket-commit))) + (sha256 (base32 + "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx")) + (file-name + (git-file-name "racket-algol60" %racket-version))) + ("algol60" ".")) + (,%racket-origin + ("at-exp-lib" "pkgs/at-exp-lib") + ("compiler" "pkgs/compiler") + ("compiler-lib" "pkgs/compiler-lib") + ("net" "pkgs/net") + ("net-doc" "pkgs/net-doc") + ("net-lib" "pkgs/net-lib") + ("racket-doc" "pkgs/racket-doc") + ("racket-index" "pkgs/racket-index") + ("sandbox-lib" "pkgs/sandbox-lib") + ("zo-lib" "pkgs/zo-lib")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/cext-lib") + (commit %racket-commit))) + (sha256 (base32 + "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341")) + (file-name (git-file-name "racket-cext-lib" %racket-version))) + "cext-lib" "dynext-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/class-iop") + (commit %racket-commit))) + (sha256 (base32 + "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l")) + (file-name (git-file-name "racket-class-iop" %racket-version))) + "class-iop-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/compatibility") + (commit "37f11132cdad7ef27386b68383d073f275d67c31"))) + (sha256 (base32 + "0bfqwscjpyi325br5pa6g62g9c8lq18a80zp5g3d2qzn3n3mi6x0")) + (file-name (git-file-name "racket-compatibility" %racket-version))) + "compatibility" "compatibility-doc" "compatibility-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/contract-profile") + (commit "95d980a076126b8e4e4284e912f2a7d9d3ab6860"))) + (sha256 (base32 + "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3")) + (file-name + (git-file-name "racket-contract-profile" %racket-version))) + ("contract-profile" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/data") + (commit "e32d012b394e32e102e8a9adfcc885bb0541ab51"))) + (sha256 (base32 + "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55")) + (file-name (git-file-name "racket-data" %racket-version))) + "data" "data-doc" "data-enumerate-lib" "data-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/datalog") + (commit "7d160a86451af8298093d07674a2eb0e1a0161a4"))) + (sha256 (base32 + "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp")) + (file-name (git-file-name "racket-datalog" %racket-version))) + ("datalog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/db") + (commit %racket-commit))) + (sha256 (base32 + "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5")) + (file-name (git-file-name "racket-db" %racket-version))) + "db" "db-doc" "db-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/deinprogramm") + (commit %racket-commit))) + (sha256 (base32 + "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd")) + (file-name (git-file-name "racket-deinprogramm" %racket-version))) + "deinprogramm" "deinprogramm-signature") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/distributed-places") + (commit %racket-commit))) + (sha256 (base32 + "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0")) + (file-name + (git-file-name "racket-distributed-places" %racket-version))) + "distributed-places" "distributed-places-doc" "distributed-places-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/draw") + (commit %racket-commit))) + (sha256 (base32 + "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly")) + (file-name (git-file-name "racket-draw" %racket-version))) + "draw" "draw-doc" "draw-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/drracket") + (commit %racket-commit))) + (sha256 (base32 + "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c")) + (file-name (git-file-name "racket-drracket" %racket-version))) + "drracket" + "drracket-plugin-lib" + "drracket-tool" + "drracket-tool-doc" + "drracket-tool-lib" + "drracket-tool-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/ds-store") + (commit "949ca63dd00522b3ab8aec2d71c543ece8266872"))) + (sha256 (base32 + "0ajr27kipp4dr1qlisaghsb3h7lhhjwrfw2r79b5myczsa1mp661")) + (file-name (git-file-name "racket-ds-store" %racket-version))) + "ds-store" "ds-store-doc" "ds-store-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eli-tester") + (commit "036e07d43a1f478ea1750881d5591d983ce1ffaf"))) + (sha256 (base32 + "0icx6wn14gjm8kdmq1jppqgq87sxkras4qb5xmdr6wigxafhjqyk")) + (file-name (git-file-name "racket-eli-tester" %racket-version))) + ("eli-tester" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eopl") + (commit %racket-commit))) + (sha256 (base32 + "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s")) + (file-name (git-file-name "racket-eopl" %racket-version))) + ("eopl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/errortrace") + (commit %racket-commit))) + (sha256 (base32 + "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip")) + (file-name (git-file-name "racket-errortrace" + (package-version (racket-vm-for-system))))) + "errortrace" "errortrace-doc" "errortrace-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/expeditor") + (commit %racket-commit))) + (sha256 (base32 + "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf")) + (file-name (git-file-name "racket-expeditor" %racket-version))) + "expeditor" "expeditor-doc" "expeditor-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/frtime") + (commit %racket-commit))) + (sha256 (base32 + "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5")) + (file-name (git-file-name "racket-frtime" %racket-version))) + ("frtime" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/future-visualizer") + (commit %racket-commit))) + (sha256 (base32 + "1758qq769m0r14xf64sl2ix2l9z340kvapar0j7s5kdg42lmvnhm")) + (file-name + (git-file-name "racket-future-visualizer" %racket-version))) + "future-visualizer" "future-visualizer-pict" "future-visualizer-typed") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/games") + + (commit %racket-commit))) + (sha256 (base32 + "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d")) + (file-name (git-file-name "racket-games" %racket-version))) + ("games" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui") + (commit %racket-commit))) + (sha256 (base32 + "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) + (file-name (git-file-name "racket-gui" %racket-version))) + "gui" "gui-doc" "gui-lib" "tex-table") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui-pkg-manager") + (commit %racket-commit))) + (sha256 (base32 + "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5")) + (file-name + (git-file-name "racket-gui-pkg-manager" %racket-version))) + "gui-pkg-manager-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/htdp") + (commit %racket-commit))) + (sha256 (base32 + "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl")) + (file-name (git-file-name "racket-htdp" %racket-version))) + "htdp" "htdp-doc" "htdp-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/html") + (commit %racket-commit))) + (sha256 (base32 + "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x")) + (file-name (git-file-name "racket-html" %racket-version))) + "html" "html-doc" "html-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/icons") + (commit %racket-commit))) + (sha256 (base32 + "1s5a6j11fg3fdr6b7vm2q7q178d7q8b8igy73bs211r27qrd1gg7")) + (file-name (git-file-name "racket-icons" %racket-version))) + ("icons" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/images") + (commit %racket-commit))) + (sha256 (base32 + "0rpjxqw34bq5m08kh1ldl1mr7s9z1lyydxxcyzb292kqh9qiqvfl")) + (file-name (git-file-name "racket-images" %racket-version))) + "images" "images-doc" "images-gui-lib" "images-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/lazy") + (commit %racket-commit))) + (sha256 (base32 + "176ylzgbdsbmqknpihaz519afq71pyjkv1h87j5v8jfbpbddyfsf")) + (file-name (git-file-name "racket-lazy" %racket-version))) + ("lazy" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/macro-debugger") + (commit %racket-commit))) + (sha256 (base32 + "14hyrwbkffr61fk44l02xb47bhv5zccw0ymaa9kxld86hvyqhqbm")) + (file-name (git-file-name "racket-macro-debugger" %racket-version))) + "macro-debugger" "macro-debugger-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/main-distribution") + (commit %racket-commit))) + (sha256 (base32 + "0m2n9s32s8a4a2gn4ywrm9l8jycdm5ayi5w9kh5wchhrrw7qzq7y")) + (file-name + (git-file-name "racket-main-distribution" %racket-version))) + ("main-distribution" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/make") + (commit %racket-commit))) + (sha256 (base32 + "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa")) + (file-name (git-file-name "racket-make" %racket-version))) + ("make" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/math") + (commit %racket-commit))) + (sha256 (base32 + "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac")) + (file-name (git-file-name "racket-math" %racket-version))) + "math" "math-doc" "math-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mysterx") + (commit %racket-commit))) + (sha256 (base32 + "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48")) + (file-name (git-file-name "racket-mysterx" %racket-version))) + ("mysterx" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzcom") + (commit %racket-commit))) + (sha256 (base32 + "0rc9pfj7gwm5azghqvcibz6si1x5s2v8mr2yngk7ssq9gzfbi6a4")) + (file-name (git-file-name "racket-mzcom" %racket-version))) + ("mzcom" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzscheme") + (commit %racket-commit))) + (sha256 (base32 + "192c52zi726h5wjamxrhivjw2waq1im0zpyxhbrkrxknm8x84bs9")) + (file-name (git-file-name "racket-mzscheme" %racket-version))) + "mzscheme" "mzscheme-doc" "mzscheme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RenaissanceBug/racket-cookies") + (commit %racket-commit))) + (sha256 (base32 + "0k0hifxhywl5c3hjcaiizc098dpyk001d981p572gly116yvjxc1")) + (file-name + (git-file-name "RenaissanceBug-racket-cookies" %racket-version))) + "net-cookies" "net-cookies-doc" "net-cookies-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stamourv/optimization-coach") + (commit %racket-commit))) + (sha256 (base32 + "0b27sw48d7rhz0hin88c7rbr9vpg1c23sn82nd4jkmq54h6gasr1")) + (file-name + (git-file-name "stamourv-optimization-coach" %racket-version))) + ("optimization-coach" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/option-contract") + (commit %racket-commit))) + (sha256 (base32 + "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk")) + (file-name + (git-file-name "racket-option-contract" %racket-version))) + "option-contract" "option-contract-doc" "option-contract-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/parser-tools") + (commit %racket-commit))) + (sha256 (base32 + "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3")) + (file-name (git-file-name "racket-parser-tools" %racket-version))) + "parser-tools" "parser-tools-doc" "parser-tools-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pconvert") + (commit %racket-commit))) + (sha256 (base32 + "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1")) + (file-name (git-file-name "racket-pconvert" %racket-version))) + "pconvert-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict") + (commit %racket-commit))) + (sha256 (base32 + "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x")) + (file-name (git-file-name "racket-pict" %racket-version))) + "pict" "pict-doc" "pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict-snip") + (commit %racket-commit))) + (sha256 (base32 + "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x")) + (file-name (git-file-name "racket-pict-snip" %racket-version))) + "pict-snip" "pict-snip-doc" "pict-snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/picturing-programs") + (commit %racket-commit))) + (sha256 (base32 + "1g6xr39hx1j03gb3d4dljm3v91xcj2gfpq3dgy5xvplzr6cmmxgr")) + (file-name + (git-file-name "racket-picturing-programs" %racket-version))) + ("picturing-programs" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plai") + (commit %racket-commit))) + (sha256 (base32 + "0i983sh0r0zm2ng4j44m5aw9669kh5fhp91bzpc9jm280rfcqvyl")) + (file-name (git-file-name "racket-plai" %racket-version))) + "plai" "plai-doc" "plai-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/planet") + (commit %racket-commit))) + (sha256 (base32 + "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9")) + (file-name (git-file-name "racket-planet" %racket-version))) + "planet" "planet-doc" "planet-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plot") + (commit %racket-commit))) + (sha256 (base32 + "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7")) + (file-name (git-file-name "racket-plot" %racket-version))) + "plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/preprocessor") + (commit %racket-commit))) + (sha256 (base32 + "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg")) + (file-name (git-file-name "racket-preprocessor" %racket-version))) + ("preprocessor" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/profile") + (commit %racket-commit))) + (sha256 (base32 + "179i86lyby29nywz60l4vnadi02w8b12h7501nm5h5g4pq9jjmbb")) + (file-name (git-file-name "racket-profile" %racket-version))) + "profile" "profile-doc" "profile-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Metaxal/quickscript") + (commit %racket-commit))) + (sha256 (base32 + "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + (file-name (git-file-name "Metaxal-quickscript" %racket-version))) + ("quickscript" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r5rs") + (commit %racket-commit))) + (sha256 (base32 + "1g3cysj7z88r38vkzvi8g2fb2hn4yg1fdhy5smxw303jxgl3inp6")) + (file-name (git-file-name "racket-r5rs" %racket-version))) + "r5rs" "r5rs-doc" "r5rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r6rs") + (commit %racket-commit))) + (sha256 (base32 + "0b1ymzdp10r0flw2acbidjsh5ma1pm5hy54jss37sxf89z3xbvm4")) + (file-name (git-file-name "racket-r6rs" %racket-version))) + "r6rs" "r6rs-doc" "r6rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeapostrophe/racket-cheat") + (commit %racket-commit))) + (sha256 (base32 + "06wcj558rzkbl2bwkmikyspya9v1f4iwlzwnwxpkc33h2xapwabr")) + (file-name + (git-file-name "jeapostrophe-racket-cheat" %racket-version))) + ("racket-cheat" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racklog") + (commit %racket-commit))) + (sha256 (base32 + "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb")) + (file-name (git-file-name "racket-racklog" %racket-version))) + ("racklog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/rackunit") + (commit %racket-commit))) + (sha256 (base32 + "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p")) + (file-name (git-file-name "racket-rackunit" %racket-version))) + "rackunit" + "rackunit-doc" + "rackunit-gui" + "rackunit-lib" + "rackunit-plugin-lib" + "rackunit-typed" + "schemeunit" + "testing-util-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/readline") + (commit %racket-commit))) + (sha256 (base32 + "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn")) + (file-name (git-file-name "racket-readline" %racket-version))) + "readline" "readline-doc" "readline-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/realm") + (commit %racket-commit))) + (sha256 (base32 + "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi")) + (file-name (git-file-name "racket-realm" %racket-version))) + ("realm" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/redex") + (commit %racket-commit))) + (sha256 (base32 + "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f")) + (file-name (git-file-name "racket-redex" %racket-version))) + "redex" + "redex-benchmark" + "redex-doc" + "redex-examples" + "redex-gui-lib" + "redex-lib" + "redex-pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sasl") + (commit %racket-commit))) + (sha256 (base32 + "0ibh4wb4gn8pggx6gkv4vk4d6rwzn5nrvjibhvkzhaynf6lhb824")) + (file-name (git-file-name "racket-sasl" %racket-version))) + "sasl" "sasl-doc" "sasl-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scheme-lib") + (commit %racket-commit))) + (sha256 (base32 + "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x")) + (file-name (git-file-name "racket-scheme-lib" %racket-version))) + ("scheme-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scribble") + (commit %racket-commit))) + (sha256 (base32 + "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm")) + (file-name (git-file-name "racket-scribble" %racket-version))) + "scribble" + "scribble-doc" + "scribble-html-lib" + "scribble-lib" + "scribble-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/serialize-cstruct-lib") + (commit %racket-commit))) + (sha256 (base32 + "1rq3n1fa7ldjwx3lrh9ybhig7jlsw1crpzyklbzp3xqdw6jymfnz")) + (file-name + (git-file-name "racket-serialize-cstruct-lib" %racket-version))) + ("serialize-cstruct-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sgl") + (commit %racket-commit))) + (sha256 (base32 + "0nkymhdyjrwi5h199j4w5zh7y3x3ai42gsiwxzh0hy7yqrqqg9zv")) + (file-name (git-file-name "racket-sgl" %racket-version))) + ("sgl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/shell-completion") + (commit %racket-commit))) + (sha256 (base32 + "04m144gy2mp4fiq6rcbf12wjr8mws8k9scfhg9lc38vqppp4lxsj")) + (file-name + (git-file-name "racket-shell-completion" %racket-version))) + ("shell-completion" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/simple-tree-text-markup") + (commit %racket-commit))) + (sha256 (base32 + "0fyd9gfz6bnv0m1901wv5mnhc05rm8hw9i6ddrqx33hs6qsg2zqr")) + (file-name + (git-file-name "racket-simple-tree-text-markup" %racket-version))) + "simple-tree-text-markup" + "simple-tree-text-markup-doc" + "simple-tree-text-markup-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slatex") + (commit "47e1d3e3e33d826bc2b26f9e8998eb235b23a9a5"))) + (sha256 (base32 + "0pkm2isbbdk63slrbsxcql7rr0wdrw5kapw1xq4ps5k8dhlzv8x0")) + (file-name (git-file-name "racket-slatex" %racket-version))) + ("slatex" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slideshow") + (commit %racket-commit))) + (sha256 (base32 + "1znv1i2d0610hhy71q932xy7wka00q3q50in1xfnk8ibg7nzkagm")) + (file-name (git-file-name "racket-slideshow" %racket-version))) + "slideshow" "slideshow-doc" "slideshow-exe" "slideshow-lib" + "slideshow-plugin") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/snip") + (commit %racket-commit))) + (sha256 (base32 + "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj")) + (file-name (git-file-name "racket-snip" %racket-version))) + "snip" "snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/typed-racket") + (commit %racket-commit))) + (sha256 (base32 + "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv")) + (file-name (git-file-name "racket-typed-racket" %racket-version))) + "source-syntax" + "typed-racket" + "typed-racket-compatibility" + "typed-racket-doc" + "typed-racket-lib" + "typed-racket-more") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/srfi") + ;; Includes an FSDG fix: return to %racket-commit in 8.5. + ;; See . + (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) + (sha256 (base32 + "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) + ;; Use the relevant version for srfi-doc and srfi-lib, + ;; since we're using a newer commit than the v8.4 tag. + (file-name (git-file-name "racket-srfi" "1.1"))) + "srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/string-constants") + (commit %racket-commit))) + (sha256 (base32 + "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6")) + (file-name + (git-file-name "racket-string-constants" %racket-version))) + "string-constants" "string-constants-doc" "string-constants-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/swindle") + (commit %racket-commit))) + (sha256 (base32 + "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67")) + (file-name (git-file-name "racket-swindle" %racket-version))) + ("swindle" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/syntax-color") + (commit %racket-commit))) + (sha256 (base32 + "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp")) + (file-name (git-file-name "racket-syntax-color" %racket-version))) + "syntax-color" "syntax-color-doc" "syntax-color-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/trace") + (commit %racket-commit))) + (sha256 (base32 + "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia")) + (file-name (git-file-name "racket-trace" %racket-version))) + ("trace" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/unix-socket") + (commit %racket-commit))) + (sha256 (base32 + "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y")) + (file-name (git-file-name "racket-unix-socket" %racket-version))) + "unix-socket" "unix-socket-doc" "unix-socket-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/web-server") + (commit %racket-commit))) + (sha256 (base32 + "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn")) + (file-name (git-file-name "racket-web-server" %racket-version))) + "web-server" "web-server-doc" "web-server-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/wxme") + (commit %racket-commit))) + (sha256 (base32 + "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b")) + (file-name (git-file-name "racket-wxme" %racket-version))) + "wxme" "wxme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/xrepl") + (commit %racket-commit))) + (sha256 (base32 + "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3")) + (file-name (git-file-name "racket-xrepl" %racket-version))) + "xrepl" "xrepl-doc" "xrepl-lib"))))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 09:46:42 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 14:46:42 +0000 Received: from localhost ([127.0.0.1]:57193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLR0U-000781-61 for submit@debbugs.gnu.org; Sat, 19 Feb 2022 09:46:42 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:43010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLR0Q-00077o-O1 for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 09:46:40 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K1BGJ4980z1DHPn; Sat, 19 Feb 2022 15:46:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4K1BGJ4980z1DHPn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645281993; bh=r+tKh6SV4EcRHcYpfHShCS0ypxkoePI+AzDv4lhOLy4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=IXKCfgge/xxeGHeXTiCKvG9K/RDgLAGuGYhkwcmDie+kq0SWBYUXm5rUstDCGfPl7 u7BxZI05eqTIuspbVG6q18qnQtSKiPKyyBU+MWU0k7I5LotNU3gHzIR2VGPlzHNOGa 9YZlR5XLBVh0C+kV+i9wWenX0ocJR1kFPoXmeovw= Message-ID: <1d1a68ccb419f6b41c4272aa32dafc5e482ab481.camel@ist.tugraz.at> Subject: Re: [PATCH v2 08/15] gnu: chez-scheme: Explicitly package bootstrap bootfiles. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Sat, 19 Feb 2022 15:46:31 +0100 In-Reply-To: <4034931.zyubqINhsf@bastet> References: <97f8916ae5bd8d8459bdfd507864f2f55cc217a1.camel@ist.tugraz.at> <20220217205048.967383-9-philip@philipmcgrath.com> <72bb2b48f7c2fae26c60db8c13cff34a0b01347b.camel@ist.tugraz.at> <4034931.zyubqINhsf@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Freitag, dem 18.02.2022 um 18:20 -0500 schrieb Philip McGrath: > > Now to explain the difference between my suggestion and what you > > implemented.  Mine would be to > > (define-public (chez-scheme-bootstrap-bootfiles chez-scheme) > >   ...) > > where ... is the code you already have.  This would not only work > > for other chez-schemes than the one we have packaged, but might > > also make it possible to cross module boundaries, i.e. keep chez- > > scheme in chez.scm.  WDYT? > > I still don't think I understand. How would this avoid having to > override almost everything for both the upstream and Racket variants > of the package, as > was the case in my attempt in > (also at > < > https://gitlab.com/philip1/guix-patches/-/blob/guix-issue-53878-v2-bootfiles-proc/gnu/packages/chez-and-racket-bootstrap.scm#L723 > >)? I mean, you could put > the upstream stuff under the `lambda` for now, but eventually it will > also need a build phase and some inputs. I just don't see what the > benefit all that would achieve, or what the problem is (if there is > one) with this patch. The concern is not w.r.t variants, but version bumps, assuming that bootstrap mostly stays the same from e.g. Racket 8.4 → 8.5 (I don't have the Chez version in the back of my head atm, but you get the gist) Will be looking at v3. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 15:00:46 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 20:00:46 +0000 Received: from localhost ([127.0.0.1]:58771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLVuQ-0007B1-JU for submit@debbugs.gnu.org; Sat, 19 Feb 2022 15:00:46 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:41621) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLVuO-0007Am-Pm for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 15:00:45 -0500 Received: by mail-ed1-f65.google.com with SMTP id w3so21362710edu.8 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 12:00:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=+NbmovsVU6E/mA6QXGg8xdHT4AEvg+sreOE+CKtoRmw=; b=HPy1Cam2AHjKwG6zMS5TB50TVPefmRASnHIcSed02FHipp+ACyY3hc+CQ4eVnDXaWu ynBgcjX7UQhYHQChHNyguLC23N36Lm7Lumk0Y/quI6baBlaQenm4x6AbYnONiI1h1Qyl VWQ1XSDIoFJfXUeqGCWXZaveykmBIpwF8K9P6k8ghcmRPsWv8fDKV7I2x80npWNOP+Ab 0rX52LIUIEDxAsGUPFY9RBjCAtGWfucKIu+ytYrLJBCvI8BHfhop22p5YGC4Vfod3DtQ HFLxq0m12wnAWKfVSKA8KpJ5l84cpl4i7P6Os+RWH88cSYAOvBBz/T5EYz8FEuAXB8HB 53Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=+NbmovsVU6E/mA6QXGg8xdHT4AEvg+sreOE+CKtoRmw=; b=Zl/8bUa2jfFpT0Yd/VHt8NIsuZVewKX8Ggi6y4eq5umYTCCugzrLK9OQCHYl22ptIm C4NgFy8cHG0vrpcqGdhcmdr1Fqs3kUYqguFCrgUkDmYfHXXa6j0+tTK9Jk6d1Rw+91zF lMv+V91EGrgNMpirfpehZDubbmzBsWmXPZ+mELmTYN/FB5MZ+vCHMcGLS4YASDtlh9Co pm189zoGDKcqW0OSWhSgMxjgiLuNjmW17Nz+/CgQ9T3cE0acWWhFWkrP5aXy6yFF1pDr uGXiHqgghGmovxytFl370m9VPonX6+eYunIuP1kP2NYxmwVUSKjUCmgxAfgL9XaWQGfq 7QaQ== X-Gm-Message-State: AOAM5330NheCvKRs/SFHYLMCYkdG//GgDryXnducLxyvz/6sxY1vHmqK dHb4h74VJ0vJwR8gzwVJC1A= X-Google-Smtp-Source: ABdhPJysCFTcsaQCXbRAtzDlG4/myXhmTGt9Qz4tKrymgfB8APNHMAPqq27wteOAXnhuLFuUuQ0MKA== X-Received: by 2002:aa7:dd50:0:b0:40f:dd4a:9a9e with SMTP id o16-20020aa7dd50000000b0040fdd4a9a9emr14113263edw.369.1645300838827; Sat, 19 Feb 2022 12:00:38 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id z12sm6759082edb.77.2022.02.19.12.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 12:00:38 -0800 (PST) Message-ID: <1e5304885495c35e6343efcd9873e2285230591c.camel@gmail.com> Subject: Re: [PATCH v3 14/15] gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, Liliana Marie Prikler Date: Sat, 19 Feb 2022 21:00:37 +0100 In-Reply-To: <20220219064228.246917-15-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> <20220219064228.246917-15-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Am Samstag, dem 19.02.2022 um 01:42 -0500 schrieb Philip McGrath: > +(define* (chez-scheme-for-system #:optional > +                                 (system (or (%current-target- > system) > +                                             (%current-system)))) > +  "Return 'chez-scheme' unless only 'chez-scheme-for-racket' > supports SYSTEM, > +including support for native threads." > +  (if (and (nix-system->chez-machine system) > +           (not (and=> (chez-upstream-features-for-system system) > +                       (cut memq 'threads <>)))) > +      chez-scheme-for-racket > +      chez-scheme)) Given your previous explanation this series looks clean enough so far, but this looks like a bug. You probably want (if (and (nix-system->chez-machine system) (and=> (chez-upstream-features-for-system system) (cut memq 'threads <>))) chez-scheme chez-scheme-for-racket) This variant would in particular use chez-scheme-for-racket if nix- system->chez-machine returns #f. I can make that adjustment for you assuming I interpreted this correctly. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 15:46:57 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 20:46:57 +0000 Received: from localhost ([127.0.0.1]:58793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLWd7-0008I4-5g for submit@debbugs.gnu.org; Sat, 19 Feb 2022 15:46:57 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:39843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLWd5-0008Hm-4P for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 15:46:55 -0500 Received: by mail-ej1-f65.google.com with SMTP id p9so23113014ejd.6 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 12:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=60/goiDDSN/HV+pslfXRAqTZxLThCzg7N57iH/Kc9nI=; b=THXAbuJyJOLXKmfCcgx0NSg8yRJbMNtJKIv6ie3aFt86RCJgqTPsy9xZ/jUebQK0no 1aVbQbu6o7lPXyduiWiA4HatvGyRCwyH6sJhADv26kqtMkBndhHBqkF2I/v2rK1NxxL1 3NcdDY6qhwXwcKd4bBSZ0twbMHxkRMATWAvXWKSyDeUSFmcWGQGU9ydjrn5Uc5LSzL64 IjhatfXM3sYLvHM8/heM4Tt29HISThfhbMgEJqx1cwZrNiqR2DpoQ6fs/CclFTLt0nNj piK9ILYF0NSWOPdC4i5ZvpjkwJ2+M2SCslqOW8PzvfWjUAzn9izRQ3pILZhFhADKhi1j W8dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=60/goiDDSN/HV+pslfXRAqTZxLThCzg7N57iH/Kc9nI=; b=aBJYzR37CtdSU4rTywY+VZ5FC1ZawNHb31C79WeAJfJtS5JCssVNVMFYoR0KjIWhOh 75AV+WQWu9ugk2A+5639nefHlurNV0h0ucRlYC2Ji1mrbvER/pwmqwXbbkDCm2s90FCf e0q9OOEbLJfupNLP2eF7oGEY6I1PfPUtwECPwMx0Ntlz99h+n35BP7bZYPW2U76o3y5b H+7xsnz7IAST2fBae+n3/v4d720X7ufeFwOfZXpJaSNtOcSJSnsOmuJ4RJljRTD0Yhn+ anQvY18UP9q63vAAqlon9MSDi/a78GGwKZpZGmYTu9Cb4ixa3g7+Ma1DKRAASzTreUoC FW2A== X-Gm-Message-State: AOAM531zPkHLyMvMlh/KtgHY9XDrsC6txW8Z6YgFbu3/Bm0021sinDlE 6L0IEj5M+6zsbY3cLBS+Wjc= X-Google-Smtp-Source: ABdhPJxpC77DzC1NDk3xFCpfAAuq7I7St8hC/oDWtZit6+ZRuniy3+AdIXy1Q670t7o8VkCU8X1s2Q== X-Received: by 2002:a17:907:58e:b0:6ce:375a:4b8d with SMTP id vw14-20020a170907058e00b006ce375a4b8dmr10712986ejb.107.1645303608949; Sat, 19 Feb 2022 12:46:48 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id y22sm6747692edc.41.2022.02.19.12.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 12:46:48 -0800 (PST) Message-ID: <3eac7271a203816232ae5e298bfbed65f4942bf3.camel@gmail.com> Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, Liliana Marie Prikler Date: Sat, 19 Feb 2022 21:46:47 +0100 In-Reply-To: <20220219064228.246917-10-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-1-philip@philipmcgrath.com> <20220219064228.246917-10-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Am Samstag, dem 19.02.2022 um 01:42 -0500 schrieb Philip McGrath: > * gnu/packages/patches/racket-enable-scheme-backport.patch: New > patch. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/chez-and-racket-bootstrap.scm (unbundle-chez- > submodules, > %racket-version, %racket-origin, racket-vm-cgc): New variables. > (chez-scheme)[source]: Use 'unbundle-chez-submodules'. Something weird happened to me just now trying to build this series. While compiling emacs-xyz, an error was raised regarding %racket- version not existing and and import being missing. Assuming that you didn't mess up an include somewhere, there could be a cycle meaning we'd have to pass the version and origin by function as I originally said in my reply to v2. I'll clean up my work tree and try to reapply it, but that will take some time. Since you mentioned re-exports causing issues, I'd like to ask if you've made a similar experience, but the results got somehow hidden after the right incantations. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 17:34:41 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 22:34:41 +0000 Received: from localhost ([127.0.0.1]:58878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLYJM-0002WP-Um for submit@debbugs.gnu.org; Sat, 19 Feb 2022 17:34:41 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:57671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLYJL-0002WA-AV for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 17:34:39 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 3190C580188; Sat, 19 Feb 2022 17:34:34 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 19 Feb 2022 17:34:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; bh=VsZIqALzYFVhirbwJUlCmGgdL66q4wwzpy1+ZU AkmfA=; b=bomXP6cL3yV1I2wyQPHTd0S5+5EeTzAZY8pw6yt31/+WQlWw4XV49Y uUZEdsqiOdhB0Gly82IqapcNlEnVucmuT6e0nnuFoAhbTfe/XV4Sz/sy74bI5KpG HH0ryJ15BA2nQh0ppGPWsWhhg40Os/ephZG/zMq8zTBhuYPCoCWylPrWafpvB2E5 KhCCX5m4PygK/hFCv+oXXlzB6Bln3dJ/BzrUPgZQ2izRmAGBQHHNcQrPvF3BKirg qJUlmUyVmegajgKv/wEcJlMzT4Y59a2sNmOSfMXgQUjuELvKUBzvlAjU10KX6iB8 zqbzvxydZG1juU+Fc5EHkvhNNATNoodw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=VsZIqALzYFVhirbwJUlCmGgdL66q4wwzpy1+ZUAkm fA=; b=jutsbXGmx+pOPXdCAlhAJR2yIP9BpTmFZAHha/ZujiVNmtAhrOBE2O/GP Lfs65rFSyFAb6Xf3WV53gKh0Yx5q/o9oqgGGEzlQlLEY/flzM3+bNQ3cU7FrV22B lHctbQD90+vRX0o0HVTieB3HohgWrRbBimKvRuPiYa6xAafJAGimBd/Kf6famuoF 6fEdrnE2fMv0MpotqCXEOtaaJ91B43a7uIp/h7vrAreASNtBK3GtyhKpgI8JMyBC SyXuGmxOh2o8zdbUEgRY+Xh7A5khqD8v/9j7ivjoBDGdZdgN4piGofEwRgGg5MsT TRpqElnytDH1qQhGCqVkhrZ5cQJ1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkedvgdduieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfggtgesghdtreertddtvdenucfhrhhomheprfhhihhlihhpucfo tgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhmqeenuc ggtffrrghtthgvrhhnpeeujeffieehvdefleffveehgfdufffgfefgkeffgeeifffhffeu ueeigeevudetjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Feb 2022 17:34:32 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: Fwd: Re: [PATCH v3 14/15] gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. Date: Sat, 19 Feb 2022 17:34:30 -0500 Message-ID: <3235123.MgZsDSeleD@bastet> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1829058.iaLth6TSep"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart1829058.iaLth6TSep Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun , Philip McGrath Subject: Fwd: Re: [PATCH v3 14/15] gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. Date: Sat, 19 Feb 2022 17:34:30 -0500 Message-ID: <3235123.MgZsDSeleD@bastet> (sorry, missed "reply all" ...) ---------- Forwarded Message ---------- Subject: Re: [PATCH v3 14/15] gnu: chez-and-racket-bootstrap: Add 'chez- scheme-for-system'. Date: Saturday, February 19, 2022, 5:29:05 PM EST From: Philip McGrath To: Liliana Marie Prikler Hi, On Saturday, February 19, 2022 3:00:37 PM EST you wrote: > Am Samstag, dem 19.02.2022 um 01:42 -0500 schrieb Philip McGrath: > > +(define* (chez-scheme-for-system #:optional > > + (system (or (%current-target- > > system) > > + (%current-system)))) > > + "Return 'chez-scheme' unless only 'chez-scheme-for-racket' > > supports SYSTEM, > > +including support for native threads." > > + (if (and (nix-system->chez-machine system) > > + (not (and=> (chez-upstream-features-for-system system) > > + (cut memq 'threads <>)))) > > + chez-scheme-for-racket > > + chez-scheme)) > > Given your previous explanation this series looks clean enough so far, > but this looks like a bug. You probably want > (if (and (nix-system->chez-machine system) > (and=> (chez-upstream-features-for-system system) > (cut memq 'threads <>))) > chez-scheme > chez-scheme-for-racket) > This variant would in particular use chez-scheme-for-racket if nix- > system->chez-machine returns #f. > > I can make that adjustment for you assuming I interpreted this > correctly. Thanks for catching this! I must have gotten myself confused while changing to chez-upstream-features-for-system from the chez-machine->upstream-restriction version. -Philip ----------------------------------------- --nextPart1829058.iaLth6TSep Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIRcHYACgkQygNjjfo/ HHqwNA/+JGC0JnvAOPkVJKEeYikmsCUunFBLe6LQ5wzS2EIC+TEWfv042MlXzGSO wfg5aLUOxm+0iNI7TR/iZ+QMMUq6gWzMwUCHFcwNA1HoDlGtMDO2TYu8l+Wq5zOI utXCepg4WP6gY00uu5HRne9AhkeMnuE6wKeGcHt8eUKyWSahcQ1Q9EQIiqm2UkMk Gg0ZCWi1ZBeuoDNyTN7Y9N/tC88QGxbU+/oVqkg3rU6SsX8dzLQ7rpT2e+YeV/C9 rX6e04GFyFf9524LzsxAwnuCKqICs4K70GOWBfAnYYZMERw1cNtLscqQFdAwBYop czVOhhNEjAvSN2+aUF7YETeB0jcOJWzNLoS1QpqN52N1YThxgMOxQc08JlFl2z2E lFh+hoSYKGZ+tLN/dckrLXzVf/r+h5mqr61Iao1pQQtXynfrLqnf5wb5rak0HUt5 Tik8Boh8/H0CWYKnuygvLRFKXXPB0zBWHYGrJxJv61bGMBKXOGvejJRy8roqgWhq 4MTkAd/E83+0Gf4HgZGvTMvm14Sh0otjWWjN7Iop8H0C+DjUTxrrFd2webHtxaz5 fy1ZTrtKABy1vZ2bU/n9lQsowJugh35tWK6p7TaS04cCYKvwMALyEJ/W8zFk89Ap ucQ77lZ3x8rlNNYiRQ2i3XoxBcFS6DyZ7knAhBSnSb3cEuf4T5A= =j725 -----END PGP SIGNATURE----- --nextPart1829058.iaLth6TSep-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 17:35:30 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 22:35:30 +0000 Received: from localhost ([127.0.0.1]:58884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLYKA-0002Xy-8u for submit@debbugs.gnu.org; Sat, 19 Feb 2022 17:35:30 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:51449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLYK8-0002Xl-QN for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 17:35:29 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id B2078580171; Sat, 19 Feb 2022 17:35:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 19 Feb 2022 17:35:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; bh=WpoLTxNXhwuYVhXd6Od4CxUYClpVQhv4mN7Kli etUWQ=; b=DWHrVOc749cxlsGYtyKsAUfYHMdDHGDEM8Wre8c8p5hpmBX58jaMqm Cnzyugvzs3qp8ICSQsOLeo0vMgk606vd3GqU4JpQCyVaoWIot+onPUvXt3PEYu6W EKYQq+RDsgodlcfKmj+49unJplRJOmKY+dEHCkgsRJEzqvN4SJThTwO+8VEnUbTB ctdW+83Pu2IksxORCFoHRn+QwVjZX91oeVL7GAcSkXFI4mORR7dGBFVSc0bZ7ban g/ChMJM7h7w9XydWOZLiahAAnIdpntfSUJPo7u6QDWp62GkEOPn355dNaP94sVVE yhZrY91odJZDfEF/M466pSW7EJ34fPEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=WpoLTxNXhwuYVhXd6Od4CxUYClpVQhv4mN7KlietU WQ=; b=dHU/eJfLcao/mMi19BChRqX/5xSOTl9TMr0CXNPYbRAuOyKov6tWtcT3m MJYxwZYIYtLISJfxIBDWJgicItxDjV/2K8bcwGvZL+UuY0mMT6yccwYKLqWGeygi zTokkzCAYGhzStp6+Qm1D+Cj5185vdHYphHqW/wNarxZtA0leDBjiQgDOFYeFtA8 9SNYGvKwb3pY2zJCQch6sEP3BLKSxsE9plXjZok05rrKm/XgIC5JdbeVn49dPLb8 0jucZ+/ziOz9qy4A83Xj4Hx+G9oA5kBJ+VRkm1iWRrZ3CscZ//SIc4ghV6DJWr6K tryjcfcJAE85mv5BvlC39VhxoqljA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeefucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh ephffvufffkfggtgesghdtreertddtvdenucfhrhhomheprfhhihhlihhpucfotgfirhgr thhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhmqeenucggtffrrg htthgvrhhnpeeujeffieehvdefleffveehgfdufffgfefgkeffgeeifffhffeuueeigeev udetjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Feb 2022 17:35:22 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Subject: Fwd: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sat, 19 Feb 2022 17:35:22 -0500 Message-ID: <8318672.icPvpm7bSU@bastet> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3539733.Sm5KBrZdlh"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart3539733.Sm5KBrZdlh Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , zimoun , Philip McGrath Subject: Fwd: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sat, 19 Feb 2022 17:35:22 -0500 Message-ID: <8318672.icPvpm7bSU@bastet> (... on this one, too) ---------- Forwarded Message ---------- Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Saturday, February 19, 2022, 5:27:39 PM EST From: Philip McGrath To: Liliana Marie Prikler Hi, On Saturday, February 19, 2022 3:46:47 PM EST you wrote: > Am Samstag, dem 19.02.2022 um 01:42 -0500 schrieb Philip McGrath: > > * gnu/packages/patches/racket-enable-scheme-backport.patch: New > > patch. > > * gnu/local.mk (dist_patch_DATA): Add it. > > * gnu/packages/chez-and-racket-bootstrap.scm (unbundle-chez- > > submodules, > > %racket-version, %racket-origin, racket-vm-cgc): New variables. > > (chez-scheme)[source]: Use 'unbundle-chez-submodules'. > > Something weird happened to me just now trying to build this series. > While compiling emacs-xyz, an error was raised regarding %racket- > version not existing and and import being missing. Assuming that you > didn't mess up an include somewhere, there could be a cycle meaning > we'd have to pass the version and origin by function as I originally > said in my reply to v2. > > I'll clean up my work tree and try to reapply it, but that will take > some time. Since you mentioned re-exports causing issues, I'd like to > ask if you've made a similar experience, but the results got somehow > hidden after the right incantations. I haven't seen errors from emacs-xyz, but I have gotten errors about %racket- version not existing: at the time I thought it was just a problem with incremental rebuilds while moving back and forward through history, but, having just refreshed my memory on more details of the cyclic issues, I think it may be related. I'll send another email presently with details once I've gathered references. For now, I found that `rm gnu/packages/*.go` was enough to get `make` to succeed again. -Philip ----------------------------------------- --nextPart3539733.Sm5KBrZdlh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIRcKoACgkQygNjjfo/ HHqjvg//bhV4fvp/+HcRjzdmqdDylVsS0VwRsjii4wba5FLOgXu4xaZQhkmWU6PZ qU+sYqjqoOocNmoVf1G/VPFTZerWav5Orw4hJMz90vEvzhE4JwJSgOXZsNQMgbNJ bi21V4yofKF+yoPogcx5zs7qEbyz3D8OKARnfeldyAG4v0ovocfOMPoq6m1mEMxN xW1NzlaphLU0Y5rQBxZvDtxDWAth7iQduRCXv4p1032exBSafJIbKNfG+GJ2wNnS OYmdzBgMonHSuGYzlyDp4XepvTEnL2R9jQYTlHHnYpYvDjPIVNjsCp60abB2We1R JTvJW70D6qsh/kHqOyjKEFDEcs7vq0KC59/g69pim+7LTYzYXQnWXduPcn4TxRvN Dyi+x5uJ5BgLw+Gy0RF9TB+wmWTPzlWjxlR4vvujRKRbYhnvo8Tk10Lk9Sm2c0NY JUNs+kB/+9VS3N9fS5aswOZ8/N92p3HMzvKtmFa7m26TyaN15SQTht1Rcy31/Gw2 yu7fx0uLCAGgqoGKAEfSzpFSbmnZooSkOrG8dSpfH6m3r11jIH4i4pmFQpfMxzHL 86oCWwkkIzCz2GiAVbMwaP/NZyYff9KeDTPg0NvY0vYiqRrRYQzKdDyrazLCykUt /rW4YYgYgzS1tNgzOdbonH4FXnEAviju3FGP3/VC4na2x84bwvw= =J+cU -----END PGP SIGNATURE----- --nextPart3539733.Sm5KBrZdlh-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 19 18:24:38 2022 Received: (at 53878) by debbugs.gnu.org; 19 Feb 2022 23:24:38 +0000 Received: from localhost ([127.0.0.1]:58917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLZ5d-0003l1-SC for submit@debbugs.gnu.org; Sat, 19 Feb 2022 18:24:38 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:51403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLZ5c-0003ko-Fr for 53878@debbugs.gnu.org; Sat, 19 Feb 2022 18:24:33 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 599CD5801DB; Sat, 19 Feb 2022 18:24:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 19 Feb 2022 18:24:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=qbz51qpnzogMry rm6aBEcZQlu0eirEnZUUSll0RM7lk=; b=Z1PMS4Uk3JJmWHyr7cdZYmt1WOpLAd SOuTWuMM6SXcIS324WxrQo+ml2m8X1773JxxXTCHZ5ScLJQnActuBdERJZqSZcwj wvty5Obn3IyGNdLT2BsoF1+2B8YuY6aGHcTywcugEkhnNVAtZEIuxjxE+h3tfkZm yYgcroAmGMYD/S+KR3KmTWkFgcwVIOcMjA+EHk89UW9P310R63ijImpKyq/I+XWk NaQmKLGc710tOm5+SRj4vFKVVwmQgTxBXX0/osbxhhErnqSSIZJdBgowfp92QDWr IePbcMaKVqwsrkB9E57mCPdxljrhTYqm+h9ahxTjcuWPJLOq98mNjqTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=qbz51qpnzogMryrm6 aBEcZQlu0eirEnZUUSll0RM7lk=; b=oGqWJukK4YaJS+tbqqYPs+yXsJqnPIxlM f7kDF7vd9E9uRrosdYOeimLYyKr8E3rV3Wpky/cG+iRJ5bnjbXIUQuTiOF06NzpR YCeTVkT8gjMfrp7e7Np3MPWL4202KuMHoizGLU8MxaJHY9t34Bx5fvJhy/VGm/xl dwVcQAEQP9nowv5DdoPBOciE23fp7OUcx1LikVihE7RcVOOU59p7PZx+Gi+btc1j k+i/RA8MGH3WApw3FnIIagUphWWvt0Bfhj0T6WzyRbhRqpelkMV2DHoGGl10i60v KhfsIJT6ZxpbAZlsARzTPbB+WfZLNfevrrROFjfco7o2z7B2gykNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeefgddutdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhepueettdeggeelgfdtgfeigfetvddugefgvedvjeehhfefieff fffggfetleehhefhnecuffhomhgrihhnpehgnhhurdhorhhgpdhrrggtkhgvthdqlhgrnh hgrdhorhhgpdhriehrshdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Feb 2022 18:24:25 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: Fwd: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sat, 19 Feb 2022 18:24:14 -0500 Message-ID: <2789908.yFRqqTqYmU@bastet> In-Reply-To: <8318672.icPvpm7bSU@bastet> References: <8318672.icPvpm7bSU@bastet> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart65832543.ErJBQUClLv"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart65832543.ErJBQUClLv Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Cc: Attila Lendvai , Malte Gerdes , zimoun , raingloom , Philip McGrath Subject: Re: Fwd: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sat, 19 Feb 2022 18:24:14 -0500 Message-ID: <2789908.yFRqqTqYmU@bastet> In-Reply-To: <8318672.icPvpm7bSU@bastet> References: <8318672.icPvpm7bSU@bastet> Hi, On Saturday, February 19, 2022 5:35:22 PM EST Philip McGrath wrote: > On Saturday, February 19, 2022 3:46:47 PM EST you wrote: > > Am Samstag, dem 19.02.2022 um 01:42 -0500 schrieb Philip McGrath: > > > * gnu/packages/patches/racket-enable-scheme-backport.patch: New > > > patch. > > > * gnu/local.mk (dist_patch_DATA): Add it. > > > * gnu/packages/chez-and-racket-bootstrap.scm (unbundle-chez- > > > submodules, > > > %racket-version, %racket-origin, racket-vm-cgc): New variables. > > > (chez-scheme)[source]: Use 'unbundle-chez-submodules'. > >=20 > > Something weird happened to me just now trying to build this series. > > While compiling emacs-xyz, an error was raised regarding %racket- > > version not existing and and import being missing. Assuming that you > > didn't mess up an include somewhere, there could be a cycle meaning > > we'd have to pass the version and origin by function as I originally > > said in my reply to v2. > >=20 > > I'll clean up my work tree and try to reapply it, but that will take > > some time. Since you mentioned re-exports causing issues, I'd like to > > ask if you've made a similar experience, but the results got somehow > > hidden after the right incantations. >=20 > I haven't seen errors from emacs-xyz, but I have gotten errors about > %racket- version not existing: at the time I thought it was just a problem > with incremental rebuilds while moving back and forward through history, > but, having just refreshed my memory on more details of the cyclic issues, > I think it may be related. I'll send another email presently with details > once I've gathered references. >=20 > For now, I found that `rm gnu/packages/*.go` was enough to get `make` to > succeed again. This reminded me of one of the commits I mentioned yesterday in : > commit 96db2ff145ecbd962206eae815b065bda7ed3d9f > Author: Ludovic Court=C3=A8s > Date: Tue Sep 7 15:11:46 2021 +0200 > > gnu: racket-minimal: Remove top-level reference to 'chez-scheme'. > > This could cause build errors; for instance, doing: > make && touch gnu/packages/chez.scm && make > > would trigger a "chez-scheme: unbound variable" error. > > * gnu/packages/racket.scm (racket-minimal)[source]: Add 'modules' > field. In 'snippet', remove top-level reference to CHEZ-SCHEME, which > could cause build errors. Simplify snippet. That symptom of an unbound variable error on re-making sounds like what's=20 going on. In , Ludo=E2=80=99 explained: On Monday, May 31, 2021 12:23:27 PM EST Ludovic Court=C3=A8s wrote: > Philip McGrath skribis: > > On 5/29/21 4:15 PM, Ludovic Court=C3=A8s wrote: > >> In general we cannot use #:select for (gnu packages =E2=80=A6) modules= because > >> that doesn=E2=80=99t play well with circular module dependencies. > >=20 > > Ah, interesting, I'll keep that in mind. I'm used to Racket, where all > > cyclic module dependencies cause errors at compile time. >=20 > Yeah, in hindsight, that=E2=80=99s probably safer=E2=80=A6 >=20 > > Do you have any advice on what would be good practice? >=20 > For package modules, the main things are: >=20 > 1. Don=E2=80=99t use #:select or #:autoload for (gnu packages =E2=80=A6= ) modules in a > (gnu packages =E2=80=A6) module. >=20 > 2. At the top level of a module, only refer to variables within that > module. For instance, the following would be wrong: >=20 > (define-module (gnu packages racket) > #:use-module (gnu packages chez) > =E2=80=A6) >=20 > (define whatever > ;; Wrong because =E2=80=98chez-scheme=E2=80=99 is defined in ano= ther module, > ;; which might be part of a cycle with this one. > (package (inherit chez-scheme) =E2=80=A6)) >=20 > (define something > (package > ;; =E2=80=A6 > (license (package-license chez-scheme)))) ;likewise >=20 > Note that references from =E2=80=98inputs=E2=80=99 and =E2=80=98arguments= =E2=80=99 fields are perfectly > fine (fortunately!) because those fields are =E2=80=9Cthunked=E2=80=9D (t= heir value is > wrapped in a thunk). >=20 My understanding of the semantics of Guile modules is strictly less than th= e=20 content of that thread. I'm most familiar with Racket modules, and I have s= ome=20 understanding of how those semantics differ from R6RS library semantics. I think I had seized in my memory of =E2=84=96 2 on "at the top level of a= module",=20 and I'd filled in my usual (Racket) understanding of "at the top level of a= =20 module" as a less formal way of saying "in a module context", in the sense = of=20 "expansion contexts".[1] But Ludo=E2=80=99's examples show that's wrong: those uses of `chez scheme= ` are in=20 what the "expansion contexts" model would call "expression contexts". Instead, I think rule =E2=84=96 2 prohibits any reference to a variable imp= orted from=20 another (gnu packages ...) module that will be evaluated when the (gnu=20 packages ...) modules are=E2=80=94visited? instantiated? [2][3]=E2=80=94IDK= when exactly, but,=20 for practical purposes, any variable reference that is not underneath a lam= bda=20 abstraction. If that's right, IIUC, it would mean that: (define chez-scheme-for-racket (make-chez-scheme-for-racket ...)) would also be prohibited. On the other hand, uses of `(racket-vm-for-system)` and `(chez-scheme-for- system)` in an `imports` field should still be fine, thanks to the implicit= =20 thunks. I think I can can make that work relatively well. The one thing I don't kno= w=20 how to avoid is defining `%racket-version` in both "chez-and-racket- bootstrap.scm" and "racket.scm", but I'll leave a cautionary comment. I'll try to make a v4 with the approach I have in mind. I'd be glad to hear= =20 better ideas, though! Especially if anyone knows more about what Guile's=20 module semantics really are. =2DPhilip [1]: https://docs.racket-lang.org/reference/syntax-model.html#%28part._expa= nd-context-model%29 [2]: http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-10.html#node_sec_7.2 [4]: https://docs.racket-lang.org/reference/syntax-model.html#%28part._mod-= parse%29 --nextPart65832543.ErJBQUClLv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIRfB4ACgkQygNjjfo/ HHqoQBAAtF4TgTfb+ApUlglKEnksKiAfP5D/m37wOXCzpMsu69guThVzEYr5kljG lFT5c2OrfQ6FnD7l5u1uCui4Pw1Rf4yUqZCFxh/xnrZA47x7CPOb2h/jYKfOoQzL P2xsyHpLgwdNf35D21nZu/ocvOnmDQ88wQWSWiIqc14SGae/5VdVyp2qfKgtGduM 2lf1YsGGNzUTxI6D1/7jONhhX1UJxDSvldQYRbmPcrCUawbtfv3dmiAL3KlTJ6F6 dfnyMerSyCnfvJ5WhsJEgZkWMaNJgFAYdq5W4gRs7uI2D4LUKt2v8r6iD3Q3Eh4B PSrgVmPmRazQqzl5KUwzbfDCKuMvRngBKbpfiXyoaUHuyUJWOZCYTtXPkPp/koPM GYceK9n0BmzqDSBMrXIGc27dmZvQKwGOkQALrwXR2BVqW1DQbqOTP1d+iIqmYgLU 0WiiuP8RwfpMQ2yxXdpyGGJwz0NoLz8fCxTRYPVr7Gvv+msz8LKTUNnxF4thFzAH /Ur/nvlammPfdbEehE6mMLBgMAaiA4EucaaO9i9EO1i5UCKnEPqeaMipBQiLO2P+ HR9XcXRru9nAk/EvuqTUWeMFfqlijiRvAob2R/DzrU6H6dMU3RgT8Vo3LD4/pLPQ We3mXQB/wvpekRwJBSQg8TjtoomIwmr/0TepqGRDAIoUY3yu6BM= =rbYl -----END PGP SIGNATURE----- --nextPart65832543.ErJBQUClLv-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:21 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:21 +0000 Received: from localhost ([127.0.0.1]:59150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMS-0005Jw-Ra for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:21 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:35480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMQ-0005Jf-BF for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:18 -0500 Received: by mail-qv1-f43.google.com with SMTP id d7so23846935qvk.2 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:18 -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=oN70ljmbg2rNOZZblTiCwUXEXnAmcvCexQ3gLw9kTC0=; b=DJ5n3ntc7P8DvjwQUff3j2vjbVc1hu9raVSRCUajjq91UaHTUXIdW//l/zNH0NFufs WgQnal8piRBJQ8OrwEn35a+nhlw0qzD+IwrPjH50PeJxwXwY9uRtVeH94et84iZwEUqB JZ8TL36/kcmiOmLQUCWkMALBy5Qqq1JreUKhEMTLNbsFBgJVuqgKF5x6+xeOHSEMT/NY LXCI0P5RgpNoSipQubPgM9ADVTMnciWyfuxxBwNzCOysR7TvVLirecs4Y5GerV7ZfM8K qIGBB9BWVRW+8hJYh5QDN1N8/pL4+48bala1C9Ahq7VY+N7XxV1rCaj/d2bZiHzcEJRT RtBA== 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=oN70ljmbg2rNOZZblTiCwUXEXnAmcvCexQ3gLw9kTC0=; b=m02KuZkMIPMdM+wrNIXm/fmcUpYYYYz5geLw/gT7903S1n0+PGti/2yCW/wFXFbz7u 0iumOdTxL4hg61DXGrXEKWj+4LwOThblnp6RtgmMNZrguFnoXzwwRJJR9BXx1DiLxPlD hSWHHVqPlqvlwCbbmXzk1eXxcLiuDPFXKo+O86XTN8300JI1FdKmE20AoYEgXXOcHXsq CahEY1rJU3Ii3Tk14c1DbEZZV9+ZRKokRGC1xmh/68gC6PGr0COxCaSndkWCQOOYH8TI ctRavzY43cjjh3J0wn/qx8GP0OGrBKTj/7EASnzCB5o7gVcq/roqyPdoiLXuNRb00Qt5 X00w== X-Gm-Message-State: AOAM531Ux/5mCnVw3tmeeIJqbqpuoDcDtv8TQwlUsZcjJh2KlDIxswas 7nhzj49DwkoOetwobLYbXZJePa2Tgzh6rIW3AkI= X-Google-Smtp-Source: ABdhPJxmdmzPj0msU0CPCQ3eyrn7e0haiHeMqt6y7kZv9kU/mP3WSEtTQVY9qIiAnVpLtKPWliXqJQ== X-Received: by 2002:a05:622a:8c:b0:2cf:7373:e458 with SMTP id o12-20020a05622a008c00b002cf7373e458mr12950507qtw.93.1645337172627; Sat, 19 Feb 2022 22:06:12 -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 w2sm3773207qts.29.2022.02.19.22.06.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:12 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 00/15] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sun, 20 Feb 2022 01:05:55 -0500 Message-Id: <20220220060610.178131-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151316.1897345-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, Here is v4. I believe it avoids the import cycle. The first change from v3 is in patch 09/15, in which I changed "gnu/packages/chez-and-racket-bootstrap.scm" no longer export `%racket-version` or `%racket-origin`. The package `source` field is not thunked, so exporting the latter seems like a particular trap for the unwary. In 14/15, I looked again at the issue with `chez-scheme-for-system` that Liliana reported in , and I realized my intention had actually been to return `chez-scheme` if the specified system is completely unsupported (not that it makes much difference ...). I tweaked it slightly and added comments, since I've gotten confused about it more than once now. The changes to avoid the import cycle are primarily in 15/15. As I outlined in , I duplicated the definition of `%racket-version` in "gnu/packages/racket.scm" and added comments there and to "gnu/packages/chez-and-racket-bootstrap.scm" warning to keep them in sync. I also had to avoid the use of `%racket-origin` (or `(package-source (racket-vm-for-system))`) outside of lambda abstractions, which in particular meant that it could no longer be used in the `source` field of `racket-minimal`. Instead, I changed `racket-minimal` to handle "base" and "racket-lib" in the same way `racket` does for its component Racket packages. Recalling Liliana's comment in , since I was lifting the function to handle Racket package origins anyway to reuse it, I changed it to produce `computed-file`s that take care of extracting the right files from the origin, so `racket-minimal` can now use `union-build` and `racket` no longer needs to replace the build phase. I can immagine a `racket-build-system` helping to improve the situation, since it would presumably add `(racket-vm-for-system)` as an implicit input. It might also be useful to provide special support for packages from the main Racket Git repository: almost always, if you change transform the origin for the Racket VM, you want all of the packages developed in the same repository to use come from the transformed origin, too. But for now, v4 should avoid the import cycle problem without doing anything too ugly. -Philip Philip McGrath (15): gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. gnu: chez-scheme: Use new package style. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: Add racket-vm-cgc. gnu: Add racket-vm-bc. gnu: Add chez-scheme-for-racket. gnu: Add racket-vm-cs. gnu: chez-mit: Support chez-scheme-for-racket. gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. gnu: racket: Update to 8.4. gnu/local.mk | 5 +- gnu/packages/chez-and-racket-bootstrap.scm | 1077 +++++++++++ gnu/packages/chez.scm | 628 +++---- gnu/packages/emacs-xyz.scm | 4 +- gnu/packages/loko.scm | 4 +- .../racket-enable-scheme-backport.patch | 465 +++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1599 +++++++++++------ 8 files changed, 2871 insertions(+), 937 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:33 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:33 +0000 Received: from localhost ([127.0.0.1]:59154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMZ-0005KH-7n for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:33 -0500 Received: from mail-qk1-f180.google.com ([209.85.222.180]:35796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMU-0005Jn-SY for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:24 -0500 Received: by mail-qk1-f180.google.com with SMTP id j78so7818205qke.2 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:22 -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=01P60vtMOvxl2cNiog5VA/iHLysOz6bSalCN5iZNYIU=; b=AJiCrVzLzUtRTBv7d6BtEMoVgnT9V5XEdUyvGR4J4hDpyPO6LIvMurUsM1Yri9RQ+a pf8bhcY/d2ovUMKJNiyBAS8ttvUEni213LbQ4E0nlEWwq/qCUlE+5JLXbGEnfjwZy1FA PuPe6ld02NZ2LCpVkY+eQ78UkitQ25vqCLp/1mO9NDu1HTioW85hUVKeCisahk6r1R96 rAHlIJLxDVO/D/vhw7onq9ClxW5UaeqL2awYc6+gY++tJK4+wvNLA967BZfWjBJvgN51 krz7fgfhgvCGdU8X6QVta4o+f5VZcwMbGzD2QWC+6Vb9PoF5eI70b3srKvYDpB1ga5L6 5/qA== 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=01P60vtMOvxl2cNiog5VA/iHLysOz6bSalCN5iZNYIU=; b=CD0tOqmfnyOTtvcBgPmSydW/Iu2qJpzoKJOrmvJ1M2eSjBGqYLdSP2t24J+/48ZDXI 8mEVvQ/eYMheW3S0baKgtxfZBrlw9S/85ZAN3G1ytmqWYDVrBht6CzkTx+HiD6NvCXw8 3uiMlCJmROn1cMgnuWGJ9elsGv9LQ0Q2GXV9SVd6GQCMyEZoUOx9n/oZYYiuT/oocQNZ HVVITrObjQvwNjJ5l/f0gtJFyfTluI/nviHIWegNvmzNnqnpnPsWy58NtW2OLNKmFBMe sbez9lwkfmHLbEwXkXgbiSNdh+o34WYM+OkdAx/uB1ZZZ/c3i6+tljsGs3zUxaxGUP7J dVBQ== X-Gm-Message-State: AOAM532omg6IGPxp8WRb55+hGySurUiDasQwjPBFaQIzatWIj8Nor9pm s/sJ1553xI47pavfG/FYryxRZKAL4kbNxqHKxis= X-Google-Smtp-Source: ABdhPJwLWApeUYfAVXng08AgnueANlDYOdxGm25NSuikfM8yJnwXceBw1C71jBO/+2m+1ijejViCsg== X-Received: by 2002:ae9:df42:0:b0:47e:fe7b:a202 with SMTP id t63-20020ae9df42000000b0047efe7ba202mr8923384qkf.256.1645337176839; Sat, 19 Feb 2022 22:06:16 -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 a6sm29340892qta.91.2022.02.19.22.06.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:16 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 01/15] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap). Date: Sun, 20 Feb 2022 01:05:56 -0500 Message-Id: <20220220060610.178131-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (nanopass, stex, chez-scheme): Move to ... * gnu/packages/chez-and-racket-bootstrap.scm: ... this new file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/emacs-xyz.scm: Adjust imports accordingly. * gnu/packages/loko.scm: Likewise. * gnu/packages/racket.scm: Likewise. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 278 +++++++++++++++++++++ gnu/packages/chez.scm | 225 +---------------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- gnu/packages/racket.scm | 2 +- 6 files changed, 283 insertions(+), 227 deletions(-) create mode 100644 gnu/packages/chez-and-racket-bootstrap.scm diff --git a/gnu/local.mk b/gnu/local.mk index 75a60b0093..e802b4450b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -144,6 +144,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/certs.scm \ %D%/packages/check.scm \ %D%/packages/chemistry.scm \ + %D%/packages/chez-and-racket-bootstrap.scm \ %D%/packages/chez.scm \ %D%/packages/chicken.scm \ %D%/packages/chromium.scm \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm new file mode 100644 index 0000000000..f102b099fb --- /dev/null +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -0,0 +1,278 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Federico Beffa +;;; Copyright © 2016 Efraim Flashner +;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2019 Brett Gilio +;;; Copyright © 2020 Brendan Tildesley +;;; Copyright © 2021, 2022 Philip McGrath +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages chez-and-racket-bootstrap) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages compression) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages linux) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages netpbm) + #:use-module (gnu packages tex) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) + +;; Commentary: +;; +;; Alphabetically and chronologically, Chez comes before Racket. +;; +;; 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. +;; +;; Putting the relevant definitions together in this module avoids having to +;; work around dependency cycles. +;; +;; Code: + +(define nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) + +(define stex + ;; This commit includes a fix, which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (version "1.2.2") + (version (git-version version "1" commit))) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name "stex" version))))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version "9.5.6") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet + ;; Remove bundled libraries. + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib"))))))) + (build-system gnu-build-system) + (inputs + `(("libuuid" ,util-linux "lib") + ("zlib" ,zlib) + ("zlib:static" ,zlib "static") + ("lz4" ,lz4) + ("lz4:static" ,lz4 "static") + ;; for expeditor: + ("ncurses" ,ncurses) + ;; for X11 clipboard support in expeditor: + ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 + ("libx11" ,libx11))) + (native-inputs + `(("nanopass" ,nanopass) ; source only + ;; for docs + ("stex" ,stex) + ("xorg-rgb" ,xorg-rgb) + ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek))) + ("ghostscript" ,ghostscript) + ("netpbm" ,netpbm))) + (native-search-paths + (list (search-path-specification + (variable "CHEZSCHEMELIBDIRS") + (files (list (string-append "lib/csv" version "-site")))))) + (outputs '("out" "doc")) + (arguments + `(#:modules + ((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 match)) + #:test-target "test" + #:configure-flags + '("--threads") ;; TODO when we fix armhf, it doesn't support --threads + #:phases + (modify-phases %standard-phases + ;; put these where configure expects them to be + (add-after 'unpack 'unpack-nanopass+stex + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (for-each (lambda (dep) + (define src + (assoc-ref (or native-inputs inputs) dep)) + (copy-recursively src dep + #:keep-mtime? #t)) + '("nanopass" "stex")))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs outputs + (configure-flags '()) + #:allow-other-keys) + (let* ((zlib-static (assoc-ref inputs "zlib:static")) + (lz4-static (assoc-ref inputs "lz4:static")) + (out (assoc-ref outputs "out")) + ;; add flags which are always required: + (flags (cons* + (string-append "--installprefix=" out) + (string-append "ZLIB=" zlib-static "/lib/libz.a") + (string-append "LZ4=" lz4-static "/lib/liblz4.a") + ;; Guix will do compress man pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" ,(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke + "./configure" + 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* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib")) + (name "chez-scheme")) + (symlink (string-append bin "/scheme") + (string-append bin "/" name)) + (map (lambda (file) + (symlink file (string-append (dirname file) + "/" name ".boot"))) + (find-files lib "scheme.boot"))))) + ;; Building explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (stex-output "/tmp") + (doc-dir (string-append stex-output + "/share/doc/" + stex+version))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/" + stex+version) + (string-append "Scheme=" + (assoc-ref outputs "out") + "/bin/scheme")) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (let* ((chez+version (strip-store-file-name + (assoc-ref outputs "out"))) + (stex+version + (strip-store-file-name + (assoc-ref (or native-inputs inputs) "stex"))) + (scheme (string-append (assoc-ref outputs "out") + "/bin/scheme")) + ;; see note on stex-output in phase build-stex, above: + (stexlib (string-append "/tmp" + "/lib/" + stex+version)) + (doc-dir (string-append (assoc-ref outputs "doc") + "/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))) + ;; Chez Scheme does not have a MIPS backend. + ;; FIXME: Debian backports patches to get armhf working. + ;; We should too. It is the Chez machine type arm32le + ;; (no threaded version upstream yet, though there is in + ;; Racket's fork), more specifically (per the release notes) ARMv6. + (supported-systems (fold delete %supported-systems + '("mips64el-linux" "armhf-linux"))) + (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 license:asl2.0))) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 47904e7b4e..caf61a95f5 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -4,7 +4,6 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Brendan Tildesley -;;; Copyright © 2021 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,234 +31,12 @@ (define-module (gnu packages chez) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (guix build-system gnu) - #:use-module (gnu packages compression) - #:use-module (gnu packages ncurses) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages ghostscript) - #:use-module (gnu packages linux) - #:use-module (gnu packages netpbm) #:use-module (gnu packages tex) - #:use-module (gnu packages compression) - #:use-module (gnu packages image) - #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) -(define nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - -(define-public chez-scheme - (package - (name "chez-scheme") - (version "9.5.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) - (build-system gnu-build-system) - (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) - (native-inputs - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) - (native-search-paths - (list (search-path-specification - (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) - (outputs '("out" "doc")) - (arguments - `(#:modules - ((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw) - (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) - ;; Chez Scheme does not have a MIPS backend. - ;; FIXME: Debian backports patches to get armhf working. - ;; We should too. It is the Chez machine type arm32le - ;; (no threaded version upstream yet, though there is in - ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) - (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-public chez-srfi (package (name "chez-srfi") diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 49748abd32..6430318ec5 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -145,7 +145,7 @@ (define-module (gnu packages emacs-xyz) #:use-module (gnu packages aspell) #:use-module (gnu packages audio) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages cmake) #:use-module (gnu packages code) #:use-module (gnu packages cpp) diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index ef9312afe3..74a649b8a1 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -24,7 +24,7 @@ (define-module (gnu packages loko) #:use-module (gnu packages package-management) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) - #:use-module (gnu packages chez)) + #:use-module (gnu packages chez-and-racket-bootstrap)) (define-public loko-scheme (package diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d0a5ca494b..865fdff70f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -34,7 +34,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) - #:use-module (gnu packages chez) + #:use-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages fontutils) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:34 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:34 +0000 Received: from localhost ([127.0.0.1]:59157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMf-0005KY-F3 for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:34 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:46655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMY-0005K4-Rq for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:27 -0500 Received: by mail-qv1-f42.google.com with SMTP id n6so23822151qvk.13 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:26 -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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=Xj5ca7r8pwtFnzDCMxqcicti8B/n61QdIhui+piusEC8dqGD5kdloeB7BkHgLNCDcz X9ppcvhXB88L1Ul/44YgvuJGJ5P0Gtmkan3imLyCxHNFGGwJVhxikfleaDB8XKpeDckz Z9xO/y8PzJ6t4naM8B5jXSMbiL333uBKvL6XmjudD3Pry2ENH9i0T5DXIApZy4YXYVZj TPt3R0r/KQS+g6DzLJ7+u6/PQJsmDnzYv6nRXmH0JiILhicWyzqW7GRB0UOovpwvKhFy wWiml8jLsJ+RcbvV2zlmd7GYb9nMLm6H19obMxZns6e9vcWNr8YcY2nqV4IEtXFpgYw8 ulNA== 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=spAKc6Y38W1TlPs5i3iI5b1SXgaYKzCROU+vlNbbPq8=; b=tiz5eDEuwNhxQNHgkwKHn1RfoXn8tvvFOtlh4IS7FIIfdwTu74xQMKTBiWif8TV9oE 0dQ04Fi2azMrYWOKLhaTyLsEjwC62U2bLUmPgXatQM/2sJuYAoODiwv584hS45mDSwKr x9CpsPS//aZZ93Nguk6UxlpBIC8CF/BIPEKum700Jt5zo0Z2Xb1wplHILuPPDWgQKm3R bTWO43HqyM8W6rq8LWulJMk8hmNl8IGCAAUeZZBt9Tjy6kjg2lBdIaJnqyfH0UMDPajp wZQyafE6CHBIfk9QAY99/sTuPU5STuatuKEoQKmZuBAR7WhHafnFr11bpQ9Pd94AB9ww mSDQ== X-Gm-Message-State: AOAM530qigUrVZkXekAaG5exWYH9PRzLEH1rIdoWohrM7cjpyz/bUkvQ I7mHh96OTEs3Uxiwg5QSBfX9FpDUp8prkurVqlI= X-Google-Smtp-Source: ABdhPJxCxvkhgkYmDb1RiWn8wkbN+llciSmwOl50FEh9jvSrADlytBSgipvynNBFQV7p9WrUegE9pw== X-Received: by 2002:a05:6214:14e9:b0:42d:f1a4:5487 with SMTP id k9-20020a05621414e900b0042df1a45487mr11042163qvw.110.1645337181125; Sat, 19 Feb 2022 22:06:21 -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 r129sm24156020qkf.99.2022.02.19.22.06.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:20 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 02/15] gnu: chez-scheme: Use "lib/chez-scheme" for search path. Date: Sun, 20 Feb 2022 01:05:57 -0500 Message-Id: <20220220060610.178131-3-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". * gnu/packages/chez.scm (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Update accordingly. Also, remove input labels and use G-expressions. --- gnu/packages/chez-and-racket-bootstrap.scm | 2 +- gnu/packages/chez.scm | 373 +++++++++++---------- 2 files changed, 191 insertions(+), 184 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index f102b099fb..1ed4631ced 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -136,7 +136,7 @@ (define-public chez-scheme (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) + (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments `(#:modules diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index caf61a95f5..54bbee7923 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -37,6 +37,28 @@ (define-module (gnu packages chez) #:use-module (ice-9 match) #:use-module (srfi srfi-1)) + +;; Help function for Chez Scheme to add the current path to +;; CHEZSCHEMELIBDIRS. +(define chez-configure + #~(lambda _ + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) + (setenv "CHEZSCHEMELIBDIRS" + (if chez-env + (string-append ".:" chez-env) + "."))))) + +;; Help function to define make flags for some Chez Scheme custom make +;; files. +(define (chez-make-flags name version) + #~(let ((out #$output)) + (list + ;; Set 'schemedir' so that libraries are installed in + ;; 'lib/chez-scheme' like Chez's 'native-search-paths' expects. + (string-append "schemedir=" out "/lib/chez-scheme") + (string-append "PREFIX=" out) + (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) + (define-public chez-srfi (package (name "chez-srfi") @@ -54,13 +76,11 @@ (define-public chez-srfi (native-inputs (list chez-scheme)) (arguments - `(#:make-flags (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out) - "CHEZ=chez-scheme --libdirs ./" - (string-append "chezversion=" ,(package-version chez-scheme)))) - #:test-target "test" - #:phases (modify-phases %standard-phases - (delete 'configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -85,42 +105,48 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("ghostscript" ,ghostscript) - ("texlive" ,(texlive-updmap.cfg (list texlive-oberdiek - texlive-epsf - texlive-metapost - texlive-charter - texlive-pdftex - texlive-context - texlive-cm - texlive-tex-plain))))) + (list chez-scheme + ghostscript + ;; FIXME: This package fails to build with the error: + ;; mktexpk: don't know how to create bitmap font for bchr8r + ;; Replacing the following with `texlive` fixes it. + ;; What is missing? + (texlive-updmap.cfg (list texlive-oberdiek + texlive-epsf + texlive-metapost + texlive-charter + texlive-pdftex + texlive-context + texlive-cm + texlive-tex-plain)))) (arguments - `(#:make-flags (list (string-append "PREFIX=" %output) - (string-append "DOCDIR=" %output "/share/doc/" - ,name "-" ,version) - (string-append "LIBDIR=" %output "/lib/chezweb") - (string-append "TEXDIR=" %output "/share/texmf-local")) - #:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - ;; This package has a custom "bootstrap" script that - ;; is meant to be run from the Makefile. - (delete 'bootstrap) - (replace 'configure - (lambda* _ - (copy-file "config.mk.template" "config.mk") - (substitute* "tangleit" - (("\\./cheztangle\\.ss" all) - (string-append "chez-scheme --program " all))) - (substitute* "weaveit" - (("mpost chezweb\\.mp") - "mpost --tex=tex chezweb.mp") - (("\\./chezweave" all) - (string-append "chez-scheme --program " all))) - (substitute* "installit" - (("-g \\$GROUP -o \\$OWNER") "")) - #t))))) + (list + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "DOCDIR=" #$output "/share/doc/" + #$name "-" #$version) + ;; lib/chez-scheme/chezweb ??? + (string-append "LIBDIR=" #$output "/lib/chezweb") + (string-append "TEXDIR=" #$output "/share/texmf-local")) + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + ;; This package has a custom "bootstrap" script that + ;; is meant to be run from the Makefile. + (delete 'bootstrap) + (replace 'configure + (lambda* _ + (copy-file "config.mk.template" "config.mk") + (substitute* "tangleit" + (("\\./cheztangle\\.ss" all) + (string-append "scheme --program " all))) + (substitute* "weaveit" + (("mpost chezweb\\.mp") + "mpost --tex=tex chezweb.mp") + (("\\./chezweave" all) + (string-append "scheme --program " all))) + (substitute* "installit" + (("-g \\$GROUP -o \\$OWNER") ""))))))) (home-page "https://github.com/arcfide/ChezWEB") (synopsis "Hygienic Literate Programming for Chez Scheme") (description "ChezWEB is a system for doing Knuthian style WEB @@ -144,95 +170,74 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("chez-web" ,chez-web) - ("texlive" ,(texlive-updmap.cfg (list texlive-pdftex))))) + (list chez-scheme + chez-web + (texlive-updmap.cfg (list texlive-pdftex)))) (arguments - `(#:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-web (assoc-ref inputs "chez-web")) - (chez (assoc-ref inputs "chez-scheme")) - (chez-h (dirname (car (find-files chez "scheme\\.h"))))) - (substitute* "Makefile" - (("(SCHEMEH=).*$" all var) - (string-append var chez-h))) - #t))) - (add-before 'build 'tangle - (lambda* (#:key inputs #:allow-other-keys) - (setenv "TEXINPUTS" - (string-append - (getcwd) ":" - (assoc-ref inputs "chez-web") "/share/texmf-local/tex/generic:" - ":")) - ;; just using "make" tries to build the .c files before - ;; they are created. - (and (invoke "make" "sockets") - (invoke "make")))) - (replace 'build - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - ;; make sure Chez Scheme can find the shared libraries. - (substitute* "sockets.ss" - (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" - all cmd so) - (string-append cmd " \"" chez-site "/" so "\"")) - (("sockets-stub\\.[sd][oy].*" all) - (string-append chez-site "/" all))) - ;; to compile chez-sockets, the .so files must be - ;; installed (because of the absolute path we - ;; inserted above). - (for-each (lambda (f d) (install-file f d)) - '("socket-ffi-values.so" "sockets-stub.so") - (list chez-site chez-site)) - (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) - (replace 'install - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/chez-sockets")) - (doc (string-append out "/share/doc/" ,name "-" ,version)) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - (for-each (lambda (f d) (install-file f d)) - '("sockets.pdf" "sockets.so") - (list doc chez-site)) - #t)))))) + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((scheme (search-input-file (or native-inputs inputs) + "/bin/scheme")) + (lib (string-append (dirname scheme) "/../lib")) + (header-file (car (find-files lib "scheme\\.h"))) + (include-dir (dirname header-file))) + (substitute* "Makefile" + (("(SCHEMEH=).*$" _ var) + (string-append var include-dir)))))) + (add-before 'build 'tangle + (lambda* (#:key inputs #:allow-other-keys) + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" + (assoc-ref inputs "chez-web") + "/share/texmf-local/tex/generic:" + ":")) + ;; just using "make" tries to build the .c files before + ;; they are created. + (and (invoke "make" "sockets") + (invoke "make")))) + (replace 'build + (lambda args + (let ((chez-site (string-append #$output + "/lib/chez-scheme/arcfide"))) + ;; make sure Chez Scheme can find the shared libraries. + (substitute* "sockets.ss" + (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post)) + (("(\")(sockets-stub\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post))) + ;; to compile chez-sockets, the .so files must be + ;; installed (because of the absolute path we + ;; inserted above). + (for-each (lambda (f) + (install-file f chez-site)) + '("socket-ffi-values.so" + "sockets-stub.so")) + (invoke "bash" + "-c" + (format #f "echo '~s' | scheme -q" + '(compile-file "sockets.sls")))))) + (replace 'install + (lambda args + (install-file "sockets.so" + (string-append #$output + "/lib/chez-scheme/arcfide")) + (install-file "sockets.pdf" + (string-append #$output + "/share/doc/" + #$name "-" #$version))))))) (home-page "https://github.com/arcfide/chez-sockets") (synopsis "Extensible sockets library for Chez Scheme") (description "Chez-sockets is an extensible sockets library for Chez Scheme.") (license expat)))) -;; Help function for Chez Scheme to add the current path to -;; CHEZSCHEMELIBDIRS. -(define chez-configure - '(lambda _ - (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) - (setenv "CHEZSCHEMELIBDIRS" - (if chez-env - (string-append ".:" chez-env) - ".")) - #t))) - -;; Help function to define make flags for some Chez Scheme custom make -;; files. -(define (chez-make-flags name version) - `(let ((out (assoc-ref %outputs "out"))) - (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" ,(package-version chez-scheme)) - (string-append "PREFIX=" out) - (string-append "DOCDIR=" out "/share/doc/" - ,name "-" ,version)))) - (define-public chez-matchable (package (name "chez-matchable") @@ -253,10 +258,11 @@ (define-public chez-matchable (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -284,10 +290,11 @@ (define-public chez-irregex (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -314,17 +321,18 @@ (define-public chez-fmt (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "chez-check" - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - (replace 'build - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-build" make-flags))) - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-install" make-flags)))))) + (list #:make-flags (chez-make-flags name version) + #:test-target "chez-check" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-build" make-flags))) + (replace 'install + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-install" make-flags)))))) (home-page "http://synthcode.com/scheme/fmt") (synopsis "Combinator formatting library for Chez Scheme") (description "This package provides a library of procedures for @@ -354,10 +362,11 @@ (define-public chez-mit (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -386,46 +395,44 @@ (define-public chez-scmutils (propagated-inputs (list chez-mit chez-srfi)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:tests? #f ; no test suite - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - ;; 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 - ;; in turn requires us to compile the files in the final - ;; destination. - (delete 'build) - (add-after 'install 'install-src - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-src" make-flags))) - (add-after 'install-src 'absolute-path-in-scm-files - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils") - (string-append "include \"" (dirname file))))) - (find-files out "\\.sls")) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils/simplify") - (string-append "include \"" (dirname file))))) - (find-files out "fbe-syntax\\.scm")) - #t))) + (list + #:make-flags (chez-make-flags name version) + #:tests? #f ; no test suite + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + ;; 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 + ;; in turn requires us to compile the files in the final + ;; destination. + (delete 'build) + (add-after 'install 'install-src + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "install-src" make-flags))) + (add-after 'install-src 'absolute-path-in-scm-files + (lambda* (#:key #:allow-other-keys) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils") + (string-append "include \"" (dirname file))))) + (find-files #$output "\\.sls")) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils/simplify") + (string-append "include \"" (dirname file))))) + (find-files #$output "fbe-syntax\\.scm")))) (add-after 'absolute-path-in-scm-files 'build - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (mk-file (car (find-files out "Makefile")))) + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (let ((mk-file (car (find-files #$output "Makefile")))) (with-directory-excursion (dirname mk-file) (apply invoke "make" "build" make-flags))))) (add-after 'build 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (for-each delete-file - (find-files out "Makefile|compile-all\\.ss")) - #t)))))) + (lambda args + (for-each delete-file + (find-files #$output + "Makefile|compile-all\\.ss"))))))) (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") (description "This package provides a port of the MIT/GNU Scheme Scmutils program to Chez Scheme. The port consists of a set of -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:40 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:40 +0000 Received: from localhost ([127.0.0.1]:59160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMl-0005Ky-JE for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:40 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:46625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMh-0005KR-8l for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:35 -0500 Received: by mail-qk1-f169.google.com with SMTP id f21so1300125qke.13 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:35 -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=voen33luSuZnifO97fQiqSCtXHVzAz6OmjDwr/H6AjE=; b=LtXCXxXJ/fRCo+MBxR7Mbf0+vi3tVPODey1hFJX8tWbmNahYiLIOxl/n1Ov7BO4JZ1 WLX1z74XqbL0AopWfqyw6NtzliQqrEgg+spThBFXgXnC9j+lJ+BnRD4wU2EQFgoKfbGN 3iIy2OE3NoLpswpTJiQn7XeFS6aq1eNdSzN1SLSXkZWfGFAU6b4LAedOcVTcS2KhioFS iNOcsNkiBbnDc2M2LqWF4VTxk5k5vLHIURvtYhH6fA7rsCp8xeOgcmhcjQzOqe7kdfpa 7ngIfK5r/U+t/nEjTuOnruk0Dkan7m8pGQn9JsQnQm+tzCqh/+btMWXInfDZ1IFNFFCJ FSGw== 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=voen33luSuZnifO97fQiqSCtXHVzAz6OmjDwr/H6AjE=; b=4e1legmIbeAJ2IU6pZAZlYpJC61Ho8Fey/8BQllR+svqpPwO4kuiaRgqzzheary/Er ZojdlzXIL6DP2OANKfWmxhw8/H051/w+lcOa7Zl+uRY4SeyF6ueXJjRA+puvoYp0i+BB uEzVNnAs9fxJ0MvJxwDENC5+e6Sw1D/axj/OjoQ4nmO4Vt6j795CINDJhtbZeVoI67r8 9LdGwFFAS/OtW23wdG7jK9by/GhRDrIXsFCNtL9rvR1FumjJXB/8T8hadUSOY7wZOdmd Zl5UAAhs+KSBwbD92V3DaLor0H4mPtFk0zH90sMugDNAV2iIQYyWlUxVjRUQjEXe1vRV QDGg== X-Gm-Message-State: AOAM533sS/0FAPaIv9Xj0gK6R3SJN0GbD/md9HQ5bo03l2pTRGUuEjTE KfXm3tVU2jk8365epBW1/5ZfSnu7zs12b+QChtc= X-Google-Smtp-Source: ABdhPJxuUCnSIErWxLOASiKBR0z2Msv1SHLHdHr0BhmXxAGrAoiLiKrNyLntLCl28cAhj1WjbcEG6g== X-Received: by 2002:a37:610c:0:b0:5f1:83b8:a6c9 with SMTP id v12-20020a37610c000000b005f183b8a6c9mr8776498qkb.196.1645337189678; Sat, 19 Feb 2022 22:06:29 -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 c3sm21149986qkp.39.2022.02.19.22.06.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:29 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 04/15] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types. Date: Sun, 20 Feb 2022 01:05:59 -0500 Message-Id: <20220220060610.178131-5-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system, nix-system->chez-machine, chez-upstream-features-for-system): New private functions. (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private constants. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. --- gnu/packages/chez-and-racket-bootstrap.scm | 118 ++++++++++++++++++++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 11d570059b..1a923fe62d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -28,7 +28,9 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix utils) #:use-module (guix gexp) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -61,6 +63,115 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; 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 +MACHINE. The returned string may share storage with MACHINE." + ;; Chez Scheme documentation consistently uses "nonthreaded" rather than + ;; e.g. "unthreaded" + (if (eqv? #\t (string-ref machine 0)) + (substring machine 1) + machine)) +(define (chez-machine->threaded machine) + "Like @code{chez-machine->nonthreaded}, but returns the threaded machine +type." + (if (eqv? #\t (string-ref machine 0)) + machine + (string-append "t" machine))) + +;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt +;; in https://github.com/racket/raco-cross. +;; For supported platforms, refer to release_notes/release_notes.stex in the +;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md +;; in https://github.com/racket/racket. +(define %nix-arch-to-chez-alist + `(("x86_64" . "a6") + ("i386" . "i3") + ("aarch64" . "arm64") + ("armhf" . "arm32") ;; Chez supports ARM v6+ + ("ppc" . "ppc32"))) +(define %nix-os-to-chez-alist + `(("w64-mingw32" . "nt") + ("darwin" . "osx") + ("linux" . "le") + ("freebsd" . "fb") + ("openbsd" . "ob") + ("netbsd" . "nb") + ("solaris" . "s2"))) + +(define (chez-machine->nix-system machine) + "Return the Nix system type corresponding to the Chez Scheme machine type +MACHINE. If MACHINE is not a string representing a known machine type, an +exception is raised. This function does not distinguish between threaded and +nonthreaded variants of MACHINE. + +Note that this function only handles Chez Scheme machine types in the +strictest sense, not other kinds of descriptors sometimes used in place of a +Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or +@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type +for the host system is often still relevant.)" + (let ((machine (chez-machine->nonthreaded machine))) + (let find-arch ((alist %nix-arch-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (string-prefix? chez machine) + (string-append + nix "-" (let ((machine-os + (substring machine (string-length chez)))) + (let find-os ((alist %nix-os-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (equal? chez machine-os) + nix + (find-os alist))))))) + (find-arch alist))))))) + +(define* (nix-system->chez-machine #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return the Chez Scheme machine type corresponding to the Nix system +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme +machine type is undefined. + +It is unspecified whether the resulting string will name a threaded or a +nonthreaded machine type: when the distinction is relevant, use +@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust +the result." + (let* ((hyphen (string-index system #\-)) + (nix-arch (substring system 0 hyphen)) + (nix-os (substring system (+ 1 hyphen))) + (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) + (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) + (and chez-arch chez-os (string-append chez-arch chez-os)))) + +(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}. Other feature symbols may be added in the future." + (cond + ((not (nix-system->chez-machine system)) + #f) + ((target-aarch64? system) + #f) + ((target-arm32? system) + (and (target-linux? system) + '())) + ((target-ppc32? system) + (and (target-linux? system) + '(threads))) + (else + '(threads)))) + +;; +;; Chez Scheme: +;; + (define nanopass (let ((version "1.9.2")) (origin @@ -264,8 +375,11 @@ (define* (stex-make #:optional (suffix "")) ;; We should too. It is the Chez machine type arm32le ;; (no threaded version upstream yet, though there is in ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) + (supported-systems + (delete + "armhf-linux" ;; <-- should work, but reportedly broken + (filter chez-upstream-features-for-system + %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:44 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:44 +0000 Received: from localhost ([127.0.0.1]:59163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMq-0005LN-B2 for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:44 -0500 Received: from mail-qv1-f51.google.com ([209.85.219.51]:35505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMc-0005KD-SI for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:39 -0500 Received: by mail-qv1-f51.google.com with SMTP id d7so23847551qvk.2 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:30 -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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=Hw1OnwiBYX9gMLhU6AamneOJruopTEhBVESgXrnejdpaWaRY+BHSBJrfKgSchkjEF3 LOsc7uAdmh65saFYH0mhnW1D7s9oCniAKL3IU2iqtCApSoy5eqds9C6fK9f+G9CZakZ6 eHBhJWZh6mRVezn/dheA2rCnKXj5epknE8GTPgTQkYlMFG2ouotfD9uYB4T5Jx/UtqrG dgKor2Vsh/MnmLLL0gibR2Lq2ZJxDhLJTQ7C5u6CV27DczH3jaF367OYQW4IcRX+aHs+ WXucYlFnlKpRAAp9yvtMEBaEjCa177Uz+dLjCv1O+XNJwF2/etgq7egTo9e3v5uEw8WF ONQQ== 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=NrUrTgUVsw38qpTKfIYl2vJbliIV3wXNuKimJY8k5Sc=; b=SMF5TJaW3bC9ZYoBW0qOU62prRB9cClH21ekSxf9g66KPvuvsu4jE3u1lxnzjfhcoJ /mQL3gRSLFna8yf7cYRq9SeBrDsWp1y9u46EyVFeU9oirMFDwv2V71SgEkG9g8R3oTU1 /HadxeYr0rULHGKztUiHSze8JdzS/X8X+ryAt9MMOo2hqOBOqlKP/7aXbXX5vjHkTcYq HmYsfFo51jnTejm5q4qQClSSCBo4rkzwDYP6QaOtBoWansObS0KwqZaync+/70YMj17E CZMUeZ+DT/76TlOKc7FAqHbDRRvt7tzJwmil0IL6aYRbmFKAe4gegNQvVmZbHW9S0r6Z ngpA== X-Gm-Message-State: AOAM533MQWCTDEMZpUV/UCRVOgrM90TeIL5BwbCOT0r4Dbdkzx6LhJ+Y 6Qf3u0QeQsqZzVp4hWcIIKVmxyg+LZ0uFnq1Png= X-Google-Smtp-Source: ABdhPJzmpQRQnt3zqpqHA4S4ToLyHvi0k6g7eRJpG7rXzNveDV1tGt7Ef4KdMNAF/Sc/VdLYnyeCXQ== X-Received: by 2002:ac8:5f4a:0:b0:2dd:1ec1:7bea with SMTP id y10-20020ac85f4a000000b002dd1ec17beamr12939173qta.205.1645337185358; Sat, 19 Feb 2022 22:06:25 -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 x12sm553340qtw.9.2022.02.19.22.06.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:25 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 03/15] gnu: chez-scheme: Use shared zlib and lz4. Date: Sun, 20 Feb 2022 01:05:58 -0500 Message-Id: <20220220060610.178131-4-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez-and-racket-bootstrap (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 1ed4631ced..11d570059b 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -114,9 +114,7 @@ (define-public chez-scheme (inputs `(("libuuid" ,util-linux "lib") ("zlib" ,zlib) - ("zlib:static" ,zlib "static") ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") ;; for expeditor: ("ncurses" ,ncurses) ;; for X11 clipboard support in expeditor: @@ -169,14 +167,14 @@ (define src (lz4-static (assoc-ref inputs "lz4:static")) (out (assoc-ref outputs "out")) ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) + (flags (cons* (string-append "--installprefix=" out) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do compress-man-pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) (format #t "configure flags: ~s~%" flags) ;; Some makefiles (for tests) don't seem to propagate CC ;; properly, so we take it out of their hands: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:45 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:45 +0000 Received: from localhost ([127.0.0.1]:59165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMq-0005LP-Nq for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:45 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:45826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMl-0005Kf-I6 for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:40 -0500 Received: by mail-qv1-f47.google.com with SMTP id c14so23823982qvl.12 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:39 -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=JwvfZHyJKETZma/gALezVSuvOV1yuRcg10wvB8l7Pq0=; b=NH6E51msrFaQxe5WG0TbHJ07KGh8N0w8A3wYICNRl/NVtG2BiYpoSRLM+JE9ybrlhq B8SxIof8eJlj9RsvvTUseklfYB82EYYkVBlxmS2PhLrlofhPjbwOsUzG4nwqd01mBykR aa8X3vcD5C36N7YS+dixwK6V4cx2cjL1dd6mni2pcr1zjyCsBszseNk2SO9ttCJi5fv7 JvNLujZFUR2VatibKdFDn1J5tp3NItLJlVU0K4M6efGjRpji3vZzj9MKfGRo9c0BvtQ8 5vHbKXDfsr10oMm6QRNBsgxY5XCXLJE8W8HrDY3ZHnnOMZemd6O6FDBJ0jr83T0fWUw1 qEZg== 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=JwvfZHyJKETZma/gALezVSuvOV1yuRcg10wvB8l7Pq0=; b=OgzKEMGNWakh1H+rXHqkfXKZlAlgQND4GRFKe5o2O1+fDiPhOc/iZZyVWCB2pFEMZ3 Q8JzyI/zaWMLYlyuTm6Bm3qbD4h9SS7bepvlKeaVdiXroLj9cNIHS2zdvq91Qg5CVsgp egjtTvgGnpGQokP8IeD/kSq/Lp6S0xgj+6N0jJmATSSFvwYVf8LXe4pUk8PTSvVfPJsw DAI/BFeWVovAm56m7QhVUVkT+9VgmMHPL8UqTHRlsfFco7jtXstTpLD0zIFyxBBGRWHS /AeM55xvmjRY63g5DBY/aWEnBxKpeAUs3g7S1OvCFjRJKudS7+kaenREuBdJlHQKX0ye lPUQ== X-Gm-Message-State: AOAM530h1q5zpktKe6BBORwx9SHwxUAZxI2tCCWHrMDo9yjHsPejT2C4 Yr+shMqDjPc7O1FUNQcAsEhtX9enuAKbU12uvbA= X-Google-Smtp-Source: ABdhPJzoxGAC0G83SFe0U2oTyGWpFzAMDJCMjQbiOO5XSJot+JDHYmAhX4NzDKZXNs7yPBbfyaKwjQ== X-Received: by 2002:ad4:404d:0:b0:42c:4168:feb0 with SMTP id r13-20020ad4404d000000b0042c4168feb0mr11002240qvp.115.1645337193958; Sat, 19 Feb 2022 22:06:33 -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 k15sm863842qkj.5.2022.02.19.22.06.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:33 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 05/15] gnu: chez-scheme: Use new package style. Date: Sun, 20 Feb 2022 01:06:00 -0500 Message-Id: <20220220060610.178131-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme)[inputs, native-inputs]: Remove labels. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass, stex): Make public as a temporary workaround for Racket. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 288 ++++++++++----------- gnu/packages/racket.scm | 5 +- 2 files changed, 137 insertions(+), 156 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 1a923fe62d..81ac8f0774 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -172,7 +172,7 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define nanopass +(define-public nanopass (let ((version "1.9.2")) (origin (method git-fetch) @@ -182,7 +182,7 @@ (define nanopass (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) (file-name (git-file-name "nanopass" version))))) -(define stex +(define-public stex ;; This commit includes a fix, which we would otherwise want to use as ;; patch. Let's revert to tagged releases as soon as one becomes available. (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") @@ -199,86 +199,80 @@ (define stex (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.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))))) (build-system gnu-build-system) (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("lz4" ,lz4) - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) + (list + `(,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 - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) + (list nanopass ; source only + ;; for docs + stex + xorg-rgb + (texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* (string-append "--installprefix=" out) + #:test-target "test" + ;; TODO when we fix armhf, it may not support --threads + #:configure-flags #~'("--threads") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (copy-recursively #$nanopass + "nanopass" + #:keep-mtime? #t) + (copy-recursively #$stex + "stex" + #:keep-mtime? #t))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) + ;; add flags which are always required: + (let ((flags (cons* (string-append "--installprefix=" #$output) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" @@ -286,90 +280,78 @@ (define src ;; and letting Chez try causes an error "--nogzip-man-pages" configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke "./configure" 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* ((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 explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (let* ((stex-output "/tmp") + (doc-dir (string-append stex-output "/share/doc/stex"))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/stex") + (string-append "Scheme=" + (search-input-file outputs + "/bin/scheme"))) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (match (assoc-ref outputs "doc") + (#f + (format #t "not installing docs~%")) + (doc-prefix + (let* ((chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib "/tmp/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 865fdff70f..a1ba57cca3 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,9 +333,8 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) "stex")) - ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) - "nanopass")))) + ("stex" ,stex) + ("nanopass" ,nanopass))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:54 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:54 +0000 Received: from localhost ([127.0.0.1]:59170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMz-0005M6-Pq for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:54 -0500 Received: from mail-qk1-f178.google.com ([209.85.222.178]:45920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMr-0005Kv-1x for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:45 -0500 Received: by mail-qk1-f178.google.com with SMTP id b13so3015179qkj.12 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:45 -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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=bmWEEhJXrwL/DIOt1/o3eOElVBy0bk9Ki0caDLx0JyPtWn3OhcAJK1lG5KJNxupmYa s5WbpLKes8zgJqEviur6LH46q9nT15jTL5cXIf41SB/K9UPLFuZiO1pRgzZ8ZVt0sJSI J7LViGI88Y3VEhe/H1G0P8cYqtGhDSmszCf3BPFQrMzYiCT3RqpBkY96d+IX+2x6Zj/Y 8k/4rmVZxYo86g03HikB70GT/GPQmzmwvyM5cC42dIkF7mO7w576qG/TBkaPi7mrPaGX I38FgI8SXRCoqg1E5EZV0fqV4nBsNpLO3sSCyx3pmn/Iw+gmmJBdXZsDvCD7Pb/BtuLb uw3g== 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=R5bPwbrkUMdlMn1ekuRwzq5uarG7nkZ7xUKzaCpRCbA=; b=hnUyhXKvWrraoc68nH11tbnVZy1KKbibLGfkAsgL2NzZqBfVyJW5klmE1mcNT0hTqF eYJwSM4hGoJnqdJlOpgKpo4AEC+sPgOaEfI8ZiIOOgIb9de+OQcDJNPQlnWpx6hXmfOr KaOIURpmO8sYwjkIiiWoPAw1H4844gi8eH2B47bhaLk6+7Zd10AvZUzruu8g86AiqHG+ t2q006OZ6X7V4BDOenDcVbys9P7mPStVg9pmp0smGQTIdlsvZ/Y1qW0I5rVOdVf949yZ GMPj0ZIOyN7XCLVfm16GjdzjJF/YR62ZSQwBiXlUPmoB5H5yvKuw04vt6DmGxGfKg5KE ms1g== X-Gm-Message-State: AOAM533hbtpQpy0h60u3YVGE0lfB9jJNmY/p/xnqKZsfH1uccxHAPZAQ EyMr42lbAONfiwnhNaUxYUz/TYlfHNg8B+nLQyY= X-Google-Smtp-Source: ABdhPJx/AMdGoze8/zBEnI18ATkQVjnDPwOzpnrmprFrjdFZNMLLsTIRMr6BXwwxJJJS4/2SXkD3uw== X-Received: by 2002:a05:620a:1326:b0:648:adc4:283a with SMTP id p6-20020a05620a132600b00648adc4283amr3072156qkj.441.1645337198242; Sat, 19 Feb 2022 22:06:38 -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 t11sm19768666qkp.82.2022.02.19.22.06.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:37 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 06/15] gnu: Add stex. Date: Sun, 20 Feb 2022 01:06:01 -0500 Message-Id: <20220220060610.178131-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap'. (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies of stex-bootstrap. [arguments]<#:phases>: Remove 'prepare-stex'. Adjust 'unpack-nanopass+stex' and 'install-doc'. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Update accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 215 +++++++++++++++------ gnu/packages/racket.scm | 2 +- 2 files changed, 155 insertions(+), 62 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 81ac8f0774..83bf15b5fb 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -31,6 +31,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -172,30 +173,6 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define-public stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - (define-public chez-scheme (package (name "chez-scheme") @@ -232,15 +209,7 @@ (define-public chez-scheme libx11)) (native-inputs (list nanopass ; source only - ;; for docs - stex - xorg-rgb - (texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek)) - ghostscript - netpbm)) + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -263,9 +232,11 @@ (define-public chez-scheme (copy-recursively #$nanopass "nanopass" #:keep-mtime? #t) - (copy-recursively #$stex - "stex" - #: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"))))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -301,32 +272,9 @@ (define-public chez-scheme (symlink scheme.boot (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (let* ((stex-output "/tmp") - (doc-dir (string-append stex-output "/share/doc/stex"))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/stex") - (string-append "Scheme=" - (search-input-file outputs - "/bin/scheme"))) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) ;; Building the documentation requires stex and a running scheme. ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc + (add-after 'install-symlink 'install-doc (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (match (assoc-ref outputs "doc") (#f @@ -334,7 +282,9 @@ (define-public chez-scheme (doc-prefix (let* ((chez+version (strip-store-file-name #$output)) (scheme (search-input-file outputs "/bin/scheme")) - (stexlib "/tmp/lib/stex") + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) (doc-dir (string-append doc-prefix "/share/doc/" chez+version))) @@ -370,3 +320,146 @@ (define* (stex-make #:optional (suffix "")) generates native code for each target processor, with support for x86, x86_64, and 32-bit PowerPC architectures.") (license license:asl2.0))) + +;; +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + #$(chez-machine->threaded + (nix-system->chez-machine))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine "\\."))))) + (else + ;; for bootstrapping, can run without ahead-of-time + ;; compilation + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is referenced in the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license license:expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (outputs '("out" "doc")) + (properties '()))) + +(define-public nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index a1ba57cca3..d8338bcd6f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -333,7 +333,7 @@ (define-public racket-bootstrap-chez-bootfiles `(("racket" ,(if (%current-target-system) racket-minimal racket-minimal-bc-3m)) - ("stex" ,stex) + ("stex" ,(package-source stex)) ("nanopass" ,nanopass))) (arguments `(#:phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:54 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:55 +0000 Received: from localhost ([127.0.0.1]:59172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfN0-0005M9-Ce for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:54 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:35521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMu-0005LL-68 for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:48 -0500 Received: by mail-qv1-f43.google.com with SMTP id d7so23848433qvk.2 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:48 -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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=MB48to0ZptkWAePl2jFpb3vayampexZsg1Wn5MP8H+KvXX3t4ezwKNO7BAH6BBrimK G+gAlvOJ1kjGlH/le/9TfvvBM2Tmbv+lgfScHwYnaaW/H4bqLLzpyT3Ud4E2rxJri5/x 593e5UCtbMgFN59CZNk7rQ+IdOmJWv+11eRFNrDiEo4qV0OCgCzOgnik88PEixR572Z+ YGo5eBaI05R0WbwCKJKee19zXf50Skojy1yyW0a3SIbwkimnGvmgnod8DoHJfQl04WG4 6Kli0PNlF0/p7gwcB3qm2cA8nr5BAEIumx6BgsCar3NWFVIRUVHZNJ5fGBGcIcl4v8+D BEjQ== 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=myFOQsagaM5rWP7H+8y+MtEcVQRHE/gFDdJewhkQ1Ps=; b=mH9WSamjj8KYXpbqT6s4ps9S6xr/XQF3SUTUyqixqtdDrdkhm4N3bwClLuaKKdMit+ sTgwDp5dTuIjGBX+K4BCb0/eKoBYkv2XdJ2pLBgU3wDAFipCI7Sox+NlSY97LIXkVzpT CE/PV3PNOViDyq3a2UZbTK8w7yPtN/i+4IPw6ZtMyJV1DOEYclgvm5Df3BZpmd86dbN5 7vD08BRq6f0RkoTLPohd5wI9lcxe84R2TVCwjlm3Utq7SJImS7ZBVl2gCuk69ruiQNl6 Om1xY/lmOMS+qnTR6UONheyJXOlNwqk9ETGKiaj/3KAphp0Pne3bIw2BXZSfShlz1K+W 606Q== X-Gm-Message-State: AOAM533OXQ9lOzzBccj6aXHUgsuHW6qlgE/9GnSwXPPVNO6HtWV05yq6 pQ1zpVG/YPml4AIjkPMbmQP8XJEvvYHfKYgLCk0= X-Google-Smtp-Source: ABdhPJy54q9OYdZ7jxKMOJ/+9ZXozdc5ulS9Oo9eg1SdFodhdoW0Ar1AelrLd5cuafHnXT4pUu/R8w== X-Received: by 2002:ac8:5fd0:0:b0:2d9:6d7d:75a5 with SMTP id k16-20020ac85fd0000000b002d96d7d75a5mr12792831qta.470.1645337202738; Sat, 19 Feb 2022 22:06:42 -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 i20sm6309340qtr.38.2022.02.19.22.06.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:42 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 07/15] gnu: Add chez-nanopass. Date: Sun, 20 Feb 2022 01:06:02 -0500 Message-Id: <20220220060610.178131-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Adapt 'unpack-nanopass+stex'. (chez-nanopass): New variable. * gnu/packages/racket.scm (racket-bootstrap-chez-bootfiles)[native-inputs]: Adapt accordingly. --- gnu/packages/chez-and-racket-bootstrap.scm | 96 ++++++++++++++++++---- gnu/packages/racket.scm | 2 +- 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 83bf15b5fb..d66955d50d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -207,9 +207,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs - (list nanopass ; source only - stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -228,10 +226,12 @@ (define-public chez-scheme #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (copy-recursively #$nanopass - "nanopass" - #:keep-mtime? #t) + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (copy-recursively + (dirname (search-input-file (or native-inputs inputs) + "lib/chez-scheme/nanopass.ss")) + "nanopass" + #:keep-mtime? #t) (mkdir-p "stex") (with-output-to-file "stex/Mf-stex" (lambda () @@ -454,12 +454,76 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license license:expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d8338bcd6f..e8d016c07b 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -334,7 +334,7 @@ (define-public racket-bootstrap-chez-bootfiles racket-minimal racket-minimal-bc-3m)) ("stex" ,(package-source stex)) - ("nanopass" ,nanopass))) + ("nanopass" ,(package-source chez-nanopass)))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:06:55 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:55 +0000 Received: from localhost ([127.0.0.1]:59174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfN0-0005MH-Rh for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:55 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:45838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMy-0005Lk-JA for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:53 -0500 Received: by mail-qv1-f43.google.com with SMTP id c14so23824691qvl.12 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:52 -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=KNOUjMT3+W/jjCU6TuR4VoZo9rnrj3vaZE3pLMma7YQ=; b=etqNf27d1sqDj7+jQgEQZIR3yTsYg+lI6VmCAxGz7wxwIUuR/Oz84MIWQ1zGkGnNNe U+yHkH0QkjDV+IWHqA64VHls1TDNIoKxOTW+caQ7tgLegTFoAug1ZN3f79l+bw7SfuzA i61UKCrpqPFBW5mZgb0zGK+qEmr2FGwLdJGA9Wc69/uhUVexxDexOWGy3IVrj/rZ4E+P YWgukGoxQa6WoZZsxRIRrqgHqxkG7HeR+KKq4vYr5wGay3Hk4rOYGZDVw+io719N5hnL 5Ij6Sv5OIrrh5kaUSKMZQsldhUwYpb7VSOCWcJeeDBJZVgrexsjPnmqAIPi82BFVBRKt iw8A== 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=KNOUjMT3+W/jjCU6TuR4VoZo9rnrj3vaZE3pLMma7YQ=; b=nt/VvhFnQUJWoFHnFMiVh885xha4oZP/7zefHzoEixs9vS4cLsT5XhR1irxqSh9zVT JT5wmNiAHCq0MeY+QgvdfWrnyKe+1J7qhhK8rjrB9eJ2Oh2ivi2TOT9rx+DGdwoUtOSM 3bz7Kv9TiI+1IdXwfAUc2VmJkcizFV+uCkHlJnp1f04DeAN0pqNzYhznMOj4iqfcCSWo Xnwj+wQfgDyygSmqjGxnhJAt0jXkpug6IROxFN28B+Dg55D4w8JWi5DeL+eoPeC9MHEL 7iWENm76+8JoQQpR8GyfOtw8v0xfRiYxfXuXFpvs606s6clB31+4cWJKgHaoEQ/ZR2C1 NcyA== X-Gm-Message-State: AOAM530VUUg05dEq6A+H1+8LM4IvRCn7xAyxLnmE7SaFUAXjIpd54dhP LynPRAsw1fNz9EEZiEOSceWnCcBII+Kq/q1G1kY= X-Google-Smtp-Source: ABdhPJyQa0Y5hpoR+FKCebANgXRfOf/bVPYEOzoUfR/NTRkmDNY6+qSpXqgLAS/DuVqRaubpbI24Cw== X-Received: by 2002:ac8:4e94:0:b0:2dd:dbdc:1366 with SMTP id 20-20020ac84e94000000b002dddbdc1366mr4277663qtp.111.1645337207003; Sat, 19 Feb 2022 22:06:47 -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 s65sm8325312qkh.126.2022.02.19.22.06.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:46 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 08/15] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Sun, 20 Feb 2022 01:06:03 -0500 Message-Id: <20220220060610.178131-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This might seem a bit silly in isolation, but it makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. --- gnu/packages/chez-and-racket-bootstrap.scm | 51 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index d66955d50d..366815634d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -187,7 +187,7 @@ (define-public chez-scheme (sha256 (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) + (file-name (git-file-name "chez-scheme" version)) (snippet #~(begin (use-modules (guix build utils)) (for-each (lambda (dir) @@ -207,7 +207,9 @@ (define-public chez-scheme ;; 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-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -237,6 +239,14 @@ (define-public chez-scheme (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 (or native-inputs 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`. @@ -321,6 +331,43 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license 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 + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %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 upsream +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: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:07:09 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:07:09 +0000 Received: from localhost ([127.0.0.1]:59198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNF-0005QS-9l for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:09 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:44030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfN6-0005MV-UN for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:01 -0500 Received: by mail-qv1-f53.google.com with SMTP id a28so23837745qvb.10 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:07:00 -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=y+yoZnYl3IB/Of4LNVvAXjiqsOHhxeGWBrHaGyTiB88=; b=UEEceUAVsl1wTU8a3dt5ShEpfv1bva2TDRYO2wdRj+KKskZS3XtD0XP+mabxkQlxU1 92anabS3j8rG06u6iMG3dz+TCvh5JCpM4nt9O0+U9XQQNr0xW3fPRaWPWIoA+eVo0MCW zXsWZ6O6mphueL//DY2CtSzceSTYTyxqtqph/+3Pct31/uAWOXgMwAMIYNNswSGVr0z9 +OjKCY0CARBPork/XJglc8whYW870O3d4PW8DinQRbR102wPUBOfGIn8m1bgUWOSh0+h T03+JeK5EweEIqw/x12P1l8n4eOg0rzwkVPUFdmkRJHcvoXHUJ2ko5oxzk3aswZ11Pww WBBw== 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=y+yoZnYl3IB/Of4LNVvAXjiqsOHhxeGWBrHaGyTiB88=; b=BZGuAlz42m96h7jMV9Ec9NsBJLGwoegtDOr5RDIrMIs2BZS48jzAVQXf+Dc2i/dFLf BOLbVwofUlFNoDcxN7avtNwsW5BhlQZyDlJcW35/LF81ZEnXXXh+ejTxiDe2cdKL8tO5 LS2ZpfKRuL5o1bk+VhveTwq4OnxQPBLt8qT/fvXCtUeR/DvnLb3aPAMjba7LjtqWowJc O/xnedKL9qMllxhyEwCZH+AOMQUstrIJUSj0nD+yjy9bRK7cWWBKSNaryLUxc7E1BM5h Eo9xH/LMoKJjOKELBuTQKCvBX3l0P7ewHxBtrOmsJcpWMBos7YVjmIi/SzZMLzw5Qb/m ub/Q== X-Gm-Message-State: AOAM532EhEtpzRp55J3jo0ZrSMQ5wn/nuz9PTYf7JI7p3ECyW8rFIgqN T79OZq3g9S4zVERyInLctFFSo4uqSA/Tk7E9fTQ= X-Google-Smtp-Source: ABdhPJxt7R/bNvrQG7fNTqNN2GJd9KGJjT70G92PWSk5vAS/Hez7QFWWET+ZU6d1fq8En6BBLnT+gw== X-Received: by 2002:ac8:4b61:0:b0:2d1:cfc7:2989 with SMTP id g1-20020ac84b61000000b002d1cfc72989mr13062339qts.416.1645337215439; Sat, 19 Feb 2022 22:06:55 -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 h21sm5953391qtm.23.2022.02.19.22.06.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:55 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 10/15] gnu: Add racket-vm-bc. Date: Sun, 20 Feb 2022 01:06:05 -0500 Message-Id: <20220220060610.178131-11-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-bc): New variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index c99b8ff19e..2f649fe67f 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -475,6 +475,29 @@ (define maybe-release-catalog ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) +(define-public racket-vm-bc + (package + (inherit racket-vm-cgc) + (name "racket-vm-bc") + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc))) + (arguments + (substitute-keyword-arguments (package-arguments racket-vm-cgc) + ((#:configure-flags _ '()) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket BC [3M] implementation") + (description "The Racket BC (``before Chez'' or ``bytecode'') +implementation was the default before Racket 8.0. It uses a compiler written +in C targeting architecture-independent bytecode, plus a JIT compiler on most +platforms. Racket BC has a different C API and supports a slightly different +set of architectures than the current default runtime system, Racket CS (based +on ``Chez Scheme''). It is the recommended implementation for architectures +that Racket CS doesn't support. + +This package is the normal implementation of Racket BC with a precise garbage +collector, 3M (``Moving Memory Manager'')."))) ;; ;; Chez Scheme: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:07:16 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:07:16 +0000 Received: from localhost ([127.0.0.1]:59200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNF-0005Qc-Jh for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:16 -0500 Received: from mail-qk1-f178.google.com ([209.85.222.178]:40816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfN3-0005Lx-Dc for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:02 -0500 Received: by mail-qk1-f178.google.com with SMTP id c7so10293108qka.7 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:57 -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=YVXkciEcUrrNan3CDqEOGu3Z6fcCGa+kmkoYxJTrv1Q=; b=MbdkaqxLjFe++fejSimKIfpU9dfSvRlPDEZtlL0SmG7OFIgw1PBpMZIHOlbV5Nw8G+ 4Axo0ZCfruleNfEslJTkvovIh9FVt4IEqbvSoRbdAQ4QjgDk/XkeFaCJE9eVuNvmv3Mk KAo/BdhA4a38NyMbBGQxkHgJYf9uN7kFbCplgM6BVJokCxIb9YuhDQgMduFzPLLsdO4d kWeyV/+w0Sks2M6uw67ozUrYmzp7EdDU+FDpAWnqLtWqV2KaFag3BmYX7DcwQbqGpL5p RTOKsL5vZ0rsxyOeXf1qnkX4huYOlhQtMgGzEzaqs/XDNWZLb1f6DGOGNRlCO+GI0lel WMTQ== 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=YVXkciEcUrrNan3CDqEOGu3Z6fcCGa+kmkoYxJTrv1Q=; b=8SS/1qIueVmDWMf25BEX7ILaiNSKVx5+i7YRW1oI5YAxZnBfkLKMzk2WTurTB0hjOz 5pWJv10Sm01vS+rCjSR0EeoQ1aKSqxiIYIECxeMO01rDYC9uDnFuIHebu4Ymdym0kNt1 f4aIdNnh60Pr1+faLwVMc24QhMmK8zCVJcB7mvIgfftRihi63Fhieto1D9pGFNTuh0rD 7ffOHaOylkgheviv54PaqHOe8TpEVRavE6qDQ8ZxgUksasdszkhNGAHgLepNFJEOybzw iW7uEr6ZmiePXRym/aZ7+Jvy59Fx7rcE24L3lOQ2KQ6tJe9ejW/OJy3lm/jh5MIsZwLW cftA== X-Gm-Message-State: AOAM531xASAGCvKd1rIOxlOv5FIgrkEGt2lJSMWmI71XQTedsDcZ8pka jhrUtnHwbWMJDk68MuIdix1JMl64nZ0fjaY/n8g= X-Google-Smtp-Source: ABdhPJzUNYBsHmi7+OgBEH2tbO+zwLEguWOpGOWumPp0U07kZtCtJD+j5/Rbroiu5lQi/LnUwHko0g== X-Received: by 2002:a37:a6c5:0:b0:62c:ed0a:4b45 with SMTP id p188-20020a37a6c5000000b0062ced0a4b45mr5071342qke.583.1645337211250; Sat, 19 Feb 2022 22:06:51 -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 z17sm28315238qta.11.2022.02.19.22.06.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:50 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 09/15] gnu: Add racket-vm-cgc. Date: Sun, 20 Feb 2022 01:06:04 -0500 Message-Id: <20220220060610.178131-10-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/patches/racket-enable-scheme-backport.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (unbundle-chez-submodules, %racket-version, %racket-origin, racket-vm-cgc): New variables. (chez-scheme)[source]: Use 'unbundle-chez-submodules'. --- gnu/local.mk | 1 + gnu/packages/chez-and-racket-bootstrap.scm | 316 +++++++++++- .../racket-enable-scheme-backport.patch | 465 ++++++++++++++++++ 3 files changed, 773 insertions(+), 9 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index e802b4450b..5fcbe3a391 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1750,6 +1750,7 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-enable-scheme-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 366815634d..c99b8ff19e 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -34,8 +34,11 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages ncurses) #:use-module (gnu packages netpbm) @@ -62,6 +65,136 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; Putting the relevant definitions together in this module avoids having to ;; work around dependency cycles. ;; +;; Anatomy of Racket: +;; ------------------ +;; +;; The main Racket Git repository () is +;; organized broadly like this: +;; +;; . +;; ├── Makefile +;; ├── pkgs/ +;; └── racket/ +;; ├── collects/ +;; └── src/ +;; ├── configure +;; ├── Makefile.in +;; ├── bc/ +;; ├── cs/ +;; ├── ChezScheme/ +;; └── ... +;; +;; The 'racket/src/' directory contains the source of the runtime system, core +;; compiler, and primitives for the major Racket implementations: this layer +;; is called the ``Racket VM''. It is basically a normal autotools +;; project. (Even when Racket VM implementations use components implemented in +;; Racket, they are compiled in special modes to produce VM primitives.) +;; (There are or have been experimental Racket VM implementations elsewhere, +;; e.g. .) +;; +;; The 'racket/collects/' directory contains ``built in'' Racket libraries +;; that are not part of any package, including the implementation of +;; 'racket/base': in particular, it must contain enough to implement `raco pkg +;; install'. It is theoretically possible to use the Racket VM layer without +;; the main collections, but it is not stable or useful. +;; +;; The 'pkgs/' directory contains Racket packages that are especially closely +;; tied to the implementation of the Racket VM, including 'compiler-lib', +;; 'racket-doc', and 'racket-test'. Some of these packages depend on Racket +;; packages that are developed in other Git repositories, predominantly but +;; not exclusively under the 'racket' GitHub organization. Conversely, not all +;; of the packages developed in the main Git repository are part of the main +;; Racket distribution. (Additionally, components of the Racket VM that are +;; implemented in Racket can be installed as packages, mostly for ease of +;; development.) +;; +;; The top-level 'Makefile' is more like a directory of scripts: it has +;; convienience targets for developing Racket, and it cooperates with the +;; 'distro-build' package to assemble custom Racket distributions. 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. +;; +;; A ''minimal Racket'' installation includes two packages: 'base', which is a +;; sort of bridge between the current ``built-in'' collections and the package +;; system's model of dependencies, and 'racket-lib', which, for installations +;; that can not rely on a system package manager, pulls in the SQLite and +;; OpenSSL shared libraries as platform-specific dependencies for use by the +;; ``built-in'' collections. +;; +;; The main Racket distribution consists of installing the 'main-distribution' +;; package and all of its dependencies. +;; +;; The default mode when building Racket (or installing it with the released +;; installers) is an ``in-place build'', which produces a self-contained, +;; relocatable, roughly FHS-like directory. (Racket also supports +;; ``Unix-style'' installations, which rearrange the parts of an in-place +;; build into Racket-specific subdirectories and generally tries to work for +;; installation into an FHS-based system.) Certain tools, e.g. 'distro-build' +;; and 'raco cross', are able to work with an in-place Racket build. +;; +;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and +;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and +;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store +;; output. The function 'racket-vm-for-system' returns the recomended Racket +;; VM package for a given system. +;; +;; The file 'racket.scm' builds on these packages to define 'racket-minimal' +;; and 'racket' packages. These use Racket's support for ``layered +;; installations'', which allow an immutable base layer to be extended with +;; additional packages. They use the layer configuration directly provide +;; ready-to-install FHS-like trees, rather than relying on the built in +;; ``Unix-style install'' mechanism. +;; +;; Bootstrapping Racket: +;; --------------------- +;; +;; Here's how bootstrapping Racket works: +;; +;; - Racket BC [CGC] can be built with only a C compiler (except for +;; one caveat discussed below). +;; - 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 +;; 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. +;; +;; So, we build CGC to build 3M to build bootfiles and CS. +;; +;; (Note: since the CGC variant is basically only for bootstrapping, we +;; often use "BC" to mean "3M", consistent with `(banner)` and the +;; suffixes used on executables when more than one variant co-exists.) +;; +;; 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 +;; README file applies to all such subsystems: +;; +;; The Racket version must be practically the same as the current Racket +;; verson, although it can be the Racket BC implementation (instead of +;; the Racket CS implementation). +;; +;; Unlike Chez Scheme boot files, the files generated in "schemified" +;; are human-readable and -editable Scheme code. That provides a way +;; out of bootstrapping black holes, even without BC. +;; +;; However, other Racket subsystems implemented in Racket for Racket CS +;; use older C implementations for Racket BC, whereas the reader, expander, +;; and module system were completely replaced with the Racket implementation +;; +;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) +;; are embeded in C as a static string constant. Eventually, they are further +;; compiled by the C-implemented Racket BC bytecode and JIT compilers. +;; (On platforms where Racket BC's JIT is not supported, yet another compiler +;; instead compiles the linklets to C code, but this is not a bootstrapping +;; issue.) +;; ;; Code: (define (chez-machine->nonthreaded machine) @@ -169,6 +302,179 @@ (define* (chez-upstream-features-for-system #:optional (else '(threads)))) +;; +;; Chez auxiliary G-expressions: +;; + +(define unbundle-chez-submodules + #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))) + +;; +;; Racket VM: +;; + +(define %racket-version "8.4") +(define %racket-origin + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racket") + (commit (string-append "v" %racket-version)))) + (sha256 + (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (file-name (git-file-name "racket" %racket-version)) + (patches (search-patches "racket-minimal-sh-via-rktio.patch" + ;; Remove by Racket 8.5: + "racket-enable-scheme-backport.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Unbundle Chez submodules. + (with-directory-excursion "racket/src/ChezScheme" + #$unbundle-chez-submodules) + ;; Unbundle libffi. + (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + +(define (racket-vm-common-configure-flags) + ;; under a lambda extraction to avoid evaluating bash-minimal too early + #~`(,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/libtool")) + => (lambda (libtool) + (list (string-append "--enable-lt=" libtool)))) + (else + '())) + ,@(cond + ((false-if-exception + (search-input-file %build-inputs "/opt/racket-vm/bin/racket")) + => (lambda (racket) + (list (string-append "--enable-racket=" racket)))) + (else + '())) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")) + "--disable-strip" + "--enable-origtree")) + +(define-public racket-vm-cgc + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (hidden-package + (package + (name "racket-vm-cgc") + (version %racket-version) + (source %racket-origin) + (inputs (list ncurses ;; <- common to all variants (for #%terminal) + bash-minimal ;; <- common to all variants (for `system`) + libffi)) ;; <- only for BC variants + (native-inputs (list libtool)) ;; <- only for BC variants + (outputs '("out" "debug")) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) + (guix build gnu-build-system) + (guix build utils)) + #:strip-directories #~'("opt/racket-vm/bin" + "opt/racket-vm/lib") + #:phases + #~(let () + (define* ((wrap-racket-vm-outputs phase) . args) + (apply + phase + (let loop ((args args)) + (match args + ((#:outputs outputs . args) + `(#:outputs + ,(let loop ((outputs outputs)) + (match outputs + ((("out" . out) . outputs) + `(("out" . ,(string-append out "/opt/racket-vm/")) + ,@outputs)) + ((other . outputs) + (cons other (loop outputs))))) + ,@args)) + ((arg . args) + (cons arg (loop args))))))) + (modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (replace 'configure + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'configure))) + (replace 'patch-shebangs + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-shebangs))) + (replace 'validate-runpath + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'validate-runpath))) + (replace 'make-dynamic-linker-cache + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) + (replace 'patch-dot-desktop-files + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) + (home-page "https://racket-lang.org") + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. + +Racket CGC is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat))))) + ;; ;; Chez Scheme: ;; @@ -188,15 +494,7 @@ (define-public chez-scheme (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) (file-name (git-file-name "chez-scheme" version)) - (snippet #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib")))))) + (snippet unbundle-chez-submodules))) (build-system gnu-build-system) (inputs (list diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch new file mode 100644 index 0000000000..3a5a4a3d82 --- /dev/null +++ b/gnu/packages/patches/racket-enable-scheme-backport.patch @@ -0,0 +1,465 @@ +From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 10:36:09 -0700 +Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` + +(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) + +(Fixed conflicts by dropping pbchunks and pbarch changes.) +--- + racket/src/ChezScheme/configure | 15 ++++++++++++++- + racket/src/ChezScheme/s/Mf-base | 4 ++-- + racket/src/ChezScheme/s/Mf-cross | 4 +++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 4515ffc105..0098829091 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -45,6 +45,7 @@ threads=yes + nothreads=no + temproot="" + help=no ++forceworkarea=no + gzipmanpages=yes + installowner="" + installgroup="" +@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do + --pb) + pb=yes + ;; ++ --force) ++ forceworkarea=yes ++ ;; + --installprefix=*) + installprefix=`echo $1 | sed -e 's/^--installprefix=//'` + ;; +@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then + echo " --toolprefix= prefix tool (compiler, linker, ...) names" + echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" + echo " --workarea= build directory ($w)" ++ echo " --force configure even without boot files" + echo " CC= C compiler" + echo " CPPFLAGS= C preprocessor flags" + echo " CFLAGS= C compiler flags" +@@ -721,8 +726,16 @@ case "${flagsmuni}" in + ;; + esac + ++if [ "$w" = "$m" ] ; then ++ configuringin="" ++else ++ configuringin=" in $w" ++fi ++ + if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then +- echo "Configuring for $m" ++ echo "Configuring for $m$configuringin" ++elif [ "$forceworkarea" = yes ] ; then ++ echo "Configuring for $m$configuringin despite missing boot files" + else + if [ "$m" = "" ] ; then + maybem="" +diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base +index cc6178c973..1f4a967998 100644 +--- a/racket/src/ChezScheme/s/Mf-base ++++ b/racket/src/ChezScheme/s/Mf-base +@@ -94,7 +94,7 @@ endif + # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme + # implementation + Scheme = ../bin/$m/scheme${ExeSuffix} +-export SCHEMEHEAPDIRS=../boot/%m ++export SCHEMEHEAPDIRS=../boot/$m + export CHEZSCHEMELIBDIRS=. + + # Define the libdirs separator character +@@ -691,4 +691,4 @@ reset-one: + + .PHONY: run + run: +- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) ++ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) +diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross +index d796cbb459..397af59a28 100644 +--- a/racket/src/ChezScheme/s/Mf-cross ++++ b/racket/src/ChezScheme/s/Mf-cross +@@ -43,5 +43,7 @@ x$(xm).$(m): + $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch + mv xpatch x$(xm).$(m) + ++ifneq ($(SCHEMEHEAPDIRS),:) + # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed +-nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++endif +-- +2.32.0 + + +From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 11:03:30 -0700 +Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable + +When the same Chez Scheme version as used by Racket is already +available, then `--enable-scheme=...` can supply an executable. For +cross builds, `--enable-scheme=...` can still supply a build +directory, instead, as before. + +(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) +--- + racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ + racket/src/README.txt | 30 +++++++++++--- + racket/src/configure | 8 +++- + racket/src/cs/README.txt | 6 ++- + racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- + racket/src/cs/c/configure | 24 +++++++++-- + racket/src/cs/c/configure.ac | 21 ++++++++-- + 7 files changed, 112 insertions(+), 24 deletions(-) + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index c396efc851..3998ef9ccd 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -59,6 +59,9 @@ reset: + %.boot: + (cd $(workarea) && $(MAKE) $*.boot) + ++auto.boot: ++ (cd $(workarea) && $(MAKE) $(defaultm).boot) ++ + # .bootquick to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine +diff --git a/racket/src/README.txt b/racket/src/README.txt +index 98647aebce..d77310b4a4 100644 +--- a/racket/src/README.txt ++++ b/racket/src/README.txt +@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of + ======================================================================== + + Cross-compilation requires at least two flags to `configure`: ++`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) ++`--enable-scheme-SCHEME`. ++ ++More information: + + * `--host=OS`, where OS is something like `i386-gnu-linux` to + indicate the target platform. +@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: + run `configure` again (with no arguments) in a "local" subdirectory + to create a build for the current platform. + +-An additional flag is needed for building Racket CS, unless the flag +-`--enable-racket=auto` is used: +- +- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" +- directory where Chez Scheme is built for the host system. ++ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable ++ executable that runs on the build platform; the executable must be ++ the same version as used in Racket built for the target platform. ++ ++ Supplying `--enable-scheme=DIR` is also supported in cross-build ++ mode, where DIR is a path that has a "ChezScheme" directory where ++ Chez Scheme is built for the host system. ++ ++The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are ++allowed for non-cross builds, too: ++ ++ * For Racket CS, supplying either selects a Racket or Chez Scheme ++ implementation used to create boot files to the build platform. ++ Suppling Chez Scheme is a much more direct path, but when Racket is ++ supplied, its version does not have to match the version being ++ built. ++ ++ * For Racket BC, `--enable-racket=RACKET` selects a Racket for ++ prepare C sources to cooperate with garbage collection. Its version ++ needs to be close to the one being built, and potentially exactly ++ the same version. + + Some less commonly needed `configure` flags are for Racket BC: + +diff --git a/racket/src/configure b/racket/src/configure +index c9f3ba4419..1b53ec7ce2 100755 +--- a/racket/src/configure ++++ b/racket/src/configure +@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" + use_cs=maybe + use_bc=maybe + supplied_racket=no ++supplied_scheme=no + enable_boothelp= + + # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, +@@ -34,6 +35,9 @@ for arg in $*; do + --enable-racket=*) + supplied_racket=yes + ;; ++ --enable-scheme=*) ++ supplied_scheme=yes ++ ;; + --help | -h) + echo $0: + echo see --help-bc or --help-cs, since the Racket CS build and the +@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then + fi + + if test "$use_cs" = "yes" ; then +- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then +- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly ++ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then ++ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly + exit 1 + fi + +diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt +index 2ece417b78..8e6fc57b74 100644 +--- a/racket/src/cs/README.txt ++++ b/racket/src/cs/README.txt +@@ -39,6 +39,11 @@ build: + installed in the "../ChezScheme/boot/pb" directory as described by + "../ChezScheme/BUILDING". + ++ Supplying `--enable-scheme=...` is also an option if you alerady ++ have the same version of Chez Scheme built on the current platform. ++ Another build will be created, anyway, but more quickly than ++ without Chez Scheme. ++ + * Racket is needed to generate the files in the "schemified" + directory from the sources in sibling directories like "../io". The + Racket version must be practically the same as the current Racket +@@ -48,7 +53,6 @@ build: + Unlike Chez Scheme boot files, the files generated in "schemified" + are human-readable and -editable Scheme code. That provides a way + out of bootstrapping black holes, even without BC. +- + + + ======================================================================== +diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in +index 54a644a1d9..d73993f0fc 100644 +--- a/racket/src/cs/c/Makefile.in ++++ b/racket/src/cs/c/Makefile.in +@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ + SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) + SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme + SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) +-SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_existing = @MAKE_SCHEME_SCHEME@ ++SCHEME = $(SCHEME@USE_SCHEME_MODE@) + + TARGET_MACH = @TARGET_MACH@ + SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) +@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. + @INCLUDEDEP@ @srcdir@/../../version/version.mak + + cs: +- $(MAKE) scheme@T_CROSS_MODE@ ++ $(MAKE) scheme@MAKE_SCHEME_MODE@ + $(MAKE) racket-so + cd rktio; $(MAKE) + $(MAKE) racketcs +@@ -121,9 +123,13 @@ racket-so: + + RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ + ++TARGET_MACH_built = $(TARGET_MACH) ++TARGET_MACH_existing = xc-$(TARGET_MACH) ++XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch ++ + CS_PROGS = SCHEME="$(SCHEME)" + CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ +-CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" ++CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" + PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" + + build-racket-so: +@@ -163,6 +169,15 @@ pb-bootquick: + cd $(SCHEME_WORKAREA) && $(MAKE) reset + $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) + ++scheme-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot ++ $(MAKE) mach-make ++ ++$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: ++ mkdir -p $(SCHEME_WORKAREA) ++ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" ++ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all ++ + mach-make: + $(MAKE) config-scheme + cd $(SCHEME_WORKAREA) && $(MAKE) +@@ -182,24 +197,33 @@ config-scheme: + + scheme-cross: + env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt ++ $(MAKE) finish-scheme-cross ++ ++finish-scheme-cross: + $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) + cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) + cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t +- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch ++ $(MAKE) $(XPATCH_FILE) ++ ++scheme-cross-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) ++ $(MAKE) finish-scheme-cross + + # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older +-# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files +-XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ +- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot ++# than the build- use as Racket for build; or "auto" to create +- --enable-scheme= use as host's build directory for cross ++ --enable-scheme= use as host build for cross + --enable-mach= use Chez Scheme machine type + --enable-target= cross-build for Chez Scheme machine type + --enable-portable prefer portable to host-specific +@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" + show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' + + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + show_explicitly_enabled "${enable_portable}" "portable" +@@ -4745,9 +4748,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags + + + ++ ++ ++ + + + +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 464ebe1760..aaee88156d 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev + AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) + m4_include(../ac/path_arg.m4) + AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket for build; or "auto" to create]) +-AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host's build directory for cross]) ++AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host build for cross]) + AC_ARG_ENABLE(mach, [ --enable-mach= use Chez Scheme machine type ]) + AC_ARG_ENABLE(target, [ --enable-target= cross-build for Chez Scheme machine type ]) + m4_include(../ac/portable_arg.m4) +@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" + show_explicitly_enabled "${enable_xonx}" "Unix style" + m4_include(../ac/path_show.m4) + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + m4_include(../ac/portable_show.m4) +@@ -504,9 +504,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) + AC_SUBST(CROSS_MODE) + AC_SUBST(T_CROSS_MODE) + AC_SUBST(TT_CROSS_MODE) ++AC_SUBST(MAKE_SCHEME_MODE) ++AC_SUBST(MAKE_SCHEME_SCHEME) ++AC_SUBST(USE_SCHEME_MODE) + AC_SUBST(SETUP_BOOT_MODE) + AC_SUBST(OSX) + AC_SUBST(NOT_OSX) +-- +2.32.0 + -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:07:16 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:07:17 +0000 Received: from localhost ([127.0.0.1]:59203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNM-0005Tg-BQ for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:16 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:42734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNB-0005Ma-1s for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:05 -0500 Received: by mail-qv1-f47.google.com with SMTP id e22so23827639qvf.9 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:07:05 -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=5PMC+szkO1rOVGCQARJBH0mRv7wpQ+x6PhOjZiSrMvI=; b=iBlM+i0f26pH/sin6RwAmsz56Ojx28Ui/Woue157VrdLa3Ui6f1Gzk52rd0voy4zCb 3Q9x1r+7DKeUgaovet/ktpAuJnaDfFwPnuFdc9Wseut8sf/9jFgRCE+1ifqoOjqScX1R YU5BM28fZ/pbGD5XDz1w6MA//HLqZ1JacJI/tcK/M1oiCJoQTGlFyJdkXBmRPfVQ9DL0 gGzULsHYZqSPSU98oBxOqJt3R/6+phto4s9NXBW7mlsuqmdIYzZLO509bxUMOtgyE9Gf mlVUzdELBClMQbDkNbxSnN7IwMaTIzZlWUp0nZqcoLdTYePIgovdJijPY5IlSxOknqh1 7EOg== 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=5PMC+szkO1rOVGCQARJBH0mRv7wpQ+x6PhOjZiSrMvI=; b=MsmoTmXEpIQRLsWgKdPUxfNU4O/EUMl9fJ5sVXKRQjNJvj0SXHaFvZNxF5bKF4pP0R 4lTyAPT3i1Gm4DkSmhpQJYcppBFOfnWFnbkDILwlP8OSTGgDdVTqvlSz4x5BAQeaIRWz 4SS6j66V2zh2QvwUqwwLmfo5rmbMTigemmcGVFiIhihDTg8mcNs8TizxoeHhkO/Y0Aw5 /dsOzIFnisMeGeGOW1F6AmzVQ+rq7lOpAiO/35U2ZZPola3QbYUbwmQztlY3Mcw5Xn/8 gbT8vBIJ7YbLDDEfcyGInhkIjmqRdJqC6TghwvvZGWbbUO58ZHSULcTSnH1P4LVDPp7d IZug== X-Gm-Message-State: AOAM5320bB4n3cvLTwtowHFzLklztl4V/QaseOtT8R8oDBZrQK5fmjJH 4eI/hatK4fUomHLh4uDWKSmEHpxN5sL7jgTY+FU= X-Google-Smtp-Source: ABdhPJxwzyncrofZqnFX33PR9pvKvqJf8lD8/YD2QPxlgYEX8gbV/loSqqxGa4ssPLCwM+YtruE1tw== X-Received: by 2002:ac8:5850:0:b0:2dd:9260:c4f9 with SMTP id h16-20020ac85850000000b002dd9260c4f9mr10657527qth.446.1645337219613; Sat, 19 Feb 2022 22:06:59 -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 c7sm9000089qtp.61.2022.02.19.22.06.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:59 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 11/15] gnu: Add chez-scheme-for-racket. Date: Sun, 20 Feb 2022 01:06:06 -0500 Message-Id: <20220220060610.178131-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) The Racket variant of Chez Scheme can be used to support platforms that are not yet supported by upstream Chez Scheme. * gnu/packages/chez-and-racket-bootstrap.scm (unpack-nanopass+stex): (chez-scheme-for-racket): (chez-scheme-for-racket-bootstrap-bootfiles): New variables. (chez-scheme)[arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase to use the eponymous new variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 132 +++++++++++++++++++-- 1 file changed, 121 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 2f649fe67f..25f1ff52f8 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -317,11 +317,28 @@ (define unbundle-chez-submodules "lz4" "zlib")))) +(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"))))) + ;; ;; Racket VM: ;; (define %racket-version "8.4") +(define %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! (define %racket-origin (origin (method git-fetch) @@ -549,17 +566,8 @@ (define-public chez-scheme #:phases #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (copy-recursively - (dirname (search-input-file (or native-inputs 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"))))) + (lambda args + #$unpack-nanopass+stex)) (add-after 'unpack-nanopass+stex 'unpack-bootfiles (lambda* (#:key native-inputs inputs #:allow-other-keys) (when (directory-exists? "boot") @@ -689,6 +697,108 @@ (define-public chez-scheme-bootstrap-bootfiles work with upstream Chez Scheme so that we can bootstrap these files from source."))) +(define-public chez-scheme-for-racket + (package + (inherit chez-scheme) + (name "chez-scheme-for-racket") + (version %chez-scheme-for-racket-version) + (source %racket-origin) + (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) + #~(modify-phases #$those-phases + (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 license:asl2.0))) + +(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 (package-source chez-scheme-for-racket)) + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) + (arguments + (substitute-keyword-arguments + (package-arguments chez-scheme-bootstrap-bootfiles) + ((#:phases those-phases #~%standard-phases) + #~(modify-phases #$those-phases + (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) + (invoke (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "rktboot/main.rkt"))))))) + (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 "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 +supported platforms.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +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."))) + ;; ;; Chez's bootstrap dependencies: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:07:24 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:07:24 +0000 Received: from localhost ([127.0.0.1]:59207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNT-0005Ve-Vh for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:24 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:34528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNF-0005Nt-4Y for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:09 -0500 Received: by mail-qk1-f179.google.com with SMTP id 185so4817286qkh.1 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:07:09 -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=4ShzeyZsRCigfyxoFD7aYzR9LiIx+sSCoyEYRMjDGUo=; b=jtW9ysach5ZZGr86H0nGkxcMFcxl663YEkh1zKW8iL6S6jEw1SpZTUX1Gqkgw+csaQ bXX6tIQ5JfO6mIDvMqXxrO9BUiNHj9/ZoB8N1FtmDqJIN9jyvnrnFPTrQM6bPexDFMP8 sDsCnZlNv0mB6FQC3XROK16Xepq9UchAzGyV2c4Uot81cLI94vD3yz50mtUKO1hE9N4L UkJZtHb81MyQ66enPgriVZdJN0qbkEmEjCWe9qpirdaYYK81u5UsegYOuEjvhl7FyFl9 ZtWjdjgjomSKKTKBRfzP3ppnVjgMur7DXPz8R0Op+gcjzZfrE95sMV7Op7ogBax+lle7 kQ7A== 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=4ShzeyZsRCigfyxoFD7aYzR9LiIx+sSCoyEYRMjDGUo=; b=aUL3+ZX+d90cA8SRcDur62eBda4MA1iaOlI0bAb/05eIBHOMC0nhU/I+8uzaTiTPzN qSLiQotVvPcpIW1IUokwIzNN03sm46XPZc504D8J1JSDfXctaBr5N45OriDmlGTO6N1r FBDcPWxhoqAWDk0JYlY4VEKn/VG/9Mg34QNV5msYeJhZmBc94ocqrIMalVdHqmiWagdA y4KolM1o9wI/rVvox6xRGUf8ESCJo4N28eXo6R/iLLxxy4QDktiJ5A1NDqYQQMTk7mdB fH2p8KNzxRWz2px3lnKPDlG/O7NrdIDyHcHd7u8ezr73UwM6JEK0oovpm61NBxB3UGUR Y+5A== X-Gm-Message-State: AOAM530+gjnNA57UeOmXp2pyyiL3eGP7qdo/pwzWP+88P9hyENRnoISP OdLElAAcGNDfoZKsUwtWSEdeFHjW3ZBxp/p6InY= X-Google-Smtp-Source: ABdhPJzRYYKVEBtGz/XVkS8Mkb7vQ+K0qxFRnj7YbJSPFld7ySBBeU4AaS0zXZLJowlIiCLk+cmLqg== X-Received: by 2002:a05:620a:f02:b0:47d:8329:282c with SMTP id v2-20020a05620a0f0200b0047d8329282cmr8780117qkl.355.1645337223662; Sat, 19 Feb 2022 22:07:03 -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 f16sm3023865qkl.52.2022.02.19.22.07.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:07:03 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 12/15] gnu: Add racket-vm-cs. Date: Sun, 20 Feb 2022 01:06:07 -0500 Message-Id: <20220220060610.178131-13-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-cs): New variable. --- gnu/packages/chez-and-racket-bootstrap.scm | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 25f1ff52f8..f8fc4c7ea1 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -515,6 +515,50 @@ (define-public racket-vm-bc This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'')."))) + +(define-public racket-vm-cs + (package + (inherit racket-vm-bc) + (name "racket-vm-cs") + (inputs + (modify-inputs (package-inputs racket-vm-cgc) + (prepend zlib lz4) + (delete "libffi"))) + (native-inputs + (modify-inputs (package-native-inputs racket-vm-cgc) + (delete "libtool") + (prepend chez-scheme-for-racket + chez-nanopass-bootstrap + racket-vm-bc))) + (arguments + (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))))) + ((#:configure-flags _ '()) + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + (string-append "--enable-scheme=" + #$(this-package-native-input + "chez-scheme-for-racket") + "/bin/scheme") + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket CS implementation") + (description "The Racket CS implementation, which uses ``Chez Scheme'' as +its core compiler and runtime system, has been the default Racket VM +implemetation since Racket 8.0. It performs better than the Racket BC +implementation for most programs. + +Using the Racket VM packages directly is not recommended: instead, install the +@code{racket-minimal} or @code{racket} packages.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) + ;; ;; Chez Scheme: ;; -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:07:24 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:07:24 +0000 Received: from localhost ([127.0.0.1]:59209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNU-0005Vg-Cr for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:24 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:45025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNJ-0005Pj-6e for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:13 -0500 Received: by mail-qv1-f49.google.com with SMTP id p7so23807399qvk.11 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:07:13 -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=ZRi6asVXV+QTTkm+7nvM8RjAeYcMCR/ik7tKnX79K+k=; b=itywXS9Ow5cRGkD0RviRlBSSoSKp9SguDwfQ00zCZ0t2utL8sZjLMwKVmuopHvJS5M 1NTsR7p6oT6cz97mDlLwgLDUUf027ZkCLyRm8f/8cA+MIIt+doMBD+ddtnmInTSe6fIj K/XOu05+bMWUDr6Vz5HogSX/NqP+E4Pqezaj244SScscdXzozUGPXWQucNRbfWAU/kiU y/E+YoYChuOFAtBAJnQBnh+eI405LkVxJpawGZV+r24ijVbes/vdbLQKtnnfLniCj3y8 Fx0Q0TYYiy4mS/tGHAm3klwFBPgHy1BTboJxDp3n57T56nL8nGioWIyToimORXkfTg38 tFag== 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=ZRi6asVXV+QTTkm+7nvM8RjAeYcMCR/ik7tKnX79K+k=; b=NTuVBk4y7/rqlXLR2LHNa964yLnItFX6qM59XXKtoiXW6GJaApmSwiOqPOws5Kj5k4 16RkWtFsr4t1FhMDaMhw7HSJXKqzxBR/sOe8PTjolJDncYrSMHikIirVoTvnoSnEfhwa 431qcU468PXsiTuG1Dn9jJ6asCbUDzmc4YfCfCDxpLsVxgRCZKTCcCI1xgCUhwykMUiP 2oLLWtY9S3BqEQpy1DTNpLxt8xCl67hZAcyQA5p0RpDKCh6Ovtt76cw0AxMldXcEcM1w 9hw7EIkkmdbweX39X1dvqV8xkrXSwYwtjaPiNw24Wv4HLzn7rjQzz75z5j9gkbhsk4rK D5yA== X-Gm-Message-State: AOAM531K/9uZe2G2VmPu4s9ehob1kfx6+ynMzqjTsLNJ42yjWmZkVZ4y /m0Dvp5UYVAvREawvAEs3n5BbhMRw5qDXu9nZ4M= X-Google-Smtp-Source: ABdhPJyU96az28xFasO+de1sAE//ikPmvBLeJqsiAiSPR5n+wob92jIA1bRmie8fIiNVqOgLm1QouA== X-Received: by 2002:a05:6214:23c9:b0:413:b627:13d5 with SMTP id hr9-20020a05621423c900b00413b62713d5mr11235669qvb.16.1645337227772; Sat, 19 Feb 2022 22:07:07 -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 bk23sm24639145qkb.3.2022.02.19.22.07.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:07:07 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 13/15] gnu: chez-mit: Support chez-scheme-for-racket. Date: Sun, 20 Feb 2022 01:06:08 -0500 Message-Id: <20220220060610.178131-14-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 54bbee7923..be251798c3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -355,7 +355,29 @@ (define-public chez-mit (commit (string-append "v" version)))) (sha256 (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (snippet + ;; Workaround for chez-scheme-for-racket. + ;; See: https://github.com/racket/racket/issues/4151 + #~(begin + (use-modules (guix build utils)) + (substitute* "mit/core.sls" + (("[(]import ") + "(import (only (chezscheme) import)\n") + (("[(]define string->uninterned-symbol gensym[)]") + (format #f "~s" + '(begin + (import (only (chezscheme) + meta-cond + library-exports)) + (meta-cond + ((memq 'string->uninterned-symbol + (library-exports '(chezscheme))) + (import (only (chezscheme) + string->uninterned-symbol))) + (else + (define string->uninterned-symbol + gensym))))))))))) (build-system gnu-build-system) (inputs (list chez-srfi)) ; for tests -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:07:27 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:07:27 +0000 Received: from localhost ([127.0.0.1]:59211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNU-0005Vo-No for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:27 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:38708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNN-0005RJ-C3 for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:17 -0500 Received: by mail-qv1-f41.google.com with SMTP id d3so23810786qvb.5 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:07:17 -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=/EGU9jE9WmDO51Jzx7vGF0emMKn80UmwgIXqYiXKULk=; b=DVarq+VhNZLVLsW1WSI8HCdqCT81vBGkw0bZZFzz+RLJeLUmEzDyYhKV3fFrw39WDe BzPrx4Kf1xkndZJ7XGDCOfoBw69NkfMa4MWZR31bEWIthqVKwbtCO0E0EHSYycGiK6eB 7ToIaRkxAludBOYoGVNGzmDQ/bc2pa5sJa9fOMaVKS28+QyG/fjwLXJeZ06ed/EoZ+u8 ejj2jfrdkaB9mojx1lmQ3UbANOhPOqVEBCom01kssAoV520LX5Jn1mGBdZzEMD+w5+YJ eiB199tkuvVIVSEDDb6EE8Qn+jMG5VMQ9AtuuG1Q1MAhBC2LGqFNwaUETXq3dPz5feVw NKDw== 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=/EGU9jE9WmDO51Jzx7vGF0emMKn80UmwgIXqYiXKULk=; b=7xK31u6b8BipOjKG9P9/CRSpmPWlIlDAswaCElZAW5iS0RbYeCIVwz2un0K7UpuQGw QiUK+qH3N4LIkYk9fQnbD3pEYzgAwzpOfJQoTJN0qu5zRlPPU6WeGB/TqJqpODkYkX4V dmWnr0IswV+XDZYuBYk5xp9KhAKARH4J+WTwsi8dOvLp2+FC2Y/DtgPx9BOZ+Oz7XsmY IQv0i49qXFRMdU8/FGTjOMJ4fxXxHOKZe3m1YY3Q7FlgGcGCIoKFdV/wSUcfDvOWSC8X Zbhr99O+lTFgbwTCj1G/rXNqmkBChClh5BXMUhdNXVQHs2BxkT56HQGrePFgvUfUOYcI w+pg== X-Gm-Message-State: AOAM531oUF7gVZk8yRNl/3FoVGz+EOPDcd/OrGfV7as5ir3gCT8O5v49 ombqvJTKkCIxfEBCOsvDQM+0NT/QIu8pE1jQe0k= X-Google-Smtp-Source: ABdhPJxPARJG8HsnYPHetidmFGfoRca0xXBF+1R7n2ohPCrS6v1/+SA8OXN/89e1MIriF21GcDeqMg== X-Received: by 2002:ac8:5a85:0:b0:2ca:e6ab:3972 with SMTP id c5-20020ac85a85000000b002cae6ab3972mr13061086qtc.584.1645337231880; Sat, 19 Feb 2022 22:07:11 -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 p70sm23982542qka.62.2022.02.19.22.07.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:07:11 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 14/15] gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'. Date: Sun, 20 Feb 2022 01:06:09 -0500 Message-Id: <20220220060610.178131-15-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-for-system): New procedure. * gnu/packages/loko.scm (loko-scheme): Use 'chez-scheme-for-system'. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise * gnu/packages/chez.scm (chez-srfi): (chez-web): (chez-sockets): (chez-matchable): (chez-irregex): (chez-fmt): (chez-mit): (chez-scmutils): Likewise. --- gnu/packages/chez-and-racket-bootstrap.scm | 17 ++++++++++++++++- gnu/packages/chez.scm | 16 ++++++++-------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index f8fc4c7ea1..e837d49c63 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -45,7 +45,8 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages tex) #:use-module (gnu packages xorg) #:use-module ((guix licenses) - #:prefix license:)) + #:prefix license:) + #:export (chez-scheme-for-system)) ;; Commentary: ;; @@ -197,6 +198,20 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; Code: +(define* (chez-scheme-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, +including support for native threads." + (if (or + ;; full support upstream + (and=> (chez-upstream-features-for-system system) + (cut memq 'threads <>)) + ;; no support anywhere + (not (nix-system->chez-machine system))) + chez-scheme + chez-scheme-for-racket)) + (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 diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index be251798c3..d5007e0cfd 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -74,7 +74,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -105,7 +105,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) ghostscript ;; FIXME: This package fails to build with the error: ;; mktexpk: don't know how to create bitmap font for bchr8r @@ -170,7 +170,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) chez-web (texlive-updmap.cfg (list texlive-pdftex)))) (arguments @@ -256,7 +256,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -288,7 +288,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -319,7 +319,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -382,7 +382,7 @@ (define string->uninterned-symbol (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -413,7 +413,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 6430318ec5..ccd05130ca 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -451,7 +451,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index 74a649b8a1..a7ab12a0c4 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -71,7 +71,7 @@ (define-public loko-scheme #t))))) (native-inputs `(("akku" ,akku) - ("chez-scheme" ,chez-scheme) + ("chez-scheme" ,(chez-scheme-for-system)) ("struct" ,guile-struct-pack) ("laesare" ,guile-laesare) ("pfds" ,guile-pfds) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 01:07:51 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:07:51 +0000 Received: from localhost ([127.0.0.1]:59213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNk-0005WQ-CX for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:51 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:39905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfNS-0005U9-H9 for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:07:26 -0500 Received: by mail-qk1-f179.google.com with SMTP id t21so6085187qkg.6 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:07:22 -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=TRA253p2NuxcKGSv0eeNtxYuMApN+xwmT/CalphCwiQ=; b=TrCHlRxGZojdKRa7M+tTnQtGJNsh/3wJdz2ZiUYsocxlDsMcAdtCSaYIUSAnFlEgrg g4Q9Cu5IyWTgO15BpG1/OnHGv6/Uie67GEs27Q5/KY14MYB+/N50uoHetNNqdiWMQvqT bzRpCANPipZnxkczxlkvLfT1LGkcAeMJSkXjjSVLgXXrsvV0itqeMXHTYGpQ8tHmB455 p0P/8g26qgcK+CiunAu7x+Cy7qAIk6HaxpFAghT1ujTBpz2gOJzq2hU9u1BbtSwwxGJZ e3ETNz/MtuY4ACn99UKUPZXpxG9QTX2EcasmZEslAMGLwVXZ5134mZkLv6pb8kDOwzaj fJ1w== 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=TRA253p2NuxcKGSv0eeNtxYuMApN+xwmT/CalphCwiQ=; b=omgbL2kK7Jyvit4TIJtXrVvUzF/vm6RgQxencJoeZqBEZeAMJ9ok9RivbkvIu86Dej bpmxM+aagk+0WOkyHD44Vebpejku5EgR62CwKnSNPJJt4euNkG49CWEKj1HQOmsVxQhX DQOamQfMOmonk24oLwtPPXLiK6Ehkdn8NLkdBY255kLM+7GhnXKQT6N05ymrbyCem1It 45qBpfQGuT0oXVekc2jVU0mfiJAEN+twksTWrEM2ubziKS5v8Z6ydLDWmAvkK+BJBchf XVImhMTk/4s3Tz2Cw2pCS8qRwy261TAMAYJWm3f/9+AiMHD85lieb0As+NYkcG0CtAYC EbFA== X-Gm-Message-State: AOAM532F61Hfuilm6N4ErRgsECHozy5eor6jkXZIXUwGgD7kwIZyXFJc h55EF47UbXn3z31Yd408aJNLhZT58nKNwys+b2Y= X-Google-Smtp-Source: ABdhPJwOj4tKnt8YiiIP2m8K0Azv17KkKo/J5dN04aH6fvXcxjGOr470crmUNpDhHmFmS2j7JK7/EQ== X-Received: by 2002:a37:91c6:0:b0:508:1ece:ce66 with SMTP id t189-20020a3791c6000000b005081ecece66mr8949928qkd.248.1645337236150; Sat, 19 Feb 2022 22:07:16 -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 t18sm28234676qta.90.2022.02.19.22.07.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:07:15 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: [PATCH v4 15/15] gnu: racket: Update to 8.4. Date: Sun, 20 Feb 2022 01:06:10 -0500 Message-Id: <20220220060610.178131-16-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: Philip McGrath Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedu [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.179 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.179 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedu [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): New procedure. * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.4. Rewrite to use 'racket-vm-for-system', label-less inputs, G-expressions, and Git origins for main-distribution packages. --- gnu/local.mk | 3 +- gnu/packages/chez-and-racket-bootstrap.scm | 15 +- ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1596 +++++++++++------ 4 files changed, 1118 insertions(+), 522 deletions(-) create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5fcbe3a391..2fb4440eee 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright © 2020 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan -# Copyright © 2021 Philip McGrath +# Copyright © 2021, 2022 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher # Copyright © 2021 Dmitry Polyakov @@ -1751,6 +1751,7 @@ dist_patch_DATA = \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-enable-scheme-backport.patch \ + %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index e837d49c63..b779099fb3 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -46,7 +46,8 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:) - #:export (chez-scheme-for-system)) + #:export (chez-scheme-for-system + racket-vm-for-system)) ;; Commentary: ;; @@ -212,6 +213,14 @@ (define* (chez-scheme-for-system #:optional chez-scheme chez-scheme-for-racket)) +(define* (racket-vm-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." + (if (nix-system->chez-machine system) + racket-vm-cs + racket-vm-bc)) + (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 @@ -349,7 +358,9 @@ (define unpack-nanopass+stex ;; Racket VM: ;; -(define %racket-version "8.4") +(define %racket-version "8.4") ; MUST match "racket.scm" +;; The definition of %racket-version is duplicated to avoid an import cycle: +;; see . (define %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. diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch new file mode 100644 index 0000000000..1e018eaa79 --- /dev/null +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -0,0 +1,26 @@ +From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Mon, 31 Jan 2022 15:31:22 -0700 +Subject: [PATCH] fix creation of tethered launchers + +Related to racket/racket#4133 + +(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) +--- + gui-lib/mred/installer.rkt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt +index b1691472..9ef06c53 100644 +--- a/gui-lib/mred/installer.rkt ++++ b/gui-lib/mred/installer.rkt +@@ -72,4 +72,5 @@ + (list "-A" (path->string (find-system-path 'addon-dir))))) + + (define (config-flags) +- (list "-G" (path->string (find-config-dir)))) ++ (list "-X" (path->string (find-collects-dir)) ++ "-G" (path->string (find-config-dir)))) +-- +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index e8d016c07b..c2854f84e8 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021 Philip McGrath +;;; Copyright © 2021, 2022 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -21,8 +21,6 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages racket) - #:use-module ((guix licenses) - #:select (asl2.0 expat lgpl3+)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -30,7 +28,10 @@ (define-module (gnu packages racket) #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 regex) + #:use-module (ice-9 exceptions) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) @@ -47,200 +48,161 @@ (define-module (gnu packages racket) #:use-module (gnu packages multiprecision) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) + #:prefix license:)) + +(define %racket-version "8.4") ; MUST match "chez-and-racket-bootstrap.scm" +;; The definition of %racket-version is duplicated to avoid an import cycle: +;; see . +(define %racket-commit + (string-append "v" %racket-version)) + +(define (extract-package-source origin spec) + "Extract the source for a Racket package specified by SPEC from ORIGIN into +a new file-like object. In the resulting file-like object, the package source +will be in the directory \"/share/racket/pkgs/NAME/\", where NAME is the Racket +name for the package. + +SPEC is a list of the form: + + (NAME PATH) + +where PATH is the path to the package source relative to ORIGIN---possibly +`\".\"`. As a special case, SPEC may also be given a string, which is +equivalent to: + + (NAME NAME) + +Examples: -;; Commentary: -;; -;; Here's how bootstrapping minimal Racket works: -;; -;; - Racket BC [CGC] can be built with only a C compiler (except for -;; one caveat discussed below). -;; - 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 -;; 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. -;; -;; So, we build CGC to build 3M to build bootfiles and CS. -;; -;; 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 -;; README file applies to all such subsystems: -;; -;; The Racket version must be practically the same as the current Racket -;; verson, although it can be the Racket BC implementation (instead of -;; the Racket CS implementation). -;; -;; Unlike Chez Scheme boot files, the files generated in "schemified" -;; are human-readable and -editable Scheme code. That provides a way -;; out of bootstrapping black holes, even without BC. -;; -;; However, other Racket subsystems implemented in Racket for Racket CS -;; use older C implementations for Racket BC, whereas the reader, expander, -;; and module system were completely replaced with the Racket implementation -;; as of Racket 7.0. -;; -;; For Racket BC, the compiled "linklet" s-expressions (primitive modules) -;; are embeded in C as a static string constant. Eventually, they are further -;; compiled by the C-implemented Racket BC bytecode and JIT compilers. -;; (On platforms where Racket BC's JIT is not supported, yet another compiler -;; instead compiles the linklets to C code, but this is not a bootstrapping -;; issue.) -;; -;; Code: +- \"expeditor\" +- (\"main-distribution\" \".\") +- (\"racket-lib\" \"pkgs/racket-lib\")" + (match (match spec + ((? string? name) + (list name (file-append origin (string-append "/" name)))) + ((name ".") + (list name origin)) + ((name path) + (list name (file-append origin (string-append "/" path))))) + ((name src) + (computed-file + (string-append "racket-pkg-" name) + (with-imported-modules `((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p (string-append #$output "/share/racket/pkgs")) + (copy-recursively #$src (string-append #$output + "/share/racket/pkgs/" + #$name)))))))) + +(define (extract-package-source* source-groups) + "Return a list of file-like objects containing the sources of the Racket +packages specified by SOURCE-GROUPS, a list of the form: -(define cfg-flag:sh-for-rktio - `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - (assoc-ref %build-inputs "sh") - "/bin/sh")) -(define cfg-flag:enable-lt - `(string-append "--enable-lt=" - (assoc-ref %build-inputs "libtool") - "/bin/libtool")) -(define cfg-flag:enable-racket - `(let ((racket (assoc-ref %build-inputs "racket"))) - (string-append "--enable-racket=" - racket - "/bin/racket"))) + ((ORIGIN SPEC ...) ...) -(define unpack-nanopass+stex - ;; Copied from chez-scheme. - ;; TODO: Eventually, we should refactor Chez Scheme - ;; enough to share more directly, so that we can make - ;; Racket's version of Chez avalable as a Guix package, - ;; e.g. for architectures not supported upstream. - ;; For now, we let Racket drive the Chez build process - ;; other than this step. - `(for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex"))) +The result is equivalent to: + (append (list (extract-package-source ORIGIN SPEC) ...) ...)" + (append-map (match-lambda + ((origin . specs) + (map (cut extract-package-source origin <>) + specs))) + source-groups)) (define-public racket-minimal (package (name "racket-minimal") - (version "8.3") ; note: remember to also update racket! - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit (string-append "v" version)))) - (sha256 - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") - (file-name (git-file-name name version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) - (modules '((guix build utils))) - (snippet - (with-imported-modules '((guix build utils)) - #~(begin - ;; Unbundle Chez submodules. - (with-directory-excursion "racket/src/ChezScheme" - ;; Remove bundled libraries (copied from 'chez-scheme'). - (for-each delete-file-recursively - '("stex" - "nanopass" - "lz4" - "zlib"))) - ;; Unbundle libffi. - (delete-file-recursively "racket/src/bc/foreign/libffi")))))) + (version %racket-version) + (source #f) + ;; For cross-compilation, Matthew Flatt recommends reusing + ;; as much of `raco cross` as possible. So, put that off until + ;; we have a build system for Racket packages. (inputs - `(;; common to all racket-minimal variants: - ("openssl" ,openssl) - ("sqlite" ,sqlite) - ("sh" ,bash-minimal) - ;; only for CS - ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static"))) - (native-inputs - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) + (cons* openssl + sqlite + (racket-vm-for-system) + (extract-package-source* + `((,(package-source (racket-vm-for-system)) + ("base" "pkgs/base") + ("racket-lib" "pkgs/racket-lib")))))) (build-system gnu-build-system) (arguments - `(#:configure-flags - (list "--enable-csonly" - "--enable-libz" - "--enable-liblz4" - ,cfg-flag:enable-racket - ,cfg-flag:sh-for-rktio) - #:out-of-source? #true - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main distribution. - #:tests? #f - #:modules ((ice-9 match) - (guix build gnu-build-system) - (guix build utils)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (string-append (assoc-ref inputs "bootfiles") "/boot") - "boot")) - #t)) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f ,@(map (lambda (lib) - (string-append (assoc-ref inputs lib) - "/lib")) - '("openssl" - "sqlite")))) - (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - ,version - "/catalog/") - #f)))))) - #t)) - (add-before 'configure 'change-directory - (lambda _ - (chdir "racket/src") - #t)) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda* (#:key outputs #:allow-other-keys) - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append (assoc-ref outputs "out") - "/share/racket/pkgs")) - #t))))) + ;; Here and for the `racket` package, we're using #:configure-flags + ;; to pass flags for `make-installation-layer.rkt` and #:make-flags + ;; to pass arguments for `raco pkg install` + (list + #:configure-flags + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format + #f "~s" + (list #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib")))) + #:make-flags #~`("racket-lib") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (guix build union) + (ice-9 match)) + #:imported-modules `((guix build union) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (delete 'unpack) + (replace 'configure + (lambda* (#:key inputs configure-flags #:allow-other-keys) + (let* ((vm-dir (search-input-directory inputs "opt/racket-vm")) + (racket (string-append vm-dir "/bin/racket"))) + (apply invoke + racket + #$make-installation-layer.rkt + `(,@(cond + ((false-if-exception + (search-input-file + inputs "etc/racket/config.rktd")) + => (lambda (file) + `("--parent" + ,(dirname (dirname (dirname file)))))) + (else + '())) + ,@configure-flags + ,vm-dir + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; We use "share/racket/pkgs" for sources to distinguish them + ;; from the "lib/racket/pkgs" of a potential parent layer. + (union-build (string-append #$output "/lib/racket/pkgs") + (search-path-as-list '("share/racket/pkgs") + (map cdr inputs)) + #:create-all-directories? #t))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket + (search-input-file inputs "/opt/racket-vm/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) (home-page "https://racket-lang.org") (synopsis "Racket without bundled packages such as DrRacket") (description @@ -254,280 +216,832 @@ (define (write-racket-hash alist) DrRacket IDE, are not included.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list asl2.0 expat)))) - - -(define-public racket-minimal-bc-3m - (hidden-package - (package - (inherit racket-minimal) - (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (delete "zlib" "zlib:static" "lz4" "lz4:static") - (prepend libffi ;; <- only for BC variants - ))) - (native-inputs - `(("libtool" ,libtool) - ("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc)))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) - ((#:configure-flags _ '()) - `(list "--enable-bconly" - ,cfg-flag:enable-racket - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)) - ((#:phases usual-phases) - `(modify-phases ,usual-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") - (description "The Racket BC (``before Chez'' or ``bytecode'') -implementation was the default before Racket 8.0. It uses a compiler written -in C targeting architecture-independent bytecode, plus a JIT compiler on most -platforms. Racket BC has a different C API and supports a slightly different -set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). - -This package is the normal implementation of Racket BC with a precise garbage -collector, 3M (``Moving Memory Manager'').") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list lgpl3+ asl2.0 expat))))) - - -(define-public racket-minimal-bc-cgc - (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs - (alist-delete "racket" (package-native-inputs racket-minimal-bc-3m))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:configure-flags _ '()) - `(list "--enable-cgcdefault" - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the -Racket CS implementation. - -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) - - -(define-public racket-bootstrap-chez-bootfiles - (hidden-package - (package - (inherit racket-minimal) - (name "racket-bootstrap-chez-bootfiles") - (inputs `()) - (native-inputs - `(("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-3m)) - ("stex" ,(package-source stex)) - ("nanopass" ,(package-source chez-nanopass)))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (delete 'configure) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (invoke (string-append (assoc-ref inputs "racket") - "/bin/racket") - "rktboot/main.rkt" - "--dest" (assoc-ref outputs "out"))) - #t)) - (delete 'check) - (delete 'install)))) - (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 -supported platforms.) - -The Racket package @code{cs-bootstrap} (part of the main Racket Git -repository) implements enough of a Chez Scheme simulation to load the Chez -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.") - (license (list asl2.0))))) - - -(define %installer-mirrors - ;; Source: - ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58 - ;; Matthew Flatt says: "note that many are commented out" - ;; INVARIANT: End with a trailing "/"! - '("https://mirror.racket-lang.org/installers/" - "https://www.cs.utah.edu/plt/installers/" - "https://plt.cs.northwestern.edu/racket-mirror/" - "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" - ;; Universität Tübingen is using a self-signed HTTPS certificate: - "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" - "https://racket.infogroep.be/" - )) - -(define %main-repo-main-distribution-pkgs - ;; These are the packages developed in the main Racket Git repository - ;; that are part of the main distribution. - '("at-exp-lib" - "base" - "compiler-lib" - ;; NOT "compiler-test" - "compiler" - "net-doc" - "net-lib" - ;; NOT "net-test" - "net" - ;; NOT "plt-services" - ;; NOT "racket-benchmarks" - ;; NOT "racket-build-guide" - "racket-doc" - "racket-index" - "racket-lib" - ;; NOT "racket-test-core" - ;; NOT "racket-test-extra" - ;; NOT "racket-test" - "zo-lib")) - + (license (list license:asl2.0 license:expat)))) (define-public racket (package (inherit racket-minimal) (name "racket") - (version (package-version racket-minimal)) ; needed for origin uri to work - (source - (origin - (method url-fetch) - (uri (map (lambda (base) - (string-append base version "/racket-src.tgz")) - %installer-mirrors)) - (sha256 - (base32 - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) - (snippet - #~(begin - (use-modules (guix build utils) - (ice-9 match) - (ice-9 regex)) - ;; unbundle minimal Racket - (for-each delete-file-recursively - '("collects" - "doc" - "etc" - "README" - "src")) - ;; unbundle package sources included elsewhere - (with-directory-excursion "share/pkgs" - (for-each delete-file-recursively - '#+%main-repo-main-distribution-pkgs)) - #t)))) + (source #f) (inputs - `(("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("glib" ,glib) - ("glu" ,glu) - ("gmp" ,gmp) - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("mpfr" ,mpfr) - ("pango" ,pango) - ("unixodbc" ,unixodbc) - ("libedit" ,libedit))) - (native-inputs - `(("racket" ,racket-minimal) - ("extend-layer" ,extend-layer) - ("main-repo" ,(package-source racket-minimal)))) + (cons* + cairo + fontconfig + glib + glu + gmp + gtk+ ;; propagates gdk-pixbuf+svg + libjpeg-turbo + libpng + libx11 ;; ?? wayland ?? + mesa + mpfr + pango + unixodbc + libedit ;; TODO reconsider in light of expeditor and readline-gpl + racket-minimal ;; <-- TODO non-tethered layer + (racket-vm-for-system) + (extract-package-source* + `((,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/2d") + (commit %racket-commit))) + (sha256 (base32 + "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) + (file-name + (git-file-name "racket-2d" %racket-version))) + "2d" "2d-doc" "2d-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/algol60") + (commit %racket-commit))) + (sha256 (base32 + "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx")) + (file-name + (git-file-name "racket-algol60" %racket-version))) + ("algol60" ".")) + (,(package-source (racket-vm-for-system)) + ("at-exp-lib" "pkgs/at-exp-lib") + ("compiler" "pkgs/compiler") + ("compiler-lib" "pkgs/compiler-lib") + ("net" "pkgs/net") + ("net-doc" "pkgs/net-doc") + ("net-lib" "pkgs/net-lib") + ("racket-doc" "pkgs/racket-doc") + ("racket-index" "pkgs/racket-index") + ("sandbox-lib" "pkgs/sandbox-lib") + ("zo-lib" "pkgs/zo-lib")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/cext-lib") + (commit %racket-commit))) + (sha256 (base32 + "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341")) + (file-name (git-file-name "racket-cext-lib" %racket-version))) + "cext-lib" "dynext-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/class-iop") + (commit %racket-commit))) + (sha256 (base32 + "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l")) + (file-name (git-file-name "racket-class-iop" %racket-version))) + "class-iop-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/compatibility") + (commit "37f11132cdad7ef27386b68383d073f275d67c31"))) + (sha256 (base32 + "0bfqwscjpyi325br5pa6g62g9c8lq18a80zp5g3d2qzn3n3mi6x0")) + (file-name + (git-file-name "racket-compatibility" %racket-version))) + "compatibility" "compatibility-doc" "compatibility-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/contract-profile") + (commit "95d980a076126b8e4e4284e912f2a7d9d3ab6860"))) + (sha256 (base32 + "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3")) + (file-name + (git-file-name "racket-contract-profile" %racket-version))) + ("contract-profile" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/data") + (commit "e32d012b394e32e102e8a9adfcc885bb0541ab51"))) + (sha256 (base32 + "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55")) + (file-name (git-file-name "racket-data" %racket-version))) + "data" "data-doc" "data-enumerate-lib" "data-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/datalog") + (commit "7d160a86451af8298093d07674a2eb0e1a0161a4"))) + (sha256 (base32 + "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp")) + (file-name (git-file-name "racket-datalog" %racket-version))) + ("datalog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/db") + (commit %racket-commit))) + (sha256 (base32 + "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5")) + (file-name (git-file-name "racket-db" %racket-version))) + "db" "db-doc" "db-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/deinprogramm") + (commit %racket-commit))) + (sha256 (base32 + "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd")) + (file-name + (git-file-name "racket-deinprogramm" %racket-version))) + "deinprogramm" "deinprogramm-signature") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/distributed-places") + (commit %racket-commit))) + (sha256 (base32 + "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0")) + (file-name + (git-file-name "racket-distributed-places" %racket-version))) + "distributed-places" + "distributed-places-doc" + "distributed-places-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/draw") + (commit %racket-commit))) + (sha256 (base32 + "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly")) + (file-name (git-file-name "racket-draw" %racket-version))) + "draw" "draw-doc" "draw-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/drracket") + (commit %racket-commit))) + (sha256 (base32 + "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c")) + (file-name (git-file-name "racket-drracket" %racket-version))) + "drracket" + "drracket-plugin-lib" + "drracket-tool" + "drracket-tool-doc" + "drracket-tool-lib" + "drracket-tool-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/ds-store") + (commit "949ca63dd00522b3ab8aec2d71c543ece8266872"))) + (sha256 (base32 + "0ajr27kipp4dr1qlisaghsb3h7lhhjwrfw2r79b5myczsa1mp661")) + (file-name (git-file-name "racket-ds-store" %racket-version))) + "ds-store" "ds-store-doc" "ds-store-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eli-tester") + (commit "036e07d43a1f478ea1750881d5591d983ce1ffaf"))) + (sha256 (base32 + "0icx6wn14gjm8kdmq1jppqgq87sxkras4qb5xmdr6wigxafhjqyk")) + (file-name (git-file-name "racket-eli-tester" %racket-version))) + ("eli-tester" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eopl") + (commit %racket-commit))) + (sha256 (base32 + "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s")) + (file-name (git-file-name "racket-eopl" %racket-version))) + ("eopl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/errortrace") + (commit %racket-commit))) + (sha256 (base32 + "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip")) + (file-name (git-file-name "racket-errortrace" %racket-version))) + "errortrace" "errortrace-doc" "errortrace-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/expeditor") + (commit %racket-commit))) + (sha256 (base32 + "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf")) + (file-name (git-file-name "racket-expeditor" %racket-version))) + "expeditor" "expeditor-doc" "expeditor-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/frtime") + (commit %racket-commit))) + (sha256 (base32 + "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5")) + (file-name (git-file-name "racket-frtime" %racket-version))) + ("frtime" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/future-visualizer") + (commit %racket-commit))) + (sha256 (base32 + "1758qq769m0r14xf64sl2ix2l9z340kvapar0j7s5kdg42lmvnhm")) + (file-name + (git-file-name "racket-future-visualizer" %racket-version))) + "future-visualizer" + "future-visualizer-pict" + "future-visualizer-typed") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/games") + + (commit %racket-commit))) + (sha256 (base32 + "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d")) + (file-name (git-file-name "racket-games" %racket-version))) + ("games" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui") + (commit %racket-commit))) + (sha256 (base32 + "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) + (file-name (git-file-name "racket-gui" %racket-version))) + "gui" "gui-doc" "gui-lib" "tex-table") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui-pkg-manager") + (commit %racket-commit))) + (sha256 (base32 + "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5")) + (file-name + (git-file-name "racket-gui-pkg-manager" %racket-version))) + "gui-pkg-manager-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/htdp") + (commit %racket-commit))) + (sha256 (base32 + "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl")) + (file-name (git-file-name "racket-htdp" %racket-version))) + "htdp" "htdp-doc" "htdp-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/html") + (commit %racket-commit))) + (sha256 (base32 + "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x")) + (file-name (git-file-name "racket-html" %racket-version))) + "html" "html-doc" "html-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/icons") + (commit %racket-commit))) + (sha256 (base32 + "1s5a6j11fg3fdr6b7vm2q7q178d7q8b8igy73bs211r27qrd1gg7")) + (file-name (git-file-name "racket-icons" %racket-version))) + ("icons" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/images") + (commit %racket-commit))) + (sha256 (base32 + "0rpjxqw34bq5m08kh1ldl1mr7s9z1lyydxxcyzb292kqh9qiqvfl")) + (file-name (git-file-name "racket-images" %racket-version))) + "images" "images-doc" "images-gui-lib" "images-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/lazy") + (commit %racket-commit))) + (sha256 (base32 + "176ylzgbdsbmqknpihaz519afq71pyjkv1h87j5v8jfbpbddyfsf")) + (file-name (git-file-name "racket-lazy" %racket-version))) + ("lazy" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/macro-debugger") + (commit %racket-commit))) + (sha256 (base32 + "14hyrwbkffr61fk44l02xb47bhv5zccw0ymaa9kxld86hvyqhqbm")) + (file-name + (git-file-name "racket-macro-debugger" %racket-version))) + "macro-debugger" "macro-debugger-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/main-distribution") + (commit %racket-commit))) + (sha256 (base32 + "0m2n9s32s8a4a2gn4ywrm9l8jycdm5ayi5w9kh5wchhrrw7qzq7y")) + (file-name + (git-file-name "racket-main-distribution" %racket-version))) + ("main-distribution" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/make") + (commit %racket-commit))) + (sha256 (base32 + "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa")) + (file-name (git-file-name "racket-make" %racket-version))) + ("make" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/math") + (commit %racket-commit))) + (sha256 (base32 + "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac")) + (file-name (git-file-name "racket-math" %racket-version))) + "math" "math-doc" "math-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mysterx") + (commit %racket-commit))) + (sha256 (base32 + "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48")) + (file-name (git-file-name "racket-mysterx" %racket-version))) + ("mysterx" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzcom") + (commit %racket-commit))) + (sha256 (base32 + "0rc9pfj7gwm5azghqvcibz6si1x5s2v8mr2yngk7ssq9gzfbi6a4")) + (file-name (git-file-name "racket-mzcom" %racket-version))) + ("mzcom" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzscheme") + (commit %racket-commit))) + (sha256 (base32 + "192c52zi726h5wjamxrhivjw2waq1im0zpyxhbrkrxknm8x84bs9")) + (file-name (git-file-name "racket-mzscheme" %racket-version))) + "mzscheme" "mzscheme-doc" "mzscheme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RenaissanceBug/racket-cookies") + (commit %racket-commit))) + (sha256 (base32 + "0k0hifxhywl5c3hjcaiizc098dpyk001d981p572gly116yvjxc1")) + (file-name + (git-file-name "RenaissanceBug-racket-cookies" %racket-version))) + "net-cookies" "net-cookies-doc" "net-cookies-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stamourv/optimization-coach") + (commit %racket-commit))) + (sha256 (base32 + "0b27sw48d7rhz0hin88c7rbr9vpg1c23sn82nd4jkmq54h6gasr1")) + (file-name + (git-file-name "stamourv-optimization-coach" %racket-version))) + ("optimization-coach" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/option-contract") + (commit %racket-commit))) + (sha256 (base32 + "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk")) + (file-name + (git-file-name "racket-option-contract" %racket-version))) + "option-contract" "option-contract-doc" "option-contract-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/parser-tools") + (commit %racket-commit))) + (sha256 (base32 + "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3")) + (file-name (git-file-name "racket-parser-tools" %racket-version))) + "parser-tools" "parser-tools-doc" "parser-tools-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pconvert") + (commit %racket-commit))) + (sha256 (base32 + "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1")) + (file-name (git-file-name "racket-pconvert" %racket-version))) + "pconvert-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict") + (commit %racket-commit))) + (sha256 (base32 + "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x")) + (file-name (git-file-name "racket-pict" %racket-version))) + "pict" "pict-doc" "pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict-snip") + (commit %racket-commit))) + (sha256 (base32 + "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x")) + (file-name (git-file-name "racket-pict-snip" %racket-version))) + "pict-snip" "pict-snip-doc" "pict-snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/picturing-programs") + (commit %racket-commit))) + (sha256 (base32 + "1g6xr39hx1j03gb3d4dljm3v91xcj2gfpq3dgy5xvplzr6cmmxgr")) + (file-name + (git-file-name "racket-picturing-programs" %racket-version))) + ("picturing-programs" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plai") + (commit %racket-commit))) + (sha256 (base32 + "0i983sh0r0zm2ng4j44m5aw9669kh5fhp91bzpc9jm280rfcqvyl")) + (file-name (git-file-name "racket-plai" %racket-version))) + "plai" "plai-doc" "plai-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/planet") + (commit %racket-commit))) + (sha256 (base32 + "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9")) + (file-name (git-file-name "racket-planet" %racket-version))) + "planet" "planet-doc" "planet-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plot") + (commit %racket-commit))) + (sha256 (base32 + "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7")) + (file-name (git-file-name "racket-plot" %racket-version))) + "plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/preprocessor") + (commit %racket-commit))) + (sha256 (base32 + "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg")) + (file-name (git-file-name "racket-preprocessor" %racket-version))) + ("preprocessor" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/profile") + (commit %racket-commit))) + (sha256 (base32 + "179i86lyby29nywz60l4vnadi02w8b12h7501nm5h5g4pq9jjmbb")) + (file-name (git-file-name "racket-profile" %racket-version))) + "profile" "profile-doc" "profile-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Metaxal/quickscript") + (commit %racket-commit))) + (sha256 (base32 + "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + (file-name (git-file-name "Metaxal-quickscript" %racket-version))) + ("quickscript" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r5rs") + (commit %racket-commit))) + (sha256 (base32 + "1g3cysj7z88r38vkzvi8g2fb2hn4yg1fdhy5smxw303jxgl3inp6")) + (file-name (git-file-name "racket-r5rs" %racket-version))) + "r5rs" "r5rs-doc" "r5rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r6rs") + (commit %racket-commit))) + (sha256 (base32 + "0b1ymzdp10r0flw2acbidjsh5ma1pm5hy54jss37sxf89z3xbvm4")) + (file-name (git-file-name "racket-r6rs" %racket-version))) + "r6rs" "r6rs-doc" "r6rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeapostrophe/racket-cheat") + (commit %racket-commit))) + (sha256 (base32 + "06wcj558rzkbl2bwkmikyspya9v1f4iwlzwnwxpkc33h2xapwabr")) + (file-name + (git-file-name "jeapostrophe-racket-cheat" %racket-version))) + ("racket-cheat" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racklog") + (commit %racket-commit))) + (sha256 (base32 + "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb")) + (file-name (git-file-name "racket-racklog" %racket-version))) + ("racklog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/rackunit") + (commit %racket-commit))) + (sha256 (base32 + "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p")) + (file-name (git-file-name "racket-rackunit" %racket-version))) + "rackunit" + "rackunit-doc" + "rackunit-gui" + "rackunit-lib" + "rackunit-plugin-lib" + "rackunit-typed" + "schemeunit" + "testing-util-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/readline") + (commit %racket-commit))) + (sha256 (base32 + "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn")) + (file-name (git-file-name "racket-readline" %racket-version))) + "readline" "readline-doc" "readline-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/realm") + (commit %racket-commit))) + (sha256 (base32 + "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi")) + (file-name (git-file-name "racket-realm" %racket-version))) + ("realm" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/redex") + (commit %racket-commit))) + (sha256 (base32 + "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f")) + (file-name (git-file-name "racket-redex" %racket-version))) + "redex" + "redex-benchmark" + "redex-doc" + "redex-examples" + "redex-gui-lib" + "redex-lib" + "redex-pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sasl") + (commit %racket-commit))) + (sha256 (base32 + "0ibh4wb4gn8pggx6gkv4vk4d6rwzn5nrvjibhvkzhaynf6lhb824")) + (file-name (git-file-name "racket-sasl" %racket-version))) + "sasl" "sasl-doc" "sasl-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scheme-lib") + (commit %racket-commit))) + (sha256 (base32 + "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x")) + (file-name (git-file-name "racket-scheme-lib" %racket-version))) + ("scheme-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scribble") + (commit %racket-commit))) + (sha256 (base32 + "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm")) + (file-name (git-file-name "racket-scribble" %racket-version))) + "scribble" + "scribble-doc" + "scribble-html-lib" + "scribble-lib" + "scribble-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/serialize-cstruct-lib") + (commit %racket-commit))) + (sha256 (base32 + "1rq3n1fa7ldjwx3lrh9ybhig7jlsw1crpzyklbzp3xqdw6jymfnz")) + (file-name + (git-file-name "racket-serialize-cstruct-lib" %racket-version))) + ("serialize-cstruct-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sgl") + (commit %racket-commit))) + (sha256 (base32 + "0nkymhdyjrwi5h199j4w5zh7y3x3ai42gsiwxzh0hy7yqrqqg9zv")) + (file-name (git-file-name "racket-sgl" %racket-version))) + ("sgl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/shell-completion") + (commit %racket-commit))) + (sha256 (base32 + "04m144gy2mp4fiq6rcbf12wjr8mws8k9scfhg9lc38vqppp4lxsj")) + (file-name + (git-file-name "racket-shell-completion" %racket-version))) + ("shell-completion" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/simple-tree-text-markup") + (commit %racket-commit))) + (sha256 (base32 + "0fyd9gfz6bnv0m1901wv5mnhc05rm8hw9i6ddrqx33hs6qsg2zqr")) + (file-name + (git-file-name "racket-simple-tree-text-markup" %racket-version))) + "simple-tree-text-markup" + "simple-tree-text-markup-doc" + "simple-tree-text-markup-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slatex") + (commit "47e1d3e3e33d826bc2b26f9e8998eb235b23a9a5"))) + (sha256 (base32 + "0pkm2isbbdk63slrbsxcql7rr0wdrw5kapw1xq4ps5k8dhlzv8x0")) + (file-name (git-file-name "racket-slatex" %racket-version))) + ("slatex" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slideshow") + (commit %racket-commit))) + (sha256 (base32 + "1znv1i2d0610hhy71q932xy7wka00q3q50in1xfnk8ibg7nzkagm")) + (file-name (git-file-name "racket-slideshow" %racket-version))) + "slideshow" "slideshow-doc" "slideshow-exe" "slideshow-lib" + "slideshow-plugin") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/snip") + (commit %racket-commit))) + (sha256 (base32 + "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj")) + (file-name (git-file-name "racket-snip" %racket-version))) + "snip" "snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/typed-racket") + (commit %racket-commit))) + (sha256 (base32 + "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv")) + (file-name (git-file-name "racket-typed-racket" %racket-version))) + "source-syntax" + "typed-racket" + "typed-racket-compatibility" + "typed-racket-doc" + "typed-racket-lib" + "typed-racket-more") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/srfi") + ;; Includes an FSDG fix: return to %racket-commit in 8.5. + ;; See . + (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) + (sha256 (base32 + "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) + ;; Use the relevant version for srfi-doc and srfi-lib, + ;; since we're using a newer commit than the v8.4 tag. + (file-name (git-file-name "racket-srfi" "1.1"))) + "srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/string-constants") + (commit %racket-commit))) + (sha256 (base32 + "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6")) + (file-name + (git-file-name "racket-string-constants" %racket-version))) + "string-constants" "string-constants-doc" "string-constants-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/swindle") + (commit %racket-commit))) + (sha256 (base32 + "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67")) + (file-name (git-file-name "racket-swindle" %racket-version))) + ("swindle" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/syntax-color") + (commit %racket-commit))) + (sha256 (base32 + "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp")) + (file-name (git-file-name "racket-syntax-color" %racket-version))) + "syntax-color" "syntax-color-doc" "syntax-color-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/trace") + (commit %racket-commit))) + (sha256 (base32 + "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia")) + (file-name (git-file-name "racket-trace" %racket-version))) + ("trace" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/unix-socket") + (commit %racket-commit))) + (sha256 (base32 + "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y")) + (file-name (git-file-name "racket-unix-socket" %racket-version))) + "unix-socket" "unix-socket-doc" "unix-socket-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/web-server") + (commit %racket-commit))) + (sha256 (base32 + "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn")) + (file-name (git-file-name "racket-web-server" %racket-version))) + "web-server" "web-server-doc" "web-server-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/wxme") + (commit %racket-commit))) + (sha256 (base32 + "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b")) + (file-name (git-file-name "racket-wxme" %racket-version))) + "wxme" "wxme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/xrepl") + (commit %racket-commit))) + (sha256 (base32 + "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3")) + (file-name (git-file-name "racket-xrepl" %racket-version))) + "xrepl" "xrepl-doc" "xrepl-lib"))))) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'configure 'unpack-packages - (let ((unpack (assoc-ref %standard-phases 'unpack))) - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out")) - (pkgs-dir (string-append prefix "/share/racket/pkgs"))) - (mkdir-p pkgs-dir) - (copy-recursively - "share/links.rktd" - (string-append prefix "/share/racket/links.rktd")) - (copy-recursively "share/pkgs" pkgs-dir) - ;; NOTE: unpack changes the working directory - (unpack #:source (assoc-ref (or native-inputs inputs) - "main-repo")) - (for-each (lambda (pkg) - (define dest (string-append pkgs-dir "/" pkg)) - (mkdir-p dest) - (copy-recursively (string-append "pkgs/" pkg) - dest)) - ',%main-repo-main-distribution-pkgs) - #t)))) - (replace 'configure - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out"))) - (apply invoke - (string-append racket "/bin/racket") - (assoc-ref inputs "extend-layer") - racket - prefix - (map - (lambda (lib) - (string-append (assoc-ref inputs lib) "/lib")) - '("cairo" - "fontconfig" - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))) - #t))) - (replace 'build - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) - "racket") - "/bin/racket") - "--config" - (string-append (assoc-ref outputs "out") - "/etc/racket") - "-l" - "raco" - "setup") - #t)) - (delete 'install)) - ;; we still don't have these: - #:tests? #f)) + (substitute-keyword-arguments (package-arguments racket-minimal) + ((#:make-flags _ '()) + #~`("main-distribution")) + ((#:configure-flags _ '()) + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit")))))))) (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -539,82 +1053,126 @@ (define dest (string-append pkgs-dir "/" pkg)) DrRacket IDE, libraries for GUI and web programming, and implementations of languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) - -(define extend-layer +(define make-installation-layer.rkt (scheme-file - "extend-layer.rkt" + "make-installation-layer.rkt" `(module - extend-layer racket/base + make-installation-layer racket/base (require racket/cmdline racket/match racket/file + racket/port racket/list racket/pretty) - (define config-file-pth - "etc/racket/config.rktd") (define (build-path-string . args) (path->string (apply build-path args))) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) - (command-line - #:args (parent-layer prefix . lib-dir*) - (let* ([config - (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) - (hash-set* - config - main-key - (build-path-string prefix pth) - search-key - (list* #f - (hash-ref config - main-key - (build-path-string parent-layer pth)) - (filter values (hash-ref config search-key null)))))] - [config - (hash-set config - 'apps-dir - (build-path-string prefix "share/applications"))] - [config - ;; place new foreign lib-search-dirs before old - ;; foreign dirs, but after Racket layers - (let-values - ([(rkt extra) - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - (hash-ref config 'lib-search-dirs))]) - (hash-set config + (define tethered? #f) + (define parent #f) + (define extra-foreign-lib-search-dirs '()) + (define-values [vm-dir prefix] + (command-line + #:once-each + [("--tethered") "create a tethered layer" + (set! tethered? #t)] + [("--parent") dir "path of parent layer, if any" + (set! parent dir)] + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (vm-dir prefix) + (values vm-dir prefix))) + (let* ([config + (for/fold + ([config (file->value + (if parent + (build-path parent "etc/racket/config.rktd") + (build-path vm-dir "etc/config.rktd")))]) + ([spec + (in-list + '((lib-dir lib-search-dirs "lib/racket" "lib") + (share-dir share-search-dirs "share/racket" "share") + (links-file links-search-files + "lib/racket/links.rktd" + "share/links.rktd") + (pkgs-dir pkgs-search-dirs "lib/racket/pkgs" "share/pkgs") + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(bin-dir bin-search-dirs "bin" "bin") + (bin-dir bin-search-dirs + "lib/racket/bogus-untethered-bin" + "bin") + (man-dir man-search-dirs "share/man" "share/man") + (doc-dir doc-search-dirs "share/doc/racket" "doc") + (include-dir include-search-dirs + "include/racket" + "include")))]) + (match-define (list main-key search-key pth vm-pth) spec) + (hash-set* + config + main-key + (build-path-string prefix pth) + search-key + (list* #f + (hash-ref config + main-key + (lambda () + (if parent + (build-path-string parent pth) + (build-path-string vm-dir vm-pth)))) + (filter values (hash-ref config search-key null)))))] + [config + (hash-update config 'lib-search-dirs - (append rkt - lib-dir* - extra)))] - [bin-dir - (hash-ref config 'bin-dir)] - [config - (hash-set* config - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) - (make-parent-directory* new-config-pth) - (call-with-output-file* - new-config-pth - (lambda (out) - (pretty-write config out)))))))) + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] + [config + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaroung Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] + [config + (cond + [tethered? + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(define bin-dir (hash-ref config 'bin-dir)) + (define bin-dir (build-path-string prefix "bin")) + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [else + config])]) + (define new-config-pth + (build-path prefix "etc/racket/config.rktd")) + (make-parent-directory* new-config-pth) + (call-with-output-file* + new-config-pth + (lambda (out) + (pretty-write config out))))))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 04:03:38 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 09:03:38 +0000 Received: from localhost ([127.0.0.1]:59338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLi81-0006FJ-H2 for submit@debbugs.gnu.org; Sun, 20 Feb 2022 04:03:37 -0500 Received: from mail-ej1-f67.google.com ([209.85.218.67]:42817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLi7y-0006F1-G6 for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 04:03:35 -0500 Received: by mail-ej1-f67.google.com with SMTP id hw13so25351360ejc.9 for <53878@debbugs.gnu.org>; Sun, 20 Feb 2022 01:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=V+DRCVhjZLHZ6eoXqfo1Cuu7Grqfo+3gkUCI1b0wpRU=; b=Xww/5KhEayyjIDSF10JJaTEgYtmYVhu2zyQCwcy1WRZXGn+9TaGlYu5fnjtVEcBRh6 EZwsHgCWtB0hpuGbx2uzBahw0xXi/zH3YhHuP9hiQM7ZfU/DOFgVZhXrsUgKuOfMKmVL 8lylMPWSYZqQxv7k93eyHMDbO5HpMN1EfZdYJPi/r3EKTEXLpfwmsmNO0BFdsM86rbSF LlvIn2h61XfP3OYI916HXVQb4w74qaXUjWC2MLvXge7TQSz3CvCoH1mW3Smj1LAWhiQd zxPLvgKCqjNxUTSYPVU/KW/9mdr6cNvfdl73VPkliuLWxh618iI43ltbUd9H1rHhpp2c j8Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=V+DRCVhjZLHZ6eoXqfo1Cuu7Grqfo+3gkUCI1b0wpRU=; b=0mSHpSeFR19rtpZJLgLBji3dvTj/UyyOrtYd8WuPQeUUckYZEqc2gaMIiwpgbPQC4h DBsEgbcnqxv1dbbHJFcrLuMWu9e7wNQ1gMm672mIEoEFHWB1iZzd1yndYVoeqUDH5s/0 GdYuqicfGF+DV5qPUHhLKIzmL+5qExsAf+Oa5544z2y3whU5yJrdAlqwyqLyOahBulYe 1nJb/cm6SfDboN0ASQvN9CVhpp2zqwL9TCWWOFBKQcxvtHSX5MbAX77q3PdTcMvyknXf JnVKBpjgzPYMrUF42WZ2e9zn5ok715AMz/vl7O6Y35sHpWXAJcPj7D3azOSgZXC/pCzj /ZJg== X-Gm-Message-State: AOAM531gGKE8DFOiGPDRYHX/Bsz7IbCObMiuAgk3+n/wjFxLGj0kufXa Oli0EGKHIwky29W+xgBYMCA= X-Google-Smtp-Source: ABdhPJx9HCI9oUODYOj5AEZpGlyCykbdTVkzo5mAahBjKdrjO5/J9IdHZNitaRLfQuUPwvM+UNcj4A== X-Received: by 2002:a17:907:6218:b0:6d1:c74:1507 with SMTP id ms24-20020a170907621800b006d10c741507mr4098612ejc.670.1645347808354; Sun, 20 Feb 2022 01:03:28 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id q12sm6745510edv.99.2022.02.20.01.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 01:03:27 -0800 (PST) Message-ID: Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. From: Liliana Marie Prikler To: Philip McGrath Date: Sun, 20 Feb 2022 10:03:26 +0100 In-Reply-To: <2223439.vW7IG60toP@bastet> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220219064228.246917-10-philip@philipmcgrath.com> <3eac7271a203816232ae5e298bfbed65f4942bf3.camel@gmail.com> <2223439.vW7IG60toP@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: 53878@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Am Samstag, dem 19.02.2022 um 17:27 -0500 schrieb Philip McGrath: > Hi, > > On Saturday, February 19, 2022 3:46:47 PM EST you wrote: > > Am Samstag, dem 19.02.2022 um 01:42 -0500 schrieb Philip McGrath: > > > * gnu/packages/patches/racket-enable-scheme-backport.patch: New > > > patch. > > > * gnu/local.mk (dist_patch_DATA): Add it. > > > * gnu/packages/chez-and-racket-bootstrap.scm (unbundle-chez- > > > submodules, > > > %racket-version, %racket-origin, racket-vm-cgc): New variables. > > > (chez-scheme)[source]: Use 'unbundle-chez-submodules'. > > > > Something weird happened to me just now trying to build this > > series. While compiling emacs-xyz, an error was raised regarding > > %racket-version not existing and and import being missing.  > > Assuming that you didn't mess up an include somewhere, there could > > be a cycle meaning we'd have to pass the version and origin by > > function as I originally said in my reply to v2. > > > > I'll clean up my work tree and try to reapply it, but that will > > take some time.  Since you mentioned re-exports causing issues, I'd > > like to ask if you've made a similar experience, but the results > > got somehow hidden after the right incantations. > > I haven't seen errors from emacs-xyz, but I have gotten errors about > %racket-version not existing: at the time I thought it was just a > problem with incremental rebuilds while moving back and forward > through history, but, having just refreshed my memory on more details > of the cyclic issues, I think it may be related. I'll send another > email presently with details once I've gathered references. > > For now, I found that `rm gnu/packages/*.go` was enough to get `make` > to succeed again. As you said, the clean build succeeds, but I still think we should do something about incremental rebuilds. So here's my suggestion: Inside chez-and-racket-bootstrap, define (make-) functions for the following: - chez-bootstrap-bootfiles, chez-for-racket-bootstrap-bootfiles: Taking version and origin. - racket-vm-cgc: Taking version and origin. - racket-vm-bc: Taking racket-vm-cgc. - racket-vm-cs: Taking racket-vm-bc. Inside chez, define chez-scheme, as well as non-bootstrapped versions of stex et al. Also define make-chez-scheme-for-racket, taking version and origin as parameter. Finally, define chez-scheme-for-system, which uses (resolve-interface '(gnu packages racket)) to get racket's version and origin. Inside racket, define %racket-version, %racket-origin, racket-minimal and racket. It'd also be good if you made local definitions (define racket-vm-cgc (make-racket-vm-cgc %racket-version %racket- origin)) (define racket-vm-bc (make-racket-vm-bc racket-vm-cgc)) ... in this file. With this split, it should be possible to do incremental builds without stuff breaking. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 05:16:21 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 10:16:21 +0000 Received: from localhost ([127.0.0.1]:59402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLjGI-00088w-Mc for submit@debbugs.gnu.org; Sun, 20 Feb 2022 05:16:21 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:33371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLjGG-00088h-U7 for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 05:16:13 -0500 Received: by mail-ed1-f66.google.com with SMTP id s14so6086619edw.0 for <53878@debbugs.gnu.org>; Sun, 20 Feb 2022 02:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=215CgoyXIbSXVG7Cm/sa/Drp0lz5lncSk/mJKN+eRk0=; b=WyoHFkiyJKVWZ+t5IO6Na8je+zqQmo0TfTTq243Oa1pQ7FHPuvCeQixDt7vl01jPQt gJA8m09+WluCedA3+wfOkiSFg0VDpidupLNkCZ1Q86LSmAU0eGz2ZOBRahUnYgd4+rkj SMAqX2zknsxLZWQ/7pdIKx3CFaGpJxVhwZRvaROEtsAXig6J8JSSYM/cURfOdBQYeGyE 8jwVrvh1sRGtTShx/zudWzEPn34iJw5Zr1K2Ec30nKN+o+xWJpXzo0uuwFfdPg/ku8ze 3udGGGGAW/PPEprGcToKHfKz+VkGdKqJ/XbAlm5z/RaTzqiLZd/GeWK8YXIRfHBxarY1 PJ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=215CgoyXIbSXVG7Cm/sa/Drp0lz5lncSk/mJKN+eRk0=; b=UXh50DcRGCzku8SDBGqmCHb47AwYAhSc82KeRCOVPsigopSfzGFqwHmeoPSg2u6OsP EfEnRxvKkJazA5D3tvanM5Q/m7lnEne6bTEE0P44FK4adSrEjNjQJtTP1XkoUnAzKrFx Bs1+PWZU1uJg20OtP9umoqfxQHbNZMbrXjXIbyOOw6cV4F/od1bFFcftu3m81XA5EPb6 XlYWcBUeMIynYN9Gs7A8vnwxRnQNw8Oz7jkAZLd2wpNkf6QyEhn/CSO5jWO+gL1yI5qJ lLZ9B4kPhb7nlf+DIepTrSfR7J8S+RwVFyafwjBZnXDQHOFj+7ciaLl/TEN9MA3oJcjA PTcQ== X-Gm-Message-State: AOAM531aRdDN9u1y0vFRX3AHUBGG9uHTrL4b7CvoYtHqL+qNLOsDmlUy QNVeOdHFesbU7plwqdFb/LY= X-Google-Smtp-Source: ABdhPJxrMp3m6kIcfzcUtfnZhDsP9WBzGWkvJkbXg2523+fNTJJFztyleiHpxMc5GBcmX+lLvThY/w== X-Received: by 2002:a50:9f8e:0:b0:410:8c:5dcc with SMTP id c14-20020a509f8e000000b00410008c5dccmr16185967edf.94.1645352166695; Sun, 20 Feb 2022 02:16:06 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id s2sm4051390ejs.113.2022.02.20.02.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 02:16:06 -0800 (PST) Message-ID: <39bfc6f557bf2ef03ce22067d5c73adcbb67b167.camel@gmail.com> Subject: Re: [PATCH v4 15/15] gnu: racket: Update to 8.4. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sun, 20 Feb 2022 11:16:04 +0100 In-Reply-To: <20220220060610.178131-16-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> <20220220060610.178131-16-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Am Sonntag, dem 20.02.2022 um 01:06 -0500 schrieb Philip McGrath: > * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: > New > file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gn [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.66 listed in wl.mailspike.net] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , zimoun , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) Hi, Am Sonntag, dem 20.02.2022 um 01:06 -0500 schrieb Philip McGrath: > * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: > New > file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/chez-and-racket-bootstrap.scm (racket-vm-for-system): > New > procedure. > * gnu/packages/racket.scm (racket-minimal, racket): Update to 8.4. > Rewrite to use 'racket-vm-for-system', label-less inputs, G- > expressions, > and Git origins for main-distribution packages. > --- >  gnu/local.mk                                  |    3 +- >  gnu/packages/chez-and-racket-bootstrap.scm    |   15 +- >  ...acket-gui-tethered-launcher-backport.patch |   26 + >  gnu/packages/racket.scm                       | 1596 +++++++++++---- > -- >  4 files changed, 1118 insertions(+), 522 deletions(-) >  create mode 100644 gnu/packages/patches/racket-gui-tethered- > launcher-backport.patch > > diff --git a/gnu/local.mk b/gnu/local.mk > index 5fcbe3a391..2fb4440eee 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -41,7 +41,7 @@ >  # Copyright © 2020 Vinicius Monego >  # Copyright © 2021 Björn Höfling >  # Copyright © 2021 Greg Hogan > -# Copyright © 2021 Philip McGrath > +# Copyright © 2021, 2022 Philip McGrath >  # Copyright © 2021 Arun Isaac >  # Copyright © 2021 Sharlatan Hellseher >  # Copyright © 2021 Dmitry Polyakov > @@ -1751,6 +1751,7 @@ dist_patch_DATA > =                                         \ >    %D%/packages/patches/rpcbind-CVE-2017-8779.patch             \ >    %D%/packages/patches/rtags-separate- > rct.patch                        \ >    %D%/packages/patches/racket-enable-scheme-backport.patch     \ > +  %D%/packages/patches/racket-gui-tethered-launcher- > backport.patch     \ >    %D%/packages/patches/racket-minimal-sh-via-rktio.patch       \ >    %D%/packages/patches/remake-impure- > dirs.patch                        \ >    %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ > diff --git a/gnu/packages/chez-and-racket-bootstrap.scm > b/gnu/packages/chez-and-racket-bootstrap.scm > index e837d49c63..b779099fb3 100644 > --- a/gnu/packages/chez-and-racket-bootstrap.scm > +++ b/gnu/packages/chez-and-racket-bootstrap.scm > @@ -46,7 +46,8 @@ (define-module (gnu packages chez-and-racket- > bootstrap) >    #:use-module (gnu packages xorg) >    #:use-module ((guix licenses) >                  #:prefix license:) Small note, #:prefix license: should be on the same line as #:use- module. > -(define %racket-version "8.4") > +(define %racket-version "8.4") ; MUST match "racket.scm" > +;; The definition of %racket-version is duplicated to avoid an > import cycle: > +;; see . >  (define %chez-scheme-for-racket-version "9.5.7.3") > [...] > +(define %racket-version "8.4") ; MUST match "chez-and-racket- > bootstrap.scm" > +;; The definition of %racket-version is duplicated to avoid an > import cycle: > +;; see . > +(define %racket-commit > +  (string-append "v" %racket-version)) That works, but it's not really nice. I did send my mail w.r.t. making the bootstrap packages procedures that take racket-version and origin as arguments before reading this mail, but I think my comment still applies mostly. WDYT? > +(define (extract-package-source origin spec) > +  "Extract the source for a Racket package specified by SPEC from > ORIGIN into > +a new file-like object.  In the resulting file-like object, the > package source > +will be in the directory \"/share/racket/pkgs/NAME/\", where NAME is > the Racket > +name for the package. > + > +SPEC is a list of the form: > + > +  (NAME PATH) > + > +where PATH is the path to the package source relative to ORIGIN--- > possibly > +`\".\"`.  As a special case, SPEC may also be given a string, which > is > +equivalent to: > + > +  (NAME NAME) > + > +Examples: Would it make sense to use this procedure for our bootstrap packages already? (In particular for bootfiles or extracting chez-scheme from the racket source). Regarding the big racket package, the recipe currently looks a little nicer in that it no longer overrides `build', but I think we could still do a union-build with #:symlink copy-recursively if the full racket is just racket plus a bunch of packages on top. This would have the benefit that we could declare each of them as a package. Not sure if this is something we ought to address here or in a separate patch set, though. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 09:09:51 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 14:09:51 +0000 Received: from localhost ([127.0.0.1]:59696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLmuN-0002ja-Ib for submit@debbugs.gnu.org; Sun, 20 Feb 2022 09:09:51 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:46491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLmuM-0002jM-MU for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 09:09:51 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 9A01F58032F; Sun, 20 Feb 2022 09:09:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 20 Feb 2022 09:09:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=DuxIwogsYh5sFl M7/fAhfAjm45ynDA49Xd7Q+kxRWXs=; b=criDc9nEZ6vdv+5LsiRobKh/8p6tJH UeRATJrd7mGebcKb/wF8+sbYAU3JT03E/1Ys4ZarC/Q6SBJndc6OKt4GhNf6lwI4 Cr0WFDqjJ/km3uVGrKgmzZCqFD/XVTE0Ipft93Xd36exBIhKqPBSpIEvC1JcFpYR ABl6rUp3n/oCJdVGbok1dM4iU1Xb2az1mGa6CdeKyi7CfflqRsmaMX2ltjzV6Y49 ik5PnrlzwHojBUppLG339L1JhSIKkQJnaxzltIwulTMChp8hwEXvwbwySl7xxZY2 vqo8cyNozFs9EKA+030dSpv220YJvHACm1d1XYRExy9MhNyKxVmrlVEg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=DuxIwogsYh5sFlM7/ fAhfAjm45ynDA49Xd7Q+kxRWXs=; b=EzHflZvqNddupp7OVEASiDMthsDLhnhET aVI8kydeb+lUruMPD5+bTzGTS32mJMZVL01uT3nKHAsPr93mY62KUcX9l29YGk/4 iT+t3e37Ym8syLFJ6LF3L0udnrU99hoqeWQmEidy2uYKD+RV7ho67ObmlGruFpgf Yt+7+jID11zTebb1QmYeKqizi4JgfsgTbXyoSfsXzVQrqbAdDdklPucVSep0EnV1 6tuT7wj2XUDpSaCteI28gW830gtY74z0QmeGo/5UykjF8AV+1GyMRvZ/Csi2I2Sr i1XGEiSUFeZmAx9pH4wTsE/GMpfZc2CgZoheLImmoFSTdUCrFZlQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeeggdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhephfeileeggfehvdfhtddvgeekffffiefhfeejgeegtdekveeu geekudekkeeggfeunecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhm tghgrhgrthhhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Feb 2022 09:09:44 -0500 (EST) From: Philip McGrath To: Liliana Marie Prikler Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sun, 20 Feb 2022 09:09:36 -0500 Message-ID: <1853902.IiyMIqa0Cy@bastet> In-Reply-To: References: <20220208151316.1897345-1-philip@philipmcgrath.com> <2223439.vW7IG60toP@bastet> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart14840674.9saSdijX2C"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: 53878@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart14840674.9saSdijX2C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: Liliana Marie Prikler Cc: 53878@debbugs.gnu.org Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sun, 20 Feb 2022 09:09:36 -0500 Message-ID: <1853902.IiyMIqa0Cy@bastet> In-Reply-To: References: <20220208151316.1897345-1-philip@philipmcgrath.com> <2223439.vW7IG60toP@bastet> Hi, On Sunday, February 20, 2022 4:03:26 AM EST Liliana Marie Prikler wrote: > So here's my suggestion: >=20 > Inside chez-and-racket-bootstrap, define (make-) functions for > the following: > - chez-bootstrap-bootfiles, chez-for-racket-bootstrap-bootfiles: > Taking version and origin. > - racket-vm-cgc: Taking version and origin. > - racket-vm-bc: Taking racket-vm-cgc. > - racket-vm-cs: Taking racket-vm-bc. >=20 > Inside chez, define chez-scheme, as well as non-bootstrapped versions > of stex et al. > Also define make-chez-scheme-for-racket, taking version and origin as > parameter. Finally, define chez-scheme-for-system, which uses > (resolve-interface '(gnu packages racket)) to get racket's version and > origin. >=20 > Inside racket, define %racket-version, %racket-origin, racket-minimal > and racket. It'd also be good if you made local definitions > (define racket-vm-cgc (make-racket-vm-cgc %racket-version %racket- > origin)) > (define racket-vm-bc (make-racket-vm-bc racket-vm-cgc)) > ... > in this file. My understanding=E2=80=94which is not very good!=E2=80=94is that this would= have the same=20 problem we do currently. It would be analogous to my example from : > But Ludo=E2=80=99's examples show that's wrong: those uses of `chez sche= me` are in > what the "expansion contexts" model would call "expression contexts". >=20 > Instead, I think rule =E2=84=96 2 prohibits any reference to a variable i= mported > from > another (gnu packages ...) module that will be evaluated when the (gnu > packages ...) modules are=E2=80=94visited? instantiated? [2][3]=E2=80=94I= DK when exactly, > but, for practical purposes, any variable reference that is not underneath > a lambda abstraction. >=20 > If that's right, IIUC, it would mean that: > > (define chez-scheme-for-racket > (make-chez-scheme-for-racket ...)) >=20 > would also be prohibited. >=20 > On the other hand, uses of `(racket-vm-for-system)` and `(chez-scheme-for- > system)` in an `imports` field should still be fine, thanks to the implic= it > thunks. The reference to `make-chez-scheme-for-racket` or `make-racket-vm-cs` or an= y=20 such procedure defined in "chez-and-racket-bootstrap.scm" would be evaluate= d=20 when "racket.scm" is instantiated=E2=80=94or whenever precisely it is that = causes the=20 problem. =2DPhilip --nextPart14840674.9saSdijX2C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmISS6AACgkQygNjjfo/ HHo+SQ/+PyAtGhkcL8bhTk8Mn+RPL2I1OoE5mQq2yBMgvNsFOJ2HCLeIpR6Lf8n4 eXEH/ngp4RTELnziyN3WiYU9k5n5XzVAWN3XKNpWB2mVtkf8ACA5oTer/NIb0GTG eG5QUThL8P/zagZyW811HLFwuOqVVSKGeVK/dH/n49woazPFa179nmrfs0IzUL0+ A2I3jQ8wOJC5jIvP0XNmLpMw1/C7j+6JfR1ZZgdh9958usel8Y3seehECnjMogIL mnsqm87Jet9DFi4mOWiWjJz+wM19ueYzFPF4BfZatOzn3qxWls8fonUb2/T3DkLL iFewxB3lGfK9ghSMb8YZ545AWZ5xFE5IwQMabpRVjylmJRomQbf08PM02p5SjwRO t7+0R1xphT4XSpxo25kfM0/HButfkHuG/iVD6huPidozMKw0cJjwMPB9B1rzuAHU H+cYwHa6LydKgcVRssiE1QJYoH+kYAK7a2Zj1F35wxXOGhsbduceO6MycZWuqlju qABpSac9BCvIngpMDNsIekcpO2LtxAWrbC1KUAQtQMJhECfxVzXPAA32GSRuTped iAkz7tXqDzss1/l7/2V2e1DfpEtdYkZ+JH1CiasOhGRJpofa3295lLC3WuvQxQ5W 9nZ7E4zXlDyDjZx6xpQc0k2rOpJ6Gh/hOh/9rgI4IEI6MHnByEg= =9hf2 -----END PGP SIGNATURE----- --nextPart14840674.9saSdijX2C-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 09:10:10 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 14:10:11 +0000 Received: from localhost ([127.0.0.1]:59701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLmuV-0002jw-To for submit@debbugs.gnu.org; Sun, 20 Feb 2022 09:10:10 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:45479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLmuO-0002jP-LK for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 09:09:53 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 9CECE580338; Sun, 20 Feb 2022 09:09:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 20 Feb 2022 09:09:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=HWkWDCMm1m4mtW BbrYPqHKRwutKhPTYSZN/U3LDQo0U=; b=nKqofT+EbZXsFpf+0i8ZExJbr/dSo3 IM4GIB0G9jSNBsRF6f/oRPOah6U07tzOq80VovHVnfQ8lLOotYoz8PNq501/foGN m52j0Q3XmkR7PWd1dcuiuUJuya+zNPMlXzFEJW8EaXyyJjDdItoPQbul3PJdXXSh xQi0XmZr8WcmjZzy3iqtE6gL26XhfKKPhyaa0xH9eOtlgeWRljy9JlKD1k7dPbwX HRuhkgJ1LoSmrrKamYSoVupKHeC1RnGPXlEkazK2oMzQwFI5Dk4l+HFs+VUr2kHp SMhAVt6RrlUyYVbcaP3+o4uvUzOaMdKJXJyZxTGFAnopR/J26ogODhzQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=HWkWDCMm1m4mtWBbr YPqHKRwutKhPTYSZN/U3LDQo0U=; b=IhKmSr/aTeP0pHtitG0O/YiStHvs/lQ9a rpWvp+TFMskS30Lw8cYbx9Gf7qIBdK+R/RRAx15SP/Vjpv8oJ8XQdKR5ei9XL9yz fyAI/iCDEdPpfBvWeWWnFqubJaqataFhiXQ0PJDz+AU6bdDNKf94pkXLvL8FYd3Z r5oSMwJxaDOPyU6fb6THLyvRnmUNnzsGsjkzQ8oqKT9hbGtFBOIzcG6ZW/sXyUUw Xkb5yKNWeBXvQPGByr/1ivYl1U+EBJhMsG1Vq+8Sp0t8m1DRMYX9dbEN8hvH20FS 4KueLQqeLtug2tmg6GKWj8YnOvkyo8LTpcq0BwWGXIti4/hUXF2Yg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeeggdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhepleejffegjeetieeuleelgfekuedtgfdvjedtkeefueduudfh geeukeevieeuiedunecuffhomhgrihhnpehgnhhurdhorhhgpdhrrggtkhgvthdqlhgrnh hgrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Feb 2022 09:09:46 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= , Liliana Marie Prikler Subject: Re: [PATCH v4 15/15] gnu: racket: Update to 8.4. Date: Sun, 20 Feb 2022 09:09:45 -0500 Message-ID: <2466017.hpQdrOUuIC@bastet> In-Reply-To: <39bfc6f557bf2ef03ce22067d5c73adcbb67b167.camel@gmail.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-16-philip@philipmcgrath.com> <39bfc6f557bf2ef03ce22067d5c73adcbb67b167.camel@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2066579.fovGzxi7Es"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , zimoun , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart2066579.fovGzxi7Es Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?ISO-8859-1?Q?Court=E8s?= , Liliana Marie Prikler Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun Subject: Re: [PATCH v4 15/15] gnu: racket: Update to 8.4. Date: Sun, 20 Feb 2022 09:09:45 -0500 Message-ID: <2466017.hpQdrOUuIC@bastet> In-Reply-To: <39bfc6f557bf2ef03ce22067d5c73adcbb67b167.camel@gmail.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-16-philip@philipmcgrath.com> <39bfc6f557bf2ef03ce22067d5c73adcbb67b167.camel@gmail.com> On Sunday, February 20, 2022 5:16:04 AM EST Liliana Marie Prikler wrote: > > #:use-module (gnu packages xorg) > > #:use-module ((guix licenses) > > #:prefix license:) >=20 > Small note, #:prefix license: should be on the same line as #:use- > module. >=20 Ok. > > -(define %racket-version "8.4") > > +(define %racket-version "8.4") ; MUST match "racket.scm" > > +;; The definition of %racket-version is duplicated to avoid an > > import cycle: > > +;; see . > > (define %chez-scheme-for-racket-version "9.5.7.3") > > [...] > > +(define %racket-version "8.4") ; MUST match "chez-and-racket- > > bootstrap.scm" > > +;; The definition of %racket-version is duplicated to avoid an > > import cycle: > > +;; see . > > +(define %racket-commit > > + (string-append "v" %racket-version)) >=20 > That works, but it's not really nice. I did send my mail w.r.t. making > the bootstrap packages procedures that take racket-version and origin > as arguments before reading this mail, but I think my comment still > applies mostly. WDYT? >=20 As I said, I think that would cause an import cycle. This seems like a very= =20 subtle and confusing issue! I haven't heard anyone but Ludo=E2=80=99 expres= s much=20 confidence in their understanding of how this works=E2=80=94certainly I don= 't feel=20 much! > > +(define (extract-package-source origin spec) > > + "Extract the source for a Racket package specified by SPEC from > > ORIGIN into > > +a new file-like object. In the resulting file-like object, the > > package source > > +will be in the directory \"/share/racket/pkgs/NAME/\", where NAME is > > the Racket > > +name for the package. > > + > > +SPEC is a list of the form: > > + > > + (NAME PATH) > > + > > +where PATH is the path to the package source relative to ORIGIN--- > > possibly > > +`\".\"`. As a special case, SPEC may also be given a string, which > > is > > +equivalent to: > > + > > + (NAME NAME) > > + >=20 > > +Examples: > Would it make sense to use this procedure for our bootstrap packages > already? (In particular for bootfiles or extracting chez-scheme from > the racket source). >=20 Well, for one thing, trying to use this package in "chez-and-racket- bootstrap.scm" seems like it could get us into trouble with import cycles=20 again. I think it will be less painful if we can have at least "chez-and- racket-bootstrap.scm", "chez.scm", and "racket.scm" form a DAG. Also, this function was really intended to handle the quite common `?path=3D=E2=80=B9path=E2=80=BA` case for Racket Git "package sources"[1]. = Eventually, it should=20 be part of a `racket-build-system`. >=20 > Regarding the big racket package, the recipe currently looks a little > nicer in that it no longer overrides `build', but I think we could > still do a union-build with #:symlink copy-recursively if the full > racket is just racket plus a bunch of packages on top. This would have > the benefit that we could declare each of them as a package. Not sure > if this is something we ought to address here or in a separate patch > set, though. Well, I certainly do want to declare each of them as a package! But I don't= =20 know what the benefit would be for doing so before its possible for a Guix = user=20 to usefully, say, install one. Maybe you know this, but installing a Racket package isn't just a matter of= =20 putting a directory in the right place and setting a search path. Most=20 obviously, it has to be compiled, and it would be most useful to explicitly= =20 generate "built packages"[2] separately from installing them into a layer.= =20 Installation into a layer potentially involves generating collection links= =20 files, indexing documentation cross-reference information, moving man pages= or=20 other kinds of files, creating launchers like the `drracket` command, and=20 potentially various other steps: indeed, collections (not just packages) ca= n=20 specify arbitrary functions to be invoked by `raco setup` at pre-install,=20 install, or post-install time. Creating a "config-tethered" layer=E2=80=94t= he kind we'd=20 want to install into a Guix profile, as opposed to a sparse intermediate la= yer=E2=80=94 also creates new `racket` and other executables in the layer's "bin" direct= ory=20 that exec the `racket` from the VM layer while propagating information abou= t=20 the layers that have been installed. Anyway, the packaging for racket@8.4 should be less of a hack than before=20 (which was better than when we used to duplicate racket-minimal, VM and all= ),=20 but this is all still fundamentally a hack, and I'd rather spend my effort= =20 trying to do the right thing, rather than overly fine-tuning the details of= the=20 temporary workarounds. =2DPhilip [1]: https://docs.racket-lang.org/pkg/ Package_Concepts.html#%28part._concept~3asource%29 [2]: https://docs.racket-lang.org/pkg/strip.html --nextPart2066579.fovGzxi7Es Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmISS6kACgkQygNjjfo/ HHrYzRAAlL83d8yxYruFEbC8zVBfevket1To9GrpM4WstkluAbxpIV9rEDrFNFBF QoYPfOpHl9PeX4ICP9rUY6EFQFMhD3Nld9XXQMu7G4PuEybt93PBRtza3SmqB8aX dF/oyNnxt9fc5fkwxoHwtlSO16DxpzluVjQ40SoUtpJbzh250vf1j6oN0wVmwx4k /mbjWjjZU2rludNJKET0YtT9FVzVcYZ8vJ29hiKmNLcmDk25xNdXIEcyq0TJWzTf nbnMGhQOM1z32Uu/FF+8vSY51Ruzp35kZ04sY3SBL8mfd1jfvXU5xUso8mcMOmPu oHoDnlyL1UE5eTemwYhIcDkbS0iWQRTPT+MVz88HnRw39nyMOGLg1H3u3GAOFJzq BYtkrieWATiY/q09D1EkNU9w7ar3adSBkV1bQ5AQTkWXK+isHO7jdpnKV36+9X4p TRv1h2PolyqVA5DZ0VLlrNBZuhhUm0hdNAI+INnFwGBDCuphxtLSwgksM/zMB6lG xjLaRW2PxnmTNt0uiUGrf7gK2cVu8XZFN3eEqVlBA5eGENEfpf+bIepljVbb8orO wsEWzNvePCuN/6gcREy2V0IqyWMOih2cjto/SdiR8FkA2vIxdcsCblKCyVs443UG 8Se71ILBostG3vHrO6Pz8JG62Ay6P/g6Iekx6v4FuNoUfeH2bq0= =JlQ7 -----END PGP SIGNATURE----- --nextPart2066579.fovGzxi7Es-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 11:48:15 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 16:48:15 +0000 Received: from localhost ([127.0.0.1]:33622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLpNf-0007m3-CM for submit@debbugs.gnu.org; Sun, 20 Feb 2022 11:48:15 -0500 Received: from mail-ej1-f66.google.com ([209.85.218.66]:33436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLpNd-0007lr-Ev for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 11:48:14 -0500 Received: by mail-ej1-f66.google.com with SMTP id vz16so27283087ejb.0 for <53878@debbugs.gnu.org>; Sun, 20 Feb 2022 08:48:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=m7JdUyR5s59ePg5zSq/94bqd6LSYR1YiK7wyhjd5P1k=; b=LJhLhkOlAwAeZ3TLBDDRGl9C2MktiZU7bHOu4iHJiVOB70A77uYB8kaJ9mX9iqDa9X psksxPxyEG+verLwx1vsUKtShWT0VCwuJz0gy27rbfYhPJMUZPAqCcds/M7i3ZfPNCsh S3sxZA/dQirHSJb2OAjQao062ia6jZpF6DiOA60XyREaVKVKeqR2bj8pOsfDudaIifuX 6B2ewrwbTgEmEIU2udo3kbisB1TM5tJEsI0gpg8X7xE6jTZCKeHTTxt/rFNMwuuh3ZyL CqV/aKCVU63suVH5suJDq4cKu+eINrXlsp0fc30Kb0CiB84wXJjuvjH2cPzl5x+vrT6p clyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=m7JdUyR5s59ePg5zSq/94bqd6LSYR1YiK7wyhjd5P1k=; b=3+s/iUCTQjClE4T1SSidq1ZH3hOnCVFyiJ1oD3C2mraR5bE+VDrVsTUkryA/USNEGy TDQc40LxWxvAxpQrJubKOVjaVeoZQpGYrXMGlxsCM4AwbnEg3KDZg6MMb9db2615aM87 FXi9+GR5LcvARMT9egFmAdYg0hXix1knnuFIr4wkPCCqRPs5OIvGX3/Ivby4mvUWmNpL Ljt+M1DcpwJsKjXAlNxisT3VOQRSFgfK0kwBFcKjGFf84oVMhB3Eoy5C1bi11Nf8L661 uIIBrcv2UFTcTA8G6rbWuZdWaNsuGglrmH5xGhW7/CxuWbQLijT3LrNm0J3mk92ItLaz cwcA== X-Gm-Message-State: AOAM533XU9WnlNy5SoTn6NkgLrQ4PaxSb0kGgZkU0Pk39ri7YVYKFs67 rGMkfUFtOV/U8EBSDGvtsUo= X-Google-Smtp-Source: ABdhPJx+K8AxhE3+fWsvrmrlk6ej04n3MiRwqyzCcePi3H3ZEyMwZAswcbamX98DxpBgOQISOtey+g== X-Received: by 2002:a17:906:bcda:b0:6b8:6809:59fa with SMTP id lw26-20020a170906bcda00b006b8680959famr13024752ejb.359.1645375687296; Sun, 20 Feb 2022 08:48:07 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id k20sm919335ejx.152.2022.02.20.08.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 08:48:06 -0800 (PST) Message-ID: Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. From: Liliana Marie Prikler To: Philip McGrath Date: Sun, 20 Feb 2022 17:48:01 +0100 In-Reply-To: <1853902.IiyMIqa0Cy@bastet> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <2223439.vW7IG60toP@bastet> <1853902.IiyMIqa0Cy@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: 53878@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Am Sonntag, dem 20.02.2022 um 09:09 -0500 schrieb Philip McGrath: > Hi, > > On Sunday, February 20, 2022 4:03:26 AM EST Liliana Marie Prikler > wrote: > > So here's my suggestion: > > > > Inside chez-and-racket-bootstrap, define (make-) functions > > for > > the following: > > - chez-bootstrap-bootfiles, chez-for-racket-bootstrap-bootfiles: > >   Taking version and origin. > > - racket-vm-cgc: Taking version and origin. > > - racket-vm-bc: Taking racket-vm-cgc. > > - racket-vm-cs: Taking racket-vm-bc. > > > > Inside chez, define chez-scheme, as well as non-bootstrapped > > versions of stex et al. Also define make-chez-scheme-for-racket, > > taking version and origin as parameter.  Finally, define chez- > > scheme-for-system, which uses (resolve-interface '(gnu packages > > racket)) to get racket's version and > > origin. > > > > Inside racket, define %racket-version, %racket-origin, racket- > > minimal > > and racket.  It'd also be good if you made local definitions > > (define racket-vm-cgc (make-racket-vm-cgc %racket-version %racket- > > origin)) > > (define racket-vm-bc (make-racket-vm-bc racket-vm-cgc)) > > ... > > in this file. > > My understanding—which is not very good!—is that this would have the > same problem we do currently. It would be analogous to my example > from : Well, for one this claim is both verifiable and falsifiable by way of implementation. For another, I don't really see the issue however. Since those bindings would be local to racket.scm and not used anywhere else, I don't think there is a cycle to be found anywhere. > > > But  Ludo’'s examples show that's wrong: those uses of `chez > > scheme` are in what the "expansion contexts" model would call > > "expression contexts". > > > > Instead, I think rule № 2 prohibits any reference to a variable > > imported from another (gnu packages ...) module that will be > > evaluated when the (gnu packages ...) modules are—visited? > > instantiated? [2][3]—IDK when exactly, but, for practical purposes, > > any variable reference that is not underneath a lambda abstraction. > > > > If that's right, IIUC, it would mean that: > > > >     (define chez-scheme-for-racket > >       (make-chez-scheme-for-racket ...)) > > > > would also be prohibited. > > > > On the other hand, uses of `(racket-vm-for-system)` and `(chez- > > scheme-for-system)` in an `imports` field should still be fine, > > thanks to the implicit thunks. > The reference to `make-chez-scheme-for-racket` or `make-racket-vm-cs` > or any such procedure defined in "chez-and-racket-bootstrap.scm" > would be evaluated when "racket.scm" is instantiated—or whenever > precisely it is that causes the problem. I don't think that'd be a problem since make-chez-scheme-for-racket is itself a function. If it still is, one pair of brackets makes it not so. This is a well-explored technique of resolving chains, used for example in our build system code. chez-and-racket-bootstrap.scm should imo not be imported anywhere but chez.scm and racket.scm, so it by itself can not form a cycle. Only chez.scm and racket.scm can, but there are ways of making those well-formed. See (standard-packages) in guix/build-system/gnu.scm pointing to (gnu packages commencement) or (default-python) in guix/build- system/python.scm for pointers. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 12:52:36 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 17:52:36 +0000 Received: from localhost ([127.0.0.1]:33668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLqNv-0000w7-Pf for submit@debbugs.gnu.org; Sun, 20 Feb 2022 12:52:36 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:48905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLqNu-0000vr-OY for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 12:52:35 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 9815E58012C; Sun, 20 Feb 2022 12:52:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 20 Feb 2022 12:52:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=3oxIXBuk/duISD TWWysjgsyM9VdMqhYMeGwdCoZWTh4=; b=h/0Va6osR7Bp+IekP4OI8dzquJ+PWq F8g1NJ3gexMCg2jooPtNMy/qxUA1GPJkKCbk5+n648SYhBkXL4U0xv+fXkvlQAO1 4Me7wPYIBwug4vgCphUG/SFWUrf92elxFYOfwLVhg21FJsD0tHhjH9USdAjnD0Ny wy1b49+Rpb8tZllLVMvCPdV0CiOElvLm/ymfm8J4M+DWGz4cVmnDKeDb+AvMc4jn c+lGm47NM4AkApBxN8SsIqbGjI9ncV+8lnngTAjXnEwJiympiyFBotrfc7aLdXjk SOciZ0pofM/PgWiVgIhamg0RL4qQblmo/mOVXgijLufULHOpbtTBfnPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=3oxIXBuk/duISDTWW ysjgsyM9VdMqhYMeGwdCoZWTh4=; b=fkx30aKazUTAKHHYkVxOmGBdFyg4e+nYa qgC3H7ypUSxW47pDK4SiWJDscC7cMDgbQLkfaOb26EEm+GJwOEwfHX5VJYsdH5b6 h/o9cJvkZ/q/upG1zoLdCBh4O90Mzf+vFjxNVWJhHypzCTa8kQbju6/oAeo2fAhs aR6Meo326Ut7Lz2hsiPKJA3QRCh8X5g1NI4H3E1RuyXafr8ckWWr8Zk1ZoQ/zFDl eAZLCLgEsSLXbBaLiDxie0uBVidIc54Pt7K1zLJLwmf7w4TtTL0T1gP4cw53yMaN HmB85e0UnRN2585qlSLUqu4LZ2JYyPcUeBO2Z2s07PNRkKJC4E5qQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeeggddutdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhggtgesghdtreertddtjeenucfhrhhomheprfhhihhlihhp ucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhmqe enucggtffrrghtthgvrhhnpefhieelgefghedvhfdtvdegkeffffeihfefjeeggedtkeev ueegkedukeekgefgueenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhlihhp mhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Feb 2022 12:52:28 -0500 (EST) From: Philip McGrath To: Liliana Marie Prikler , 53878@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sun, 20 Feb 2022 12:52:22 -0500 Message-ID: <5037281.s90xYg8xyF@bastet> In-Reply-To: References: <20220208151316.1897345-1-philip@philipmcgrath.com> <1853902.IiyMIqa0Cy@bastet> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1812931.zRP7H386fE"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Maxime Devos , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart1812931.zRP7H386fE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: Liliana Marie Prikler , 53878@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= Cc: Attila Lendvai , Malte Gerdes , zimoun , raingloom , Maxime Devos Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Date: Sun, 20 Feb 2022 12:52:22 -0500 Message-ID: <5037281.s90xYg8xyF@bastet> In-Reply-To: References: <20220208151316.1897345-1-philip@philipmcgrath.com> <1853902.IiyMIqa0Cy@bastet> Hi, On Sunday, February 20, 2022 11:48:01 AM EST Liliana Marie Prikler wrote: > Am Sonntag, dem 20.02.2022 um 09:09 -0500 schrieb Philip McGrath: > > Hi, > >=20 > > On Sunday, February 20, 2022 4:03:26 AM EST Liliana Marie Prikler > >=20 > > wrote: > > > So here's my suggestion: > > >=20 > > > Inside chez-and-racket-bootstrap, define (make-) functions > > > for > > > the following: > > > - chez-bootstrap-bootfiles, chez-for-racket-bootstrap-bootfiles: > > > Taking version and origin. > > > - racket-vm-cgc: Taking version and origin. > > > - racket-vm-bc: Taking racket-vm-cgc. > > > - racket-vm-cs: Taking racket-vm-bc. > > >=20 > > > Inside chez, define chez-scheme, as well as non-bootstrapped > > > versions of stex et al. Also define make-chez-scheme-for-racket, > > > taking version and origin as parameter. Finally, define chez- > > > scheme-for-system, which uses (resolve-interface '(gnu packages > > > racket)) to get racket's version and > > > origin. > > >=20 > > > Inside racket, define %racket-version, %racket-origin, racket- > > > minimal > > > and racket. It'd also be good if you made local definitions > > > (define racket-vm-cgc (make-racket-vm-cgc %racket-version %racket- > > > origin)) > > > (define racket-vm-bc (make-racket-vm-bc racket-vm-cgc)) > > > ... > > > in this file. > >=20 > > My understanding=E2=80=94which is not very good!=E2=80=94is that this w= ould have the > > same problem we do currently. It would be analogous to my example >=20 > > from : > Well, for one this claim is both verifiable and falsifiable by way of > implementation. For another, I don't really see the issue however. > Since those bindings would be local to racket.scm and not used anywhere > else, I don't think there is a cycle to be found anywhere. >=20 While working on v4, I did try using `racket-vm-for-system` at what Ludo=E2= =80=99=20 called "the top level of a module", and I encountered the same error. > > > But Ludo=E2=80=99's examples show that's wrong: those uses of `chez > > > scheme` are in what the "expansion contexts" model would call > > > "expression contexts". > > >=20 > > > Instead, I think rule =E2=84=96 2 prohibits any reference to a variab= le > > > imported from another (gnu packages ...) module that will be > > > evaluated when the (gnu packages ...) modules are=E2=80=94visited? > > > instantiated? [2][3]=E2=80=94IDK when exactly, but, for practical pur= poses, > > > any variable reference that is not underneath a lambda abstraction. > > >=20 > > > If that's right, IIUC, it would mean that: > > >=20 > > > (define chez-scheme-for-racket > > > (make-chez-scheme-for-racket ...)) > > >=20 > > > would also be prohibited. > > >=20 > > > On the other hand, uses of `(racket-vm-for-system)` and `(chez- > > > scheme-for-system)` in an `imports` field should still be fine, > > > thanks to the implicit thunks. > >=20 > > The reference to `make-chez-scheme-for-racket` or `make-racket-vm-cs` > > or any such procedure defined in "chez-and-racket-bootstrap.scm" > > would be evaluated when "racket.scm" is instantiated=E2=80=94or whenever > > precisely it is that causes the problem. >=20 > I don't think that'd be a problem since make-chez-scheme-for-racket is > itself a function. If it still is, one pair of brackets makes it not > so. This is a well-explored technique of resolving chains, used for > example in our build system code. chez-and-racket-bootstrap.scm should > imo not be imported anywhere but chez.scm and racket.scm, so it by > itself can not form a cycle. Only chez.scm and racket.scm can, but > there are ways of making those well-formed. AFAICT the error is not from applying the function bound to the variable=20 `racket-vm-for-system` (or `make-racket-vm-bc`, or whatever), but from=20 evaluating the reference to a variable imported from a sibling `(gnu packages ...)` module, regardless of the value to which the variable = is=20 bound. My current best guess at Guile's semantics for mutually-recursive modules i= s=20 that it's something like the `letrec` restriction, e.g. the difference betw= een=20 these two examples (given an implementation that fully enforces `letrec`=20 semantics, as opposed to `letrec*`): =2D-8<---------------cut here---------------start------------->8--- $ scheme=20 Chez Scheme Version 9.5.6 Copyright 1984-2021 Cisco Systems, Inc. > (letrec ((a (lambda () 1)) (b a)) 2) Exception: attempt to reference undefined variable a Type (debug) to enter the debugger. > (letrec ((a (lambda () 1)) (b (lambda () (a)))) (b)) 1 =2D-8<---------------cut here---------------end--------------->8--- >=20 > See (standard-packages) in guix/build-system/gnu.scm pointing to (gnu > packages commencement) or (default-python) in guix/build- > system/python.scm for pointers. Given Ludo=E2=80=99's explanation, I think the difference (or at least an i= mportant=20 difference) is that those functions are defined in `(guix ...)` modules, as= =20 opposed to `(gnu packages ...)` modules. But I wish I knew with any degree of certainty *why* this would be true, if= =20 indeed it is. Maybe Maxime knows? =2DPhilip --nextPart1812931.zRP7H386fE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmISf9YACgkQygNjjfo/ HHpJ5w/9F2cWQgS0/P/mH5L1/asF6h5Sk4oP7Yq0kjGpLXVdPAcwQhj26PXTebYo DXCCb+tKrPrQdMgPfaYzOBkASw+WAMG4iIvwyVOOtJGmSOtBgg9oIHL2f8Ahn62n PoGpRLxoWRzfBM/fisps2aPn6dPVt3dbX+mENYemeKQUGX5pVBtSMNqIynMVQG1Q wPv2ybJaWDBsFIUP12yFysiQkrfR3tzJ5M0VSBnQqI+CGs2J03JBiNFlfqdtCd7f 1akrgl5nZh+FUSbRstYtGmlOofkiTb93HeeJSNe5cRm1WzO+44frj9Az6ZRTeudl +RmcaHugv4ZbHKcGw5r58DBdVupU1WGaqRJR0UkCpLxrBQzvPKQ8TGwpuR8n7U7P WIixrpIlaB6aSzY6RlRh8Xn1nY/26sWmIdvdq3r8UIUmHFznKn1U0eH2sMgso8Ty 9QiuL2mbPu10UW8RxgsLtMdnsT5MUuoie2daqp4c6cTTrU2a5npSN8yT1c4BFyjl qAls+HfTWgHWYMZ4ZXfjr8sSC7LT4Q6UKK98ilZgL0GHCpX7juNis5aeu1xl558D ta4KzNGrVeVJAheEqCaaOksH8eJjGhmG/Rp0WJhe7rni9axxMVbIDiBLON0rAkjF DPxBvvXUOZ2Ckje9Vz+UC8DIk5+wr8sdfLf9vDPNt+JBfyaOO+4= =c4VN -----END PGP SIGNATURE----- --nextPart1812931.zRP7H386fE-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 13:14:17 2022 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 18:14:17 +0000 Received: from localhost ([127.0.0.1]:33686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLqiq-0001S6-1k for submit@debbugs.gnu.org; Sun, 20 Feb 2022 13:14:17 -0500 Received: from mail-ej1-f67.google.com ([209.85.218.67]:38406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLqij-0001RO-Mr for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 13:14:11 -0500 Received: by mail-ej1-f67.google.com with SMTP id r13so4439891ejd.5 for <53878@debbugs.gnu.org>; Sun, 20 Feb 2022 10:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=Z5B48EywOwqwqxtTc0cXW4FZzXmegk/u35RosmpHNmw=; b=VAbJn/2a9PHLYtXtwI0ppSYJ6LumaSFqyH4PBr0LieEUEzOovqCodbp0j5ZRO3+F++ 1AtzpB/lFDnUGR4wo+ihghoncsyT3LawWHhLQzIoPkW4uTIW98aEi/norIHeEl3kcX4h nyNMMPx/MNjjcqv9IeKg0EzB8kYm7MB6/tuSlOEifOZq8YueKN23CUHzBtvi7II62rmV YU1qXOKk3ltboYyrBo96ip/zk2KsABX5uWAEjWupyqLHd5dHMEFxkBBgLEF2Mlzlb3KB Phd9h9KZ/iYNQfApdbL9jieJriMIbqAhY1B/cTL8DqO2mBo0Ged8QOrwuTGkLkRrNtV5 TuDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Z5B48EywOwqwqxtTc0cXW4FZzXmegk/u35RosmpHNmw=; b=1V81L7gvWIW2SV/qPdKJpWdTZ01Ht4mxU7EIZnT25CYaqehgjissaD7PXeSis87yfe V3xcWJgBi7V0g3hxibc/B8+klhecVpZB+gbpZ8V8x1SBl9/GYoMV8sqCUUwepr0G33Zk vCg9+niF08G9j5Esmv+d/GoIInVAkR8AzG4VajVL+XyDEsrRfT6a51L8d3cMuHmPAlvC n6IJcC+QJ8ri0XmI67FgJtuSEzCPRbehm30zmdZC4nXgZfXt2EkA+po0ZX7i/7QshfcB u+UMkSqqHBo2CUHbeUCPtb6iCujfsFLq1jg8nckVePsnTsFCHmeJ/h3FBgdX1mD1gMVk oAhQ== X-Gm-Message-State: AOAM532Arhbl/uMGzh6gwGtA1eZ2I8gO1PrUwe0OYh6W8yFtjh7d8LJO obyrYsWN11n5nOvpIVTZ8ao= X-Google-Smtp-Source: ABdhPJyExoUTWiS+GohGKbSdzmTw+OkUzTnj14X94cEsP1yyDWNDR8SPQunbqBBet1GhPgBBSGDuUA== X-Received: by 2002:a17:906:69ce:b0:6a7:8c03:3caa with SMTP id g14-20020a17090669ce00b006a78c033caamr13253999ejs.335.1645380839822; Sun, 20 Feb 2022 10:13:59 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id e18sm7746812edj.85.2022.02.20.10.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 10:13:59 -0800 (PST) Message-ID: Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sun, 20 Feb 2022 19:13:58 +0100 In-Reply-To: <5037281.s90xYg8xyF@bastet> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <1853902.IiyMIqa0Cy@bastet> <5037281.s90xYg8xyF@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Maxime Devos , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Am Sonntag, dem 20.02.2022 um 12:52 -0500 schrieb Philip McGrath: > AFAICT the error is not from applying the function bound to the > variable `racket-vm-for-system` (or `make-racket-vm-bc`, or > whatever), but from evaluating the reference to a variable imported > from a sibling `(gnu packages ...)` module, regardless of the value > to which the variable is bound. > > My current best guess at Guile's semantics for mutually-recursive > modules is that it's something like the `letrec` restriction, e.g. > the difference between these two examples (given an implementation > that fully enforces `letrec` semantics, as opposed to `letrec*`): > > --8<---------------cut here---------------start------------->8--- > $ scheme > Chez Scheme Version 9.5.6 > Copyright 1984-2021 Cisco Systems, Inc. > > > (letrec ((a (lambda () 1)) >            (b a)) >     2) > Exception: attempt to reference undefined variable a > Type (debug) to enter the debugger. > > (letrec ((a (lambda () 1)) >            (b (lambda () (a)))) >     (b)) > 1 > --8<---------------cut here---------------end--------------->8--- > > > > > See (standard-packages) in guix/build-system/gnu.scm pointing to > > (gnu > > packages commencement) or (default-python) in guix/build- > > system/python.scm for pointers. > > Given Ludo’'s explanation, I think the difference (or at least an > important difference) is that those functions are defined in `(guix > ...)` modules, as opposed to `(gnu packages ...)` modules. > > But I wish I knew with any degree of certainty *why* this would be > true, if indeed it is. > > Maybe Maxime knows? Both Ludo and Maxime already explained this, but to be extra clear, it's the thunking. (define foo ) (define bar ) <- problem (define (foo) ) (define bar ) <- no problem. Since inputs are thunked, you can define chez in chez.scm and racket in racket.scm and use them as input to each other without breaking the compiler (you will break the package builder though). If you want something more meaningful, you can define racket-minimal in racket.scm and use it in chez.scm as input to a package, then use that package as input to racket. This does not work for (source ) and (inherit ) however, because those forms are not thunked. You would have to thunk them until you reach a save haven (like a package's inputs), where you can call the thunk to produce a value. Cheers From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 23 14:27:12 2022 Received: (at 53878) by debbugs.gnu.org; 23 Feb 2022 19:27:12 +0000 Received: from localhost ([127.0.0.1]:46572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMxI8-0007o3-3x for submit@debbugs.gnu.org; Wed, 23 Feb 2022 14:27:12 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:39675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMwnL-0006xX-So for 53878@debbugs.gnu.org; Wed, 23 Feb 2022 13:55:24 -0500 Received: by mail-qv1-f52.google.com with SMTP id a1so10078581qvl.6 for <53878@debbugs.gnu.org>; Wed, 23 Feb 2022 10:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=12c2JJJXeto50BbY2zuvCtk0Q6FQDOkttxIaRRkaXUE=; b=jrH+edyNX4TKETL+RTifa4uaHzx+q+Fp7ETyHQB5FCilxx4HSuS6xFEMlSSLm8JwSa av9BjFamEKJ098QBVg19g0BV39CQln9W54I/BavWQ3GAtfG8pxlQJr9+DaDQCLg0SVXP QYJ6lZJH/crh6uDZDAHMS8Csxdpxsipu0JJrdsML/i1uGo9HGoQl4SxosTQXLG894buL 9TyL4htefuHjnmcvEMSgyh1sfATzQchYAYoSckD3SpgRqSluAyhzrEtEiXDAfZICNBlp RTSfwkCrP+PcT6SU/WVBwG+f93lsEUZG5DFg28NNq3+l2UF1QCgq88ufLdE4Yi0NRF1u RZoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=12c2JJJXeto50BbY2zuvCtk0Q6FQDOkttxIaRRkaXUE=; b=MGurJSGaYhNedITSWBUweeXUC+0MWViaHUgRPxWjxWs0cEJ5Uv9wVJWKqzA9qJfV08 8iWa0SsPfExhHjLTb+gIoNuNZKAgG2h6mXaw1FHIvVooHyBLiIlje8245D0ZzfMNmG31 v0U1tg0Y3ZxqxgmqeS48TkDSOiC4MYo9/ldFaQHnXXfLNuzhVXWmJXHjZHGBBf6j6tT4 KEBNYZSkXIO9csMnHli2wCWlO5hPN/XZ2DEwrqLSYax1ZExR9jDtvpxFEu0/gvxQxY1Z sQnBmP5eqV/SVo2hqV014e5Ngf5mxzFPpjpGJoqcjYYW6PJ8xbrG8VRmloPOfv1L01Ki tMlA== X-Gm-Message-State: AOAM532Oh0ABU5iRfcs0r7UF/DnEQ0ydigzV76H4t8SojdeMGa9Kg+vw B6gsoXOTadwyJoGHZOYHypA= X-Google-Smtp-Source: ABdhPJxZ7QK0BoO2MWE+kCbOjQQ50nF2kDKSyXJE4OJMLVIBmt2PkakAhXNFRw4myKjRP66tQ+u8Dw== X-Received: by 2002:ad4:450d:0:b0:432:6b36:acb2 with SMTP id k13-20020ad4450d000000b004326b36acb2mr641233qvu.130.1645642518200; Wed, 23 Feb 2022 10:55:18 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id e3sm269483qto.25.2022.02.23.10.55.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Feb 2022 10:55:17 -0800 (PST) Message-ID: Date: Wed, 23 Feb 2022 13:55:16 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. Content-Language: en-US To: Liliana Marie Prikler , Philip McGrath , 53878@debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=c3=a8s?= References: <20220208151316.1897345-1-philip@philipmcgrath.com> <1853902.IiyMIqa0Cy@bastet> <5037281.s90xYg8xyF@bastet> From: Philip McGrath In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 X-Mailman-Approved-At: Wed, 23 Feb 2022 14:27:10 -0500 Cc: Attila Lendvai , Maxime Devos , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On 2/20/22 13:13, Liliana Marie Prikler wrote: >> Given Ludo’'s explanation, I think the difference (or at least an >> important difference) is that those functions are defined in `(guix >> ...)` modules, as opposed to `(gnu packages ...)` modules. >> >> But I wish I knew with any degree of certainty *why* this would be >> true, if indeed it is. >> >> Maybe Maxime knows? > Both Ludo and Maxime already explained this, but to be extra clear, > it's the thunking. > > (define foo ) > (define bar ) <- problem > > (define (foo) ) > (define bar ) <- no problem. > > Since inputs are thunked, you can define chez in chez.scm and racket in > racket.scm and use them as input to each other without breaking the > compiler (you will break the package builder though). If you want > something more meaningful, you can define racket-minimal in racket.scm > and use it in chez.scm as input to a package, then use that package as > input to racket. This does not work for (source ) and (inherit ) > however, because those forms are not thunked. You would have to thunk > them until you reach a save haven (like a package's inputs), where you > can call the thunk to produce a value. To try to be concrete, I made the patch below as a mock-up of part of your earlier suggestion (IIUC): On 2/20/22 04:03, Liliana Marie Prikler wrote: > Inside chez-and-racket-bootstrap, define (make-) functions for > the following: > - chez-bootstrap-bootfiles, chez-for-racket-bootstrap-bootfiles: > Taking version and origin. > - racket-vm-cgc: Taking version and origin. > - racket-vm-bc: Taking racket-vm-cgc. > - racket-vm-cs: Taking racket-vm-bc. > ... > > Inside racket, define %racket-version, %racket-origin, racket-minimal > and racket. It'd also be good if you made local definitions > (define racket-vm-cgc (make-racket-vm-cgc %racket-version %racket- > origin)) > (define racket-vm-bc (make-racket-vm-bc racket-vm-cgc)) > ... > in this file. This applies on top of v4, or I've put it at if that's easier for anyone: --8<---------------cut here---------------start------------->8--- From 982fe7cfb4d33103ee611acc310e3225ccf35852 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Wed, 23 Feb 2022 11:13:43 -0500 Subject: [PATCH] example of import problems --- gnu/packages/chez-and-racket-bootstrap.scm | 4 ++++ gnu/packages/racket.scm | 3 +++ 2 files changed, 7 insertions(+) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index b779099fb3..ea10f7fe92 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -47,6 +47,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module ((guix licenses) #:prefix license:) #:export (chez-scheme-for-system + make-racket-vm-cgc racket-vm-for-system)) ;; Commentary: @@ -199,6 +200,9 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; Code: +(define (make-racket-vm-cgc a b) + 42) + (define* (chez-scheme-for-system #:optional (system (or (%current-target-system) (%current-system)))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index c2854f84e8..08e437a722 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -58,6 +58,9 @@ (define %racket-version "8.4") ; MUST match "chez-and-racket-bootstrap.scm" (define %racket-commit (string-append "v" %racket-version)) +(define fake-racket-vm-cgc + (make-racket-vm-cgc 1 2)) + (define (extract-package-source origin spec) "Extract the source for a Racket package specified by SPEC from ORIGIN into a new file-like object. In the resulting file-like object, the package source -- 2.32.0 --8<---------------cut here---------------end--------------->8--- With this patch, trying to run `make` fails with the same kind of error we've seen before: ``` ice-9/eval.scm:293:34: error: make-racket-vm-cgc: unbound variable hint: Did you forget `(use-modules (gnu packages chez-and-racket-bootstrap))'? ``` Overall, I certainly agree that duplicating the definition of `%racket-version` is not ideal. I'd be glad for you or anyone to improve the situation, and I'll try to get my head around Maxime's email about the underlying semantics. But I am confident that v4 of this series is at least not broken, if perhaps not maximally beautiful. Especially given that I, for one, have tried things that initially seemed correct only to discover subtle problems later, I think it would be better for any refinements to come in follow-on patches later. -Philip From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 23 15:31:43 2022 Received: (at 53878) by debbugs.gnu.org; 23 Feb 2022 20:31:43 +0000 Received: from localhost ([127.0.0.1]:46663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMyIZ-0004qL-6j for submit@debbugs.gnu.org; Wed, 23 Feb 2022 15:31:43 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:34469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMyIY-0004lL-0j for 53878@debbugs.gnu.org; Wed, 23 Feb 2022 15:31:42 -0500 Received: by mail-ej1-f68.google.com with SMTP id gb39so55052218ejc.1 for <53878@debbugs.gnu.org>; Wed, 23 Feb 2022 12:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=h1GjfGhRT+QT34raVyoeimIKl/ITRptmFHh0KbSyC9Y=; b=m214/JV4wgX63n8aca65Ux/kWyL522N+rkyZXpz2Cxk/iowY5L1lPlyirCUe0jdngY KduzKQIcjzK3nlXallsl6FtM0k9l/AkhzP/mcGVWqgger4GIfIEOl24teIANNVs5NxCb UMBZZAviJRgOF1Xcy+fnjN57XxNS6FnvfGv1fl04JIcC10b71aQ92NUp5ob3tk9Wc9Pv y43MyT7h7o0gFr36AIyU6bIJNsNnYcL9obd6jLaFqE7BSZi34utr0/a/8c+4FbvICslu M5rkW36Oec67yYArw5hmLQU4UYYalQDOSUeyK5YnieWbaQ3UEzSkA4XUqxlFxgyS2Q9e ZlLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=h1GjfGhRT+QT34raVyoeimIKl/ITRptmFHh0KbSyC9Y=; b=MnCFGkf1VCqIQSAiKgWRDI21g46F6ukJKS8OArRnjKLIPKjlaqX3Hi8mhePJR0MG0M HsCBbfNPXjKMDN/PgF59hOUtxzcZ/8TyrMcvtW96GJQCnFJ9pHkmY7+p56vDIBOz14xS +PR3vC/MIkMW1rCbkOUJoHYtpHgl0Luhc0UoDnxT7zzQa3lT6oZp1KoSqF8zHUuiqLYf UkhqDF+hMYgyr1azyBH34rlJUtDiIQ1Oj9sOi4JG25t9hB/YGyIfRA7NzA+AJM9j+yJN +SX/ZFSsCnLyaXjGYiJFx5kU1GYLA2j4ow/80yJLMCelKou9QXImgxXHUG+I6+98/o2k gpbw== X-Gm-Message-State: AOAM530SMI4zDuHIK69ibcTQQ4DuOpZ1WUvh6+FgKA4SUwGDQWN+4AN/ f1cYIrEotBqa+VDaQXlXG00= X-Google-Smtp-Source: ABdhPJxGi1A4Gb+YXMa7/Q4bXMaFZq/D5gIcbaglpg6N6Mh2GgUnOo3CVOwEhXpZNqT+Kn+BtE1rUQ== X-Received: by 2002:a17:906:35da:b0:6b8:9f07:f15d with SMTP id p26-20020a17090635da00b006b89f07f15dmr1063586ejb.552.1645648296122; Wed, 23 Feb 2022 12:31:36 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id l19sm373695edb.87.2022.02.23.12.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 12:31:35 -0800 (PST) Message-ID: <236d81872dff1880e9fba2f413f1a5ac3cb4f6fd.camel@gmail.com> Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. From: Liliana Marie Prikler To: Philip McGrath , Philip McGrath , 53878@debbugs.gnu.org, Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Wed, 23 Feb 2022 21:31:34 +0100 In-Reply-To: References: <20220208151316.1897345-1-philip@philipmcgrath.com> <1853902.IiyMIqa0Cy@bastet> <5037281.s90xYg8xyF@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Attila Lendvai , Maxime Devos , Malte Gerdes , raingloom , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Am Mittwoch, dem 23.02.2022 um 13:55 -0500 schrieb Philip McGrath: > To try to be concrete, I made the patch below as a mock-up of part of > your earlier suggestion (IIUC): > > On 2/20/22 04:03, Liliana Marie Prikler wrote: >  > Inside chez-and-racket-bootstrap, define (make-) > functions for >  > the following: >  > - chez-bootstrap-bootfiles, chez-for-racket-bootstrap-bootfiles: >  >    Taking version and origin. >  > - racket-vm-cgc: Taking version and origin. >  > - racket-vm-bc: Taking racket-vm-cgc. >  > - racket-vm-cs: Taking racket-vm-bc. > >  > Inside racket, define %racket-version, %racket-origin, racket- > minimal >  > and racket.  It'd also be good if you made local definitions >  > (define racket-vm-cgc (make-racket-vm-cgc %racket-version %racket- >  > origin)) >  > (define racket-vm-bc (make-racket-vm-bc racket-vm-cgc)) >  > ... >  > in this file. > > This applies on top of v4, or I've put it at > < > https://gitlab.com/philip1/guix-patches/-/commit/982fe7cfb4d33103ee611acc310e3225ccf35852 > > > if that's easier for anyone: To be fair, the issue here is with my proposal, which doesn't completely thunk through. I clarified later on that it would need another pair of brackets or – if that's easier for you – commented on the commit you've linked. > Overall, I certainly agree that duplicating the definition of > `%racket-version` is not ideal. I'd be glad for you or anyone to > improve the situation, and I'll try to get my head around Maxime's > email about the underlying semantics. > > But I am confident that v4 of this series is at least not broken, if > perhaps not maximally beautiful. Especially given that I, for one, > have tried things that initially seemed correct only to discover > subtle problems later, I think it would be better for any refinements > to come in follow-on patches later. I can understand the sentiment, but there are some things that still don't feel right for me – for instance the fact, that seemingly unrelated modules now have to pull in racket bootstrap sounds like a recipe for trouble. The final patch in the series also still does too much for me to wrap my head around, which makes it difficult to audit. Therefore, one question I have w.r.t. updating Racket is whether we could theoretically bump the version while keeping the old bootstrap, and then adjust the bootstrap by adding all the packages you've made. It does seem to be an all or nothing deal when doing the bootstrap first, but that need not necessarily hold for bootstrap second. Also, accepting for a moment that we might have to move chez-scheme and other important things into chez-scheme-and-racket-bootstrap (even though I'm not really content with it), I still wonder if we could introduce chez-scheme-for-system first (defined as simply chez-scheme initially) and adjust the callers, then move chez-scheme while keeping the function in chez.scm and finally do the magic with making it either chez or racket. I know I have a tendency towards being overly cautious when it comes to pushing big changes, so if that's the case I'd be happy if someone else were to take over. That said, I do feel somewhat lonely at the moment despite the many people specifically mentioned in "To:" and "Cc:", so I'm somewhat content with moving slowly for now. Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 10:09:40 2022 Received: (at 53878) by debbugs.gnu.org; 24 Feb 2022 15:09:41 +0000 Received: from localhost ([127.0.0.1]:50141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNFkS-0000Rt-L7 for submit@debbugs.gnu.org; Thu, 24 Feb 2022 10:09:40 -0500 Received: from mail-io1-f47.google.com ([209.85.166.47]:43724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNFkQ-0000Rd-C7 for 53878@debbugs.gnu.org; Thu, 24 Feb 2022 10:09:38 -0500 Received: by mail-io1-f47.google.com with SMTP id m185so2988594iof.10 for <53878@debbugs.gnu.org>; Thu, 24 Feb 2022 07:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FfM43mk0dY3yINlI2BBNCfaRYOifBqQex05SrZc5C2k=; b=iGd1AJ6doxdD03E8lqHDaISHGy5ctKsWUY9yFYjenkXgPm0zFZlAOCeqKYTkvUDkQU UyzWVTQYgerOhs+2zr4/7Mf6PpAWOrGlRN/TI638zDnJWdD7HGC0bPkzLjykQug+DqvK pYnBuoBpTGhcNp41n+CBDbhesMcTB4n/WTgEezGGzY55Z9ZChmbnXlUABUAw6PMbW1yI CDGtLJr/7GV5T2Esvss2h7UbBxKktJa0iRP0ANX5QpHZkaGCJhau02R1SRLk2yD+L2v3 BGUW1L3fW4M/HjG/wBATpZj51C/EpeNXmy/D9sHC6oPL0A2hJPZku3pazCrBFO08NPKb PVUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FfM43mk0dY3yINlI2BBNCfaRYOifBqQex05SrZc5C2k=; b=UE7TNFAsRWCW7j79/Gna3DqOfr30JtbmZNNYwEtgEOwnFVK9nttDIJhoiAOIJ2u1Ou D7HcUo7+usYJv38ZU01tezIye/FRLqSD0McdOiaLhzglRQibbNFUhq/r7NGON7xyqSxL 2mklZBGTwBQ53pJvTVruHcr8000rsirGhzxt26rNj4/XdpOoTWdDK+b8kjtJKW1PjNSK VwgLMDokRjuLzCvmhgFxjs3WdTEcIoX7z62Go9gvKE5lyXwJBB2qd46HWkkw6d7QqI7Q r1PQmcy+X1+QhO8oLYGWwCwyblYZHfyQuLwbkDeitE22KDlP3dWtVnb+ASOyslA97bUd e4Mg== X-Gm-Message-State: AOAM533rxbTzhDqBCUlE0WTzQySmYjLqnhy6FM2fp5Kq6YtHYEhnuOtn I/Cv+zb0QgKYdzfSQ9YHFsyFJDDDEJWdEEi4JxE= X-Google-Smtp-Source: ABdhPJypG2J4ssvew45zHWed+wFzG2XoFon6vppv/6zk2gOdhLgKUgn3z8DGPLKKc2TNg6K65saM1Dp2ilnzoJwFT20= X-Received: by 2002:a02:cd91:0:b0:314:2535:6f75 with SMTP id l17-20020a02cd91000000b0031425356f75mr2418842jap.307.1645715372783; Thu, 24 Feb 2022 07:09:32 -0800 (PST) MIME-Version: 1.0 References: <20220208151316.1897345-1-philip@philipmcgrath.com> <1853902.IiyMIqa0Cy@bastet> <5037281.s90xYg8xyF@bastet> <236d81872dff1880e9fba2f413f1a5ac3cb4f6fd.camel@gmail.com> In-Reply-To: <236d81872dff1880e9fba2f413f1a5ac3cb4f6fd.camel@gmail.com> From: zimoun Date: Thu, 24 Feb 2022 16:09:21 +0100 Message-ID: Subject: Re: [PATCH v3 09/15] gnu: Add racket-vm-cgc. To: Liliana Marie Prikler Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , Malte Gerdes , Maxime Devos , raingloom , Attila Lendvai , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , 53878@debbugs.gnu.org, Philip McGrath X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Liliana, Thanks Philip for these large series. > I know I have a tendency towards being overly cautious when it comes to > pushing big changes, so if that's the case I'd be happy if someone else > were to take over. That said, I do feel somewhat lonely at the moment > despite the many people specifically mentioned in "To:" and "Cc:", so > I'm somewhat content with moving slowly for now. Sorry, I am running out of time and the series is quite large; the changes are not really atomic. ;-) On Wed, 23 Feb 2022 at 21:31, Liliana Marie Prikler wrote: > > But I am confident that v4 of this series is at least not broken, if > > perhaps not maximally beautiful. Especially given that I, for one, > > have tried things that initially seemed correct only to discover > > subtle problems later, I think it would be better for any refinements > > to come in follow-on patches later. > > I can understand the sentiment, but there are some things that still > don't feel right for me =E2=80=93 for instance the fact, that seemingly > unrelated modules now have to pull in racket bootstrap sounds like a > recipe for trouble. The final patch in the series also still does too > much for me to wrap my head around, which makes it difficult to audit. I understand both sentiments. I also have some difficulties for auditing the series. Well, it needs some time to sit down, fill the coffee pot and careful review. :-) I cannot promise but I will try to give a look next week; for what my reviewing eyes are worth. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:04 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:04 +0000 Received: from localhost ([127.0.0.1]:54414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwj2-0005SW-0h for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:04 -0500 Received: from mail-qt1-f177.google.com ([209.85.160.177]:40523) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwiz-0005Ry-Rq for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:02 -0500 Received: by mail-qt1-f177.google.com with SMTP id t28so4990914qtc.7 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:01 -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=Fy4AJtzByadh4Q83DXt5CyQvYogjUexf8NFO4ZMcBh4=; b=Y0LORkGcACm3EtsGdeMoWsJejna8iGGUUlS7pd5iJGZ1gxwKxPuH4wU002+n7ONsC1 hRVIZqGIg5N0hUeJqqM+Ddg8grwkdW6RZWzn6KHOfWFey8TAxKu3VwkG680uIrk2+y0N qBsFdT8CeEuwXxLaVzHTeJ2iwCTiEuDjKIiS4k7Uw+ODxxQkYV62T/SznHV5EM3tSZu3 fxHMPguTsPw1RKCEvAHJAmcbXuBeLbX4BH47JY1z5lE8yd3UF5rhFzdYP4sktQ4Ly5VM H56R8P8B1MRt21gburOwyBu+nv5H9gYiWgftCots+Ei7WlkbZAxag5fULhm0uR9U2//Z nOXQ== 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=Fy4AJtzByadh4Q83DXt5CyQvYogjUexf8NFO4ZMcBh4=; b=LRY4jruMxpd6o9YwsLh+hagwX+qWZPmeQbKy1Ee13Vg3etSbzaeeUNP/4tqDWxCvwk SGB8Ng3/Pw229BjUkImd0GxslR3RU8xUpb34DVRS3ktk2rGu/VK3nnAWahPlu7N0rB/5 6/ZBdvIzLGDtJ4cSeA6tkd0eV9m3R7udFfJuP13ud7mgHTpaGTrAo70NcN5P1hVQB6xC xC9g9K+1U+bwQ1d9zGL4VJX0qDI1qyei/yuqrn1kudpOsNqF13JEMVoWrWfN5D/y9xFc K8YQ5lX5NR8YohR9mev1HR4CAC0BvIlj2dkmZk49p7BzZdUKC21jcQLNYT5r/HokKVB2 Jk6Q== X-Gm-Message-State: AOAM531iFxzCNXt5zbbFqad2hO9jKDsEFVqgh84/wDHVh0Mi4CJGr9gu wVt+LOl/wGKx5p7RvoPDDDpKP3lttjLbdii8bdM= X-Google-Smtp-Source: ABdhPJzNvq8B5Ahgawzu+Sox0prw5mFED0zNoREtdRHWdlJGt9tjnaL2GeNFd2yx/s4Z65kdVBhfdw== X-Received: by 2002:ac8:5ace:0:b0:2d8:c7fa:6f8f with SMTP id d14-20020ac85ace000000b002d8c7fa6f8fmr10235598qtd.410.1645880576017; Sat, 26 Feb 2022 05:02:56 -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 24-20020a05620a06d800b0047bc1e91c34sm2508092qky.114.2022.02.26.05.02.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:02:55 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 00/22] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sat, 26 Feb 2022 08:02:32 -0500 Message-Id: <20220226130254.1301333-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-Debbugs-CC: philip@philipmcgrath.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, I've been ruminating for a while on Liliana's comment from : On Wednesday, February 23, 2022 3:31:34 PM EST Liliana Marie Prikler wrote: > [...] there are some things that still > don't feel right for me – for instance the fact, that seemingly > unrelated modules now have to pull in racket bootstrap sounds like a > recipe for trouble. The final patch in the series also still does too > much for me to wrap my head around, which makes it difficult to audit. > > Therefore, one question I have w.r.t. updating Racket is whether we > could theoretically bump the version while keeping the old bootstrap, > and then adjust the bootstrap by adding all the packages you've made. > It does seem to be an all or nothing deal when doing the bootstrap > first, but that need not necessarily hold for bootstrap second. > > Also, accepting for a moment that we might have to move chez-scheme and > other important things into chez-scheme-and-racket-bootstrap (even > though I'm not really content with it), I still wonder if we could > introduce chez-scheme-for-system first (defined as simply chez-scheme > initially) and adjust the callers, then move chez-scheme while keeping > the function in chez.scm and finally do the magic with making it either > chez or racket. > It struck me that the core of the dependency cycle (at least, from one perspective) is that 'chez-scheme-for-racket' wants to 'inherit' from 'chez-scheme' but use '%racket-origin' for its 'source', and neither of those are thunked fields. I realized that, if we just pass the origin some other way than as the 'source' field, we can avoid adding the "chez-and-racket-bootstrap.scm" file altogether: patch v5 10/22 does the core of that. I also managed to split up the update to Racket 8.4 (patch v4 15/15) into a number of smaller steps (or, more precisely, rewrite it now that I knew what the end result would be). I now have the 'racket-minimal*' packages gradually evolve into the corresponding 'racket-vm-*' packages (rather than adding the 'racket-vm-*' stack in parallel), then split the new 'racket-minimal' package out of 'racket'. Hopefully this might be somewhat easier to review. The downside is there are now 22 patches, rather than 15. So, here is v5! -Philip P.S.: I've also posted this series at . Philip McGrath (22): gnu: Use license prefix in (gnu packages racket). gnu: racket: Update to 8.4. gnu: racket: Use Git origins for Racket packages. gnu: racket-minimal: Use new package style. gnu: racket-minimal: Don't configure non-existant catalogs. gnu: racket-minimal: Change inheritance to follow bootstrapping. gnu: racket-minimal: Add "debug" output. gnu: make-installation-layer.rkt: Adjust indentation. gnu: racket-minimal: Separate from the Racket VM. gnu: racket: Move Chez bootfiles to (gnu packages chez). gnu: chez: Add utilities for Chez machine types. gnu: racket: Add 'racket-vm-for-system'. gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-scheme: Use new package style. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: chez-mit: Support chez-scheme-for-racket. gnu: Add chez-scheme-for-racket. gnu: chez: Add 'chez-scheme-for-system'. gnu: racket-vm-cs: Build with "--enable-scheme". gnu/local.mk | 4 +- gnu/packages/chez.scm | 1264 +++++++---- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- .../racket-enable-scheme-backport.patch | 465 ++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1866 ++++++++++++----- 7 files changed, 2774 insertions(+), 855 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:12 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:12 +0000 Received: from localhost ([127.0.0.1]:54418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjA-0005St-Ei for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:12 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:38638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwj3-0005S5-Vr for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:06 -0500 Received: by mail-qv1-f52.google.com with SMTP id d3so8855086qvb.5 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:05 -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=im2eB4m2cw9htGdEwc+CW/YqzVpAKz+5GUbS5TUWUbs=; b=Za+KvRwxcUARq3f9OYCEGH62Ix1IOOyYdyjHBTxQxPF6azPjocsqjUMnbp1vJOnOLO 6C6FIWe2eqlm+oFDW/WhYdPII5L8dYRiw8yjbmHaM8IarzZkDY6zmnDtpQOA8dOaGrAO conEdExzhBINVrbFimw1WvoEliB7TlTP+AbIn74kelHz4DHq+2FuhaJ7ehjlUzXvRGTP bunlFwhD7lF73sxAVI6ZUF+p/i7ZTBAJErpUVhAbiB/AO5ws02wBd5LePKZcsleVc3v5 8PWOFYR6birLOr0AeAH5EJpZWX8hrRPeOmwIPqIrH5yccwAGSYh7aDZppdPPogxJ/Vrw ZvgA== 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=im2eB4m2cw9htGdEwc+CW/YqzVpAKz+5GUbS5TUWUbs=; b=4xAK7W+Aa+KxiSMQV5YIy0A4EEVxSQficZ33fpHF/S0dwxWhn0EMRiYd31mS9d97cL 5AAKWK/R+bP/ROME36SsfWqZAc2JCgy/WY2cDnV9sN/W4MKf4UoY2BCpbmfsO9KJ7vPl ZY0B2Foc9j2UivbOPlc6d2BbanBW8MMo+PJ7uJMi7kFJPLRUrGY9rLFWGnctUy2h/Z2y r3rqAEToNrHKRmSOhC2s1VSb1rGwy8bStL/fobh0ykQ6K36pgngyddbZG7KYllfg1xYz kBdP08V0MuysMFk3b9Zc2Q1fmod2LITHqWZl5ZxSsLsEDxgAqpjxOWa8y+FAWAhH5rfB 9eFQ== X-Gm-Message-State: AOAM530mdJun9IuNerkym3gayTtv4vVEzhrBIFuy2xsnTAIgIqPCosXZ uGOb0ComZq5PQfBL16f12kHBWY4RyKz+Y03cVb8= X-Google-Smtp-Source: ABdhPJwQPA3WPuiUigF8iTuYzBKj+Dj6pZBgnJ+v96cbEusk/woEwI4FbJd6eGI/rNhrknxue3x+eA== X-Received: by 2002:a05:6214:1c5:b0:42c:1227:c542 with SMTP id c5-20020a05621401c500b0042c1227c542mr9187268qvt.11.1645880580182; Sat, 26 Feb 2022 05:03:00 -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 t9-20020a05622a148900b002de2dfd0ee2sm3321627qtx.70.2022.02.26.05.02.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:02:59 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 01/22] gnu: Use license prefix in (gnu packages racket). Date: Sat, 26 Feb 2022 08:02:33 -0500 Message-Id: <20220226130254.1301333-2-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-minimal, racket-minimal-bc-3m, racket-bootstrap-chez-bootfiles): Use license prefix. --- gnu/packages/racket.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d0a5ca494b..ec9e836a4c 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -21,8 +21,6 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages racket) - #:use-module ((guix licenses) - #:select (asl2.0 expat lgpl3+)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -47,7 +45,8 @@ (define-module (gnu packages racket) #:use-module (gnu packages multiprecision) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) #:prefix license:)) ;; Commentary: ;; @@ -254,7 +253,7 @@ (define (write-racket-hash alist) DrRacket IDE, are not included.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list asl2.0 expat)))) + (license (list license:asl2.0 license:expat)))) (define-public racket-minimal-bc-3m @@ -295,7 +294,7 @@ (define-public racket-minimal-bc-3m collector, 3M (``Moving Memory Manager'').") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list lgpl3+ asl2.0 expat))))) + (license (list license:lgpl3+ license:asl2.0 license:expat))))) (define-public racket-minimal-bc-cgc @@ -372,7 +371,7 @@ (define-public racket-bootstrap-chez-bootfiles 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.") - (license (list asl2.0))))) + (license (list license:asl2.0))))) (define %installer-mirrors -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:27 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:27 +0000 Received: from localhost ([127.0.0.1]:54422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjH-0005TK-Q7 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:27 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:41824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwj8-0005Sf-EE for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:13 -0500 Received: by mail-qt1-f175.google.com with SMTP id n11so4993662qtk.8 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:10 -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=z0pcZSlzKw/cUO7uj/U8mdQ+2/FnmZU2cO/RKK1LnLk=; b=IaUmIHfYHEe+NmI5my1RiTl41/byXOdcdxHp8gFNbOK9DN50tZGhskezkrXLxdIC3Z Jgf2Uh3dvg99e1wTea8hZgQIF+roy3tRHrYIBkYhs4CycksAPJeTzP5PQhswQmQGRyRV kdmVU3CFnyGBfRxYRFdxydHPNh8/IfjCMCypBSPrRsGwy1LqRUzb9oN49lK15v/Lhhoe ty8PExs9UBcv3e9RezAD2/1OhzaYnkxJiEJ7KR6C/6RHbspmph3FmTnwh+Bsx5fpV2S1 RAH+GuGcFYJ+BvDEzCroasgDtO5jsvm28ONkvCLhh+9l1sA/N+BasbEf5ca5EzH3hGRG 67Yw== 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=z0pcZSlzKw/cUO7uj/U8mdQ+2/FnmZU2cO/RKK1LnLk=; b=w7+3YwGq2dMIK0fgYGLdtWU4ZG9lGdv41OMAQkhOMr4nMavwXOXK4Fd/fuR2mEPLrd 0XY0w4L6lIKyjM6jNmwvumhDOoqpIQwfjnS01K99jGR0AraIxJNMzM64NFZkJO8RPpi1 RuSK3oHIXpm5cZYW9w5X0047zTX8FusxnzrUiSYEgfox7Y3dQSPnPZb7I7cBoXbQr5vF 85mqamoFNdSJMX6Kfi+nFyFHQF4Y/y3Sp0VE43PxmBi73WInn1/aLIEI3/ozivIIppUV xKuIsNQ9Lcu5nFRm/SmBhgwxuWCzrcVg2Q8ZV9rokbPLjYxDGC+3oCznU6FBD8T5F3mW HtGw== X-Gm-Message-State: AOAM530OwOg8R3mkKKkmDVKogV1G3DSYX/xQYN1iMHA2/p/93h8kDXvg Ij2VBLjn52Om5WEdsAoKFFwQQ9sr2GG3bcqx0PI= X-Google-Smtp-Source: ABdhPJww9HPCjaMcJkCgdz/y49sCXGx6laI3LkksKpaAqCvMuXq0nzZq23fDVHB6qnRrFCd57Md9Yg== X-Received: by 2002:ac8:5950:0:b0:2dc:a139:4f36 with SMTP id 16-20020ac85950000000b002dca1394f36mr10743672qtz.646.1645880584348; Sat, 26 Feb 2022 05:03:04 -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 y11-20020a05622a004b00b002dea2052d7dsm3322222qtw.12.2022.02.26.05.03.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:04 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 02/22] gnu: racket: Update to 8.4. Date: Sat, 26 Feb 2022 08:02:34 -0500 Message-Id: <20220226130254.1301333-3-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/ra [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.175 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.175 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/ra [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/racket.scm (%racket-version): New variable. (%racket-commit): New variable. (%racket-origin): New variable. [patches]: Add "racket-enable-scheme-backport.patch". (racket-minimal): Update to 8.4. [version]: Use '%racket-version'. [source]: Use '%racket-origin'. [inputs]: Add 'ncurses'. Remove 'zlib:static' and 'lz4:static'. (racket-minimal-bc-3m)[inputs]: Adjust accordingly. (racket-bootstrap-chez-bootfiles)[version]: Use Chez Scheme's '(scheme-fork-version-number)'. (racket)[version]: Use '%racket-version'. [native-inputs]: Use '%racket-origin'. [source]: Update to 8.4. : Use "racket-gui-tethered-launcher-backport.patch". : Remove "srfi-doc-nonfree". --- gnu/local.mk | 4 +- .../racket-enable-scheme-backport.patch | 465 ++++++++++++++++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 99 ++-- 4 files changed, 557 insertions(+), 37 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index 98f2d4ac30..cf34905431 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright © 2020 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan -# Copyright © 2021 Philip McGrath +# Copyright © 2021, 2022 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher # Copyright © 2021 Dmitry Polyakov @@ -1749,6 +1749,8 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-enable-scheme-backport.patch \ + %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch new file mode 100644 index 0000000000..3a5a4a3d82 --- /dev/null +++ b/gnu/packages/patches/racket-enable-scheme-backport.patch @@ -0,0 +1,465 @@ +From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 10:36:09 -0700 +Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` + +(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) + +(Fixed conflicts by dropping pbchunks and pbarch changes.) +--- + racket/src/ChezScheme/configure | 15 ++++++++++++++- + racket/src/ChezScheme/s/Mf-base | 4 ++-- + racket/src/ChezScheme/s/Mf-cross | 4 +++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 4515ffc105..0098829091 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -45,6 +45,7 @@ threads=yes + nothreads=no + temproot="" + help=no ++forceworkarea=no + gzipmanpages=yes + installowner="" + installgroup="" +@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do + --pb) + pb=yes + ;; ++ --force) ++ forceworkarea=yes ++ ;; + --installprefix=*) + installprefix=`echo $1 | sed -e 's/^--installprefix=//'` + ;; +@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then + echo " --toolprefix= prefix tool (compiler, linker, ...) names" + echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" + echo " --workarea= build directory ($w)" ++ echo " --force configure even without boot files" + echo " CC= C compiler" + echo " CPPFLAGS= C preprocessor flags" + echo " CFLAGS= C compiler flags" +@@ -721,8 +726,16 @@ case "${flagsmuni}" in + ;; + esac + ++if [ "$w" = "$m" ] ; then ++ configuringin="" ++else ++ configuringin=" in $w" ++fi ++ + if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then +- echo "Configuring for $m" ++ echo "Configuring for $m$configuringin" ++elif [ "$forceworkarea" = yes ] ; then ++ echo "Configuring for $m$configuringin despite missing boot files" + else + if [ "$m" = "" ] ; then + maybem="" +diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base +index cc6178c973..1f4a967998 100644 +--- a/racket/src/ChezScheme/s/Mf-base ++++ b/racket/src/ChezScheme/s/Mf-base +@@ -94,7 +94,7 @@ endif + # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme + # implementation + Scheme = ../bin/$m/scheme${ExeSuffix} +-export SCHEMEHEAPDIRS=../boot/%m ++export SCHEMEHEAPDIRS=../boot/$m + export CHEZSCHEMELIBDIRS=. + + # Define the libdirs separator character +@@ -691,4 +691,4 @@ reset-one: + + .PHONY: run + run: +- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) ++ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) +diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross +index d796cbb459..397af59a28 100644 +--- a/racket/src/ChezScheme/s/Mf-cross ++++ b/racket/src/ChezScheme/s/Mf-cross +@@ -43,5 +43,7 @@ x$(xm).$(m): + $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch + mv xpatch x$(xm).$(m) + ++ifneq ($(SCHEMEHEAPDIRS),:) + # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed +-nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++endif +-- +2.32.0 + + +From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 11:03:30 -0700 +Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable + +When the same Chez Scheme version as used by Racket is already +available, then `--enable-scheme=...` can supply an executable. For +cross builds, `--enable-scheme=...` can still supply a build +directory, instead, as before. + +(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) +--- + racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ + racket/src/README.txt | 30 +++++++++++--- + racket/src/configure | 8 +++- + racket/src/cs/README.txt | 6 ++- + racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- + racket/src/cs/c/configure | 24 +++++++++-- + racket/src/cs/c/configure.ac | 21 ++++++++-- + 7 files changed, 112 insertions(+), 24 deletions(-) + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index c396efc851..3998ef9ccd 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -59,6 +59,9 @@ reset: + %.boot: + (cd $(workarea) && $(MAKE) $*.boot) + ++auto.boot: ++ (cd $(workarea) && $(MAKE) $(defaultm).boot) ++ + # .bootquick to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine +diff --git a/racket/src/README.txt b/racket/src/README.txt +index 98647aebce..d77310b4a4 100644 +--- a/racket/src/README.txt ++++ b/racket/src/README.txt +@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of + ======================================================================== + + Cross-compilation requires at least two flags to `configure`: ++`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) ++`--enable-scheme-SCHEME`. ++ ++More information: + + * `--host=OS`, where OS is something like `i386-gnu-linux` to + indicate the target platform. +@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: + run `configure` again (with no arguments) in a "local" subdirectory + to create a build for the current platform. + +-An additional flag is needed for building Racket CS, unless the flag +-`--enable-racket=auto` is used: +- +- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" +- directory where Chez Scheme is built for the host system. ++ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable ++ executable that runs on the build platform; the executable must be ++ the same version as used in Racket built for the target platform. ++ ++ Supplying `--enable-scheme=DIR` is also supported in cross-build ++ mode, where DIR is a path that has a "ChezScheme" directory where ++ Chez Scheme is built for the host system. ++ ++The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are ++allowed for non-cross builds, too: ++ ++ * For Racket CS, supplying either selects a Racket or Chez Scheme ++ implementation used to create boot files to the build platform. ++ Suppling Chez Scheme is a much more direct path, but when Racket is ++ supplied, its version does not have to match the version being ++ built. ++ ++ * For Racket BC, `--enable-racket=RACKET` selects a Racket for ++ prepare C sources to cooperate with garbage collection. Its version ++ needs to be close to the one being built, and potentially exactly ++ the same version. + + Some less commonly needed `configure` flags are for Racket BC: + +diff --git a/racket/src/configure b/racket/src/configure +index c9f3ba4419..1b53ec7ce2 100755 +--- a/racket/src/configure ++++ b/racket/src/configure +@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" + use_cs=maybe + use_bc=maybe + supplied_racket=no ++supplied_scheme=no + enable_boothelp= + + # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, +@@ -34,6 +35,9 @@ for arg in $*; do + --enable-racket=*) + supplied_racket=yes + ;; ++ --enable-scheme=*) ++ supplied_scheme=yes ++ ;; + --help | -h) + echo $0: + echo see --help-bc or --help-cs, since the Racket CS build and the +@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then + fi + + if test "$use_cs" = "yes" ; then +- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then +- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly ++ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then ++ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly + exit 1 + fi + +diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt +index 2ece417b78..8e6fc57b74 100644 +--- a/racket/src/cs/README.txt ++++ b/racket/src/cs/README.txt +@@ -39,6 +39,11 @@ build: + installed in the "../ChezScheme/boot/pb" directory as described by + "../ChezScheme/BUILDING". + ++ Supplying `--enable-scheme=...` is also an option if you alerady ++ have the same version of Chez Scheme built on the current platform. ++ Another build will be created, anyway, but more quickly than ++ without Chez Scheme. ++ + * Racket is needed to generate the files in the "schemified" + directory from the sources in sibling directories like "../io". The + Racket version must be practically the same as the current Racket +@@ -48,7 +53,6 @@ build: + Unlike Chez Scheme boot files, the files generated in "schemified" + are human-readable and -editable Scheme code. That provides a way + out of bootstrapping black holes, even without BC. +- + + + ======================================================================== +diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in +index 54a644a1d9..d73993f0fc 100644 +--- a/racket/src/cs/c/Makefile.in ++++ b/racket/src/cs/c/Makefile.in +@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ + SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) + SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme + SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) +-SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_existing = @MAKE_SCHEME_SCHEME@ ++SCHEME = $(SCHEME@USE_SCHEME_MODE@) + + TARGET_MACH = @TARGET_MACH@ + SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) +@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. + @INCLUDEDEP@ @srcdir@/../../version/version.mak + + cs: +- $(MAKE) scheme@T_CROSS_MODE@ ++ $(MAKE) scheme@MAKE_SCHEME_MODE@ + $(MAKE) racket-so + cd rktio; $(MAKE) + $(MAKE) racketcs +@@ -121,9 +123,13 @@ racket-so: + + RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ + ++TARGET_MACH_built = $(TARGET_MACH) ++TARGET_MACH_existing = xc-$(TARGET_MACH) ++XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch ++ + CS_PROGS = SCHEME="$(SCHEME)" + CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ +-CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" ++CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" + PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" + + build-racket-so: +@@ -163,6 +169,15 @@ pb-bootquick: + cd $(SCHEME_WORKAREA) && $(MAKE) reset + $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) + ++scheme-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot ++ $(MAKE) mach-make ++ ++$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: ++ mkdir -p $(SCHEME_WORKAREA) ++ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" ++ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all ++ + mach-make: + $(MAKE) config-scheme + cd $(SCHEME_WORKAREA) && $(MAKE) +@@ -182,24 +197,33 @@ config-scheme: + + scheme-cross: + env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt ++ $(MAKE) finish-scheme-cross ++ ++finish-scheme-cross: + $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) + cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) + cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t +- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch ++ $(MAKE) $(XPATCH_FILE) ++ ++scheme-cross-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) ++ $(MAKE) finish-scheme-cross + + # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older +-# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files +-XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ +- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot ++# than the build- use as Racket for build; or "auto" to create +- --enable-scheme= use as host's build directory for cross ++ --enable-scheme= use as host build for cross + --enable-mach= use Chez Scheme machine type + --enable-target= cross-build for Chez Scheme machine type + --enable-portable prefer portable to host-specific +@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" + show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' + + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + show_explicitly_enabled "${enable_portable}" "portable" +@@ -4745,9 +4748,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags + + + ++ ++ ++ + + + +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 464ebe1760..aaee88156d 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev + AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) + m4_include(../ac/path_arg.m4) + AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket for build; or "auto" to create]) +-AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host's build directory for cross]) ++AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host build for cross]) + AC_ARG_ENABLE(mach, [ --enable-mach= use Chez Scheme machine type ]) + AC_ARG_ENABLE(target, [ --enable-target= cross-build for Chez Scheme machine type ]) + m4_include(../ac/portable_arg.m4) +@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" + show_explicitly_enabled "${enable_xonx}" "Unix style" + m4_include(../ac/path_show.m4) + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + m4_include(../ac/portable_show.m4) +@@ -504,9 +504,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) + AC_SUBST(CROSS_MODE) + AC_SUBST(T_CROSS_MODE) + AC_SUBST(TT_CROSS_MODE) ++AC_SUBST(MAKE_SCHEME_MODE) ++AC_SUBST(MAKE_SCHEME_SCHEME) ++AC_SUBST(USE_SCHEME_MODE) + AC_SUBST(SETUP_BOOT_MODE) + AC_SUBST(OSX) + AC_SUBST(NOT_OSX) +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch new file mode 100644 index 0000000000..abf253486f --- /dev/null +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -0,0 +1,26 @@ +From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Mon, 31 Jan 2022 15:31:22 -0700 +Subject: [PATCH] fix creation of tethered launchers + +Related to racket/racket#4133 + +(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) +--- + share/pkgs/gui-lib/mred/installer.rkt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt +index b1691472..9ef06c53 100644 +--- a/share/pkgs/gui-lib/mred/installer.rkt ++++ b/share/pkgs/gui-lib/mred/installer.rkt +@@ -72,4 +72,5 @@ + (list "-A" (path->string (find-system-path 'addon-dir))))) + + (define (config-flags) +- (list "-G" (path->string (find-config-dir)))) ++ (list "-X" (path->string (find-collects-dir)) ++ "-G" (path->string (find-config-dir)))) +-- +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index ec9e836a4c..00ec587eeb 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -43,6 +43,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages libedit) #:use-module (gnu packages libffi) #:use-module (gnu packages multiprecision) + #:use-module (gnu packages ncurses) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) #:use-module (gnu packages xorg) @@ -95,6 +96,41 @@ (define-module (gnu packages racket) ;; ;; Code: +(define %racket-version "8.4") +;; ^ Remember to update racket-bootstrap-chez-bootfiles! +(define %racket-commit + (string-append "v" %racket-version)) +(define %racket-origin + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racket") + (commit %racket-commit))) + (sha256 + (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (file-name (git-file-name "racket" %racket-version)) + (patches (search-patches "racket-minimal-sh-via-rktio.patch" + ;; Remove by Racket 8.5: + "racket-enable-scheme-backport.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + (use-modules (guix build utils)) + ;; Unbundle Chez submodules. + (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 + ;; without cyclic issues. + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib"))) + ;; Unbundle libffi. + (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + (define cfg-flag:sh-for-rktio `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" (assoc-ref %build-inputs "sh") @@ -128,41 +164,17 @@ (define src (define-public racket-minimal (package (name "racket-minimal") - (version "8.3") ; note: remember to also update racket! - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit (string-append "v" version)))) - (sha256 - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") - (file-name (git-file-name name version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) - (modules '((guix build utils))) - (snippet - (with-imported-modules '((guix build utils)) - #~(begin - ;; Unbundle Chez submodules. - (with-directory-excursion "racket/src/ChezScheme" - ;; Remove bundled libraries (copied from 'chez-scheme'). - (for-each delete-file-recursively - '("stex" - "nanopass" - "lz4" - "zlib"))) - ;; Unbundle libffi. - (delete-file-recursively "racket/src/bc/foreign/libffi")))))) + (version %racket-version) + (source %racket-origin) (inputs `(;; common to all racket-minimal variants: ("openssl" ,openssl) ("sqlite" ,sqlite) - ("sh" ,bash-minimal) + ("sh" ,bash-minimal) ;; <- for `system` + ("ncurses" ,ncurses) ;; <- for #%terminal ;; only for CS ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static"))) + ("lz4" ,lz4))) (native-inputs `(("bootfiles" ,racket-bootstrap-chez-bootfiles) ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) @@ -263,9 +275,8 @@ (define-public racket-minimal-bc-3m (name "racket-minimal-bc-3m") (inputs (modify-inputs (package-inputs racket-minimal) - (delete "zlib" "zlib:static" "lz4" "lz4:static") - (prepend libffi ;; <- only for BC variants - ))) + (prepend libffi) ;; <- only for BC variants + (delete "zlib" "lz4"))) (native-inputs `(("libtool" ,libtool) ("racket" ,(if (%current-target-system) @@ -327,6 +338,11 @@ (define-public racket-bootstrap-chez-bootfiles (package (inherit racket-minimal) (name "racket-bootstrap-chez-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. (inputs `()) (native-inputs `(("racket" ,(if (%current-target-system) @@ -416,7 +432,7 @@ (define-public racket (package (inherit racket-minimal) (name "racket") - (version (package-version racket-minimal)) ; needed for origin uri to work + (version %racket-version) (source (origin (method url-fetch) @@ -425,7 +441,11 @@ (define-public racket %installer-mirrors)) (sha256 (base32 - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) + "0dsv7br85nvh5gjfihznq9jb1dzas0f6gnv5qwc9zmb7yn75nrp5")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) (snippet #~(begin (use-modules (guix build utils) @@ -442,7 +462,14 @@ (define-public racket (with-directory-excursion "share/pkgs" (for-each delete-file-recursively '#+%main-repo-main-distribution-pkgs)) - #t)))) + ;; Minimal workaround for FSDG issue: + ;; see . + ;; We will backport a better fix once we use Git + ;; origins for Racket packages. + (delete-file-recursively "share/pkgs/srfi-doc-nonfree") + (substitute* "share/pkgs/srfi/info.rkt" + (("\"srfi-doc-nonfree\"") + "")))))) (inputs `(("cairo" ,cairo) ("fontconfig" ,fontconfig) @@ -461,7 +488,7 @@ (define-public racket (native-inputs `(("racket" ,racket-minimal) ("extend-layer" ,extend-layer) - ("main-repo" ,(package-source racket-minimal)))) + ("main-repo" ,%racket-origin))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:32 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:32 +0000 Received: from localhost ([127.0.0.1]:54426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjP-0005Th-MV for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:32 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]:33595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjD-0005Sp-9B for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:18 -0500 Received: by mail-qt1-f174.google.com with SMTP id bt3so4981304qtb.0 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:15 -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=+BvNzpgA0Sa5dJaEYu3Z+w2XiFLrdSAi9brEj12I1ds=; b=WeSemoWmFfvDlhbPOdoC6rubi9dTHMvPqDk0MBvH/aSZWxXucJ8O+tqplzGzi6NELX XKDvxQ4ZF02W6bi7Hk3Xwzv6rdPVZvPc03+8S8bgMkF2syv0reCKbVD5fsmDqF/VvZM5 EqMdK+BLuxHVU0RNa3H4VjpMSaOERcS8ltfz9OhRo/bDQf6EjCNGXMkmOV6wygXspvMx tSnN0y5n8a0RZ9zgvnvfT5LmOpEr9Sho/2KHg7NRsy2NxP23LTyW5uN288qMckcPVSC9 OopSYJHEpJanbLHDIfn8Jb012cWP1nRYZ9O/gxH4LD2vNF/07NpTGWyDed46vLUnOUE7 judA== 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=+BvNzpgA0Sa5dJaEYu3Z+w2XiFLrdSAi9brEj12I1ds=; b=v9eNgPD6I5B9TTB0XYyWYpm4hKYC6ghQEG362KK7WCPLv4YxNuTVTPwEu7HU3GPIqk cCWs5fRX+2wXZi1dY6BWP6bv5l9FvEHtF1fdG3hHcwgObAVpb+9HL/T22UKct1oJ7DS3 Athn/7PtJyyYkZN7xhLDDOwFNz+X+MBS0RM73qnPXeE07+TJQ/Pye2TLsdekgPQmp09H wtyZSqAEWzOYnRFgIgxCoie7ZILks5MxW/xpc2veNTNMU7l9lSIIVfCNkTCJoph0a9sO 1gEKBzJTlqGEZgoZ+Oo75gmpY+rYrRd6nTIBjsxQLoXeyotpWRm+upzITHO8XClD7Sjf LWyQ== X-Gm-Message-State: AOAM530US9J9znBXV26IWgbcx5ShIlzW2cwMwwjtaXV21EK8TwrpXI/N 5baiMrbJFOBkoBlgIR46Avj5MRYhGG+Oj5EzYkE= X-Google-Smtp-Source: ABdhPJxrMW7YWEHpk1XkVg+oEkBst/bPodP81/GXX2ysJIdFhZFGHRzuevIqTSQKjdIeH0oYJU6PmA== X-Received: by 2002:a05:622a:134d:b0:2df:e996:8814 with SMTP id w13-20020a05622a134d00b002dfe9968814mr5074450qtk.245.1645880588647; Sat, 26 Feb 2022 05:03:08 -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 h17-20020ac87d51000000b002de919e3187sm3460377qtb.28.2022.02.26.05.03.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:08 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. Date: Sat, 26 Feb 2022 08:02:35 -0500 Message-Id: <20220226130254.1301333-4-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: Adjust path. * gnu/packages/racket.scm (extract-package-source, extract-package-source*): New procedures. (extend-layer): Rename to ... (make-installation-layer.rkt): ... this variable. Tweak command-line arguments. Adapt to 'config-tethered-apps-dir'. (racket): Stop inheriting from 'racket-minimal'. [version]: Use '%racket-version'. [source]: Stop using bundled tarball. [inputs]: Remove labels. Add 'racket-minimal' and package sources. [native-inputs]: Remove, since cross-compilation doesn't work yet. [arguments]: Rewrite to use G-expressions, package sources from 'inputs', an explicit 'install' phase, and the revised 'make-installation-layer.rkt'. --- ...acket-gui-tethered-launcher-backport.patch | 6 +- gnu/packages/racket.scm | 1151 ++++++++++++++--- 2 files changed, 975 insertions(+), 182 deletions(-) diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch index abf253486f..1e018eaa79 100644 --- a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -7,13 +7,13 @@ Related to racket/racket#4133 (cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) --- - share/pkgs/gui-lib/mred/installer.rkt | 3 ++- + gui-lib/mred/installer.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt index b1691472..9ef06c53 100644 ---- a/share/pkgs/gui-lib/mred/installer.rkt -+++ b/share/pkgs/gui-lib/mred/installer.rkt +--- a/gui-lib/mred/installer.rkt ++++ b/gui-lib/mred/installer.rkt @@ -72,4 +72,5 @@ (list "-A" (path->string (find-system-path 'addon-dir))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 00ec587eeb..9970dacedb 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -28,7 +28,9 @@ (define-module (gnu packages racket) #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 exceptions) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) @@ -389,172 +391,939 @@ (define-public racket-bootstrap-chez-bootfiles Chez Scheme.") (license (list license:asl2.0))))) +(define (extract-package-source origin spec) + "Extract the source for a Racket package specified by SPEC from ORIGIN into +a new file-like object. In the resulting file-like object, the package source +will be in the directory \"/share/racket/pkgs/NAME/\", where NAME is the Racket +name for the package. -(define %installer-mirrors - ;; Source: - ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58 - ;; Matthew Flatt says: "note that many are commented out" - ;; INVARIANT: End with a trailing "/"! - '("https://mirror.racket-lang.org/installers/" - "https://www.cs.utah.edu/plt/installers/" - "https://plt.cs.northwestern.edu/racket-mirror/" - "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" - ;; Universität Tübingen is using a self-signed HTTPS certificate: - "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" - "https://racket.infogroep.be/" - )) - -(define %main-repo-main-distribution-pkgs - ;; These are the packages developed in the main Racket Git repository - ;; that are part of the main distribution. - '("at-exp-lib" - "base" - "compiler-lib" - ;; NOT "compiler-test" - "compiler" - "net-doc" - "net-lib" - ;; NOT "net-test" - "net" - ;; NOT "plt-services" - ;; NOT "racket-benchmarks" - ;; NOT "racket-build-guide" - "racket-doc" - "racket-index" - "racket-lib" - ;; NOT "racket-test-core" - ;; NOT "racket-test-extra" - ;; NOT "racket-test" - "zo-lib")) +SPEC is a list of the form: + (NAME PATH) + +where PATH is the path to the package source relative to ORIGIN---possibly +`\".\"`. As a special case, SPEC may also be given a string, which is +equivalent to: + + (NAME NAME) + +Examples: + + +- \"expeditor\" +- (\"main-distribution\" \".\") +- (\"racket-lib\" \"pkgs/racket-lib\")" + (match (match spec + ((? string? name) + (list name (file-append origin (string-append "/" name)))) + ((name ".") + (list name origin)) + ((name path) + (list name (file-append origin (string-append "/" path))))) + ((name src) + (computed-file + (string-append "racket-pkg-" name) + (with-imported-modules `((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p (string-append #$output "/share/racket/pkgs")) + (copy-recursively #$src (string-append #$output + "/share/racket/pkgs/" + #$name)))))))) + +(define (extract-package-source* source-groups) + "Return a list of file-like objects containing the sources of the Racket +packages specified by SOURCE-GROUPS, a list of the form: + + ((ORIGIN SPEC ...) ...) + +The result is equivalent to: + + (append (list (extract-package-source ORIGIN SPEC) ...) ...)" + (append-map (match-lambda + ((origin . specs) + (map (cut extract-package-source origin <>) + specs))) + source-groups)) (define-public racket (package - (inherit racket-minimal) (name "racket") (version %racket-version) - (source - (origin - (method url-fetch) - (uri (map (lambda (base) - (string-append base version "/racket-src.tgz")) - %installer-mirrors)) - (sha256 - (base32 - "0dsv7br85nvh5gjfihznq9jb1dzas0f6gnv5qwc9zmb7yn75nrp5")) - (patches - ;; remove in Racket 8.5 - ;; see https://github.com/racket/racket/issues/4133 - (search-patches "racket-gui-tethered-launcher-backport.patch")) - (snippet - #~(begin - (use-modules (guix build utils) - (ice-9 match) - (ice-9 regex)) - ;; unbundle minimal Racket - (for-each delete-file-recursively - '("collects" - "doc" - "etc" - "README" - "src")) - ;; unbundle package sources included elsewhere - (with-directory-excursion "share/pkgs" - (for-each delete-file-recursively - '#+%main-repo-main-distribution-pkgs)) - ;; Minimal workaround for FSDG issue: - ;; see . - ;; We will backport a better fix once we use Git - ;; origins for Racket packages. - (delete-file-recursively "share/pkgs/srfi-doc-nonfree") - (substitute* "share/pkgs/srfi/info.rkt" - (("\"srfi-doc-nonfree\"") - "")))))) + (source #f) (inputs - `(("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("glib" ,glib) - ("glu" ,glu) - ("gmp" ,gmp) - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("mpfr" ,mpfr) - ("pango" ,pango) - ("unixodbc" ,unixodbc) - ("libedit" ,libedit))) - (native-inputs - `(("racket" ,racket-minimal) - ("extend-layer" ,extend-layer) - ("main-repo" ,%racket-origin))) + (cons* + cairo + fontconfig + glib + glu + gmp + gtk+ ;; propagates gdk-pixbuf+svg + libjpeg-turbo + libpng + libx11 ;; ?? wayland ?? + mesa + mpfr + pango + unixodbc + libedit ;; TODO reconsider in light of expeditor and readline-gpl + racket-minimal ;; <-- TODO non-tethered layer + (extract-package-source* + `((,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/2d") + (commit %racket-commit))) + (sha256 (base32 + "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) + (file-name + (git-file-name "racket-2d" %racket-version))) + "2d" "2d-doc" "2d-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/algol60") + (commit %racket-commit))) + (sha256 (base32 + "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx")) + (file-name + (git-file-name "racket-algol60" %racket-version))) + ("algol60" ".")) + (,%racket-origin + ("base" "pkgs/base") ;; FIXME belongs in racket-minimal + ("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in racket-minimal + ("at-exp-lib" "pkgs/at-exp-lib") + ("compiler" "pkgs/compiler") + ("compiler-lib" "pkgs/compiler-lib") + ("net" "pkgs/net") + ("net-doc" "pkgs/net-doc") + ("net-lib" "pkgs/net-lib") + ("racket-doc" "pkgs/racket-doc") + ("racket-index" "pkgs/racket-index") + ("sandbox-lib" "pkgs/sandbox-lib") + ("zo-lib" "pkgs/zo-lib")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/cext-lib") + (commit %racket-commit))) + (sha256 (base32 + "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341")) + (file-name (git-file-name "racket-cext-lib" %racket-version))) + "cext-lib" "dynext-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/class-iop") + (commit %racket-commit))) + (sha256 (base32 + "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l")) + (file-name (git-file-name "racket-class-iop" %racket-version))) + "class-iop-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/compatibility") + (commit "37f11132cdad7ef27386b68383d073f275d67c31"))) + (sha256 (base32 + "0bfqwscjpyi325br5pa6g62g9c8lq18a80zp5g3d2qzn3n3mi6x0")) + (file-name + (git-file-name "racket-compatibility" %racket-version))) + "compatibility" "compatibility-doc" "compatibility-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/contract-profile") + (commit "95d980a076126b8e4e4284e912f2a7d9d3ab6860"))) + (sha256 (base32 + "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3")) + (file-name + (git-file-name "racket-contract-profile" %racket-version))) + ("contract-profile" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/data") + (commit "e32d012b394e32e102e8a9adfcc885bb0541ab51"))) + (sha256 (base32 + "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55")) + (file-name (git-file-name "racket-data" %racket-version))) + "data" "data-doc" "data-enumerate-lib" "data-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/datalog") + (commit "7d160a86451af8298093d07674a2eb0e1a0161a4"))) + (sha256 (base32 + "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp")) + (file-name (git-file-name "racket-datalog" %racket-version))) + ("datalog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/db") + (commit %racket-commit))) + (sha256 (base32 + "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5")) + (file-name (git-file-name "racket-db" %racket-version))) + "db" "db-doc" "db-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/deinprogramm") + (commit %racket-commit))) + (sha256 (base32 + "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd")) + (file-name + (git-file-name "racket-deinprogramm" %racket-version))) + "deinprogramm" "deinprogramm-signature") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/distributed-places") + (commit %racket-commit))) + (sha256 (base32 + "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0")) + (file-name + (git-file-name "racket-distributed-places" %racket-version))) + "distributed-places" + "distributed-places-doc" + "distributed-places-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/draw") + (commit %racket-commit))) + (sha256 (base32 + "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly")) + (file-name (git-file-name "racket-draw" %racket-version))) + "draw" "draw-doc" "draw-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/drracket") + (commit %racket-commit))) + (sha256 (base32 + "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c")) + (file-name (git-file-name "racket-drracket" %racket-version))) + "drracket" + "drracket-plugin-lib" + "drracket-tool" + "drracket-tool-doc" + "drracket-tool-lib" + "drracket-tool-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/ds-store") + (commit "949ca63dd00522b3ab8aec2d71c543ece8266872"))) + (sha256 (base32 + "0ajr27kipp4dr1qlisaghsb3h7lhhjwrfw2r79b5myczsa1mp661")) + (file-name (git-file-name "racket-ds-store" %racket-version))) + "ds-store" "ds-store-doc" "ds-store-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eli-tester") + (commit "036e07d43a1f478ea1750881d5591d983ce1ffaf"))) + (sha256 (base32 + "0icx6wn14gjm8kdmq1jppqgq87sxkras4qb5xmdr6wigxafhjqyk")) + (file-name (git-file-name "racket-eli-tester" %racket-version))) + ("eli-tester" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/eopl") + (commit %racket-commit))) + (sha256 (base32 + "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s")) + (file-name (git-file-name "racket-eopl" %racket-version))) + ("eopl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/errortrace") + (commit %racket-commit))) + (sha256 (base32 + "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip")) + (file-name (git-file-name "racket-errortrace" %racket-version))) + "errortrace" "errortrace-doc" "errortrace-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/expeditor") + (commit %racket-commit))) + (sha256 (base32 + "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf")) + (file-name (git-file-name "racket-expeditor" %racket-version))) + "expeditor" "expeditor-doc" "expeditor-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/frtime") + (commit %racket-commit))) + (sha256 (base32 + "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5")) + (file-name (git-file-name "racket-frtime" %racket-version))) + ("frtime" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/future-visualizer") + (commit %racket-commit))) + (sha256 (base32 + "1758qq769m0r14xf64sl2ix2l9z340kvapar0j7s5kdg42lmvnhm")) + (file-name + (git-file-name "racket-future-visualizer" %racket-version))) + "future-visualizer" + "future-visualizer-pict" + "future-visualizer-typed") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/games") + + (commit %racket-commit))) + (sha256 (base32 + "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d")) + (file-name (git-file-name "racket-games" %racket-version))) + ("games" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui") + (commit %racket-commit))) + (sha256 (base32 + "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) + (file-name (git-file-name "racket-gui" %racket-version))) + "gui" "gui-doc" "gui-lib" "tex-table") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui-pkg-manager") + (commit %racket-commit))) + (sha256 (base32 + "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5")) + (file-name + (git-file-name "racket-gui-pkg-manager" %racket-version))) + "gui-pkg-manager-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/htdp") + (commit %racket-commit))) + (sha256 (base32 + "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl")) + (file-name (git-file-name "racket-htdp" %racket-version))) + "htdp" "htdp-doc" "htdp-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/html") + (commit %racket-commit))) + (sha256 (base32 + "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x")) + (file-name (git-file-name "racket-html" %racket-version))) + "html" "html-doc" "html-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/icons") + (commit %racket-commit))) + (sha256 (base32 + "1s5a6j11fg3fdr6b7vm2q7q178d7q8b8igy73bs211r27qrd1gg7")) + (file-name (git-file-name "racket-icons" %racket-version))) + ("icons" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/images") + (commit %racket-commit))) + (sha256 (base32 + "0rpjxqw34bq5m08kh1ldl1mr7s9z1lyydxxcyzb292kqh9qiqvfl")) + (file-name (git-file-name "racket-images" %racket-version))) + "images" "images-doc" "images-gui-lib" "images-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/lazy") + (commit %racket-commit))) + (sha256 (base32 + "176ylzgbdsbmqknpihaz519afq71pyjkv1h87j5v8jfbpbddyfsf")) + (file-name (git-file-name "racket-lazy" %racket-version))) + ("lazy" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/macro-debugger") + (commit %racket-commit))) + (sha256 (base32 + "14hyrwbkffr61fk44l02xb47bhv5zccw0ymaa9kxld86hvyqhqbm")) + (file-name + (git-file-name "racket-macro-debugger" %racket-version))) + "macro-debugger" "macro-debugger-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/main-distribution") + (commit %racket-commit))) + (sha256 (base32 + "0m2n9s32s8a4a2gn4ywrm9l8jycdm5ayi5w9kh5wchhrrw7qzq7y")) + (file-name + (git-file-name "racket-main-distribution" %racket-version))) + ("main-distribution" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/make") + (commit %racket-commit))) + (sha256 (base32 + "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa")) + (file-name (git-file-name "racket-make" %racket-version))) + ("make" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/math") + (commit %racket-commit))) + (sha256 (base32 + "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac")) + (file-name (git-file-name "racket-math" %racket-version))) + "math" "math-doc" "math-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mysterx") + (commit %racket-commit))) + (sha256 (base32 + "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48")) + (file-name (git-file-name "racket-mysterx" %racket-version))) + ("mysterx" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzcom") + (commit %racket-commit))) + (sha256 (base32 + "0rc9pfj7gwm5azghqvcibz6si1x5s2v8mr2yngk7ssq9gzfbi6a4")) + (file-name (git-file-name "racket-mzcom" %racket-version))) + ("mzcom" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/mzscheme") + (commit %racket-commit))) + (sha256 (base32 + "192c52zi726h5wjamxrhivjw2waq1im0zpyxhbrkrxknm8x84bs9")) + (file-name (git-file-name "racket-mzscheme" %racket-version))) + "mzscheme" "mzscheme-doc" "mzscheme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RenaissanceBug/racket-cookies") + (commit %racket-commit))) + (sha256 (base32 + "0k0hifxhywl5c3hjcaiizc098dpyk001d981p572gly116yvjxc1")) + (file-name + (git-file-name "RenaissanceBug-racket-cookies" %racket-version))) + "net-cookies" "net-cookies-doc" "net-cookies-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stamourv/optimization-coach") + (commit %racket-commit))) + (sha256 (base32 + "0b27sw48d7rhz0hin88c7rbr9vpg1c23sn82nd4jkmq54h6gasr1")) + (file-name + (git-file-name "stamourv-optimization-coach" %racket-version))) + ("optimization-coach" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/option-contract") + (commit %racket-commit))) + (sha256 (base32 + "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk")) + (file-name + (git-file-name "racket-option-contract" %racket-version))) + "option-contract" "option-contract-doc" "option-contract-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/parser-tools") + (commit %racket-commit))) + (sha256 (base32 + "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3")) + (file-name (git-file-name "racket-parser-tools" %racket-version))) + "parser-tools" "parser-tools-doc" "parser-tools-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pconvert") + (commit %racket-commit))) + (sha256 (base32 + "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1")) + (file-name (git-file-name "racket-pconvert" %racket-version))) + "pconvert-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict") + (commit %racket-commit))) + (sha256 (base32 + "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x")) + (file-name (git-file-name "racket-pict" %racket-version))) + "pict" "pict-doc" "pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/pict-snip") + (commit %racket-commit))) + (sha256 (base32 + "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x")) + (file-name (git-file-name "racket-pict-snip" %racket-version))) + "pict-snip" "pict-snip-doc" "pict-snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/picturing-programs") + (commit %racket-commit))) + (sha256 (base32 + "1g6xr39hx1j03gb3d4dljm3v91xcj2gfpq3dgy5xvplzr6cmmxgr")) + (file-name + (git-file-name "racket-picturing-programs" %racket-version))) + ("picturing-programs" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plai") + (commit %racket-commit))) + (sha256 (base32 + "0i983sh0r0zm2ng4j44m5aw9669kh5fhp91bzpc9jm280rfcqvyl")) + (file-name (git-file-name "racket-plai" %racket-version))) + "plai" "plai-doc" "plai-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/planet") + (commit %racket-commit))) + (sha256 (base32 + "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9")) + (file-name (git-file-name "racket-planet" %racket-version))) + "planet" "planet-doc" "planet-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/plot") + (commit %racket-commit))) + (sha256 (base32 + "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7")) + (file-name (git-file-name "racket-plot" %racket-version))) + "plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/preprocessor") + (commit %racket-commit))) + (sha256 (base32 + "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg")) + (file-name (git-file-name "racket-preprocessor" %racket-version))) + ("preprocessor" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/profile") + (commit %racket-commit))) + (sha256 (base32 + "179i86lyby29nywz60l4vnadi02w8b12h7501nm5h5g4pq9jjmbb")) + (file-name (git-file-name "racket-profile" %racket-version))) + "profile" "profile-doc" "profile-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Metaxal/quickscript") + (commit %racket-commit))) + (sha256 (base32 + "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + (file-name (git-file-name "Metaxal-quickscript" %racket-version))) + ("quickscript" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r5rs") + (commit %racket-commit))) + (sha256 (base32 + "1g3cysj7z88r38vkzvi8g2fb2hn4yg1fdhy5smxw303jxgl3inp6")) + (file-name (git-file-name "racket-r5rs" %racket-version))) + "r5rs" "r5rs-doc" "r5rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/r6rs") + (commit %racket-commit))) + (sha256 (base32 + "0b1ymzdp10r0flw2acbidjsh5ma1pm5hy54jss37sxf89z3xbvm4")) + (file-name (git-file-name "racket-r6rs" %racket-version))) + "r6rs" "r6rs-doc" "r6rs-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeapostrophe/racket-cheat") + (commit %racket-commit))) + (sha256 (base32 + "06wcj558rzkbl2bwkmikyspya9v1f4iwlzwnwxpkc33h2xapwabr")) + (file-name + (git-file-name "jeapostrophe-racket-cheat" %racket-version))) + ("racket-cheat" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racklog") + (commit %racket-commit))) + (sha256 (base32 + "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb")) + (file-name (git-file-name "racket-racklog" %racket-version))) + ("racklog" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/rackunit") + (commit %racket-commit))) + (sha256 (base32 + "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p")) + (file-name (git-file-name "racket-rackunit" %racket-version))) + "rackunit" + "rackunit-doc" + "rackunit-gui" + "rackunit-lib" + "rackunit-plugin-lib" + "rackunit-typed" + "schemeunit" + "testing-util-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/readline") + (commit %racket-commit))) + (sha256 (base32 + "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn")) + (file-name (git-file-name "racket-readline" %racket-version))) + "readline" "readline-doc" "readline-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/realm") + (commit %racket-commit))) + (sha256 (base32 + "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi")) + (file-name (git-file-name "racket-realm" %racket-version))) + ("realm" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/redex") + (commit %racket-commit))) + (sha256 (base32 + "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f")) + (file-name (git-file-name "racket-redex" %racket-version))) + "redex" + "redex-benchmark" + "redex-doc" + "redex-examples" + "redex-gui-lib" + "redex-lib" + "redex-pict-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sasl") + (commit %racket-commit))) + (sha256 (base32 + "0ibh4wb4gn8pggx6gkv4vk4d6rwzn5nrvjibhvkzhaynf6lhb824")) + (file-name (git-file-name "racket-sasl" %racket-version))) + "sasl" "sasl-doc" "sasl-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scheme-lib") + (commit %racket-commit))) + (sha256 (base32 + "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x")) + (file-name (git-file-name "racket-scheme-lib" %racket-version))) + ("scheme-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/scribble") + (commit %racket-commit))) + (sha256 (base32 + "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm")) + (file-name (git-file-name "racket-scribble" %racket-version))) + "scribble" + "scribble-doc" + "scribble-html-lib" + "scribble-lib" + "scribble-text-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/serialize-cstruct-lib") + (commit %racket-commit))) + (sha256 (base32 + "1rq3n1fa7ldjwx3lrh9ybhig7jlsw1crpzyklbzp3xqdw6jymfnz")) + (file-name + (git-file-name "racket-serialize-cstruct-lib" %racket-version))) + ("serialize-cstruct-lib" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/sgl") + (commit %racket-commit))) + (sha256 (base32 + "0nkymhdyjrwi5h199j4w5zh7y3x3ai42gsiwxzh0hy7yqrqqg9zv")) + (file-name (git-file-name "racket-sgl" %racket-version))) + ("sgl" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/shell-completion") + (commit %racket-commit))) + (sha256 (base32 + "04m144gy2mp4fiq6rcbf12wjr8mws8k9scfhg9lc38vqppp4lxsj")) + (file-name + (git-file-name "racket-shell-completion" %racket-version))) + ("shell-completion" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/simple-tree-text-markup") + (commit %racket-commit))) + (sha256 (base32 + "0fyd9gfz6bnv0m1901wv5mnhc05rm8hw9i6ddrqx33hs6qsg2zqr")) + (file-name + (git-file-name "racket-simple-tree-text-markup" %racket-version))) + "simple-tree-text-markup" + "simple-tree-text-markup-doc" + "simple-tree-text-markup-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slatex") + (commit "47e1d3e3e33d826bc2b26f9e8998eb235b23a9a5"))) + (sha256 (base32 + "0pkm2isbbdk63slrbsxcql7rr0wdrw5kapw1xq4ps5k8dhlzv8x0")) + (file-name (git-file-name "racket-slatex" %racket-version))) + ("slatex" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/slideshow") + (commit %racket-commit))) + (sha256 (base32 + "1znv1i2d0610hhy71q932xy7wka00q3q50in1xfnk8ibg7nzkagm")) + (file-name (git-file-name "racket-slideshow" %racket-version))) + "slideshow" "slideshow-doc" "slideshow-exe" "slideshow-lib" + "slideshow-plugin") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/snip") + (commit %racket-commit))) + (sha256 (base32 + "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj")) + (file-name (git-file-name "racket-snip" %racket-version))) + "snip" "snip-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/typed-racket") + (commit %racket-commit))) + (sha256 (base32 + "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv")) + (file-name (git-file-name "racket-typed-racket" %racket-version))) + "source-syntax" + "typed-racket" + "typed-racket-compatibility" + "typed-racket-doc" + "typed-racket-lib" + "typed-racket-more") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/srfi") + ;; Includes an FSDG fix: return to %racket-commit in 8.5. + ;; See . + (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) + (sha256 (base32 + "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) + ;; Use the relevant version for srfi-doc and srfi-lib, + ;; since we're using a newer commit than the v8.4 tag. + (file-name (git-file-name "racket-srfi" "1.1"))) + "srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/string-constants") + (commit %racket-commit))) + (sha256 (base32 + "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6")) + (file-name + (git-file-name "racket-string-constants" %racket-version))) + "string-constants" "string-constants-doc" "string-constants-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/swindle") + (commit %racket-commit))) + (sha256 (base32 + "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67")) + (file-name (git-file-name "racket-swindle" %racket-version))) + ("swindle" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/syntax-color") + (commit %racket-commit))) + (sha256 (base32 + "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp")) + (file-name (git-file-name "racket-syntax-color" %racket-version))) + "syntax-color" "syntax-color-doc" "syntax-color-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/trace") + (commit %racket-commit))) + (sha256 (base32 + "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia")) + (file-name (git-file-name "racket-trace" %racket-version))) + ("trace" ".")) + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/unix-socket") + (commit %racket-commit))) + (sha256 (base32 + "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y")) + (file-name (git-file-name "racket-unix-socket" %racket-version))) + "unix-socket" "unix-socket-doc" "unix-socket-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/web-server") + (commit %racket-commit))) + (sha256 (base32 + "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn")) + (file-name (git-file-name "racket-web-server" %racket-version))) + "web-server" "web-server-doc" "web-server-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/wxme") + (commit %racket-commit))) + (sha256 (base32 + "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b")) + (file-name (git-file-name "racket-wxme" %racket-version))) + "wxme" "wxme-lib") + (,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/xrepl") + (commit %racket-commit))) + (sha256 (base32 + "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3")) + (file-name (git-file-name "racket-xrepl" %racket-version))) + "xrepl" "xrepl-doc" "xrepl-lib"))))) + (build-system gnu-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'configure 'unpack-packages - (let ((unpack (assoc-ref %standard-phases 'unpack))) - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out")) - (pkgs-dir (string-append prefix "/share/racket/pkgs"))) - (mkdir-p pkgs-dir) - (copy-recursively - "share/links.rktd" - (string-append prefix "/share/racket/links.rktd")) - (copy-recursively "share/pkgs" pkgs-dir) - ;; NOTE: unpack changes the working directory - (unpack #:source (assoc-ref (or native-inputs inputs) - "main-repo")) - (for-each (lambda (pkg) - (define dest (string-append pkgs-dir "/" pkg)) - (mkdir-p dest) - (copy-recursively (string-append "pkgs/" pkg) - dest)) - ',%main-repo-main-distribution-pkgs) - #t)))) - (replace 'configure - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out"))) - (apply invoke - (string-append racket "/bin/racket") - (assoc-ref inputs "extend-layer") - racket - prefix - (map - (lambda (lib) - (string-append (assoc-ref inputs lib) "/lib")) - '("cairo" - "fontconfig" - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))) - #t))) - (replace 'build - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) - "racket") - "/bin/racket") - "--config" - (string-append (assoc-ref outputs "out") - "/etc/racket") - "-l" - "raco" - "setup") - #t)) - (delete 'install)) - ;; we still don't have these: - #:tests? #f)) + ;; We're using #:configure-flags to pass flags for + ;; `make-installation-layer.rkt` and #:make-flags to pass arguments for + ;; `raco pkg install`. + (list + #:configure-flags + #~`("--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit"))))) + #:make-flags #~`("main-distribution") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (guix build union) + (ice-9 match)) + #:imported-modules `((guix build union) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (delete 'unpack) + (replace 'configure + (lambda* (#:key inputs configure-flags #:allow-other-keys) + (let* ((racket (search-input-file inputs "bin/racket"))) + (apply invoke + racket + #$make-installation-layer.rkt + `(,@configure-flags + ,(dirname (dirname racket)) + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; We use "share/racket/pkgs" for sources to distinguish them + ;; from the "lib/racket/pkgs" of a potential parent layer. + (union-build (string-append #$output "/lib/racket/pkgs") + (search-path-as-list '("share/racket/pkgs") + (map cdr inputs)) + #:create-all-directories? #t))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket (search-input-file inputs "/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) + (home-page "https://racket-lang.org") (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -564,17 +1333,20 @@ (define dest (string-append pkgs-dir "/" pkg)) The main Racket distribution comes with many bundled packages, including the DrRacket IDE, libraries for GUI and web programming, and implementations of -languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) - +languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) -(define extend-layer +(define make-installation-layer.rkt (scheme-file - "extend-layer.rkt" + "make-installation-layer.rkt" `(module - extend-layer racket/base + make-installation-layer racket/base (require racket/cmdline racket/match racket/file + racket/port racket/list racket/pretty) (define config-file-pth @@ -584,8 +1356,14 @@ (define (build-path-string . args) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) + (define extra-foreign-lib-search-dirs '()) (command-line - #:args (parent-layer prefix . lib-dir*) + #:once-each + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (parent-layer prefix) (let* ([config (for/fold ([config (file->value (build-path parent-layer @@ -615,27 +1393,42 @@ (define rx:racket (build-path-string parent-layer pth)) (filter values (hash-ref config search-key null)))))] [config - (hash-set config - 'apps-dir - (build-path-string prefix "share/applications"))] + (hash-update config + 'lib-search-dirs + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] [config - ;; place new foreign lib-search-dirs before old - ;; foreign dirs, but after Racket layers - (let-values - ([(rkt extra) - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - (hash-ref config 'lib-search-dirs))]) - (hash-set config - 'lib-search-dirs - (append rkt - lib-dir* - extra)))] + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaroung Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] [bin-dir (hash-ref config 'bin-dir)] [config (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) 'config-tethered-console-bin-dir bin-dir 'config-tethered-gui-bin-dir bin-dir)] [new-config-pth -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:33 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:33 +0000 Received: from localhost ([127.0.0.1]:54429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjU-0005U5-CO for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:33 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:40541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjG-0005T1-RT for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:19 -0500 Received: by mail-qt1-f180.google.com with SMTP id t28so4991336qtc.7 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:18 -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=x2ByxCnfjdIJ0pbvJh/yOhytZtvQCAowFzArNWCWjBU=; b=XoUYU20zVzD0kh6X+ZIe6V9wUA2Kpwtak9z0fF62y6b7MuE5HfKmCqSSIE19HvVvPQ FDxSuedowxwCAO872P8lubwPnNSyANnUo0HCja3OtaN1Ri5LTJm7/emRVlG4UPowuAiA 2P1uKugnoHLR5Ac51o6bckbc50RSrRx6H/iRFdNEmF6lH+yWtiDAyJiuxiKdzlsSTvfq fb4g8jIlduU5gbpKpGxzfgbs0moV4fa99YKkeP7a/a1Pk7f6YVmi6nKNgcgMkykvFCD3 B4R2juiK3mfT5sShNRe+1UHA5ZinT5LWKO1FCAEQ2vtSky5FtDjxNjTbZLxr9dbU8+9N jMFQ== 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=x2ByxCnfjdIJ0pbvJh/yOhytZtvQCAowFzArNWCWjBU=; b=IlYvCmMbF2Pv5IfDB2Tp9ksDgc8RvQoD1DuKwN5n2SlX7D4myA2ycvNy0o9J1nvtY7 fZQ5Svkq7I7ga8diMPEdF8XlSOW8eDSaOf7GHhsR7mafl39m8WTIPono5RuSALv7jsqj WaeUaU2fpunPt0huKvRKCPhYOUdyBQVLluuy2B6kYSRsI97iGdfkTP8vHidP1qUeU15k nZt1BSDH3mQ/khyRmkY+zJvKACv1oJpFvz82z/Ydfq5UcyiNxmN4amLJ4J3GSjpyXNUF Pu4yDTiKPArQcV7SdJ48LONy3peAlp7QozQKg1NxxxPzQgKsflsJ0T5YVvW593yU09ZR C0fA== X-Gm-Message-State: AOAM530ZKP2MpHkoP8Griwd3uolRHI1eXPL2PIgygyoVIpM6fvGEVsh/ Xby5A6er1re6tOavwv4S37VRZUxGEX1OgeYSOYk= X-Google-Smtp-Source: ABdhPJxwS1jbrCUkWO06zBylQ/4tAZ3xrR8RIRSUhxKJgUikYGo+ZV5Kr4StsNzlyRGQgDZ60zaBkQ== X-Received: by 2002:a05:622a:13d2:b0:2dd:6c76:2e32 with SMTP id p18-20020a05622a13d200b002dd6c762e32mr10543466qtk.610.1645880592787; Sat, 26 Feb 2022 05:03:12 -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 d186-20020a379bc3000000b006490a4e507esm2494008qke.70.2022.02.26.05.03.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:12 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 04/22] gnu: racket-minimal: Use new package style. Date: Sat, 26 Feb 2022 08:02:36 -0500 Message-Id: <20220226130254.1301333-5-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (cfg-flag:sh-for-rktio, cfg-flag:enable-lt, cfg-glag:enable-racket): Change to G-expressions and combine in ... (racket-vm-common-configure-flags): ... this new thunk. (unpack-nanopass+stex): Change to G-expression and move to ... (make-unpack-nanopass+stex): ... this new thunk. (racket-bootstrap-chez-bootfiles): Rename to ... (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable, and stop inheriting from 'racket-minimal'. [native-inputs]: Remove labels. [build-system]: Use 'copy-build-system'. [arguments]: Use G-expressions. Install under "lib". (racket-minimal)[inputs, native-inputs]: Remove labels. [arguments]: Use G-expressions. Avoid 'assoc-ref'. Adapt to changes in 'chez-scheme-for-racket-bootstrap-bootfiles'. (racket-minimal-bc-3m)[native-inputs]: Remove labels. [arguments]: Use G-expressions. (racket-minimal-bc-cgc)[native-inputs]: Remove labels. [arguments]: Use G-expressions. --- gnu/packages/racket.scm | 332 ++++++++++++++++++++-------------------- 1 file changed, 163 insertions(+), 169 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 9970dacedb..55514148cb 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -26,6 +26,7 @@ (define-module (gnu packages racket) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -99,7 +100,7 @@ (define-module (gnu packages racket) ;; Code: (define %racket-version "8.4") -;; ^ Remember to update racket-bootstrap-chez-bootfiles! +;; ^ Remember to update chez-scheme-for-racket-bootstrap-bootfiles! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -133,34 +134,42 @@ (define %racket-origin ;; Unbundle libffi. (delete-file-recursively "racket/src/bc/foreign/libffi"))))) -(define cfg-flag:sh-for-rktio - `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - (assoc-ref %build-inputs "sh") - "/bin/sh")) -(define cfg-flag:enable-lt - `(string-append "--enable-lt=" - (assoc-ref %build-inputs "libtool") - "/bin/libtool")) -(define cfg-flag:enable-racket - `(let ((racket (assoc-ref %build-inputs "racket"))) - (string-append "--enable-racket=" - racket - "/bin/racket"))) +(define (racket-vm-common-configure-flags) + ;; under a lambda abstraction to avoid evaluating bash-minimal too early. + #~`(,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/libtool")) + => (lambda (libtool) + (list (string-append "--enable-lt=" libtool)))) + (else + '())) + ,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/racket")) + => (lambda (racket) + (list (string-append "--enable-racket=" racket)))) + (else + '())) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")))) -(define unpack-nanopass+stex - ;; Copied from chez-scheme. - ;; TODO: Eventually, we should refactor Chez Scheme - ;; enough to share more directly, so that we can make - ;; Racket's version of Chez avalable as a Guix package, - ;; e.g. for architectures not supported upstream. - ;; For now, we let Racket drive the Chez build process - ;; other than this step. - `(for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex"))) +(define (make-unpack-nanopass+stex) + ;; Adapted from chez-scheme. + ;; TODO: Refactor enough to share this directly. + ;; Thunked to avoid evaliating 'chez-scheme' too early. + #~(begin + (copy-recursively + #$(match (assoc-ref (package-native-inputs chez-scheme) + "nanopass") + ((src) + src)) + "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-public racket-minimal @@ -169,91 +178,87 @@ (define-public racket-minimal (version %racket-version) (source %racket-origin) (inputs - `(;; common to all racket-minimal variants: - ("openssl" ,openssl) - ("sqlite" ,sqlite) - ("sh" ,bash-minimal) ;; <- for `system` - ("ncurses" ,ncurses) ;; <- for #%terminal - ;; only for CS - ("zlib" ,zlib) - ("lz4" ,lz4))) + (list + ;; common to all racket-minimal variants: + openssl + sqlite + bash-minimal ;; <- for `system` + ncurses ;; <- for #%terminal + ;; only for CS + zlib + lz4)) (native-inputs - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) + (list chez-scheme-for-racket-bootstrap-bootfiles + racket-minimal-bc-3m)) (build-system gnu-build-system) (arguments - `(#:configure-flags - (list "--enable-csonly" - "--enable-libz" - "--enable-liblz4" - ,cfg-flag:enable-racket - ,cfg-flag:sh-for-rktio) - #:out-of-source? #true - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main distribution. - #:tests? #f - #:modules ((ice-9 match) + (list + #:configure-flags + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) (guix build gnu-build-system) (guix build utils)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (string-append (assoc-ref inputs "bootfiles") "/boot") - "boot")) - #t)) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f ,@(map (lambda (lib) - (string-append (assoc-ref inputs lib) - "/lib")) - '("openssl" - "sqlite")))) - (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - ,version - "/catalog/") - #f)))))) - #t)) - (add-before 'configure 'change-directory - (lambda _ - (chdir "racket/src") - #t)) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda* (#:key outputs #:allow-other-keys) - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append (assoc-ref outputs "out") - "/share/racket/pkgs")) - #t))))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (with-directory-excursion "racket/src/ChezScheme" + #$(make-unpack-nanopass+stex)))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "racket/src/ChezScheme" + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot")))) + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((lib-search-dirs + . (#f #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib"))) + (build-stamp . "") + (catalogs + . (,(string-append + "https://download.racket-lang.org/releases/" + #$(package-version this-package) + "/catalog/") + #f)))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (add-after 'install 'remove-pkgs-directory + ;; If the configured pkgs-dir exists, "pkgs.rktd" does not + ;; exist, and a lock file does not exist, commands like + ;; `raco pkg show` will try to create a lock file and fail + ;; due to the read-only store. + ;; Arguably this may be a bug in `pkg/private/lock`: + ;; see . + ;; As a workaround, remove the directory. + (lambda args + ;; rmdir because we want an error if it isn't empty + (rmdir (string-append #$output "/share/racket/pkgs"))))))) (home-page "https://racket-lang.org") (synopsis "Racket without bundled packages such as DrRacket") (description @@ -269,7 +274,6 @@ (define (write-racket-hash alist) ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) - (define-public racket-minimal-bc-3m (hidden-package (package @@ -280,21 +284,19 @@ (define-public racket-minimal-bc-3m (prepend libffi) ;; <- only for BC variants (delete "zlib" "lz4"))) (native-inputs - `(("libtool" ,libtool) - ("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc)))) + (list libtool + (if (%current-target-system) + racket-minimal + racket-minimal-bc-cgc))) (arguments (substitute-keyword-arguments (package-arguments racket-minimal) ((#:configure-flags _ '()) - `(list "--enable-bconly" - ,cfg-flag:enable-racket - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)) - ((#:phases usual-phases) - `(modify-phases ,usual-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))) + ((#:phases cs-phases) + #~(modify-phases #$cs-phases + (delete 'unpack-nanopass+stex) + (delete 'unpack-bootfiles))))) (synopsis "Minimal Racket with the BC [3M] runtime system") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written @@ -309,19 +311,16 @@ (define-public racket-minimal-bc-3m ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) - (define-public racket-minimal-bc-cgc (package (inherit racket-minimal-bc-3m) (name "racket-minimal-bc-cgc") - (native-inputs - (alist-delete "racket" (package-native-inputs racket-minimal-bc-3m))) + (native-inputs (list libtool)) (arguments (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) ((#:configure-flags _ '()) - `(list "--enable-cgcdefault" - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)))) + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags))))) (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or ``bytecode'') implementation is not recommended for general use. It uses @@ -334,47 +333,42 @@ (define-public racket-minimal-bc-cgc also be used for embedding applications without the annotations needed in C code to use the 3M garbage collector."))) - -(define-public racket-bootstrap-chez-bootfiles - (hidden-package - (package - (inherit racket-minimal) - (name "racket-bootstrap-chez-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. - (inputs `()) - (native-inputs - `(("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-3m)) - ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) "stex")) - ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) - "nanopass")))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (delete 'configure) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (invoke (string-append (assoc-ref inputs "racket") - "/bin/racket") - "rktboot/main.rkt" - "--dest" (assoc-ref outputs "out"))) - #t)) - (delete 'check) - (delete 'install)))) - (synopsis "Chez Scheme bootfiles bootstrapped by Racket") - (description "Chez Scheme is a self-hosting compiler: building it +(define-public chez-scheme-for-racket-bootstrap-bootfiles + (package + (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. + (source %racket-origin) + (inputs `()) + (native-inputs (list racket-minimal-bc-3m)) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list + #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))) + (add-after 'chdir 'unpack-nanopass+stex + (lambda args + #$(make-unpack-nanopass+stex))) + (add-before 'install 'build + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (invoke (search-input-file (or native-inputs inputs) + "/bin/racket") + "rktboot/main.rkt")))))) + (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 "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 supported platforms.) @@ -389,7 +383,7 @@ (define-public racket-bootstrap-chez-bootfiles 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.") - (license (list license:asl2.0))))) + (license (list license:asl2.0)))) (define (extract-package-source origin spec) "Extract the source for a Racket package specified by SPEC from ORIGIN into -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:40 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:40 +0000 Received: from localhost ([127.0.0.1]:54433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjc-0005Ud-FT for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:40 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:44926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjK-0005TA-EF for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:22 -0500 Received: by mail-qt1-f178.google.com with SMTP id v3so4985076qta.11 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:22 -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=Bznu0zrmYZ/IW38lGJi0vbbQr6qr5iOfSkbslRTHEQ0=; b=YzoR5IYcxl9aQ8jXxUjQq+GcLr7Hwz5Pz1ZcbGk9IxZ9dSYENHw4OIUWCJJMaRI7Y6 7k4vsWQtuDnbyVli+9XL3YrjAI3BRKAAGkS2dmN6EhjfXSdrSKSRba7rruS9Gs/mSOz9 o94ljy/EQk8RQhsv7OBUZyfK6G4O1g2KB9XJHZtpaz7imkWhQnGdwH6HrBrc2AWpk6dK DGoMQMrkxJyXDot8YH3Zrx+JCpTNjfTeuZXkfd9MvEOuxA0bj4A6Y4LOoai+oHh4F1RE WP8GamJI2dKueMQrudFSzjWxViyW60QcbwMWccpQaIpy/VsUzejndG6tsCVvROSriYKG 1lVw== 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=Bznu0zrmYZ/IW38lGJi0vbbQr6qr5iOfSkbslRTHEQ0=; b=xvEkZBORtpVmSB0On1ktF3gyrYsOBF7IvkBDWDcs/LqrOVXeGuugg0pVNEPCNQLW6S 9GHuQ6NGz1QX4z/jbMz70VsEhS/7sEgbkXNo2gCpQmT4zvqdhikwM3K3ZfS8K2g4J2f4 YIrqmh7fr4gP+PfpOpEQ/Cc871Zh41bDJj+Myh6qcGU7LwMGtfwL7/ShXigMIqfbXidb 6VBa0nvnwo/+nXU6xeUl8Fudihm3JYV5UXW0yMwQ0im8mVc/Ubv5gZArwMOFXWW/VSI0 NyGNaigTFa7Kk4W+10jkVQBiEqqh399ZNRoUiwx2vVdu83Dg6ZMhuge1fOMjmzv3kKBp iFEQ== X-Gm-Message-State: AOAM531LdzQ6BJyiM3CqBPYkrbC9m6dsDfgdhSAkBxEGUTqXWFOIiDDh sspcwUnrAQzYwmM+8obzztgt/RjLPFFr8er3yJk= X-Google-Smtp-Source: ABdhPJyx/bpmRYtIiA+l3OYhnFJL9noZFZ0g/nASotf9tDDjUh6hJ3oCOTOnPkKGh3ss3rz8+PZ23A== X-Received: by 2002:ac8:7f52:0:b0:2de:3c4c:bfbc with SMTP id g18-20020ac87f52000000b002de3c4cbfbcmr10765320qtk.611.1645880596867; Sat, 26 Feb 2022 05:03:16 -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 b13-20020ac85bcd000000b002d6a901ad4csm3408981qtb.73.2022.02.26.05.03.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:16 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 05/22] gnu: racket-minimal: Don't configure non-existant catalogs. Date: Sat, 26 Feb 2022 08:02:37 -0500 Message-Id: <20220226130254.1301333-6-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-minimal)[arguments]<#:phases>: Change 'initialize-config.rktd' to only add a release catalog when the package version is a release version. --- gnu/packages/racket.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 55514148cb..abcd9658b2 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -231,6 +231,15 @@ (define (write-racket-hash alist) (format #t "(~s . ~s)" k v))) alist) (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) (mkdir-p "racket/etc") (with-output-to-file "racket/etc/config.rktd" (lambda () @@ -239,12 +248,8 @@ (define (write-racket-hash alist) . (#f #$(file-append (this-package-input "openssl") "/lib") #$(file-append (this-package-input "sqlite") "/lib"))) (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - #$(package-version this-package) - "/catalog/") - #f)))))))) + (catalogs ,@maybe-release-catalog + #f))))))) (add-before 'configure 'chdir (lambda _ (chdir "racket/src"))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:44 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:44 +0000 Received: from localhost ([127.0.0.1]:54435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjc-0005Uf-PA for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:44 -0500 Received: from mail-qt1-f177.google.com ([209.85.160.177]:40547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjO-0005TQ-LF for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:27 -0500 Received: by mail-qt1-f177.google.com with SMTP id t28so4991534qtc.7 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:26 -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=evebLUfr/oCnUYVfbsObW4FFLlcC6pEpmbRuPlrqxz0=; b=SZMWEhhIQVgzFKRkfFjwmzX0tIZLYjVeTirzeKQJLvx82jf7clhsWcn/vCgtzZIh9F IFlgajCe/AMeaKpjFdVynAah5azCQs7xkOdrWafNpqjBTkSRG9w6THn5uBn5ekGQGhhh rElkioDV5BoHhKk/D6W4RzpfLG0tiXN0PichF7MwZ3vkvLS5oghPQmBSSC8l/E9O+haw CGwFZljVnAjzWGCg4HNto0g59WPfKXW/73CpUp6Yy+8DhKkIbX3xwjS8QZBPrewG1DJ7 /vY8FZsgWooZjF7xljwcDJCZ9T64bVaJqDbL9iUq6AYwEgW2pYFVq7yUm1+Gp5pmEGCN +4vg== 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=evebLUfr/oCnUYVfbsObW4FFLlcC6pEpmbRuPlrqxz0=; b=RjL3VWmXoMYmkevKC8zse/JUsOwd0rg8gOEBWHLTX11SUqHP8zVTru79MGRJUUq6Bq JBVyn/u2IqmNN5Y4kS8a5Xr1wUxQckFLVE0VCR9ygQ4fS3kdhWTbcAKEJUb49rDfy9Kv V3XI+et/oTGkf5WqgrPffF3fqqOX3i6DkE0pF09LDgYA+aXNXAxkLKvvvU4LYPF/mp6S 32yJEgUcVC1+yDMefSrF68DxJeyXwQAuxVi9U4FfY0F86AYxXjqYAnaBKdBWMzvazxFL nDtgw7YoATQJ3D+L7NKqHJCcXTE+7ogNxn7c2j942wsO0M045hhhav6Rf35S0F3fEE8j H1AQ== X-Gm-Message-State: AOAM533bah6zUlVgxR38fbbsNjROhd6oWpVqOuhGDlip4EpES9V+BRIf gM0GvM/87FU6LTx2eT7D5kLldZt58/xwUC2/zng= X-Google-Smtp-Source: ABdhPJzJyKCsutUaEPNIPF5pFa8vgC9d0q8rkXPt9JdxoUOKsDdX+6hkyGXNJGDzQw3pxirvktLhMA== X-Received: by 2002:a05:622a:58f:b0:2de:92c7:8859 with SMTP id c15-20020a05622a058f00b002de92c78859mr10432901qtb.191.1645880600971; Sat, 26 Feb 2022 05:03:20 -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 o7-20020a05620a228700b005f18f39a5e3sm2422833qkh.50.2022.02.26.05.03.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:20 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 06/22] gnu: racket-minimal: Change inheritance to follow bootstrapping. Date: Sat, 26 Feb 2022 08:02:38 -0500 Message-Id: <20220226130254.1301333-7-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.177 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.177 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.177 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.177 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline formerly inherited values. (racket-minimal-bc-3m): Inherit from 'racket-minimal-bc-cgc' rather than 'racket-minimal'. [inputs, native-inputs, arguments, license]: Adjust accordingly. (racket-minimal): Inherit from 'racket-minimal-bc-3m'. [inputs, native-inputs, arguments, license]: Adjust accordingly. [properties]: Override effect of 'hidden-package'. --- gnu/packages/racket.scm | 294 ++++++++++++++++++++-------------------- 1 file changed, 147 insertions(+), 147 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index abcd9658b2..f5a8091be0 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021 Philip McGrath +;;; Copyright © 2021, 2022 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -172,99 +172,157 @@ (define (make-unpack-nanopass+stex) (display "# to placate ../configure"))))) +(define-public racket-minimal-bc-cgc + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (hidden-package + (package + (name "racket-minimal-bc-cgc") + (version %racket-version) + (source %racket-origin) + (inputs + (list + ;; common to all racket-minimal variants: + openssl + sqlite + bash-minimal ;; <- for `system` + ncurses ;; <- for #%terminal + ;; only for BC variants: + libffi)) + (native-inputs (list libtool)) ;; <- only for BC variants + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(cons* "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) + (guix build gnu-build-system) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((lib-search-dirs + . (#f #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib"))) + (build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (add-after 'install 'remove-pkgs-directory + ;; If the configured pkgs-dir exists, "pkgs.rktd" does not + ;; exist, and a lock file does not exist, commands like + ;; `raco pkg show` will try to create a lock file and fail + ;; due to the read-only store. + ;; Arguably this may be a bug in `pkg/private/lock`: + ;; see . + ;; As a workaround, remove the directory. + (lambda args + ;; rmdir because we want an error if it isn't empty + (rmdir (string-append #$output "/share/racket/pkgs"))))))) + (home-page "https://racket-lang.org") + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. + +Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat))))) + +(define-public racket-minimal-bc-3m + (package + (inherit racket-minimal-bc-cgc) + (name "racket-minimal-bc-3m") + (native-inputs + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (prepend racket-minimal-bc-cgc))) + (arguments + (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) + ((#:configure-flags _ '()) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))))) + (synopsis "Minimal Racket with the BC [3M] runtime system") + (description "The Racket BC (``before Chez'' or ``bytecode'') +implementation was the default before Racket 8.0. It uses a compiler written +in C targeting architecture-independent bytecode, plus a JIT compiler on most +platforms. Racket BC has a different C API and supports a slightly different +set of architectures than the current default runtime system, Racket CS (based +on ``Chez Scheme''). + +This package is the normal implementation of Racket BC with a precise garbage +collector, 3M (``Moving Memory Manager'')."))) + (define-public racket-minimal (package + (inherit racket-minimal-bc-3m) (name "racket-minimal") - (version %racket-version) - (source %racket-origin) (inputs - (list - ;; common to all racket-minimal variants: - openssl - sqlite - bash-minimal ;; <- for `system` - ncurses ;; <- for #%terminal - ;; only for CS - zlib - lz4)) + (modify-inputs (package-inputs racket-minimal-bc-cgc) + (prepend zlib lz4) + (delete "libffi"))) (native-inputs - (list chez-scheme-for-racket-bootstrap-bootfiles - racket-minimal-bc-3m)) - (build-system gnu-build-system) + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (delete "libtool") + (prepend chez-scheme-for-racket-bootstrap-bootfiles + racket-minimal-bc-3m))) (arguments - (list - #:configure-flags - #~(cons* "--enable-csonly" - "--enable-libz" - "--enable-lz4" - #$(racket-vm-common-configure-flags)) - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main - ;; distribution. - #:tests? #f - ;; Upstream recommends #:out-of-source?, and it does - ;; help with debugging, but it confuses `install-license-files`. - #:modules '((ice-9 match) - (ice-9 regex) - (guix build gnu-build-system) - (guix build utils)) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (with-directory-excursion "racket/src/ChezScheme" - #$(make-unpack-nanopass+stex)))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (search-input-directory (or native-inputs inputs) - "lib/chez-scheme-bootfiles") - "boot")))) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (define maybe-release-catalog - (let ((v #$(package-version this-package))) - (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" - v) - `(,(string-append - "https://download.racket-lang.org/releases/" - v - "/catalog/")) - '()))) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f #$(file-append (this-package-input "openssl") "/lib") - #$(file-append (this-package-input "sqlite") "/lib"))) - (build-stamp . "") - (catalogs ,@maybe-release-catalog - #f))))))) - (add-before 'configure 'chdir - (lambda _ - (chdir "racket/src"))) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda args - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append #$output "/share/racket/pkgs"))))))) - (home-page "https://racket-lang.org") + (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) + ((#:phases bc-phases) + #~(modify-phases #$bc-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (with-directory-excursion "racket/src/ChezScheme" + #$(make-unpack-nanopass+stex)))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "racket/src/ChezScheme" + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot")))))) + ((#:configure-flags _ '()) + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + #$(racket-vm-common-configure-flags))))) (synopsis "Racket without bundled packages such as DrRacket") (description "Racket is a general-purpose programming language in the Scheme family, @@ -275,69 +333,11 @@ (define maybe-release-catalog The ``minimal Racket'' distribution includes just enough of Racket for you to use @command{raco pkg} to install more. Bundled packages, such as the DrRacket IDE, are not included.") + (properties `()) ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) -(define-public racket-minimal-bc-3m - (hidden-package - (package - (inherit racket-minimal) - (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (prepend libffi) ;; <- only for BC variants - (delete "zlib" "lz4"))) - (native-inputs - (list libtool - (if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) - ((#:configure-flags _ '()) - #~(cons "--enable-bconly" - #$(racket-vm-common-configure-flags))) - ((#:phases cs-phases) - #~(modify-phases #$cs-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") - (description "The Racket BC (``before Chez'' or ``bytecode'') -implementation was the default before Racket 8.0. It uses a compiler written -in C targeting architecture-independent bytecode, plus a JIT compiler on most -platforms. Racket BC has a different C API and supports a slightly different -set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). - -This package is the normal implementation of Racket BC with a precise garbage -collector, 3M (``Moving Memory Manager'').") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list license:lgpl3+ license:asl2.0 license:expat))))) - -(define-public racket-minimal-bc-cgc - (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs (list libtool)) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:configure-flags _ '()) - #~(cons "--enable-cgcdefault" - #$(racket-vm-common-configure-flags))))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the -Racket CS implementation. - -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) - (define-public chez-scheme-for-racket-bootstrap-bootfiles (package (name "chez-scheme-for-racket-bootstrap-bootfiles") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:44 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:45 +0000 Received: from localhost ([127.0.0.1]:54438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjg-0005V2-IW for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:44 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:33787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjS-0005Td-Mj for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:30 -0500 Received: by mail-qk1-f169.google.com with SMTP id bm39so6844192qkb.0 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:30 -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=lsNjYzUGajVoFvbyMqbzXrOKUUe838jsLMfMm5+vOeM=; b=ibvgFZv6B15yRVZE2IFi1biFRJSmOPiIrfrf+P9JmEsZqscdJb8rreRi3EqFYTcclc S9Md9I9Fd4b2PazcH5mw6iwC3ODBigEhx5LHI2yaeN3231TtSdHo86buxJyqIeKk3H7A 9RONFAvT+CmI0wyByagF4TcSpzf74bC+nGvU4LdXJsd5R7Ly1sD3f/EOWXkhO7E+eBYc C1IQbuzmV5btC9DC9a3Pf531OQDf5H9MXAViZrmEG++oU+LcMyLfetGprnNh1TbqVHsz HmKDY4yUs522eC8L4vuABaLwk1NcIhu+xJNc74nIYatEnaUpjborELstRRD9cGhQCyMH M1WA== 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=lsNjYzUGajVoFvbyMqbzXrOKUUe838jsLMfMm5+vOeM=; b=H/827nPwhZeknSewRs7C8MkYCbaRm9ut3fYVaxe84h7C0o6zzBtoZFuN1hAQT2AyYG ncgG/NWWReFtPQFim2EBHT/r8tBT91qCZ5vFzrmFHka+7ELYdfyR4Vik6TKUB5M128so /XUr5AgNTgBhg57Re7P+hW6tSElfRiJeEra7Kgfls2zL0SriS9/Y9cPSwOPWYOFrhuJ1 ZkfBHS3wIcxGqJ9dPPmXjLPVdEY3xPtJH9dzsi0c8GGt+pyB78RlMaz7WBucdKtF/OsH NMngZ62NTDVCQ+BifZmNPSNcKyeQp0sHlGifCUrt0g0QDB1NS/k5u07WIdb044w7+hN/ WX7w== X-Gm-Message-State: AOAM530N5bUDRfsqMyH6b6UcvTdaXBx6Jt1QRWBI8Ek0oTVsKiEImZMP Fde2eqXQjxuPOwPKL1i1Jj+kY5dMRvLT2YPxjMs= X-Google-Smtp-Source: ABdhPJxvx6DWc1wNXi6eHCMNIk4Mn+zx4dGmv2PI2cWyb32I5imepTSVd40mi2AxLRGs37huhdDBHA== X-Received: by 2002:a37:9ac5:0:b0:60d:f165:8b0b with SMTP id c188-20020a379ac5000000b0060df1658b0bmr7220855qke.656.1645880605082; Sat, 26 Feb 2022 05:03:25 -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 p68-20020a378d47000000b006491d2d1450sm2558978qkd.10.2022.02.26.05.03.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:24 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 07/22] gnu: racket-minimal: Add "debug" output. Date: Sat, 26 Feb 2022 08:02:39 -0500 Message-Id: <20220226130254.1301333-8-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-minimal-bc-cgc)[outputs]: Add "debug". (racket-vm-common-configure-flags): Add "--disable-strip". --- gnu/packages/racket.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index f5a8091be0..ddbeb68a37 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -151,7 +151,8 @@ (define (racket-vm-common-configure-flags) (else '())) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - #$(file-append bash-minimal "/bin/sh")))) + #$(file-append bash-minimal "/bin/sh")) + "--disable-strip")) (define (make-unpack-nanopass+stex) ;; Adapted from chez-scheme. @@ -190,6 +191,7 @@ (define-public racket-minimal-bc-cgc ;; only for BC variants: libffi)) (native-inputs (list libtool)) ;; <- only for BC variants + (outputs '("out" "debug")) (build-system gnu-build-system) (arguments (list -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:03:45 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:03:45 +0000 Received: from localhost ([127.0.0.1]:54440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjg-0005V9-SH for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:45 -0500 Received: from mail-qk1-f173.google.com ([209.85.222.173]:36470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjW-0005Tu-P8 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:35 -0500 Received: by mail-qk1-f173.google.com with SMTP id g24so6816189qkl.3 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:34 -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=/ykUrrV+AsCKmY04Y1T+UOzhOPgVKEdMra2E59t4oOE=; b=cLPXlDM0l3/IqWaJw+2eRR7UFnVGiMFvKXCEIVAgOpQrg3Lk5/NBEimKV+hFoSIE/R foQAHo1RLia23ER/mMWRwPBvNy76x4TKRQ5UdsmPUnIZUGLhO+GBW5cN6cwaEitrA2Fc 1BrFjI4sG2INpgHVddMfBVfafSvRSE1JGMx5BdoU3GderbkyfOO+BZhPUb1N6Kb9d3kT W6yvB1+T1OY6Mtyf7X2mHL2qM3JQFSKHwkMuY0o8KJzf5bsvuSmjvKBpM4YlBwpMaXRc cAkyC9J9eMEO10wIPHOfF12CEN3SKGu2fW9la8j6CuPnW27RG3bo5g9Nt8dho/1NUs+2 BnAw== 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=/ykUrrV+AsCKmY04Y1T+UOzhOPgVKEdMra2E59t4oOE=; b=2JDoxyhIR1wNzxfFRhL5OIvnymHBKgqJUDtI5wpfxGvvXpB2xVHG6DnibqQXiZGcBV OMs8q39OdOj3z+Iu5shm79nxSaNePW1UbSliaQ6eF7CfM0bkykIn5pN94UR6wPLQMbwO xOFKI+kEk6G0IzfNw8ruUCHT/YAbnQl2wgPTBX0zXkAB4CrgKpoAbC0zi1bLiS5Det/c DuhV1Rui0HRgI7Vugrrovhil6BLrw67jezCBunn+uDCwzQpkmLHZq/NhNCuos9MDpmsC Ftgb4xJbrMrMb6ps0zN9QJyTZ9VoooGpqf5TKkM6eb77F4dVG99wJcVAFoRAQTInX/gU +ltQ== X-Gm-Message-State: AOAM530MpC8CBB5IBytgz35KzDc29Z8flb4S+0Bhxq9bKpSm/FOxgSWK 8n9LM/nUk6xZQGiffXgWC6ag6W8KFXf7O45Dq7Q= X-Google-Smtp-Source: ABdhPJw5/2uHWe75rTO1+jKaBk1VENublSO6BiNzkhyU8tl6buhmiqRGE6qi38BklG8DTnE06M3Ptg== X-Received: by 2002:a37:5503:0:b0:4e1:2b66:dc53 with SMTP id j3-20020a375503000000b004e12b66dc53mr7102819qkb.706.1645880609197; Sat, 26 Feb 2022 05:03:29 -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 r14-20020a05622a034e00b002de72634a7asm3197129qtw.37.2022.02.26.05.03.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:29 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 08/22] gnu: make-installation-layer.rkt: Adjust indentation. Date: Sat, 26 Feb 2022 08:02:40 -0500 Message-Id: <20220226130254.1301333-9-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (make-installation-layer.rkt): Wrap 'command-line' in 'define-values' to reduce rightward drift. --- gnu/packages/racket.scm | 164 ++++++++++++++++++++-------------------- 1 file changed, 83 insertions(+), 81 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index ddbeb68a37..1670f478ff 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -1358,84 +1358,86 @@ (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) (define extra-foreign-lib-search-dirs '()) - (command-line - #:once-each - [("--extra-foreign-lib-search-dirs") dir-list - "foreign library directories, as a list of strings in `read` syntax" - (set! extra-foreign-lib-search-dirs - (call-with-input-string dir-list read))] - #:args (parent-layer prefix) - (let* ([config - (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) - (hash-set* - config - main-key - (build-path-string prefix pth) - search-key - (list* #f - (hash-ref config - main-key - (build-path-string parent-layer pth)) - (filter values (hash-ref config search-key null)))))] - [config - (hash-update config - 'lib-search-dirs - (lambda (dirs) - ;; add after other layers, but before older - ;; foreign lib search directories - (define-values [rkt old-foreign-dirs] - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - dirs)) - (append rkt - extra-foreign-lib-search-dirs - old-foreign-dirs)))] - [config - (hash-set* config - 'apps-dir - (build-path-string prefix "share/applications") - 'absolute-installation? #t - ;; Let Guix coexist with other installation - ;; methods without clobbering user-specific packages. - ;; This could be set in various places, but doing - ;; it here is convienient, at least until we support - ;; cross-compilation. - 'installation-name - (string-append (version) - "-guix" - (match (system-type 'gc) - ['cgc "-cgc"] - ;; workaroung Guile reader/printer: - ['|3m| "-bc"] - [_ ""])))] - [bin-dir - (hash-ref config 'bin-dir)] - [config - (hash-set* config - 'config-tethered-apps-dir (hash-ref config 'apps-dir) - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) - (make-parent-directory* new-config-pth) - (call-with-output-file* - new-config-pth - (lambda (out) - (pretty-write config out)))))))) + (define-values [parent-layer prefix] + (command-line + #:once-each + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (parent-layer prefix) + (values parent-layer prefix))) + (let* ([config + (for/fold + ([config (file->value (build-path parent-layer + config-file-pth))]) + ([spec (in-list + '((lib-dir lib-search-dirs "lib/racket") + (share-dir share-search-dirs "share/racket") + (links-file + links-search-files + "share/racket/links.rktd") + (pkgs-dir pkgs-search-dirs "share/racket/pkgs") + (bin-dir bin-search-dirs "bin") + (man-dir man-search-dirs "share/man") + (doc-dir doc-search-dirs "share/doc/racket") + (include-dir + include-search-dirs + "include/racket")))]) + (match-define (list main-key search-key pth) spec) + (hash-set* + config + main-key + (build-path-string prefix pth) + search-key + (list* #f + (hash-ref config + main-key + (build-path-string parent-layer pth)) + (filter values (hash-ref config search-key null)))))] + [config + (hash-update config + 'lib-search-dirs + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] + [config + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaroung Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] + [bin-dir + (hash-ref config 'bin-dir)] + [config + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [new-config-pth + (build-path prefix config-file-pth)]) + (make-parent-directory* new-config-pth) + (call-with-output-file* + new-config-pth + (lambda (out) + (pretty-write config out))))))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:02 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:02 +0000 Received: from localhost ([127.0.0.1]:54445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjw-0005Vz-CO for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:02 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:44570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjb-0005UO-Fi for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:41 -0500 Received: by mail-qv1-f47.google.com with SMTP id v18so8804845qvh.11 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:39 -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=FF/6TmHiuvjut7gq51UUTOFodzTiSRWpqbyRXQTiXws=; b=dzT9LFhLLz3tsRRY68XiWEr1DylDJPBEnZ3t6UlOatmvPpS5n0HjKNjFhEseQHLhM2 jTc34HHot6L8yLyrU6gUy8QY/lyTybIc+dPaThnIhu7Suiz/UOl9YZF4FlP9nzRQFmIr zKahOvGAU3ubC6Fqd8ixolO0sxlmrnztvvVul/V5d9foD7EzaRzxjLyW9KUyNxu0GjjJ s2zVvP9Dgqv1Le5/dhCkd4Rre26mHEvWheZgbEudBkHb8KbuIZrRph3I2+bqM3ywQ64W XvmQSbgHU4Tnh3YWsyBhy0SZynoOgIodwjEeVz+SA+ukJxJoChxb6yu3THZwWynKDnMN MxfA== 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=FF/6TmHiuvjut7gq51UUTOFodzTiSRWpqbyRXQTiXws=; b=CVzDzRJj4zYQPG8qqZxjeACZCeK9tjhe4yQs59KZ1inpb1q4V6ZO+9ITGzEgWxyj5k 3Hs4/OGd8CpN0XYhFhjZRr5pbw4PSr1LB33Az8KaAxjiKEXSA3a1PNstj/L39buGC3kr cu1064wpE53xDcIyTi/XaLYw2WGJ772hpG5C/t+dI1eYvuTvDTdYrqsJwHGqCx91nlWy HUQ4dgTEWBefzk/OloYyKJL0EH0++RyBmISmF2v68Hhfao+8/55jF5hZRdYUdFFgs72k H+GN4M06NObOP2JffuZkiqpgVT3hcM3PYpf7mTD7ooyBMZTxSXjFNwdT5vbKbGlCmw27 xclg== X-Gm-Message-State: AOAM532uQWsxjuXORy/NqUgQv6AVrcZci5ItNXN3QzhyxU90UbmvDqhu XOtxPP5lDI8yuVY/by7v9nLa5j1WOIvFD5aLGiM= X-Google-Smtp-Source: ABdhPJzON4OE2zDbUU27tHlen4ZU5iUuKH6nCSgjS7SZbYifvgF/xoY6VS/1EmU3evotoQLznLCqKg== X-Received: by 2002:a0c:fd82:0:b0:432:5ff0:8e70 with SMTP id p2-20020a0cfd82000000b004325ff08e70mr8817740qvr.54.1645880613350; Sat, 26 Feb 2022 05:03:33 -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 x12-20020ac85f0c000000b002de8931d4d6sm3327426qta.77.2022.02.26.05.03.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:33 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 09/22] gnu: racket-minimal: Separate from the Racket VM. Date: Sat, 26 Feb 2022 08:02:41 -0500 Message-Id: <20220226130254.1301333-10-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) For consistency with other Racket distributions, 'racket-minimal' should have the "racket-lib" Racket package installed: see . Happily, this gives us a clean boundary between the core Racket VM and compiler, with all of the bootstrapping involved, and building Racket packages and installation layers, which can be handled in a nice, uniform way and eventually turned into a 'racket-build-system'. Building the VM layer as an "in-place" installation should help us use it with other Racket tools. * gnu/packages/racket.scm (racket-vm-common-configure-flags): Add "--enable-origtree". Adapt "--enable-racket=" for "opt/racket-vm/" prefix. (racket-minimal-bc-cgc): Rename to ... (racket-vm-cgc): ... this new variable. [inputs]: Move 'openssl' and 'sqlite' to new 'racket-minimal'. [arguments]<#:strip-directories>: Use "opt/racket-vm/" prefix. <#:phases>: Wrap 'configure', 'patch-shebangs', 'validate-runpath', 'make-dynamic-linker-cache', and 'patch-dot-desktop-files' to use "opt/racket-vm/" prefix. Adapt 'initialize-config.rktd' for removal of 'openssl' and 'sqlite'. [description]: Tweak. (racket-minimal-bc-3m): Rename to ... (racket-vm-bc): ... this new variable. [synopsis, description]: Tweak. (racket-vm-cs): New variable, adapted from the old 'racket-minimal'. (chez-scheme-for-racket-bootstrap-bootfiles)[arguments]<#:phhases>: Adapt to the "opt/racket-vm/" prefix. (racket-minimal): Rewrite like 'racket' using 'racket-vm-cs'. (racket): Inherit from 'racket-minimal'. [inputs]: Add 'racket-vm-cs'. Move "racket-lib" and "base" to 'racket-minimal'. [arguments]<#:make-flags, #:configure-flags>: Override from 'racket-minimal'. (make-installation-layer.rkt): Adapt to support in-place VM build with possible intermediate layer. --- gnu/packages/racket.scm | 598 ++++++++++++++++++++++++++-------------- 1 file changed, 385 insertions(+), 213 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 1670f478ff..a7704f1afe 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -54,7 +54,91 @@ (define-module (gnu packages racket) ;; Commentary: ;; -;; Here's how bootstrapping minimal Racket works: +;; Anatomy of Racket: +;; ------------------ +;; +;; The main Racket Git repository () is +;; organized broadly like this: +;; +;; . +;; ├── Makefile +;; ├── pkgs/ +;; └── racket/ +;; ├── collects/ +;; └── src/ +;; ├── configure +;; ├── Makefile.in +;; ├── bc/ +;; ├── cs/ +;; ├── ChezScheme/ +;; └── ... +;; +;; The 'racket/src/' directory contains the source of the runtime system, core +;; compiler, and primitives for the major Racket implementations: this layer +;; is called the ``Racket VM''. It is basically a normal autotools +;; project. (Even when Racket VM implementations use components implemented in +;; Racket, they are compiled in special modes to produce VM primitives.) +;; (There are or have been experimental Racket VM implementations elsewhere, +;; e.g. .) +;; +;; The 'racket/collects/' directory contains ``built in'' Racket libraries +;; that are not part of any package, including the implementation of +;; 'racket/base': in particular, it must contain enough to implement `raco pkg +;; install'. It is theoretically possible to use the Racket VM layer without +;; the main collections, but it is not stable or useful. +;; +;; The 'pkgs/' directory contains Racket packages that are especially closely +;; tied to the implementation of the Racket VM, including 'compiler-lib', +;; 'racket-doc', and 'racket-test'. Some of these packages depend on Racket +;; packages that are developed in other Git repositories, predominantly but +;; not exclusively under the 'racket' GitHub organization. Conversely, not all +;; of the packages developed in the main Git repository are part of the main +;; Racket distribution. (Additionally, components of the Racket VM that are +;; implemented in Racket can be installed as packages, mostly for ease of +;; development.) +;; +;; The top-level 'Makefile' is more like a directory of scripts: it has +;; convienience targets for developing Racket, and it cooperates with the +;; 'distro-build' package to assemble custom Racket distributions. 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. +;; +;; A ''minimal Racket'' installation includes two packages: 'base', which is a +;; sort of bridge between the current ``built-in'' collections and the package +;; system's model of dependencies, and 'racket-lib', which, for installations +;; that can not rely on a system package manager, pulls in the SQLite and +;; OpenSSL shared libraries as platform-specific dependencies for use by the +;; ``built-in'' collections. +;; +;; The main Racket distribution consists of installing the 'main-distribution' +;; package and all of its dependencies. +;; +;; The default mode when building Racket (or installing it with the released +;; installers) is an ``in-place build'', which produces a self-contained, +;; relocatable, roughly FHS-like directory. (Racket also supports +;; ``Unix-style'' installations, which rearrange the parts of an in-place +;; build into Racket-specific subdirectories and generally tries to work for +;; installation into an FHS-based system.) Certain tools, e.g. 'distro-build' +;; and 'raco cross', are able to work with an in-place Racket build. +;; +;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and +;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and +;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store +;; output. The function 'racket-vm-for-system' returns the recomended Racket +;; VM package for a given system. +;; +;; The file 'racket.scm' builds on these packages to define 'racket-minimal' +;; and 'racket' packages. These use Racket's support for ``layered +;; installations'', which allow an immutable base layer to be extended with +;; additional packages. They use the layer configuration directly provide +;; ready-to-install FHS-like trees, rather than relying on the built in +;; ``Unix-style install'' mechanism. +;; +;; Bootstrapping Racket: +;; --------------------- +;; +;; Here's how bootstrapping Racket works: ;; ;; - Racket BC [CGC] can be built with only a C compiler (except for ;; one caveat discussed below). @@ -72,6 +156,10 @@ (define-module (gnu packages racket) ;; ;; So, we build CGC to build 3M to build bootfiles and CS. ;; +;; (Note: since the CGC variant is basically only for bootstrapping, we +;; often use "BC" to mean "3M", consistent with `(banner)` and the +;; suffixes used on executables when more than one variant co-exists.) +;; ;; 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 @@ -145,14 +233,15 @@ (define (racket-vm-common-configure-flags) '())) ,@(cond ((false-if-exception - (search-input-file %build-inputs "/bin/racket")) + (search-input-file %build-inputs "/opt/racket-vm/bin/racket")) => (lambda (racket) (list (string-append "--enable-racket=" racket)))) (else '())) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" #$(file-append bash-minimal "/bin/sh")) - "--disable-strip")) + "--disable-strip" + "--enable-origtree")) (define (make-unpack-nanopass+stex) ;; Adapted from chez-scheme. @@ -173,31 +262,25 @@ (define (make-unpack-nanopass+stex) (display "# to placate ../configure"))))) -(define-public racket-minimal-bc-cgc +(define-public racket-vm-cgc ;; Eventually, it may make sense for some vm packages to not be hidden, ;; but this one is especially likely to remain hidden. (hidden-package (package - (name "racket-minimal-bc-cgc") + (name "racket-vm-cgc") (version %racket-version) (source %racket-origin) - (inputs - (list - ;; common to all racket-minimal variants: - openssl - sqlite - bash-minimal ;; <- for `system` - ncurses ;; <- for #%terminal - ;; only for BC variants: - libffi)) + (inputs (list ncurses ;; <- common to all variants (for #%terminal) + bash-minimal ;; <- common to all variants (for `system`) + libffi)) ;; <- only for BC variants (native-inputs (list libtool)) ;; <- only for BC variants (outputs '("out" "debug")) (build-system gnu-build-system) (arguments (list #:configure-flags - #~(cons* "--enable-cgcdefault" - #$(racket-vm-common-configure-flags)) + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) ;; Tests are in packages like racket-test-core and ;; main-distribution-test that aren't part of the main ;; distribution. @@ -208,51 +291,72 @@ (define-public racket-minimal-bc-cgc (ice-9 regex) (guix build gnu-build-system) (guix build utils)) + #:strip-directories #~'("opt/racket-vm/bin" + "opt/racket-vm/lib") #:phases - #~(modify-phases %standard-phases - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (define maybe-release-catalog - (let ((v #$(package-version this-package))) - (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" - v) - `(,(string-append - "https://download.racket-lang.org/releases/" - v - "/catalog/")) - '()))) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f #$(file-append (this-package-input "openssl") "/lib") - #$(file-append (this-package-input "sqlite") "/lib"))) - (build-stamp . "") - (catalogs ,@maybe-release-catalog - #f))))))) - (add-before 'configure 'chdir - (lambda _ - (chdir "racket/src"))) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda args - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append #$output "/share/racket/pkgs"))))))) + #~(let () + (define* ((wrap-racket-vm-outputs phase) . args) + (apply + phase + (let loop ((args args)) + (match args + ((#:outputs outputs . args) + `(#:outputs + ,(let loop ((outputs outputs)) + (match outputs + ((("out" . out) . outputs) + `(("out" . ,(string-append out "/opt/racket-vm/")) + ,@outputs)) + ((other . outputs) + (cons other (loop outputs))))) + ,@args)) + ((arg . args) + (cons arg (loop args))))))) + (modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (replace 'configure + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'configure))) + (replace 'patch-shebangs + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-shebangs))) + (replace 'validate-runpath + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'validate-runpath))) + (replace 'make-dynamic-linker-cache + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) + (replace 'patch-dot-desktop-files + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) (home-page "https://racket-lang.org") (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or @@ -262,53 +366,54 @@ (define maybe-release-catalog scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the Racket CS implementation. -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may +Racket CGC is primarily used for bootstrapping Racket BC [3M]. It may also be used for embedding applications without the annotations needed in C code to use the 3M garbage collector.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) -(define-public racket-minimal-bc-3m +(define-public racket-vm-bc (package - (inherit racket-minimal-bc-cgc) - (name "racket-minimal-bc-3m") + (inherit racket-vm-cgc) + (name "racket-vm-bc") (native-inputs - (modify-inputs (package-native-inputs racket-minimal-bc-cgc) - (prepend racket-minimal-bc-cgc))) + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) + (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:configure-flags _ '()) #~(cons "--enable-bconly" #$(racket-vm-common-configure-flags))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") + (synopsis "Racket BC [3M] implementation") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written in C targeting architecture-independent bytecode, plus a JIT compiler on most platforms. Racket BC has a different C API and supports a slightly different set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). +on ``Chez Scheme''). It is the recommended implementation for architectures +that Racket CS doesn't support. This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'')."))) -(define-public racket-minimal +(define-public racket-vm-cs (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal") + (inherit racket-vm-bc) + (name "racket-vm-cs") (inputs - (modify-inputs (package-inputs racket-minimal-bc-cgc) + (modify-inputs (package-inputs racket-vm-cgc) (prepend zlib lz4) (delete "libffi"))) (native-inputs - (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") (prepend chez-scheme-for-racket-bootstrap-bootfiles - racket-minimal-bc-3m))) + racket-vm-bc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:phases bc-phases) - #~(modify-phases #$bc-phases + (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" @@ -325,17 +430,14 @@ (define-public racket-minimal "--enable-libz" "--enable-lz4" #$(racket-vm-common-configure-flags))))) - (synopsis "Racket without bundled packages such as DrRacket") - (description - "Racket is a general-purpose programming language in the Scheme family, -with a large set of libraries and a compiler based on Chez Scheme. Racket is -also a platform for language-oriented programming, from small domain-specific -languages to complete language implementations. + (synopsis "Racket CS implementation") + (description "The Racket CS implementation, which uses ``Chez Scheme'' as +its core compiler and runtime system, has been the default Racket VM +implemetation since Racket 8.0. It performs better than the Racket BC +implementation for most programs. -The ``minimal Racket'' distribution includes just enough of Racket for you to -use @command{raco pkg} to install more. Bundled packages, such as the -DrRacket IDE, are not included.") - (properties `()) +Using the Racket VM packages directly is not recommended: instead, install the +@code{racket-minimal} or @code{racket} packages.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) @@ -350,7 +452,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; When updating, remember to also update %racket-version in racket.scm. (source %racket-origin) (inputs `()) - (native-inputs (list racket-minimal-bc-3m)) + (native-inputs (list racket-vm-bc)) (build-system copy-build-system) ;; TODO: cross compilation (arguments @@ -368,7 +470,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) (invoke (search-input-file (or native-inputs inputs) - "/bin/racket") + "/opt/racket-vm/bin/racket") "rktboot/main.rkt")))))) (home-page "https://github.com/racket/ChezScheme") ;; ^ This is downstream of https://github.com/racket/racket, @@ -447,10 +549,116 @@ (define (extract-package-source* source-groups) specs))) source-groups)) +(define-public racket-minimal + (package + (name "racket-minimal") + (version %racket-version) + (source #f) + ;; For cross-compilation, Matthew Flatt recommends reusing + ;; as much of `raco cross` as possible. So, put that off until + ;; we have a build system for Racket packages. + (inputs + (cons* openssl + sqlite + racket-vm-cs ;; TODO (racket-vm-for-system) + (extract-package-source* + `((,%racket-origin + ("base" "pkgs/base") + ("racket-lib" "pkgs/racket-lib")))))) + (build-system gnu-build-system) + (arguments + ;; Here and for the `racket` package, we're using #:configure-flags + ;; to pass flags for `make-installation-layer.rkt` and #:make-flags + ;; to pass arguments for `raco pkg install` + (list + #:configure-flags + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format + #f "~s" + (list #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib")))) + #:make-flags #~`("racket-lib") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (guix build union) + (ice-9 match)) + #:imported-modules `((guix build union) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (delete 'unpack) + (replace 'configure + (lambda* (#:key inputs configure-flags #:allow-other-keys) + (let* ((vm-dir (search-input-directory inputs "opt/racket-vm")) + (racket (string-append vm-dir "/bin/racket"))) + (apply invoke + racket + #$make-installation-layer.rkt + `(,@(cond + ((false-if-exception + (search-input-file + inputs "etc/racket/config.rktd")) + => (lambda (file) + `("--parent" + ,(dirname (dirname (dirname file)))))) + (else + '())) + ,@configure-flags + ,vm-dir + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; We use "share/racket/pkgs" for sources to distinguish them + ;; from the "lib/racket/pkgs" of a potential parent layer. + (union-build (string-append #$output "/lib/racket/pkgs") + (search-path-as-list '("share/racket/pkgs") + (map cdr inputs)) + #:create-all-directories? #t))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket + (search-input-file inputs "/opt/racket-vm/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) + (home-page "https://racket-lang.org") + (synopsis "Racket without bundled packages such as DrRacket") + (description + "Racket is a general-purpose programming language in the Scheme family, +with a large set of libraries and a compiler based on Chez Scheme. Racket is +also a platform for language-oriented programming, from small domain-specific +languages to complete language implementations. + +The ``minimal Racket'' distribution includes just enough of Racket for you to +use @command{raco pkg} to install more. Bundled packages, such as the +DrRacket IDE, are not included.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) + (define-public racket (package + (inherit racket-minimal) (name "racket") - (version %racket-version) (source #f) (inputs (cons* @@ -469,6 +677,7 @@ (define-public racket unixodbc libedit ;; TODO reconsider in light of expeditor and readline-gpl racket-minimal ;; <-- TODO non-tethered layer + racket-vm-cs ;; TODO (racket-vm-for-system) (extract-package-source* `((,(origin (method git-fetch) @@ -491,8 +700,6 @@ (define-public racket (git-file-name "racket-algol60" %racket-version))) ("algol60" ".")) (,%racket-origin - ("base" "pkgs/base") ;; FIXME belongs in racket-minimal - ("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in racket-minimal ("at-exp-lib" "pkgs/at-exp-lib") ("compiler" "pkgs/compiler") ("compiler-lib" "pkgs/compiler-lib") @@ -1238,93 +1445,40 @@ (define-public racket "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3")) (file-name (git-file-name "racket-xrepl" %racket-version))) "xrepl" "xrepl-doc" "xrepl-lib"))))) - (build-system gnu-build-system) (arguments - ;; We're using #:configure-flags to pass flags for - ;; `make-installation-layer.rkt` and #:make-flags to pass arguments for - ;; `raco pkg install`. - (list - #:configure-flags - #~`("--extra-foreign-lib-search-dirs" - ,(format #f "~s" - '(#$@(map (lambda (name) - (cond - ((this-package-input name) - => (cut file-append <> "/lib")) - (else - (raise-exception - (make-exception - (make-assertion-failure) - (make-exception-with-message - "missing input to the 'racket' package") - (make-exception-with-irritants - (list name))))))) - '("cairo" - "fontconfig-minimal" ;; aka fontconfig - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg-turbo" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))))) - #:make-flags #~`("main-distribution") - #:tests? #f ;; packaged separately - #:modules '((guix build gnu-build-system) - (guix build utils) - (guix build union) - (ice-9 match)) - #:imported-modules `((guix build union) - ,@%gnu-build-system-modules) - #:phases - #~(modify-phases %standard-phases - (delete 'unpack) - (replace 'configure - (lambda* (#:key inputs configure-flags #:allow-other-keys) - (let* ((racket (search-input-file inputs "bin/racket"))) - (apply invoke - racket - #$make-installation-layer.rkt - `(,@configure-flags - ,(dirname (dirname racket)) - ,#$output)) - (invoke racket - "--config" (string-append #$output "/etc/racket") - "-l" "raco" "setup" - "--no-user")))) - (replace 'build - (lambda* (#:key inputs #:allow-other-keys) - ;; We use "share/racket/pkgs" for sources to distinguish them - ;; from the "lib/racket/pkgs" of a potential parent layer. - (union-build (string-append #$output "/lib/racket/pkgs") - (search-path-as-list '("share/racket/pkgs") - (map cdr inputs)) - #:create-all-directories? #t))) - (replace 'install - (lambda* (#:key inputs make-flags #:allow-other-keys) - (let ((racket (search-input-file inputs "/bin/racket"))) - (unless (null? make-flags) - (invoke racket - "-l-" - "pkg/dirs-catalog" - "--link" - "local-catalog" - (string-append #$output "/lib/racket/pkgs")) - (apply invoke - racket - "--config" (string-append #$output "/etc/racket") - "-l" "raco" - "pkg" "install" - "--installation" - "--auto" - "--catalog" "local-catalog" - make-flags)))))))) - (home-page "https://racket-lang.org") + (substitute-keyword-arguments (package-arguments racket-minimal) + ((#:make-flags _ '()) + #~`("main-distribution")) + ((#:configure-flags _ '()) + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit")))))))) (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -1334,10 +1488,7 @@ (define-public racket The main Racket distribution comes with many bundled packages, including the DrRacket IDE, libraries for GUI and web programming, and implementations of -languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list license:asl2.0 license:expat)))) +languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) (define make-installation-layer.rkt (scheme-file @@ -1350,41 +1501,53 @@ (define make-installation-layer.rkt racket/port racket/list racket/pretty) - (define config-file-pth - "etc/racket/config.rktd") (define (build-path-string . args) (path->string (apply build-path args))) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) + (define tethered? #f) + (define parent #f) (define extra-foreign-lib-search-dirs '()) - (define-values [parent-layer prefix] + (define-values [vm-dir prefix] (command-line #:once-each + [("--tethered") "create a tethered layer" + (set! tethered? #t)] + [("--parent") dir "path of parent layer, if any" + (set! parent dir)] [("--extra-foreign-lib-search-dirs") dir-list "foreign library directories, as a list of strings in `read` syntax" (set! extra-foreign-lib-search-dirs (call-with-input-string dir-list read))] - #:args (parent-layer prefix) - (values parent-layer prefix))) + #:args (vm-dir prefix) + (values vm-dir prefix))) (let* ([config (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) + ([config (file->value + (if parent + (build-path parent "etc/racket/config.rktd") + (build-path vm-dir "etc/config.rktd")))]) + ([spec + (in-list + '((lib-dir lib-search-dirs "lib/racket" "lib") + (share-dir share-search-dirs "share/racket" "share") + (links-file links-search-files + "lib/racket/links.rktd" + "share/links.rktd") + (pkgs-dir pkgs-search-dirs "lib/racket/pkgs" "share/pkgs") + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(bin-dir bin-search-dirs "bin" "bin") + (bin-dir bin-search-dirs + "lib/racket/bogus-untethered-bin" + "bin") + (man-dir man-search-dirs "share/man" "share/man") + (doc-dir doc-search-dirs "share/doc/racket" "doc") + (include-dir include-search-dirs + "include/racket" + "include")))]) + (match-define (list main-key search-key pth vm-pth) spec) (hash-set* config main-key @@ -1393,7 +1556,10 @@ (define-values [parent-layer prefix] (list* #f (hash-ref config main-key - (build-path-string parent-layer pth)) + (lambda () + (if parent + (build-path-string parent pth) + (build-path-string vm-dir vm-pth)))) (filter values (hash-ref config search-key null)))))] [config (hash-update config @@ -1427,15 +1593,21 @@ (define-values [rkt old-foreign-dirs] ;; workaroung Guile reader/printer: ['|3m| "-bc"] [_ ""])))] - [bin-dir - (hash-ref config 'bin-dir)] [config - (hash-set* config - 'config-tethered-apps-dir (hash-ref config 'apps-dir) - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) + (cond + [tethered? + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(define bin-dir (hash-ref config 'bin-dir)) + (define bin-dir (build-path-string prefix "bin")) + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [else + config])]) + (define new-config-pth + (build-path prefix "etc/racket/config.rktd")) (make-parent-directory* new-config-pth) (call-with-output-file* new-config-pth -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:03 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:03 +0000 Received: from localhost ([127.0.0.1]:54448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjy-0005WI-8m for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:02 -0500 Received: from mail-qt1-f173.google.com ([209.85.160.173]:33623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjf-0005Ua-BE for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:43 -0500 Received: by mail-qt1-f173.google.com with SMTP id bt3so4981997qtb.0 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:43 -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=QWGrAxMsRalG9YbMvxWhRRakQjhDJePWTZEStznge9s=; b=Mficudk9PCCa4zZEls4pALTJ7J0NRSKQMwj0OViq6JxJBMRsospK+mCfKaksNmFMUj apMxdmn4sgvGH2XlgEdUneUQBXR/RS2V3D6iQHnVH2+mCulbgCMBN7/owwO1V/tJyACE MqYN6lwtkkEgia0WUCSkPSJz4EkcCI2r6R3Vf1xHUmjtv+LfWhcjUhpy5V2rZbrHGhdJ /E7iZsRrEtYMHevekbutDEBNzxyVFtr7BbVp2cGgS5Bdu4CLuQI6IctkRzrKgK9rdxyh 65sIZBkjHO1R97MnPsu55dzcWKUQ0CPyh0TaZOa3GXiXDdWI1tXUf+wrpkMlbbLA0Zlf XFNw== 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=QWGrAxMsRalG9YbMvxWhRRakQjhDJePWTZEStznge9s=; b=4GTvIJMoA7az3YQscK7CHzITEmVFULMF44GPt1dT/aBpnbE4lzvlO4Hgzh/aqGZ92X AqmkDiiZfyus28p4pgqSDG2oZ2ymxrYq783gAqW5dOUq+xB4SjXQDwXnONctiLe+sH/0 jenHkel2bTXdG7bueWAknzy3DeDFjFv7TDPCQ9EHAJpyd8q2jHSxL6TneYFt1fF3eGsX gyUdLcRcvLsQkBoZSi6gdrik0pFXCKGVrFrbCqqgwm6Z2VNu4OeYR0QC8l45eHxCG0BQ Uv71m1vHOUBsEBbmLWmzkMkuvDJeSwFWlHQn4C9Owtk1vq9EpSfZsg7NI+YDbIc1uwG4 /4NA== X-Gm-Message-State: AOAM532Y+AZiy50HHQJtyfXWIl2243hCig358OkItV5LULLmQtNbEIcg cTwpkjF38fITG9wMKuiFJTaU+5PWoldFryTMaPU= X-Google-Smtp-Source: ABdhPJzDmaxN6aUrm27+j7EZL+eG7npAK8v7x9V6buhZU0N4n5iX6vaUZ7+YgqaRrhNiVSrm/Rl5vg== X-Received: by 2002:a05:622a:90:b0:2de:57e3:c77a with SMTP id o16-20020a05622a009000b002de57e3c77amr10490334qtw.488.1645880617753; Sat, 26 Feb 2022 05:03:37 -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 b137-20020ae9eb8f000000b00648f9736ab0sm2503052qkg.124.2022.02.26.05.03.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:37 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 10/22] gnu: racket: Move Chez bootfiles to (gnu packages chez). Date: Sat, 26 Feb 2022 08:02:42 -0500 Message-Id: <20220226130254.1301333-11-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (chez-scheme-for-racket-bootstrap-bootfiles): Move to ... * gnu/packages/chez.scm (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable. [source]: Avoid problematic cycle with "racket.scm". [arguments]<#:phases>: Likewise. --- gnu/packages/chez.scm | 62 +++++++++++++++++++++++++++++++++++++++++ gnu/packages/racket.scm | 52 ---------------------------------- 2 files changed, 62 insertions(+), 52 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 47904e7b4e..046bb3dcdc 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -31,12 +31,14 @@ (define-module (gnu packages chez) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages compression) #:use-module (gnu packages ncurses) #:use-module (gnu packages ghostscript) #:use-module (gnu packages linux) #:use-module (gnu packages netpbm) + #:use-module (gnu packages racket) #:use-module (gnu packages tex) #:use-module (gnu packages compression) #:use-module (gnu packages image) @@ -260,6 +262,66 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license asl2.0))) +(define-public chez-scheme-for-racket-bootstrap-bootfiles + (package + (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. + (source #f) ; avoid problematic cycle with racket.scm + (inputs `()) + (native-inputs (list racket-vm-bc)) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list + #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")) + #:phases + #~(let ((unpack (assoc-ref %standard-phases 'unpack))) + (modify-phases %standard-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 + (copy-recursively + #$nanopass + "nanopass" + #:keep-mtime? #t))) + (add-before 'install 'build + (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://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 "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 +supported platforms.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +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.") + (license (list asl2.0)))) + (define-public chez-srfi (package (name "chez-srfi") diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index a7704f1afe..ba958b6101 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -442,58 +442,6 @@ (define-public racket-vm-cs ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) -(define-public chez-scheme-for-racket-bootstrap-bootfiles - (package - (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. - (source %racket-origin) - (inputs `()) - (native-inputs (list racket-vm-bc)) - (build-system copy-build-system) - ;; TODO: cross compilation - (arguments - (list - #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda args - (chdir "racket/src/ChezScheme"))) - (add-after 'chdir 'unpack-nanopass+stex - (lambda args - #$(make-unpack-nanopass+stex))) - (add-before 'install 'build - (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://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 "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 -supported platforms.) - -The Racket package @code{cs-bootstrap} (part of the main Racket Git -repository) implements enough of a Chez Scheme simulation to load the Chez -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.") - (license (list license:asl2.0)))) - (define (extract-package-source origin spec) "Extract the source for a Racket package specified by SPEC from ORIGIN into a new file-like object. In the resulting file-like object, the package source -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:03 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:03 +0000 Received: from localhost ([127.0.0.1]:54452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjz-0005WY-0Z for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:03 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:41507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjj-0005Ut-HJ for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:48 -0500 Received: by mail-qk1-f182.google.com with SMTP id d84so6786149qke.8 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:47 -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=Mlc/qhGedBkcO/u3jAnfRZ74tW1eDlJyXNhnlOfQlJM=; b=MFwR+BllMo6vD6nqhDC2Pbup/TnBXRWm58D6VBfRPC2ts6x4Th6Th3Ozsz2q4ai34c WQD9LPiC1uFQj3wwbLur4RWLkktv9R0LW5eYZ64A1qMyh+VO356KV252vtHHgOuuJ4d5 CEtSQRg1IDSAlYUjZAsaDkfZF/rCOVkxKFTznAb/ispnaoF4+ALA5FnFInRl6+y4lXFq 8wFvujB1eX9IQD/SIA42isrw7LXXzFOhJkI6GYKcVH1mrc3mm/aarKU0evVHvPY+/mJt zAEly6gefgaFNGiB4clFXqnzbIIYsVU1UI+QUxx4pEOKLizcxArVM9xsnEXt5QwZOoX9 YQbw== 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=Mlc/qhGedBkcO/u3jAnfRZ74tW1eDlJyXNhnlOfQlJM=; b=rMPY1kZO4DDrxzp04ITq+ndn+u0kkK9EnK/vlx1JBWtxKuMtWZqpP/DM6q12NFzCj2 qLGWBBpzPOk281A01YiNGqP6mYtSk4wNqpXFLIksmJ2vuS0tCEig7S72KlDrRwwp650p lDISla4b94bboqiTxxXGk7agRJXySP1j9tA/nZ5qeoNGrcIlmgSb+AnZK+diIDyQgYj0 ikN9bqcz5s0n31p4J7IW1xhvrMToC9FuNY4rR4KLDaSZzIbyPgVbhvf1Q2WiIuHBzkBU Cx9EEpixgoW97U9VRIzq4BOLmZArRMn86ZjFKEKgbGSzSkWrCvbSdYXwFWQM1azrmDGX zv5g== X-Gm-Message-State: AOAM530B50ns8MY5FQxXtcRCxqQBRqBFqHN3dEpLE5V8kpxPFNw+T+86 IHwLXSU0AeCk9Y7VrZ+9NqWQKq1HA1hUOUgeOk8= X-Google-Smtp-Source: ABdhPJyM41EvnKU2hkGODW8f5uwdwQm24sORkWPjr83+TvvaU+up5BgrIezNBi4ejTBZfKubtLWujA== X-Received: by 2002:a37:610c:0:b0:5f1:83b8:a6c9 with SMTP id v12-20020a37610c000000b005f183b8a6c9mr7116053qkb.196.1645880621774; Sat, 26 Feb 2022 05:03:41 -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 192-20020a3704c9000000b00648d50e398asm2531270qke.109.2022.02.26.05.03.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:41 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 11/22] gnu: chez: Add utilities for Chez machine types. Date: Sat, 26 Feb 2022 08:02:43 -0500 Message-Id: <20220226130254.1301333-12-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system, nix-system->chez-machine, chez-upstream-features-for-system): New functions. (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private constants. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. (chez-scheme-for-racket-bootstrap-bootfiles)[supported-systems]: Compute based on 'nix-system->chez-machine'. --- gnu/packages/chez.scm | 127 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 3 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 046bb3dcdc..603fc4201e 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -44,7 +44,119 @@ (define-module (gnu packages chez) #:use-module (gnu packages image) #:use-module (gnu packages xorg) #:use-module (ice-9 match) - #:use-module (srfi srfi-1)) + #:use-module (srfi srfi-1) + #:export (nix-system->chez-machine + chez-machine->nonthreaded + chez-machine->threaded)) + +(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 +MACHINE. The returned string may share storage with MACHINE." + ;; Chez Scheme documentation consistently uses "nonthreaded" rather than + ;; e.g. "unthreaded" + (if (eqv? #\t (string-ref machine 0)) + (substring machine 1) + machine)) +(define (chez-machine->threaded machine) + "Like @code{chez-machine->nonthreaded}, but returns the threaded machine +type." + (if (eqv? #\t (string-ref machine 0)) + machine + (string-append "t" machine))) + +;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt +;; in https://github.com/racket/raco-cross. +;; For supported platforms, refer to release_notes/release_notes.stex in the +;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md +;; in https://github.com/racket/racket. +(define %nix-arch-to-chez-alist + `(("x86_64" . "a6") + ("i386" . "i3") + ("aarch64" . "arm64") + ("armhf" . "arm32") ;; Chez supports ARM v6+ + ("ppc" . "ppc32"))) +(define %nix-os-to-chez-alist + `(("w64-mingw32" . "nt") + ("darwin" . "osx") + ("linux" . "le") + ("freebsd" . "fb") + ("openbsd" . "ob") + ("netbsd" . "nb") + ("solaris" . "s2"))) + +(define (chez-machine->nix-system machine) + "Return the Nix system type corresponding to the Chez Scheme machine type +MACHINE. If MACHINE is not a string representing a known machine type, an +exception is raised. This function does not distinguish between threaded and +nonthreaded variants of MACHINE. + +Note that this function only handles Chez Scheme machine types in the +strictest sense, not other kinds of descriptors sometimes used in place of a +Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or +@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type +for the host system is often still relevant.)" + (let ((machine (chez-machine->nonthreaded machine))) + (let find-arch ((alist %nix-arch-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (string-prefix? chez machine) + (string-append + nix "-" (let ((machine-os + (substring machine (string-length chez)))) + (let find-os ((alist %nix-os-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (equal? chez machine-os) + nix + (find-os alist))))))) + (find-arch alist))))))) + +(define* (nix-system->chez-machine #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return the Chez Scheme machine type corresponding to the Nix system +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme +machine type is undefined. + +It is unspecified whether the resulting string will name a threaded or a +nonthreaded machine type: when the distinction is relevant, use +@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust +the result." + (let* ((hyphen (string-index system #\-)) + (nix-arch (substring system 0 hyphen)) + (nix-os (substring system (+ 1 hyphen))) + (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) + (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) + (and chez-arch chez-os (string-append chez-arch chez-os)))) + +(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}. Other feature symbols may be added in the future." + (cond + ((not (nix-system->chez-machine system)) + #f) + ((target-aarch64? system) + #f) + ((target-arm32? system) + (and (target-linux? system) + '())) + ((target-ppc32? system) + (and (target-linux? system) + '(threads))) + (else + '(threads)))) + +;; +;; Chez Scheme: +;; (define nanopass (let ((version "1.9.2")) @@ -251,8 +363,11 @@ (define* (stex-make #:optional (suffix "")) ;; We should too. It is the Chez machine type arm32le ;; (no threaded version upstream yet, though there is in ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) + (supported-systems + (delete + "armhf-linux" ;; <-- should work, but reportedly broken + (filter chez-upstream-features-for-system + %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description @@ -300,6 +415,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)) (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 @@ -322,6 +439,10 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles Chez Scheme.") (license (list asl2.0)))) +;; +;; Packages: +;; + (define-public chez-srfi (package (name "chez-srfi") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:04 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:04 +0000 Received: from localhost ([127.0.0.1]:54456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjz-0005Wn-Oq for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:04 -0500 Received: from mail-qv1-f46.google.com ([209.85.219.46]:39733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjn-0005VM-DW for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:51 -0500 Received: by mail-qv1-f46.google.com with SMTP id a1so8843897qvl.6 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:51 -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=k/9MRYKwBQb0a6Gw7ObTuv3AcCArpX+jq+jv49oz8T4=; b=kIr/h5AuoMMZN27ZaZ1UBDfY7KshbDGmC1yq1XxPl9oVqKDWpKJ89kuu78nzUy26rn 7I76aaUhxEil2K7ikjhG+/ml/d57z7VKGuV8I3EreZRAyVrRKRms1BVZ+B3AvTP/MJNW um2yesIISen7Ovrinx3Mxq5cMZe6Bota0oAz6c9Y1kprULlBAPoWJtqG3dUzBzEDg9Ea ilc2zs/CDBb191u/w/qVAXQAvbDKgF5N9a0KhkPfOgL5MW0bXGKoA9XzUqnT/afOEh67 WkfB9CfkQoJ71vmoLiuqVfGg9L9/bgH6FqPoc7rErVsFdfHPw7DVRx90mF5Skp26Qc3c Egbw== 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=k/9MRYKwBQb0a6Gw7ObTuv3AcCArpX+jq+jv49oz8T4=; b=7yhdZuR2qQWcJEONe1mLdkDH/JBSST0H7lZWK32D+cZCMQoZKXch7LKUpTRqRxYvLH ML4b5OmzAw0rcJfxDmlqq0bjLy4wACekNSnfLV0jWSKPujv+3Yv3YscvW9T1fEknsJuP sAGPJz4TnjKIJ4ovTcW2ILWIyMD29x6J3SiV/IOFFhkLXT270wzY+mxXQb3wxV7xCYRt XzLHfiX0n4t4dCnG4PLYKJ7cOUsv23iSyjd2CZ2Qtahtv9y9hau+GRB4PZ+tm02qezJs AvxpXWrRaJtrv+D/8oStc/2BtrOeUS9MdbkTtM7AAyLhhUBPv4lM6gsOYR1yXixBKOEO 89+w== X-Gm-Message-State: AOAM533jEwQlyT2SnNg4ecZ7XUjm5UVfGjRISZcture5mRvLaRqeXUqH ZBxSa3lAkv/fNBH2xYTzGFiTye0pwm2NGBvgbrg= X-Google-Smtp-Source: ABdhPJwGC+7A5yJoL6E4CjPyUzTcIjfb7VYT3JtgkbeF+nmXOLt5zbeKRPPoZg7MX6r+qer/HmT4Gw== X-Received: by 2002:a05:6214:c89:b0:432:c49b:41a5 with SMTP id r9-20020a0562140c8900b00432c49b41a5mr4905379qvr.48.1645880625874; Sat, 26 Feb 2022 05:03:45 -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 c6-20020ac87d86000000b002ddd9f33ed1sm3138312qtd.44.2022.02.26.05.03.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:45 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 12/22] gnu: racket: Add 'racket-vm-for-system'. Date: Sat, 26 Feb 2022 08:02:44 -0500 Message-Id: <20220226130254.1301333-13-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-vm-for-system): New procedure. (racket-minimal, racket)[inputs]: Use it. --- gnu/packages/racket.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index ba958b6101..93e5eea158 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -187,6 +187,14 @@ (define-module (gnu packages racket) ;; ;; Code: +(define* (racket-vm-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." + (if (nix-system->chez-machine system) + racket-vm-cs + racket-vm-bc)) + (define %racket-version "8.4") ;; ^ Remember to update chez-scheme-for-racket-bootstrap-bootfiles! (define %racket-commit @@ -508,7 +516,7 @@ (define-public racket-minimal (inputs (cons* openssl sqlite - racket-vm-cs ;; TODO (racket-vm-for-system) + (racket-vm-for-system) (extract-package-source* `((,%racket-origin ("base" "pkgs/base") @@ -625,7 +633,7 @@ (define-public racket unixodbc libedit ;; TODO reconsider in light of expeditor and readline-gpl racket-minimal ;; <-- TODO non-tethered layer - racket-vm-cs ;; TODO (racket-vm-for-system) + (racket-vm-for-system) (extract-package-source* `((,(origin (method git-fetch) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:06 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:06 +0000 Received: from localhost ([127.0.0.1]:54461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwk0-0005X1-69 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:06 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:35367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjs-0005Va-2l for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:03:57 -0500 Received: by mail-qv1-f42.google.com with SMTP id 8so8885444qvf.2 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:03:56 -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=MWndrRDXHspBq1QQkgbSJoc4I680TI0JaiSKrL8aU30=; b=AywK4IwF+PSuV2SILcCvZiqa0J78f85cNNWVTH1GzTVu9bC8IKBb/k/2/NOAVknPGY mkDBDPA5y0b232Kfvi2GLpdThPjh5fN32T/9wddHhUODSpa0qCZRbHQPQ6wGijIIW9m3 3+e0Gq2+rtvhQ5Juu0rlXWUPpnId+PJZ9931LpYzn4u1emJ6dKwdgBWv0vSuB6KAquD3 VgiTRiJ0XwpnEnH9VKIbUTY6xecrh6hSsKNY31Se5HMI8vc7VUeJtgQZk3mXbv5I3JlA FaWAuxdELjydyQGUDCdrx/iX8uQ+S39r+/2IrVtclPTlRa7EzYX9l1qhHAB4CJfF1iVY 43lg== 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=MWndrRDXHspBq1QQkgbSJoc4I680TI0JaiSKrL8aU30=; b=EYI7yG4VYIKU+LuBT2ZtiDbz5nHNFjKr/sAztJxnZIwDDuWLcBTKhvgUe9EymrUMhY 8kTnwkhD9ruRriqRjXsRqzZK0LfyUpwGnL7IZHEsW8Fzt8xoEUwg75NmFrOIlV2yoTuL +uCneJx59/uRzH95iIwvOV6/tzy8n/sl/nPtQsgvWEg+9doaw67R+fQOuROCIMRAVzbT k6L63QuWI00e45S3enWNb+oyORZHQZS810ljWiEePxzjOLF2ffggaKk0XFtroE5VQ6C4 xdf83uytryk2DP02/aPmqfBxTBVXk2C/Mzk0R/s9+uM5ZfsrbwS8vxTb36kwbOgjhFLP /s3Q== X-Gm-Message-State: AOAM532eGruHXFmHYaHHfUhR/J2gy/qdi2Xu/FgDag+/AIIolp/Fs4vO boUesZK7v/SkZmYb58v3DcFyPzF4lVsmjnNencs= X-Google-Smtp-Source: ABdhPJxaZxJSYdZOg+3bkP1VQa5fCNffVRlFKVTFDrBDcZ2B1KM13lFNw5SX3LWI7B0INnuMrA63JQ== X-Received: by 2002:a0c:f8c3:0:b0:432:5482:d1b6 with SMTP id h3-20020a0cf8c3000000b004325482d1b6mr8845413qvo.60.1645880630021; Sat, 26 Feb 2022 05:03:50 -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 j10-20020ac85f8a000000b002dde6288fa7sm3364146qta.83.2022.02.26.05.03.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:49 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 13/22] gnu: chez-scheme: Use "lib/chez-scheme" for search path. Date: Sat, 26 Feb 2022 08:02:45 -0500 Message-Id: <20220226130254.1301333-14-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Update accordingly. Also, remove input labels and use G-expressions. --- gnu/packages/chez.scm | 382 +++++++++++++++++++++--------------------- 1 file changed, 194 insertions(+), 188 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 603fc4201e..0a84a07247 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -233,7 +233,7 @@ (define-public chez-scheme (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) + (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments `(#:modules @@ -443,6 +443,27 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; Packages: ;; +;; Help function for Chez Scheme to add the current path to +;; CHEZSCHEMELIBDIRS. +(define chez-configure + #~(lambda _ + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) + (setenv "CHEZSCHEMELIBDIRS" + (if chez-env + (string-append ".:" chez-env) + "."))))) + +;; Help function to define make flags for some Chez Scheme custom make +;; files. +(define (chez-make-flags name version) + #~(let ((out #$output)) + (list + ;; Set 'schemedir' so that libraries are installed in + ;; 'lib/chez-scheme' like Chez's 'native-search-paths' expects. + (string-append "schemedir=" out "/lib/chez-scheme") + (string-append "PREFIX=" out) + (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) + (define-public chez-srfi (package (name "chez-srfi") @@ -460,13 +481,11 @@ (define-public chez-srfi (native-inputs (list chez-scheme)) (arguments - `(#:make-flags (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out) - "CHEZ=chez-scheme --libdirs ./" - (string-append "chezversion=" ,(package-version chez-scheme)))) - #:test-target "test" - #:phases (modify-phases %standard-phases - (delete 'configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -491,42 +510,48 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("ghostscript" ,ghostscript) - ("texlive" ,(texlive-updmap.cfg (list texlive-oberdiek - texlive-epsf - texlive-metapost - texlive-charter - texlive-pdftex - texlive-context - texlive-cm - texlive-tex-plain))))) + (list chez-scheme + ghostscript + ;; FIXME: This package fails to build with the error: + ;; mktexpk: don't know how to create bitmap font for bchr8r + ;; Replacing the following with `texlive` fixes it. + ;; What is missing? + (texlive-updmap.cfg (list texlive-oberdiek + texlive-epsf + texlive-metapost + texlive-charter + texlive-pdftex + texlive-context + texlive-cm + texlive-tex-plain)))) (arguments - `(#:make-flags (list (string-append "PREFIX=" %output) - (string-append "DOCDIR=" %output "/share/doc/" - ,name "-" ,version) - (string-append "LIBDIR=" %output "/lib/chezweb") - (string-append "TEXDIR=" %output "/share/texmf-local")) - #:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - ;; This package has a custom "bootstrap" script that - ;; is meant to be run from the Makefile. - (delete 'bootstrap) - (replace 'configure - (lambda* _ - (copy-file "config.mk.template" "config.mk") - (substitute* "tangleit" - (("\\./cheztangle\\.ss" all) - (string-append "chez-scheme --program " all))) - (substitute* "weaveit" - (("mpost chezweb\\.mp") - "mpost --tex=tex chezweb.mp") - (("\\./chezweave" all) - (string-append "chez-scheme --program " all))) - (substitute* "installit" - (("-g \\$GROUP -o \\$OWNER") "")) - #t))))) + (list + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "DOCDIR=" #$output "/share/doc/" + #$name "-" #$version) + ;; lib/chez-scheme/chezweb ??? + (string-append "LIBDIR=" #$output "/lib/chezweb") + (string-append "TEXDIR=" #$output "/share/texmf-local")) + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + ;; This package has a custom "bootstrap" script that + ;; is meant to be run from the Makefile. + (delete 'bootstrap) + (replace 'configure + (lambda* _ + (copy-file "config.mk.template" "config.mk") + (substitute* "tangleit" + (("\\./cheztangle\\.ss" all) + (string-append "scheme --program " all))) + (substitute* "weaveit" + (("mpost chezweb\\.mp") + "mpost --tex=tex chezweb.mp") + (("\\./chezweave" all) + (string-append "scheme --program " all))) + (substitute* "installit" + (("-g \\$GROUP -o \\$OWNER") ""))))))) (home-page "https://github.com/arcfide/ChezWEB") (synopsis "Hygienic Literate Programming for Chez Scheme") (description "ChezWEB is a system for doing Knuthian style WEB @@ -550,95 +575,74 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("chez-web" ,chez-web) - ("texlive" ,(texlive-updmap.cfg (list texlive-pdftex))))) + (list chez-scheme + chez-web + (texlive-updmap.cfg (list texlive-pdftex)))) (arguments - `(#:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-web (assoc-ref inputs "chez-web")) - (chez (assoc-ref inputs "chez-scheme")) - (chez-h (dirname (car (find-files chez "scheme\\.h"))))) - (substitute* "Makefile" - (("(SCHEMEH=).*$" all var) - (string-append var chez-h))) - #t))) - (add-before 'build 'tangle - (lambda* (#:key inputs #:allow-other-keys) - (setenv "TEXINPUTS" - (string-append - (getcwd) ":" - (assoc-ref inputs "chez-web") "/share/texmf-local/tex/generic:" - ":")) - ;; just using "make" tries to build the .c files before - ;; they are created. - (and (invoke "make" "sockets") - (invoke "make")))) - (replace 'build - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - ;; make sure Chez Scheme can find the shared libraries. - (substitute* "sockets.ss" - (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" - all cmd so) - (string-append cmd " \"" chez-site "/" so "\"")) - (("sockets-stub\\.[sd][oy].*" all) - (string-append chez-site "/" all))) - ;; to compile chez-sockets, the .so files must be - ;; installed (because of the absolute path we - ;; inserted above). - (for-each (lambda (f d) (install-file f d)) - '("socket-ffi-values.so" "sockets-stub.so") - (list chez-site chez-site)) - (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) - (replace 'install - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/chez-sockets")) - (doc (string-append out "/share/doc/" ,name "-" ,version)) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - (for-each (lambda (f d) (install-file f d)) - '("sockets.pdf" "sockets.so") - (list doc chez-site)) - #t)))))) + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((scheme (search-input-file (or native-inputs inputs) + "/bin/scheme")) + (lib (string-append (dirname scheme) "/../lib")) + (header-file (car (find-files lib "scheme\\.h"))) + (include-dir (dirname header-file))) + (substitute* "Makefile" + (("(SCHEMEH=).*$" _ var) + (string-append var include-dir)))))) + (add-before 'build 'tangle + (lambda* (#:key inputs #:allow-other-keys) + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" + (assoc-ref inputs "chez-web") + "/share/texmf-local/tex/generic:" + ":")) + ;; just using "make" tries to build the .c files before + ;; they are created. + (and (invoke "make" "sockets") + (invoke "make")))) + (replace 'build + (lambda args + (let ((chez-site (string-append #$output + "/lib/chez-scheme/arcfide"))) + ;; make sure Chez Scheme can find the shared libraries. + (substitute* "sockets.ss" + (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post)) + (("(\")(sockets-stub\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post))) + ;; to compile chez-sockets, the .so files must be + ;; installed (because of the absolute path we + ;; inserted above). + (for-each (lambda (f) + (install-file f chez-site)) + '("socket-ffi-values.so" + "sockets-stub.so")) + (invoke "bash" + "-c" + (format #f "echo '~s' | scheme -q" + '(compile-file "sockets.sls")))))) + (replace 'install + (lambda args + (install-file "sockets.so" + (string-append #$output + "/lib/chez-scheme/arcfide")) + (install-file "sockets.pdf" + (string-append #$output + "/share/doc/" + #$name "-" #$version))))))) (home-page "https://github.com/arcfide/chez-sockets") (synopsis "Extensible sockets library for Chez Scheme") (description "Chez-sockets is an extensible sockets library for Chez Scheme.") (license expat)))) -;; Help function for Chez Scheme to add the current path to -;; CHEZSCHEMELIBDIRS. -(define chez-configure - '(lambda _ - (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) - (setenv "CHEZSCHEMELIBDIRS" - (if chez-env - (string-append ".:" chez-env) - ".")) - #t))) - -;; Help function to define make flags for some Chez Scheme custom make -;; files. -(define (chez-make-flags name version) - `(let ((out (assoc-ref %outputs "out"))) - (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" ,(package-version chez-scheme)) - (string-append "PREFIX=" out) - (string-append "DOCDIR=" out "/share/doc/" - ,name "-" ,version)))) - (define-public chez-matchable (package (name "chez-matchable") @@ -659,10 +663,11 @@ (define-public chez-matchable (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -690,10 +695,11 @@ (define-public chez-irregex (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -720,17 +726,18 @@ (define-public chez-fmt (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "chez-check" - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - (replace 'build - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-build" make-flags))) - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-install" make-flags)))))) + (list #:make-flags (chez-make-flags name version) + #:test-target "chez-check" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-build" make-flags))) + (replace 'install + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-install" make-flags)))))) (home-page "http://synthcode.com/scheme/fmt") (synopsis "Combinator formatting library for Chez Scheme") (description "This package provides a library of procedures for @@ -760,10 +767,11 @@ (define-public chez-mit (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -792,46 +800,44 @@ (define-public chez-scmutils (propagated-inputs (list chez-mit chez-srfi)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:tests? #f ; no test suite - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - ;; 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 - ;; in turn requires us to compile the files in the final - ;; destination. - (delete 'build) - (add-after 'install 'install-src - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-src" make-flags))) - (add-after 'install-src 'absolute-path-in-scm-files - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils") - (string-append "include \"" (dirname file))))) - (find-files out "\\.sls")) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils/simplify") - (string-append "include \"" (dirname file))))) - (find-files out "fbe-syntax\\.scm")) - #t))) - (add-after 'absolute-path-in-scm-files 'build - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (mk-file (car (find-files out "Makefile")))) - (with-directory-excursion (dirname mk-file) - (apply invoke "make" "build" make-flags))))) - (add-after 'build 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (for-each delete-file - (find-files out "Makefile|compile-all\\.ss")) - #t)))))) + (list + #:make-flags (chez-make-flags name version) + #:tests? #f ; no test suite + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + ;; 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 + ;; in turn requires us to compile the files in the final + ;; destination. + (delete 'build) + (add-after 'install 'install-src + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "install-src" make-flags))) + (add-after 'install-src 'absolute-path-in-scm-files + (lambda* (#:key #:allow-other-keys) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils") + (string-append "include \"" (dirname file))))) + (find-files #$output "\\.sls")) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils/simplify") + (string-append "include \"" (dirname file))))) + (find-files #$output "fbe-syntax\\.scm")))) + (add-after 'absolute-path-in-scm-files 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (let ((mk-file (car (find-files #$output "Makefile")))) + (with-directory-excursion (dirname mk-file) + (apply invoke "make" "build" make-flags))))) + (add-after 'build 'clean-up + (lambda args + (for-each delete-file + (find-files #$output + "Makefile|compile-all\\.ss"))))))) (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") (description "This package provides a port of the MIT/GNU Scheme Scmutils program to Chez Scheme. The port consists of a set of -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:41 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:41 +0000 Received: from localhost ([127.0.0.1]:54493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkb-0005aO-Gt for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:41 -0500 Received: from mail-qk1-f180.google.com ([209.85.222.180]:41514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwjw-0005Vl-QO for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:01 -0500 Received: by mail-qk1-f180.google.com with SMTP id d84so6786419qke.8 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:00 -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=cMhM4Hgg9U6jTMLRrhG0O3LswFRxbkC1hIDPaNTSRQc=; b=M7sGxU0O/9IWP7S1vnTpUoUNrI6tF/graDvi0wgapsezGE5rG7z54Qm92Rg9mCbPmC j38kOTM6Map509+Pc/Tk2BVtcUlP+B5Fr6D7LqAglM6Trz0yHA4Ypm8/dZ1W9RQHXkrH kfFTF7mGKU4BLCjjH3hqRz3xwn0asiCb32mEadBEw9sYf7DfeC5CFTyISryXrS+UjNbO C/UQDvhsIdD+0v8G/FjFua/AfC+FnTZQxgR5n/FWCDtLJSpYUcMtCKrAsZ+RM6SLw7cy 3mU4epZFGCfnEwcXOhDZD4M4ElnuNJKZyeh1PW/dds7SCRiI9mQc/bNT2x4ftECGrLCc gTmA== 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=cMhM4Hgg9U6jTMLRrhG0O3LswFRxbkC1hIDPaNTSRQc=; b=6an9o/z1BvaB4+YjDXJDjdj5Yj4VSHzwgSl9mwVxacbFwXSAEGF6FlIlCIzb4+/RXV lZPKOYl2AQhvlqbGYvZaDuCkMkRgPSUkuUbk+tJkkAj/klmkFRuCm/yd1fWh5wW9sdSU 5a5vlFLAsjMeg9y8zu4PHZL+rFTKkrPrOfI7I94XiMvY+r5wJBGMQR4KsuzqVX+vUqQc 3lliufn+FqxCA8p/vQ2uRMum6g6tlL9fTZrzSgcqQocGwt+D/nPJKFTVTkXDJYQKm2+g 0/lF01/exVJRKbCB6PMfUa4EqSKW6ICylBxTGmrbvpH+Ned80OmOSpzS4mpjy/+62YP7 /+Mg== X-Gm-Message-State: AOAM530UsSzTXP9cArs6AZoXiVthqPt6WLXIcLDHPByrH9ZSjQArHG8F T7RmMt2VngdkoP1TfYYQbKvyxPnG1G6miEDqxKs= X-Google-Smtp-Source: ABdhPJzvW6IUpVMs91xSLe98fXdOUT8sI4vPNPAeJr0Bczx9rN+XoO52cx3qR5xUryIC3s5oKdexgQ== X-Received: by 2002:a05:620a:1729:b0:648:a992:cd47 with SMTP id az41-20020a05620a172900b00648a992cd47mr7462423qkb.53.1645880634306; Sat, 26 Feb 2022 05:03:54 -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 k125-20020a378883000000b006491db6dbb1sm2486706qkd.84.2022.02.26.05.03.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:53 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 14/22] gnu: chez-scheme: Use shared zlib and lz4. Date: Sat, 26 Feb 2022 08:02:46 -0500 Message-Id: <20220226130254.1301333-15-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 0a84a07247..43332c06ad 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -211,9 +211,7 @@ (define-public chez-scheme (inputs `(("libuuid" ,util-linux "lib") ("zlib" ,zlib) - ("zlib:static" ,zlib "static") ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") ;; for expeditor: ("ncurses" ,ncurses) ;; for X11 clipboard support in expeditor: @@ -266,14 +264,14 @@ (define src (lz4-static (assoc-ref inputs "lz4:static")) (out (assoc-ref outputs "out")) ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) + (flags (cons* (string-append "--installprefix=" out) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do compress-man-pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) (format #t "configure flags: ~s~%" flags) ;; Some makefiles (for tests) don't seem to propagate CC ;; properly, so we take it out of their hands: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:42 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:42 +0000 Received: from localhost ([127.0.0.1]:54495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkb-0005aQ-Px for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:42 -0500 Received: from mail-qt1-f177.google.com ([209.85.160.177]:37707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwk0-0005Vx-2m for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:05 -0500 Received: by mail-qt1-f177.google.com with SMTP id q10so4989780qtw.4 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:04 -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=H6h99RZO4mXEFBHmgdJmKzbn218TAYMqE39IhXoMJBk=; b=QA+fkHiU1fnLsZvKup9O8dIbXgdQW8DiQbektmLKQGE9709lJdy2wfc/IYDF9/uK55 yz3kZsjiJNOE4nPeHXCGGET+r7Yv2ygkJhbGnhoQpzW3wzwIolsj4dGmk5VNEgLLFMNC cGTdGxGzolx4bjYKMmOVToABwjoB+s9SAjShDehKzZ2mgS1mflqlzLvifbi3ND6uM29R VhVYM8Im1/luJ/jsVFGquzegQhUPDfHM4c4v9z4G0EfMuy04Q/JJ+r5uK7CeGzt5ESWC vRMdtFqExv9SBKb+g1DPrZ/zwlWTapSpimUO5U0gmmrCEQcl9xs3v7OQEKAEqK6WC30J tqMw== 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=H6h99RZO4mXEFBHmgdJmKzbn218TAYMqE39IhXoMJBk=; b=m9rrrRmb34EAKSrOgZ7SB7cAZoUf1yU9V0kIwVy4D2Tf0AYo+1Ami5R9ctKt9Q1Hqe bmd6Xgi1bJnv3Y17GycpFQStu/6n5iwWtBavaggWEeKn2CdN/aQo86ws8kmHg4TXyvkd 5jRxJc6LE31BwVmdgCeVTkalvyxrce8+uNJxF67rzkhUDCfYBg3i4/E/zS5Id+gqnmtp JAjj5B7gBuLqQhHq++HkWBrSfXuEfM0WmHx5wKpuCqOUSbTLiTPuVT4xCPMVzZBrYsxv 3REjBzuAvuvL9d35l6piZ1MCEg6M+hMcKJQlGpNc4hKSrKh27dImYNC3pkeTwzNe91mQ 8TGA== X-Gm-Message-State: AOAM530hHyPmFlz6q6Du/lsEU9XdlYOHEyXP7qZayapLo0nHIa9b5BcM ap7EaF47hCYP5FoyGBPaiYIkcwyHF3vMRfjSxNE= X-Google-Smtp-Source: ABdhPJwx29zTq7bVGEVJ5vSrgerO8uNnM0i1MjtR5aHWquzk9dBnDSqMjXNrmdPWxuLyGJxF+NMXwg== X-Received: by 2002:ac8:5e49:0:b0:2de:90a8:307e with SMTP id i9-20020ac85e49000000b002de90a8307emr10518659qtx.671.1645880638382; Sat, 26 Feb 2022 05:03:58 -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 k10-20020a05622a03ca00b002de9f8e660dsm3396411qtx.63.2022.02.26.05.03.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:03:58 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 15/22] gnu: chez-scheme: Use new package style. Date: Sat, 26 Feb 2022 08:02:47 -0500 Message-Id: <20220226130254.1301333-16-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove labels. [native-inputs]: Likewise. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass): Make public as a temporary workaround for Racket. * gnu/packages/racket.scm (make-unpack-nanopass+stex): Update accordingly. --- gnu/packages/chez.scm | 286 +++++++++++++++++++--------------------- gnu/packages/racket.scm | 5 +- 2 files changed, 135 insertions(+), 156 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 43332c06ad..a130f2f41a 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -158,7 +158,7 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define nanopass +(define-public nanopass (let ((version "1.9.2")) (origin (method git-fetch) @@ -185,86 +185,80 @@ (define stex (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.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))))) (build-system gnu-build-system) (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("lz4" ,lz4) - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) + (list + `(,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 - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) + (list nanopass ; source only + ;; for docs + stex + xorg-rgb + (texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") (files (list (string-append "lib/chez-scheme")))))) (outputs '("out" "doc")) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* (string-append "--installprefix=" out) + #:test-target "test" + ;; TODO when we fix armhf, it may not support --threads + #:configure-flags #~'("--threads") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (copy-recursively #$nanopass + "nanopass" + #:keep-mtime? #t) + (copy-recursively #$stex + "stex" + #:keep-mtime? #t))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) + ;; add flags which are always required: + (let ((flags (cons* (string-append "--installprefix=" #$output) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" @@ -272,90 +266,78 @@ (define src ;; and letting Chez try causes an error "--nogzip-man-pages" configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke "./configure" 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* ((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 explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (let* ((stex-output "/tmp") + (doc-dir (string-append stex-output "/share/doc/stex"))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/stex") + (string-append "Scheme=" + (search-input-file outputs + "/bin/scheme"))) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (match (assoc-ref outputs "doc") + (#f + (format #t "not installing docs~%")) + (doc-prefix + (let* ((chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib "/tmp/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 93e5eea158..3ba1438014 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -257,10 +257,7 @@ (define (make-unpack-nanopass+stex) ;; Thunked to avoid evaliating 'chez-scheme' too early. #~(begin (copy-recursively - #$(match (assoc-ref (package-native-inputs chez-scheme) - "nanopass") - ((src) - src)) + #$nanopass "nanopass" #:keep-mtime? #t) (mkdir-p "stex") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:43 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:43 +0000 Received: from localhost ([127.0.0.1]:54497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkc-0005aY-EO for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:42 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:43622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwk4-0005Wj-DA for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:09 -0500 Received: by mail-qv1-f53.google.com with SMTP id c14so4016801qvk.10 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:08 -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=vxW4XQP+MDoF2BylzCMVbI/zhkM8gWIfVo6540Fy93M=; b=UNGon/Cq6Q63fXkHe+N+mMdwrT3KQEkyTcs2jrTkNSaGy6gAm0zHsD5y+DS/6CbWvJ TEo5QrIkBt4xgA3xUiv8kpgS22lfaVdYM82MPO5wgDN9I6nijIRwEx+fvcHuybh8avBN P9KqaOpy4BFT8VbMelIzLM9nNRAL8TGavVrxurwxzpIO4AKxBOgvA7Y3W0wxrR7lt5w/ Hvi9WcUa9DFgJ0Cr8cWtrq+fvD+obMkzHO/yJKIelB/CNRAc8TLy7qUBfjkabYwWKtMX KGlNfsdQsTo+qvCZImWLgts+DjPFU1nYaqKiEAf8BTACoKkfOHbpeXnWJX+qcxsSZicd f6pA== 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=vxW4XQP+MDoF2BylzCMVbI/zhkM8gWIfVo6540Fy93M=; b=FsmdcXEeHr+1aiLeIYJ8oPH8S9TNu4zlv6Sfi/mOV8kUmWUd7H7JZWgI/mTKiQIJRn eqm72YWbX+rEkyYctZXcC4/uM8IWPFpEdSF6fsjJBK6Mtt3nehrNJRVVNXEQ3uec12oC ROjEJz5jrLSwBem3jiWKSrjIofbd9itQKx8vF7178Ar1o9Ohfk7Q3o5ZSH7xzfdEtPVR jklm9hWIlZYlux5Xvq1YmuT+wP7I2E4FcPU6b0ijBjHnCv6QGQ1HBgZpjrxf/BXbgyc+ SHOZSScjosIJBsTI66fBrc74owUvWxHUXjlMMhbEV4DGLks5yKADocgV8oasV1j02YEb z28Q== X-Gm-Message-State: AOAM530Gj2IkDNstudHyZTF6NZOH/2TtsJDkQJD1NASnpP5ldn4UJ/2w 7e7ONEw9CyKuCiUzZQ7XvDhQiLhnVnozncrfgn4= X-Google-Smtp-Source: ABdhPJy7w+sV4YULKuIkpZ0jPIT1IIrQo8F+WZT9u1U6NKA4yQ85xnlPNKoZ62sD0jotTGTmW2gNFw== X-Received: by 2002:a05:6214:5296:b0:432:5c5b:5b23 with SMTP id kj22-20020a056214529600b004325c5b5b23mr8776223qvb.106.1645880642720; Sat, 26 Feb 2022 05:04:02 -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 m29-20020a05620a215d00b0047ec917d4b9sm2446474qkm.56.2022.02.26.05.04.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:04:02 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 16/22] gnu: Add stex. Date: Sat, 26 Feb 2022 08:02:48 -0500 Message-Id: <20220226130254.1301333-17-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap' (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies of stex-bootstrap. [arguments]<#:phases>: Remove 'prepare-stex'. Adjust 'unpack-nanopass+stex' and 'install-doc'. --- gnu/packages/chez.scm | 217 ++++++++++++++++++++++++++++++------------ 1 file changed, 155 insertions(+), 62 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index a130f2f41a..99a250154f 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -33,6 +33,7 @@ (define-module (gnu packages chez) #:use-module (guix gexp) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) + #:use-module (guix build-system copy) #:use-module (gnu packages compression) #:use-module (gnu packages ncurses) #:use-module (gnu packages ghostscript) @@ -158,30 +159,6 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - (define-public chez-scheme (package (name "chez-scheme") @@ -218,15 +195,7 @@ (define-public chez-scheme libx11)) (native-inputs (list nanopass ; source only - ;; for docs - stex - xorg-rgb - (texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek)) - ghostscript - netpbm)) + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -249,9 +218,11 @@ (define-public chez-scheme (copy-recursively #$nanopass "nanopass" #:keep-mtime? #t) - (copy-recursively #$stex - "stex" - #: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"))))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -287,32 +258,9 @@ (define-public chez-scheme (symlink scheme.boot (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (let* ((stex-output "/tmp") - (doc-dir (string-append stex-output "/share/doc/stex"))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/stex") - (string-append "Scheme=" - (search-input-file outputs - "/bin/scheme"))) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) ;; Building the documentation requires stex and a running scheme. ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc + (add-after 'install-symlink 'install-doc (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (match (assoc-ref outputs "doc") (#f @@ -320,7 +268,9 @@ (define-public chez-scheme (doc-prefix (let* ((chez+version (strip-store-file-name #$output)) (scheme (search-input-file outputs "/bin/scheme")) - (stexlib "/tmp/lib/stex") + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) (doc-dir (string-append doc-prefix "/share/doc/" chez+version))) @@ -420,7 +370,150 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (license (list asl2.0)))) ;; -;; Packages: +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + #$(chez-machine->threaded + (nix-system->chez-machine))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine "\\."))))) + (else + ;; for bootstrapping, can run without ahead-of-time + ;; compilation + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is referenced in the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (outputs '("out" "doc")) + (properties '()))) + +(define-public nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) + +;; +;; Other Chez packages: ;; ;; Help function for Chez Scheme to add the current path to -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:43 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:43 +0000 Received: from localhost ([127.0.0.1]:54499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkd-0005af-0T for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:43 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:35719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwk8-0005Y5-JQ for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:13 -0500 Received: by mail-qt1-f179.google.com with SMTP id w1so4998946qtj.2 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:12 -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=PK+j54/R03k9wq48VyNtT/gU/3tF/wy2U7nSt7Dij50=; b=BhwJaEfC/xEHxit1Th9I9lGzYcr9iErAHIoxE7nlpJPG2kThfWjLitmyiqjInBQfza FW65LSEnDqADO+7tGyvBViKJd4osCqgFukkBF8Tnk9jX7l8hNr/r/Y/OR/hb1biGqdYO /GFDkfQl/U6VC16C+pGKLnOCAa8V7t09Y7OoqsVHVY1fbQ5AgizQ9NscFnv14rS/qrpW yPQsgSPXQMLTzvvRDYDgOYP1Eggn/OteyA/zU3YN9sekCfFqUnZgFGWMM5X4CGWfhoMl Ix/knOLafCXO76XOGti4ioLL5ZFM3cuh4Q+AIkrWEFU/Puil37I8dOl1GxqEPFuwyEfI tCNA== 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=PK+j54/R03k9wq48VyNtT/gU/3tF/wy2U7nSt7Dij50=; b=Kh1IyQI7wHMwDd1WvvzRxwCH7sMsYWW5fFbypFp/FR/Vjytoq7TAGHPcjS9Kct99ij 3DgO/Keesku8S9PwQ12CZY5L9rT3UfQtMZ84e+a9sG4yFbQVYFJ9ftfLt1wQiSdWYgy0 /ZKY+ZrLSRWosG8PFjK8zGl5qMOk2Q678BtMvMakK+lFUmR6DMaKnM+sWfRPhVM1/pfS XifesMUfjPrPrTyx9QwwD/Xej/YQF6wd1/rmWqco8xK/v00akazMSSOAihTJtKLsJmcK Na8jxV7FhFYvefV67Vex58l8+xXYioQWSK2YFcP5jW2V8Bs/K8ejjCTlE7hDtfG/YKL7 d68Q== X-Gm-Message-State: AOAM532W+5y3qGgEAJducdE2VugIdl+j9BLbnro7S30pwbreuKfKI13x Da2UODGstxtiFFQsXR7Xkb0hUDa9eKPicTD8r+0= X-Google-Smtp-Source: ABdhPJxZu9Qx+BsuA7ykvJp4VdLcZbBNlQa4v2cCCqqvV1BJY44T17fEnslqG1UtXu1qxD0aC6MPEw== X-Received: by 2002:a05:622a:8:b0:2dc:915a:9d20 with SMTP id x8-20020a05622a000800b002dc915a9d20mr10897038qtw.74.1645880646861; Sat, 26 Feb 2022 05:04:06 -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 t128-20020a37aa86000000b0060ddf2dc3ecsm2532874qke.104.2022.02.26.05.04.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:04:06 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 17/22] gnu: Add chez-nanopass. Date: Sat, 26 Feb 2022 08:02:49 -0500 Message-Id: <20220226130254.1301333-18-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-nanopass): New variable. (unpack-nanopass+stex): New variable using 'chez-nanopass-bootstrap'. (chez-scheme-for-racket-bootstrap-bootfiles, chez-scheme)[native-inputs]: Add 'chez-nanopass-bootstrap'. [arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase to use the eponymous new variable. * gnu/packages/racket.scm (racket-vm-cs): Likewise. (make-unpack-nanopass+stex): Remove it. --- gnu/packages/chez.scm | 122 +++++++++++++++++++++++++++++++--------- gnu/packages/racket.scm | 19 +------ 2 files changed, 98 insertions(+), 43 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 99a250154f..ba555e6830 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -48,7 +48,8 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-1) #:export (nix-system->chez-machine chez-machine->nonthreaded - chez-machine->threaded)) + chez-machine->threaded + unpack-nanopass+stex)) (define (chez-machine->nonthreaded machine) "Given a string MACHINE naming a Chez Scheme machine type, returns a string @@ -159,6 +160,20 @@ (define* (chez-upstream-features-for-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-public chez-scheme (package (name "chez-scheme") @@ -176,6 +191,9 @@ (define-public chez-scheme (file-name (git-file-name name version)) (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))) @@ -193,9 +211,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs - (list nanopass ; source only - stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -215,14 +231,7 @@ (define-public chez-scheme #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex (lambda args - (copy-recursively #$nanopass - "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"))))) + #$unpack-nanopass+stex)) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -317,7 +326,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; When updating, remember to also update %racket-version in racket.scm. (source #f) ; avoid problematic cycle with racket.scm (inputs `()) - (native-inputs (list racket-vm-bc)) + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) (build-system copy-build-system) ;; TODO: cross compilation (arguments @@ -336,10 +345,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (chdir "racket/src/ChezScheme"))) (add-after 'chdir 'unpack-nanopass+stex (lambda args - (copy-recursively - #$nanopass - "nanopass" - #:keep-mtime? #t))) + #$unpack-nanopass+stex)) (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) (invoke (search-input-file (or native-inputs inputs) @@ -502,15 +508,79 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) ;; ;; Other Chez packages: diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 3ba1438014..9ed57e6154 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -251,22 +251,6 @@ (define (racket-vm-common-configure-flags) "--disable-strip" "--enable-origtree")) -(define (make-unpack-nanopass+stex) - ;; Adapted from chez-scheme. - ;; TODO: Refactor enough to share this directly. - ;; Thunked to avoid evaliating 'chez-scheme' too early. - #~(begin - (copy-recursively - #$nanopass - "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-public racket-vm-cgc ;; Eventually, it may make sense for some vm packages to not be hidden, ;; but this one is especially likely to remain hidden. @@ -414,6 +398,7 @@ (define-public racket-vm-cs (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") (prepend chez-scheme-for-racket-bootstrap-bootfiles + chez-nanopass-bootstrap racket-vm-bc))) (arguments (substitute-keyword-arguments (package-arguments racket-vm-cgc) @@ -422,7 +407,7 @@ (define-public racket-vm-cs (add-after 'unpack 'unpack-nanopass+stex (lambda args (with-directory-excursion "racket/src/ChezScheme" - #$(make-unpack-nanopass+stex)))) + #$unpack-nanopass+stex))) (add-after 'unpack-nanopass+stex 'unpack-bootfiles (lambda* (#:key native-inputs inputs #:allow-other-keys) (with-directory-excursion "racket/src/ChezScheme" -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:44 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:44 +0000 Received: from localhost ([127.0.0.1]:54501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkd-0005an-J2 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:44 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:34567) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkC-0005ZB-K5 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:17 -0500 Received: by mail-qt1-f170.google.com with SMTP id c4so4997738qtx.1 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:16 -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=oYUHSTg3r8HpZEFMQJCIvUqDi5n3JqyJ7y5RwAPsPqI=; b=a+k2tMM+p6Kdjkypy+MjPaNsSPO4+forCTEaKD4kBDg8t1g9gmHgTd6h7+jjBrzrYP LFlzj2rc4W4d91doPu58V+2iu9FsFUZPWsTvRtsjBDAAzGmJm3b2MAhJ65vCBsn2NLoF Utpqd0ac6pzeJvwqZlMdL2Udlw7AzvPmfs6966KtVTtuOIqn53CMXh2PTQeVKeJK5rlR rzJP5AYdYKEC1jfgjxUxVPwxKy+BQW+vwmfNZGvy9f0EvXiKBWon7NCzbTQojQS6Xylp 8rsFl5bxj06c3nMtLho/2GiEpBmvKawnBEhOnJCQyNnttX7gy9rCUf1tgqjNQqkVEYbu WWFQ== 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=oYUHSTg3r8HpZEFMQJCIvUqDi5n3JqyJ7y5RwAPsPqI=; b=01JqLQMqs0kj9FV/wsvc8mPoRTO2AT5N5tALbR1Z7JZ87p1pEY1HRsM7lZL6p0fJc+ KJZiGuZAUGLoPI2n4IQt7b92uj7OJ+c/L4IQEH4aaOEitlrCwopRYbMnojUEraB06Pmj aL4v6W15tNzWF7eJxq53mXP7qIrEdO3s49fY3AWilgvNX18HXKwmtaJIqg4RxwlGIPhS tTIly0SB8gqoK1/0xJ5wfTmMk8SSgmV2O9vGvPwd5wGLt9zCYRR/EI/+CYFXuymzGsKK SPnjBDGcgOOi/gfFWEKKdpLx1SkTj6bZVMvNtI6xZ+zBZVXAFSrGH1J3tSWRiH5zlzTF Qyqw== X-Gm-Message-State: AOAM533n88pAIXPYakp/pT4+O+ne4IX7WuYM9U2wfevXUVIqPjKlzFHS nID7MziXnK2bDHlM6KW44iXpqbpucXQUWnviNLw= X-Google-Smtp-Source: ABdhPJytAHTFUiQO3jS/1dop+C6B5Kgoh9FNtWH5fuaEmZcVyHzvzPLOqPcTLa+UtKs0OazhvMvr5w== X-Received: by 2002:a05:622a:24c:b0:2d7:1d1b:c98d with SMTP id c12-20020a05622a024c00b002d71d1bc98dmr10421932qtx.592.1645880650986; Sat, 26 Feb 2022 05:04:10 -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 p12-20020a05622a048c00b002de8f67b60dsm3415826qtx.58.2022.02.26.05.04.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:04:10 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 18/22] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Sat, 26 Feb 2022 08:02:50 -0500 Message-Id: <20220226130254.1301333-19-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. (chez-scheme-for-racket-bootstrap-bootfiles): Inherit from 'chez-scheme-bootstrap-bootfiles'. [arguments]: Adapt accordingly. --- gnu/packages/chez.scm | 98 +++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index ba555e6830..4818e59837 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -46,6 +46,7 @@ (define-module (gnu packages chez) #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:export (nix-system->chez-machine chez-machine->nonthreaded chez-machine->threaded @@ -211,7 +212,9 @@ (define-public chez-scheme ;; 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-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -232,6 +235,14 @@ (define-public chez-scheme (add-after 'unpack 'unpack-nanopass+stex (lambda args #$unpack-nanopass+stex)) + (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 (or native-inputs 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`. @@ -316,8 +327,46 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (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 + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %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 upsream +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."))) + (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)`. @@ -325,32 +374,30 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; 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 `()) (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) - (build-system copy-build-system) ;; TODO: cross compilation (arguments - (list - #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")) - #:phases - #~(let ((unpack (assoc-ref %standard-phases 'unpack))) - (modify-phases %standard-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) - (invoke (search-input-file (or native-inputs inputs) - "/opt/racket-vm/bin/racket") - "rktboot/main.rkt"))))))) + (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) + (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)) (home-page "https://github.com/racket/ChezScheme") @@ -372,8 +419,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles 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.") - (license (list asl2.0)))) +Chez Scheme."))) ;; ;; Chez's bootstrap dependencies: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:44 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:44 +0000 Received: from localhost ([127.0.0.1]:54503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwke-0005av-3h for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:44 -0500 Received: from mail-qk1-f171.google.com ([209.85.222.171]:40457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkG-0005ZO-Mx for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:21 -0500 Received: by mail-qk1-f171.google.com with SMTP id c7so6795166qka.7 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:20 -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=BgU2hyGGjB/CJxFAU4QxdKNvS+uNqyA0HU4oahBzgCU=; b=VZrHHMDB6ugT5OIcCx+9CUza/QBEXf2cH9JAbw01jF7fBlcKOs6ebEYhIrPa5Rb7s/ YNsdXM/R507HH/kquBEj8mddC+LN3joHYLwj7/8T3HVK/uP846g2Y8SahgqjBkumV5kW OeB0kH3g/Mf79uXeLmg8xcvvoYYKkgqL4Enkq4nVbEvsWp0iVSmD/fhhx2iS/h96zW4k PsbsZ/gCUyfj3zyi6crlynitGNsZZxxO67ezmWMviFi8bb5GA8hA1kaJjBwfFo8UUYdK qiTdHeukeic0nQpP0HHNPK84S41GcT1gO49a9A7uIIyFIZ5xV3OL3YHlHXcGwmQjsHHt sHbg== 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=BgU2hyGGjB/CJxFAU4QxdKNvS+uNqyA0HU4oahBzgCU=; b=xtd48dFxdEDZ72reUcxHUUhuBpdqeAlU5G5t21hPNkGNGVT6RVlXDpU7yFNuaeR2RY FnR/Zsc+hqfrBpwuP9kED1lT7WWZKtmVxysnHbt5TT4Pxuc2j8t5+e2esazVfvDf9mJV BSDJx0hAN4RJuOuAT5zLjIUnCvb5CnU1cH1Rfeu3oi1P6MQy7cJjtYMQzx3PZCFJA1yL PnHhfBLnQ511dhBmCW7uxZ4ypEgdUknYUkMLJ2/i4z+G/uj7EXFcA6OBvjRUn4Q1i2+3 KeF4loXZFiHicU0w2vck1OVKWTWgx/f691AUm0BQEZrvuxrJtcp2LZf33hEXBhmcXfTn mfJQ== X-Gm-Message-State: AOAM531LL3JJzl7Tld9QqZ6diXYQFaaizDFSXcyqwKwIKDVGwr4LRcIH q/wpb0frcpMM+ZcMULh2vmBBlkExKCGnvLlCa6I= X-Google-Smtp-Source: ABdhPJwY77J1H2bXyuE7FCEGzabuSTczna7F829uuRi06Z8EyGMwGtdp5FU+RRpCw0xLiNt2a6bdQw== X-Received: by 2002:a37:e312:0:b0:5e9:57ac:76f5 with SMTP id y18-20020a37e312000000b005e957ac76f5mr7095965qki.204.1645880655223; Sat, 26 Feb 2022 05:04:15 -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 x12-20020ac85f0c000000b002de8931d4d6sm3328260qta.77.2022.02.26.05.04.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:04:14 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 19/22] gnu: chez-mit: Support chez-scheme-for-racket. Date: Sat, 26 Feb 2022 08:02:51 -0500 Message-Id: <20220226130254.1301333-20-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 4818e59837..f258732baf 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -949,7 +949,29 @@ (define-public chez-mit (commit (string-append "v" version)))) (sha256 (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (snippet + ;; Workaround for chez-scheme-for-racket. + ;; See: https://github.com/racket/racket/issues/4151 + #~(begin + (use-modules (guix build utils)) + (substitute* "mit/core.sls" + (("[(]import ") + "(import (only (chezscheme) import)\n") + (("[(]define string->uninterned-symbol gensym[)]") + (format #f "~s" + '(begin + (import (only (chezscheme) + meta-cond + library-exports)) + (meta-cond + ((memq 'string->uninterned-symbol + (library-exports '(chezscheme))) + (import (only (chezscheme) + string->uninterned-symbol))) + (else + (define string->uninterned-symbol + gensym))))))))))) (build-system gnu-build-system) (inputs (list chez-srfi)) ; for tests -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:45 2022 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 To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 20/22] gnu: Add chez-scheme-for-racket. 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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:48 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:48 +0000 Received: from localhost ([127.0.0.1]:54507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwke-0005bA-VJ for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:48 -0500 Received: from mail-qv1-f46.google.com ([209.85.219.46]:39767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkO-0005Zl-RM for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:29 -0500 Received: by mail-qv1-f46.google.com with SMTP id a1so8844619qvl.6 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:28 -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=/83ED+dFe8Q625+tAL6Gg/EtduG34MLZfJ5u1q+LKK8=; b=YnWg4NZhyhVr4b1bzcwjoyApq+DMj05oMGCgbaU7SoHSvuFscetPTxUFCmAAlHJBF4 o8/NoaSqWmS6t4lIFcD60YVEE2zgK693ujoYppPWYE8R2Szvdu3fTugFSlBY+7XjMc1u NXe+/K5t6B2B88gtz+KyZvuGdp4rNIwZGKf9/X5/7p09H3nnscDVKB9B9Rx6IXNLvdq0 vK1v9smm61d57lTq6vPLnO92//a7E1QoVdDS0ynr06i7CO5zMeOo4Lh1waTu6OtCnaNx gNYrs2wB2wJlcnmG+Td4tQIccbQUuhALseQZAgu99qIVj4+wZ5NfzUnW83Fg/m+mi6Cw o8Qw== 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=/83ED+dFe8Q625+tAL6Gg/EtduG34MLZfJ5u1q+LKK8=; b=q+JM4BsEjj1/LmcIiILuP8ES+1LUl+8DbEygPemYiDwDnKdVvJvkiJHPNji8yguwgw yybf618zxobJ1FcHXr+bam8YUGdNYeoQU+OMZXdAvn39IQr4ayCck+dw3docTa5c2M8g Ov9mXrspk3N5697ev3i8VrO7NzQpUPxJup4WGpHwYohPfFGHrGkoDkNXAvZxb0K9OkKm KHK6+1T71qHgy/KsCgjECfm8tkMF1HUoTvB0YHGMvgloNav1wUtbMQBtdJHjLt6jv4Sr CQ+9wkL1rVUQUHH4erOuYH1XGkGTc8z7hBf3wleEnY9mrvxNTz8AeHXpt2OxVy+dVyEA 44Dw== X-Gm-Message-State: AOAM531QKVhpsWQmNKNH64vrmbQV+myHGsoRWdxZ0ItgKc8K/dh4pIDp COyzVFHghrZg/1Fyd6soFlhc8GTGZocGFug5CVI= X-Google-Smtp-Source: ABdhPJymvH5qLpCDiqT2J6NExqixQ6XP209YHYN1LxYyUwlfk1m7V2eJstjs18TVt98lQ4gDTbDU7g== X-Received: by 2002:a0c:ec8a:0:b0:432:a04f:d225 with SMTP id u10-20020a0cec8a000000b00432a04fd225mr8276962qvo.83.1645880663447; Sat, 26 Feb 2022 05:04:23 -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 y16-20020a05622a121000b002deaa0af9e2sm3322929qtx.49.2022.02.26.05.04.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:04:23 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 21/22] gnu: chez: Add 'chez-scheme-for-system'. Date: Sat, 26 Feb 2022 08:02:53 -0500 Message-Id: <20220226130254.1301333-22-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) * gnu/packages/chez.scm (chez-scheme-for-system): New procedure. (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Use 'chez-scheme-for-system'. * gnu/packages/loko.scm (loko-scheme): Likewise. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise --- gnu/packages/chez.scm | 33 ++++++++++++++++++++++++--------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index a6b5952819..c7505a14bd 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -47,7 +47,8 @@ (define-module (gnu packages chez) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:export (nix-system->chez-machine + #:export (chez-scheme-for-system + nix-system->chez-machine chez-machine->nonthreaded chez-machine->threaded unpack-nanopass+stex)) @@ -67,6 +68,20 @@ (define-module (gnu packages chez) ;; ;; Code: +(define* (chez-scheme-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, +including support for native threads." + (if (or + ;; full support upstream + (and=> (chez-upstream-features-for-system system) + (cut memq 'threads <>)) + ;; no support anywhere + (not (nix-system->chez-machine system))) + chez-scheme + chez-scheme-for-racket)) + (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 @@ -751,7 +766,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -782,7 +797,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) ghostscript ;; FIXME: This package fails to build with the error: ;; mktexpk: don't know how to create bitmap font for bchr8r @@ -847,7 +862,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) chez-web (texlive-updmap.cfg (list texlive-pdftex)))) (arguments @@ -933,7 +948,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -965,7 +980,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -996,7 +1011,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -1059,7 +1074,7 @@ (define string->uninterned-symbol (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -1090,7 +1105,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index ef98088100..df53df61c7 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -451,7 +451,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index ef9312afe3..449c62f1f0 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -71,7 +71,7 @@ (define-public loko-scheme #t))))) (native-inputs `(("akku" ,akku) - ("chez-scheme" ,chez-scheme) + ("chez-scheme" ,(chez-scheme-for-system)) ("struct" ,guile-struct-pack) ("laesare" ,guile-laesare) ("pfds" ,guile-pfds) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:04:57 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:58 +0000 Received: from localhost ([127.0.0.1]:54509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwki-0005bN-TE for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:57 -0500 Received: from mail-qk1-f178.google.com ([209.85.222.178]:44007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkT-0005Zw-1R for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:33 -0500 Received: by mail-qk1-f178.google.com with SMTP id z66so6783471qke.10 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:33 -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=N+2gyL8pmfuxcTmxtpruPrY5oDy7Z0DNw/HklWOdTFY=; b=AFJwB+ADT8obLcGXQGuFTFynU/duYU1bSKc8KBIpnLy+05guD91GwyC0rmmp2i1ab3 EzBgaddkPYersJmCcu/Els0wMkanVKLvqUVBZq/w1qINuNHT7nWjI6x1M7sv2uN2VZH7 7Kb4D3KQT9ZVmEuqlaUZTeVirIjaZK9ojn3Bfk/xpREbyxPnehK3VZTJZfxH5+GHNmJK wZYmxs9k+/CW/v/B+9EvGkM4pqrqhCJBSEDldWFNnibZHpvzw9naUm8mnwjm+wfZhi2A X7Kwc7zgcp8ESmOLzBb1F/9JHB1Cp4/YLMThWvt5TNNR4hDDlFLgOve4Vs0c+3U3MPvd 7F7w== 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=N+2gyL8pmfuxcTmxtpruPrY5oDy7Z0DNw/HklWOdTFY=; b=2VLxDFP++9DFdYZkEnxA+aMxzaOslnmRx2jS8U7+ZgSe4llARbaQ0w/G5a0UDrabhx x/F5MK4GElVv6bsY9flPSEneoUIkPd9nWu/RMCfhV+iaEZ6rIbA4HCl5SMM/1X5/sHwN y3+qiWCB2YecWarkcdSVx+Pe11Cgw5U3GQxWkdkgLP9EboJJcqIRIWFdaeSl1860KpzY JSUkU9ml/QS3dajlt22kjl4h71hwOaGdyonjr+aZdrIib2PKSypDWkWjGV7DqZKcC8Ll /tGW4YCCoRczj/XL4r8lZG8oIartUuCLx3XQsyo5119fHrbRTba8a/5ychVbKut8nJ4X RWJQ== X-Gm-Message-State: AOAM532mY3II/Z4lQV5MnTbF2q/rVlMMcX4UHP/3gJyd+5BSzyz6RCWg qu2JECEEtiJCwZ0hSqmvbtlFdeQWxpE86sGlfaA= X-Google-Smtp-Source: ABdhPJzBtrLghowVJLDw6gNxI3AMaP+4iK2uLvJJyqfY3T1+2yjGRF9WMIwYHxyvPAuGdnm0AXEESw== X-Received: by 2002:ae9:edc6:0:b0:60c:8807:712f with SMTP id c189-20020ae9edc6000000b0060c8807712fmr7373062qkg.14.1645880667582; Sat, 26 Feb 2022 05:04:27 -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 s10-20020a05620a080a00b0062ce6f3f5d7sm2487655qks.16.2022.02.26.05.04.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:04:27 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v5 22/22] gnu: racket-vm-cs: Build with "--enable-scheme". Date: Sat, 26 Feb 2022 08:02:54 -0500 Message-Id: <20220226130254.1301333-23-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 X-Debbugs-CC: philip@philipmcgrath.com Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-vm-cs)[native-inputs]: Remove 'chez-scheme-for-racket-bootstrap-bootfiles'. Add 'chez-scheme-for-racket'. [arguments]<#:phases>: Delete 'unpack-bootfiles'. <#:configure-flags>: Add "--enable-scheme". --- gnu/packages/racket.scm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 3f73d6bc83..f70b027160 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -396,7 +396,7 @@ (define-public racket-vm-cs (native-inputs (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") - (prepend chez-scheme-for-racket-bootstrap-bootfiles + (prepend chez-scheme-for-racket chez-nanopass-bootstrap racket-vm-bc))) (arguments @@ -406,18 +406,15 @@ (define-public racket-vm-cs (add-after 'unpack 'unpack-nanopass+stex (lambda args (with-directory-excursion "racket/src/ChezScheme" - #$unpack-nanopass+stex))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (search-input-directory (or native-inputs inputs) - "lib/chez-scheme-bootfiles") - "boot")))))) + #$unpack-nanopass+stex))))) ((#:configure-flags _ '()) #~(cons* "--enable-csonly" "--enable-libz" "--enable-lz4" + (string-append "--enable-scheme=" + #$(this-package-native-input + "chez-scheme-for-racket") + "/bin/scheme") #$(racket-vm-common-configure-flags))))) (synopsis "Racket CS implementation") (description "The Racket CS implementation, which uses ``Chez Scheme'' as -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:36:55 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:36:56 +0000 Received: from localhost ([127.0.0.1]:54536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxFn-0006St-M7 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:36:55 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:44062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxFk-0006Sj-JE for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:36:53 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5SNd0nyzz3xcN; Sat, 26 Feb 2022 14:36:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645882609; bh=13TZhBV4dsVZpwQp1IQjlEY8LrIsQL4jtGK7wF8npLk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=A8CHff1eGygyxOnJQLN4iaym1/4Si0tuNIIg1dBpnW40BF9xA1e0QscSMHVdth71t pwM54IXdDl+SO4hXAxUYLKXYD9iR4vQjwy1bzIECCvJRtLDE//oV+qDfXzltaoN3td XeronG27G3jOifDDJVKkJJB5Ydvobb+AZM50oAs8= Message-ID: Subject: Re: [PATCH v5 02/22] gnu: racket: Update to 8.4. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 14:36:48 +0100 In-Reply-To: <20220226130254.1301333-3-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <20220226130254.1301333-3-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > * gnu/packages/patches/racket-enable-scheme-backport.patch, > gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New > patches. > * gnu/local.mk (dist_patch_DATA): Add them. > * gnu/packages/racket.scm (%racket-version): New variable. > (%racket-commit): New variable. > (%racket-origin): New variable. > [patches]: Add "racket-enable-scheme-backport.patch". > (racket-minimal): Update to 8.4. > [version]: Use '%racket-version'. > [source]: Use '%racket-origin'. > [inputs]: Add 'ncurses'. Remove 'zlib:static' and 'lz4:static'. > (racket-minimal-bc-3m)[inputs]: Adjust accordingly. > (racket-bootstrap-chez-bootfiles)[version]: Use Chez Scheme's > '(scheme-fork-version-number)'. > (racket)[version]: Use '%racket-version'. > [native-inputs]: Use '%racket-origin'. > [source]: Update to 8.4. > : Use "racket-gui-tethered-launcher-backport.patch". > : Remove "srfi-doc-nonfree". To be fair, I'm a little confused with the change in [native-inputs], but that is a minor commit message thing that I can fix up. Other than that looks pretty good to me. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:47:54 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:47:54 +0000 Received: from localhost ([127.0.0.1]:54548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxQP-0006nA-KJ for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:47:53 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:53903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxQN-0006mh-48 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:47:52 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5SdG5sD4z3xcY; Sat, 26 Feb 2022 14:47:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645883267; bh=acNOJwCfD+uXnFjNrzfl32j/Z0z2W60d6rBCJRa+3c0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Av6EA8T8GloIX0hrMWpJdl7J8tfTm1Crc8Ymg1POXLwjyK/488hbs4/pGqqUeYWNZ AVv4PCQJj90YzcT8NU6DcAotqJvGHBOFKbKli7fXdNme/FNPGwilVSBz1D09/7WYil FzSTzOOHfh5/plthT+Vb1F9ZrFFw50Fr9xwgBW70= Message-ID: <649ff53c6b4ff05db5bad3c75abd9d49752930d1.camel@ist.tugraz.at> Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 14:47:45 +0100 In-Reply-To: <20220226130254.1301333-4-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <20220226130254.1301333-4-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: > Adjust path. > * gnu/packages/racket.scm (extract-package-source, > extract-package-source*): New procedures. > (extend-layer): Rename to ... > (make-installation-layer.rkt): ... this variable. Tweak command-line > arguments. Adapt to 'config-tethered-apps-dir'. > (racket): Stop inheriting from 'racket-minimal'. > [version]: Use '%racket-version'. > [source]: Stop using bundled tarball. > [inputs]: Remove labels. Add 'racket-minimal' and package sources. > [native-inputs]: Remove, since cross-compilation doesn't work yet. > [arguments]: Rewrite to use G-expressions, package sources from > 'inputs', an explicit 'install' phase, and the revised > 'make-installation-layer.rkt'. Since you haven't made this a union-build yet, I will from now on assume that it is indeed more complicated than one to save us some time debating whether it should or shouldn't be. Given that this was my main complaint w.r.t. the stuff following make-installation-layer, much is now resolved, except for two things. First, can we simplify "make-installation-layer.rkt" to "make- installation-layer"? I don't think the file extension conveys much meaning here, or does it? Second, can we find an abbreviation for > +      (extract-package-source* > +       `((,(origin > +             (method git-fetch) > +             (uri (git-reference > +                   (url "https://github.com/racket/2d") > +                   (commit %racket-commit))) > +             (sha256 (base32 > +                      > "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) > +             (file-name > +              (git-file-name "racket-2d" %racket-version))) > +          "2d" "2d-doc" "2d-lib") > +         (,(origin > +             (method git-fetch) > +             (uri (git-reference > +                   (url "https://github.com/racket/algol60") > +                   (commit %racket-commit))) > +             (sha256 (base32 > +                      > "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx")) > +             (file-name > +              (git-file-name "racket-algol60" %racket-version))) > +          ("algol60" ".")) > +         (,%racket-origin > +          ("base" "pkgs/base") ;; FIXME belongs in racket-minimal > +          ("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in > racket-minimal > +          ("at-exp-lib" "pkgs/at-exp-lib") > +          ("compiler" "pkgs/compiler") > +          ("compiler-lib" "pkgs/compiler-lib") > +          ("net" "pkgs/net") > +          ("net-doc" "pkgs/net-doc") > +          ("net-lib" "pkgs/net-lib") > +          ("racket-doc" "pkgs/racket-doc") > +          ("racket-index" "pkgs/racket-index") > +          ("sandbox-lib" "pkgs/sandbox-lib") > +          ("zo-lib" "pkgs/zo-lib")) > +         (,(origin > +             (method git-fetch) > +             (uri (git-reference > +                   (url "https://github.com/racket/cext-lib") > +                   (commit %racket-commit))) > +             (sha256 (base32 > +                      > "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341")) > +             (file-name (git-file-name "racket-cext-lib" %racket- > version))) > +          "cext-lib" "dynext-lib") > [...] I think some way to shorten those origins would do wonders in terms of the number of lines this patch adds. Other than that, looks pretty good to me. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 09:14:25 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 14:14:25 +0000 Received: from localhost ([127.0.0.1]:54573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxq5-0007W7-C0 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 09:14:25 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:34936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxq3-0007Vx-T9 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 09:14:24 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5TCp6R1Zz3xNK; Sat, 26 Feb 2022 15:14:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645884855; bh=9RhbNu50KXNFmMlo8W0C84oDmg7N3PVhWvupEKqP9ts=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=jw9iFOXRHHMWqsGGcx7SwXuCjKB0ukjwvri+JQm9cXbn31cg7G7E5towGiRMnpIEY 9MXfc1Wh2SRGGS+UySxhwrDz7FGRxbG7OPDfuBf6iwvJIatvoXMCnNexT2el/Qmd9n CMv0bB8mfX674hhzqF4vglDGK/+Mq/FdDqekeiDQ= Message-ID: Subject: Re: [PATCH v5 04/22] gnu: racket-minimal: Use new package style. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 15:14:13 +0100 In-Reply-To: <20220226130254.1301333-5-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <20220226130254.1301333-5-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > +(define (make-unpack-nanopass+stex) > +  ;; Adapted from chez-scheme. > +  ;; TODO: Refactor enough to share this directly. > +  ;; Thunked to avoid evaliating 'chez-scheme' too early. evaluating. Also, I think the thunked part should go above the TODO, WDYT? Other than that LGTM From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 09:19:33 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 14:19:33 +0000 Received: from localhost ([127.0.0.1]:54584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxv2-0007f7-U1 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 09:19:33 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:8828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxv0-0007ex-Op for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 09:19:31 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5TKj4ZwDz1LZWS; Sat, 26 Feb 2022 15:19:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4K5TKj4ZwDz1LZWS DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645885162; bh=NHcUGKO+0uj5KsQTODrNDkAF7ya9QKtKcLfWm6eFouc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=FJX43xU9U1dh4EqpaEW3lrJSupbIaJyHcSMWmgMKdgpAHI1suf6S7qodp1efX1rzC XfzC4nlHM/s45jMswJK+gJgiD2/Iu5BObHQ8N5SNpzhkReCeIsE4v7UrcoAFoKeiK+ wv1FIhzywSe8r7OWJtjP6d5NHCHLjMzWfx8k8g7E= Message-ID: Subject: Re: [PATCH v5 06/22] gnu: racket-minimal: Change inheritance to follow bootstrapping. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 15:19:20 +0100 In-Reply-To: <20220226130254.1301333-7-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <20220226130254.1301333-7-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > Having the package inheritance chain go in the same direction as the > bootstrapping chain, rather than the opposite, is less confusing. In > some cases, it can also help to avoid unnecessary rebuilds. > > * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the > root > of the package inheritance chain. > [version, source, inputs, native-inputs, build-system, arguments, > home-page, license]: Inline formerly inherited values. > (racket-minimal-bc-3m): Inherit from 'racket-minimal-bc-cgc' rather > than > 'racket-minimal'. > [inputs, native-inputs, arguments, license]: Adjust accordingly. > (racket-minimal): Inherit from 'racket-minimal-bc-3m'. > [inputs, native-inputs, arguments, license]: Adjust accordingly. > [properties]: Override effect of 'hidden-package'. > --- I think this patch might introduce some noise by moving a package to a different location in the file. If possible, we might want to avoid this and relocate afterwards – IIUC positioning within a file should not matter when it comes to the inherit clause. Other than that not much to argue against. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 09:21:12 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 14:21:12 +0000 Received: from localhost ([127.0.0.1]:54594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxwd-0007is-K7 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 09:21:11 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:38229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxwc-0007if-Gi for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 09:21:10 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 6E6A3580106; Sat, 26 Feb 2022 09:21:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 26 Feb 2022 09:21:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=5kGYCkDP/J7v3T v+TCzO7D2vEo8+BQn0EPlVBAqqu+I=; b=hSbDwExq+6kKJvkJ/zAMEqlKaTN6Ex ST7n8mAaKomZ+ZpCJ0LaqfnTZE2JOmeyQfeCkNSXB9YsAY0Or24i7ycO+p8uKyAL zQ07MmXhpOUjhojJSMQpJ1YgfaOivEPKzKJJEJS7hjvOeABtlrmUjwrZsxboH+Yc R2sAjQjlWQripWBvWObHwlH7WM0KT3LqNG4iJhAFIxxb6GWm/BmuE/QNQO0sIHy3 20ioIlf+diOriwUoSaEMT4+GXvSmBxMiln4s83/zs8hmNy4BGHGXzcJFWVOrpNfL yKKvwBLt/bT2OXCMSbM5hFK8rMAZ22zJsfDjdGp1YoaSRhezTvLCFn6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=5kGYCkDP/J7v3Tv+T CzO7D2vEo8+BQn0EPlVBAqqu+I=; b=Aqr+535+sAQ1Qk1szb5V2XIuZMuHvNVBj FIIO4tdI+7VUMKBaX04mQVMhTZormCM5Udb7zD+orjf3g2bJhJSocXpqS3wvY3yl 7G9hahtCe7FltLrYr2cKA0F+NyKDwg5Ui/oFFolKGLgFZ48WXmplnyJXGprl6V6q JprRGVgCDvMIAUhpTs3wuEB6r/8aTIwuBLLkU3AVF5wxcN/ZKz0KTg+Hx9Y66+NF /sJyAh3/thwxXYbmKdXZZQE2GmfV34B8lwHbyieGqgyormVa1aNpatLWBbIvLYJA XFkNcthqmjGt7/8Tpfz10Ig2yJcIB01vmSfJmM0chZfHLFx2iCWRQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleeigdeiudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttddvnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhepledtfeevvdevjeegleeltddtteeiveffkeetfedtieehuedt jeduudevhfejkeefnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhl ihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Feb 2022 09:21:04 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. Date: Sat, 26 Feb 2022 09:20:58 -0500 Message-ID: <3354324.gHnXMxdNb5@bastet> In-Reply-To: <649ff53c6b4ff05db5bad3c75abd9d49752930d1.camel@ist.tugraz.at> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-4-philip@philipmcgrath.com> <649ff53c6b4ff05db5bad3c75abd9d49752930d1.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3954881.TWLLKBRVyn"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart3954881.TWLLKBRVyn Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , raingloom , Maxime Devos Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. Date: Sat, 26 Feb 2022 09:20:58 -0500 Message-ID: <3354324.gHnXMxdNb5@bastet> In-Reply-To: <649ff53c6b4ff05db5bad3c75abd9d49752930d1.camel@ist.tugraz.at> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-4-philip@philipmcgrath.com> <649ff53c6b4ff05db5bad3c75abd9d49752930d1.camel@ist.tugraz.at> Hi, On Saturday, February 26, 2022 8:47:45 AM EST Liliana Marie Prikler wrote: > First, can we simplify "make-installation-layer.rkt" to "make- > installation-layer"? I don't think the file extension conveys much > meaning here, or does it? To me (I don't know about anyone else), the ".rtk" extension tells me that I have to pass the file as an argument to `racket`, i.e. that the file is not a launcher from `raco exe` or a script with a shebang that I could `invoke` directly. > > Second, can we find an abbreviation for > > > + (extract-package-source* > > + `((,(origin > > + (method git-fetch) > > + (uri (git-reference > > + (url "https://github.com/racket/2d") > > + (commit %racket-commit))) > > + (sha256 (base32 > > + > > "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) > > + (file-name > > + (git-file-name "racket-2d" %racket-version))) > > + "2d" "2d-doc" "2d-lib") > > + (,(origin > > + (method git-fetch) > > + (uri (git-reference > > + (url "https://github.com/racket/algol60") > > + (commit %racket-commit))) > > + (sha256 (base32 > > + > > "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx")) > > + (file-name > > + (git-file-name "racket-algol60" %racket-version))) > > + ("algol60" ".")) > > + (,%racket-origin > > + ("base" "pkgs/base") ;; FIXME belongs in racket-minimal > > + ("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in > > racket-minimal > > + ("at-exp-lib" "pkgs/at-exp-lib") > > + ("compiler" "pkgs/compiler") > > + ("compiler-lib" "pkgs/compiler-lib") > > + ("net" "pkgs/net") > > + ("net-doc" "pkgs/net-doc") > > + ("net-lib" "pkgs/net-lib") > > + ("racket-doc" "pkgs/racket-doc") > > + ("racket-index" "pkgs/racket-index") > > + ("sandbox-lib" "pkgs/sandbox-lib") > > + ("zo-lib" "pkgs/zo-lib")) > > + (,(origin > > + (method git-fetch) > > + (uri (git-reference > > + (url "https://github.com/racket/cext-lib") > > + (commit %racket-commit))) > > + (sha256 (base32 > > + > > "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341")) > > + (file-name (git-file-name "racket-cext-lib" %racket- > > version))) > > + "cext-lib" "dynext-lib") > > [...] > > I think some way to shorten those origins would do wonders in terms of > the number of lines this patch adds. > At one point, I had abbreviated the origins as something like: (REPO-SPEC SHA256 [COMMIT]) where REPO-SPEC is one of: (GITHUB-OWNER GITHUB-REPO) ; ^ e.g. for https://github.com/RenaissanceBug/racket-cookies GITHUB-REPO ; "racket" is owner and COMMIT defaults to `%racket-commit`, but could be overridden for . I think I'd given SHA256 as a literal string, but it could be e.g.: (extract-package-source* `((("2d" ,(base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) "2d" "2d-doc" "2d-lib") ...)) if that seems better. I wasn't sure about the trade-off between being slightly more cryptic than explicit origins, but a lot shorter. -Philip --nextPart3954881.TWLLKBRVyn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIaN0oACgkQygNjjfo/ HHpqRQ//Wldp19n9403fhtxqZmr6gwrkYHpj6QLunVETjn26U5ueu3kQxjSs0zMQ JOpdTngsYKAPUD7jU70GtAFLCjU7RiIr1W/u5Xbg1UUtKuQVl6LggMAHSOI6CjSj mreFP9jYW2/6p8Y9uN869WL8CdrY5721N+hD9YbAv5Tu9c0uQa9fjJed/lAASyT9 Hq14VERc4nt2uUIwdez5y7nx/20jUJn1yotmjUY1VqIYxfcIvATn0CVqXk//9C39 qUsJm3cb68t/6V46s/HG1O+0WEd43kWwTInJ2w1oZ2YKW3u7MreVz2dDBgsrRtc8 orTOqvM4ILefTakrMBZ1Za77lc/YoMxfBTIn4yGmBMSpna9ezL8IO89iru/ajh3s o2DBy/rej9KeLUN5ZtfUVA+L8T4j7Z9h/MQhvD78wu4FtuIxrNcKRzcmAmrzcUJ+ exS4R4NcNhiBIIZ7ZT0abZoWH7tZgtdP2ngI590KvOhGXQruc463KRWkCEMHVV3Z 7YxhWXNYAZb/r5msh2CK2piwFBYUplbZB7U/y43AS1MpAlOmoDWG/eF9KIwr60jt 1iytuqf9kQTewyMrQHCZAP10/0mixm8mXjs1W8A7+wCSypsJ5kPkSmWcTuHvmoVt gOqR4/mUm/14+VdHV1fW2z3jQLqD7YB7GgnwdqiQlVbAu6kSjNg= =6tsx -----END PGP SIGNATURE----- --nextPart3954881.TWLLKBRVyn-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 09:22:40 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 14:22:40 +0000 Received: from localhost ([127.0.0.1]:54600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxy4-0007lF-2G for submit@debbugs.gnu.org; Sat, 26 Feb 2022 09:22:40 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:42881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxy1-0007l3-Ta for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 09:22:38 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id CC6E0580125; Sat, 26 Feb 2022 09:22:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 26 Feb 2022 09:22:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=CylhKzzoUN7ram ZxqwFT9Zt00svfnaSqNww7FiPsOYQ=; b=DkptdIhDI/AW+gXJMzOFDM9xNqEWpM Z0OKTRv/pYPPOjLlzFKZLWo+bpX+fQzmQTn+ZMn3hTGSeXs1gqFqxymHywdmUV1a G9jpO8MhCD5lLb1qP2aBA/kw7KwsztOKIPxINbPLPOWdvULsK9Nel85garIoRUxI wjpLDlf/493U4AR82DG7BkfA9/0jcwsroJuyv2ie9QOiJlyLiXMPlipBS3lO4lXq c2+UaLMAzozTSESG+TR3URDgIHQKy7wfUoRO//nfHhGm8NkgU9EUuRdrKWEoY9N1 n6xw5BlQlJXM3Nt3Wj8cJKcOU5stGuaYua0qnTvjJ8CFQIeLFYs9fLuA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=CylhKzzoUN7ramZxq wFT9Zt00svfnaSqNww7FiPsOYQ=; b=X42Px0vweYp5hInx8z8ljumS5yncWoMEE 8XIc2UScpPuFEVoKrjuJt9C0ao5WF3mpOWpFnGMpYBqdV99rtEtgsULXOQCcG2eA xhTU5EIEbnmMobcZKnXtBt37bxEU0eRbPfzOSB8bj4fi3bte7QFMQZ4einbwDIQ3 s3hwQZUgz/sbSbRuNUI64DuxvoBwyd4tkSkb4Hs9m+fT/cHefhOsJi+QfTl1Fhvf MJEjE+WYGW7adWELftPSeGpGgsOYtQry8dTD8U7bRbfO2NaqzqCvR6T4h9GvtnrV 7Kx5QltAI6/yPnSHk2NiUiV93sfyjGr3+YxZGRDM/DScVMOlVvikw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleeigdeiudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttddvnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhepieeifeehueetuddtgffftdehheettdduveettdfgleduleel kefgudetjeekgffgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Feb 2022 09:22:31 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Subject: Re: [PATCH v5 04/22] gnu: racket-minimal: Use new package style. Date: Sat, 26 Feb 2022 09:22:30 -0500 Message-ID: <17004963.eTSM7FXciR@bastet> In-Reply-To: References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-5-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart11489651.3CUFtPdRgZ"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart11489651.3CUFtPdRgZ Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , raingloom , Maxime Devos Subject: Re: [PATCH v5 04/22] gnu: racket-minimal: Use new package style. Date: Sat, 26 Feb 2022 09:22:30 -0500 Message-ID: <17004963.eTSM7FXciR@bastet> In-Reply-To: References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-5-philip@philipmcgrath.com> Hi, On Saturday, February 26, 2022 9:14:13 AM EST Liliana Marie Prikler wrote: > Hi, > > Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > > +(define (make-unpack-nanopass+stex) > > + ;; Adapted from chez-scheme. > > + ;; TODO: Refactor enough to share this directly. > > + ;; Thunked to avoid evaliating 'chez-scheme' too early. > > evaluating. Yes, thanks. > Also, I think the thunked part should go above the TODO, WDYT? > I don't mind either way. This is removed in v5 17/22, anyway. -Philip --nextPart11489651.3CUFtPdRgZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIaN6YACgkQygNjjfo/ HHr29g/+PzaNiaW3Msu7pine7gDsbcD56XDctVXkcI7H7GCA+B+acJ6LKYLa4NWo Q35yyjXdeQeJ4EewD2NisvD1wd5KknhQakvkaI0NE1XtHppdcCmne/8HcSrPWLaJ vSbNC9MK5z7oyrGYLVsufdua8QdoR2THc0DNRE8X2EStt1HiTnluezodTzpmHbv6 AP97VAveLM4eeLqMEOlkIfz5Z3j8ssen0EpLrCLf/ohVTLJDSXyz9wz3oJC9dNkm 46zLcfyQFWSi16jQQ/EYZDss9a+XPvjvMqEn02cLrTqJ9gPiSeEo093ZHr9/kbaC eYCP7MqGWAQBlSi4qE/pUGDSZ7ETb6XbtsGKuMIt1l9pItddHtRDK4RycVheHLm+ 2atrUuRtaUs2LxNIv0Vg+6gDGRFOx175GiefBXlU14XhSSmd6xzh+eaLY8s+nziz iDSZ4Gvg2YgHziMuHi/v0GB6fZBhE4Kzc5zHgLrZAwSDcK/PJzIXWNOdr6WTxrpF 2qNnGztoFF5si4R0PTsY6u7R8c1IreIyI30XJ7EKBOvwoW2Q5lUjVQ2PULDQu/YT z4X1JKs9oj4VM/KGu8Voz55sOEqlyCMh4lRcNtXRqTKzHA2f5D9v3i80quQuBOYl ttsuXNe6iY8unP/UhZEYKOww6aWfnn6xrB5+ksg9Txj0mE/4cwE= =IPig -----END PGP SIGNATURE----- --nextPart11489651.3CUFtPdRgZ-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 09:26:45 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 14:26:45 +0000 Received: from localhost ([127.0.0.1]:54605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNy21-0007rr-KO for submit@debbugs.gnu.org; Sat, 26 Feb 2022 09:26:45 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:3490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNy1z-0007ri-Md for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 09:26:44 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5TTy1j3Mz1DH9C; Sat, 26 Feb 2022 15:26:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4K5TTy1j3Mz1DH9C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645885590; bh=jIJ0eHhZCnqJftVQLJ6lJOoczQF7ciGwt0McrEFKEx4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=JDegogZLnQGDhFOKUIxInCxy9+6/cqjvPpD/Yu7w8ms4t70wcvHgQZ/LhTas/hjUU esmVkNaAj9mhsHLGZ9sZzd80OJunfe4F5TPl1IKhqzPz44lmbW3M5IhDuZx/Fifdqq rA1q3Dhn/dD/oq5tI6Y6SCqYFx2d8aTkTVOE8a2I= Message-ID: <0c9963cedab248085b106effdd68649647a41ca2.camel@ist.tugraz.at> Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 15:26:29 +0100 In-Reply-To: <3354324.gHnXMxdNb5@bastet> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-4-philip@philipmcgrath.com> <649ff53c6b4ff05db5bad3c75abd9d49752930d1.camel@ist.tugraz.at> <3354324.gHnXMxdNb5@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi,  Am Samstag, dem 26.02.2022 um 09:20 -0500 schrieb Philip McGrath: > Hi, > > On Saturday, February 26, 2022 8:47:45 AM EST Liliana Marie Prikler > wrote: > > First, can we simplify "make-installation-layer.rkt" to "make- > > installation-layer"?  I don't think the file extension conveys much > > meaning here, or does it? > > To me (I don't know about anyone else), the ".rtk" extension tells me > that I have to pass the file as an argument to `racket`, i.e. that > the file is not a launcher from `raco exe` or a script with a shebang > that I could `invoke` directly. I'm not talking about the generated file, but the procedure that generates it. Special characters like dots and slash are still pretty special in Scheme, even if they're allowed as identifiers. > > I think some way to shorten those origins would do wonders in terms > > of the number of lines this patch adds. > > > > At one point, I had abbreviated the origins as something like: > >   (REPO-SPEC SHA256 [COMMIT]) > > where REPO-SPEC is one of: > >   (GITHUB-OWNER GITHUB-REPO) >   ; ^ e.g. for https://github.com/RenaissanceBug/racket-cookies >   GITHUB-REPO ; "racket" is owner > > and COMMIT defaults to `%racket-commit`, but could be overridden for > . > > I think I'd given SHA256 as a literal string, but it could be e.g.: > >   (extract-package-source* >     `((("2d" ,(base32 > "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr")) >        "2d" "2d-doc" "2d-lib") >       ...)) I wouldn't do this inside of extract-package-source, but define a one or two liner for adding specifically packages hosted on racket's github. WDYT? > I wasn't sure about the trade-off between being slightly more cryptic > than explicit origins, but a lot shorter. Note that the goal is not to code golf, but to be understandable. When adding a bunch of origins as inputs, understandability suffers by induced scrolling. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 09:31:38 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 14:31:38 +0000 Received: from localhost ([127.0.0.1]:54614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNy6k-00080i-Cb for submit@debbugs.gnu.org; Sat, 26 Feb 2022 09:31:38 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:17114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNy6i-00080b-Vx for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 09:31:37 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5Tbp5xwcz1DH9C; Sat, 26 Feb 2022 15:31:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4K5Tbp5xwcz1DH9C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645885895; bh=yNl4FXxEKf+oc/SEvvrTVji3NEHNMAiUt0tBFLvqa6w=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ol7I4GIvvOnWsnzuTM4EMhXyk4seQesgTr40C8US/0dIpNbihwNWk0qvh1kPCjFoj Y7/stm7nS0Hh3mjFswJ+YYAK4VzcitIAiNzDfr/PgppYXyXJRO8SBOnK1WfLwERCCq Rjkyd2zTsFiLlWJcwCvIpdPLN+ioHuBvnPSd2sLs= Message-ID: Subject: Re: [PATCH v5 10/22] gnu: racket: Move Chez bootfiles to (gnu packages chez). From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 15:31:33 +0100 In-Reply-To: <20220226130254.1301333-11-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <20220226130254.1301333-11-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > ´ gnu/packages/chez.scm   | 62 > +++++++++++++++++++++++++++++++++++++++++ >  gnu/packages/racket.scm | 52 ---------------------------------- >  2 files changed, 62 insertions(+), 52 deletions(-) You were the chosen one Philip! The prophecy said you would reduce the code size for racket chez, not add more to it! Prequel memes aside, LGTM on the basis that we will probably be reusing some bits in the later commits and also there's chez-scheme-for-system to think about. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 09:34:39 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 14:34:39 +0000 Received: from localhost ([127.0.0.1]:54618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNy9e-00085b-TK for submit@debbugs.gnu.org; Sat, 26 Feb 2022 09:34:39 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:43943) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNy9d-00085U-9U for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 09:34:37 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5Tg85sQKz1LWp5; Sat, 26 Feb 2022 15:34:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4K5Tg85sQKz1LWp5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645886069; bh=oVOOKXuGoZHggqDy9jQqWphoa8oNzXPe2QhaNv5CLMM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=aWFPG39kk2H7GLSeKhAn1esnp42QRo8KfMAkW4leYbXRjMJZogsMINmDy+f3W/mzG 6uMDiPVwf4qTYQHOtnVvg3pNA0vPrYr/1dh3DB298Td9ID3F+K6W6Zkb3YlNWhBoyz RM0zUhcPOb3gh4k14y3rXg2ATZ5Ajb2v7TtoFyLg= Message-ID: <9a64f2150fa4a346e7e18448d08591335d1444bf.camel@ist.tugraz.at> Subject: Re: [PATCH v5 13/22] gnu: chez-scheme: Use "lib/chez-scheme" for search path. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 15:34:27 +0100 In-Reply-To: <20220226130254.1301333-14-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <20220226130254.1301333-14-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > There does not seem to be any widely accepted standard path to use > for > "CHEZSCHEMELIBDIRS". Using a path without a version number in it > avoids > having to compute the actual path everywhere, which would be > especially > unpleasant when support is added for the Racket variant of Chez > Scheme, > which always has a different version number than upstream. > > * gnu/packages/chez.scm (chez-scheme)[native-search-paths]: Change to > use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for > "CHEZSCHEMELIBDIRS". > (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, > chez-fmt, chez-mit, chez-scmutils): Update accordingly. Also, remove > input labels and use G-expressions. I do think we ought to divorce the functional changes from the style changes, but I'm willing to let this one slide. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 10:08:41 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 15:08:41 +0000 Received: from localhost ([127.0.0.1]:56090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNygb-0003A3-BG for submit@debbugs.gnu.org; Sat, 26 Feb 2022 10:08:41 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:63861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNygY-00039t-C1 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 10:08:40 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5VQR4qZ1z3wDL; Sat, 26 Feb 2022 16:08:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645888112; bh=KaSPza0asIIEnwZFOc3ehOPbmfsQN1q5pIgLOvUfKpI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=FXcIa1vtnoN14RWgiR6sDy+givYnP3FH+J/r4Y3cuI/0omimujN4U2J3n25tsIFAf RGtEwyi0qZ0aZCzS1ZJpfW2t+os7lQKQYZqzNl8iEJAc9jep/x3SyEldwMPNe89bYs r926syZeLE3Vr4de3RI0MW0jeHDdwNGdtusOC8kc= Message-ID: <74bab2e6a9feab707496d84870c7fc987721a17c.camel@ist.tugraz.at> Subject: Re: [PATCH v5 00/22] Update Racket to 8.4. Adjust Chez Scheme packages. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 16:08:30 +0100 In-Reply-To: <20220226130254.1301333-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > Hi, > > I've been ruminating for a while on Liliana's comment > from : > > On Wednesday, February 23, 2022 3:31:34 PM EST Liliana Marie Prikler > wrote: > > [...] there are some things that still > > don't feel right for me – for instance the fact, that seemingly > > unrelated modules now have to pull in racket bootstrap sounds like > > a recipe for trouble.  The final patch in the series also still > > does too much for me to wrap my head around, which makes it > > difficult to audit. > > > > Therefore, one question I have w.r.t. updating Racket is whether we > > could theoretically bump the version while keeping the old > > bootstrap, and then adjust the bootstrap by adding all the packages > > you've made. It does seem to be an all or nothing deal when doing > > the bootstrap first, but that need not necessarily hold for > > bootstrap second. > > > > Also, accepting for a moment that we might have to move chez-scheme > > and other important things into chez-scheme-and-racket-bootstrap > > (even though I'm not really content with it), I still wonder if we > > could introduce chez-scheme-for-system first (defined as simply > > chez-scheme initially) and adjust the callers, then move chez- > > scheme while keeping the function in chez.scm and finally do the > > magic with making it either chez or racket. > > > > It struck me that the core of the dependency cycle (at least, from > one perspective) is that 'chez-scheme-for-racket' wants to 'inherit' > from 'chez-scheme' but use '%racket-origin' for its 'source', and > neither of those are thunked fields. I did realize that too, but perhaps I failed to mention that or didn't get the point across before this, so pardon me for the extra work you had to put in that I could have helped avoid. > I realized that, if we just pass the origin some other way than as > the 'source' field, we can avoid adding the > "chez-and-racket-bootstrap.scm" file > altogether: patch v5 10/22 does the core of that. I did miss that nugget when I skimmed it first; is there a reason to prefer overloading unpack and redirecting it to (package-source racket- vm-bc) over doing the same, but using simply #$%racket-origin? > I also managed to split up the update to Racket 8.4 (patch v4 15/15) > into a number of smaller steps (or, more precisely, rewrite it now > that I knew what the end result would be). I now have the 'racket- > minimal*' packages gradually evolve into the corresponding 'racket- > vm-*' packages (rather than adding the 'racket-vm-*' stack in > parallel), then split the new 'racket-minimal' package > out of 'racket'. Hopefully this might be somewhat easier to review. > The downside is there are now 22 patches, rather than 15. In general, smaller patches = more better. I really like this series so far, there's only some cosmetic nitpicks, although for the record I do have to say that I skipped over many things that felt familiar from earlier series. BTW for the record, if you're dropping one of my mails from the CCs, please make sure to include the gmail account rather than my institute mail. This one is technically supposed to be for work and I'm using a rather loose interpretation of "ensuring that software is up-to-date" as part of my work when I do comment on Guix issues from it. I'll now attempt to build racket with this patch and hopefully encounter no error as I do. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 10:16:28 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 15:16:28 +0000 Received: from localhost ([127.0.0.1]:56123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNyo8-0004jU-5H for submit@debbugs.gnu.org; Sat, 26 Feb 2022 10:16:28 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:38703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNynz-0004YB-0h for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 10:16:26 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id DFE6458011C; Sat, 26 Feb 2022 10:16:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 26 Feb 2022 10:16:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=dBm50SfZ7dFtNX sB8W1P7kVInH1oUR3lSYWZdzn2+qc=; b=tITyxZpjWYP+oE7X+17vjZzDyEZxqF YMrVRFWttuLmYVh65TGqsveuzfo7CazF+mZO2ucCk9cuRm0eZU1jHV0fLDe+mDss 22jQcQPAASrpTYiq6Tq38eJPoKid5uAPvHz1jtAXhcV9+nj4pZqSPbj6+xFJfzSd WsuwZJL6i3K+jzcJRdS+zi41RujRLWNCktIGz7IuW8iN+kW/vHfJq223lFRctWjP 6l1XF5LWRQ7NF8+AhbzQ4veVhiOQsI+4UNjF1fibpR3yiATwd8nPbtKtVRAd3scL bgV+VRif2rEDe3OhmviXjUA10qjffEF041UQhxBgvkuzQCTjz2AqXKkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=dBm50SfZ7dFtNXsB8 W1P7kVInH1oUR3lSYWZdzn2+qc=; b=JoDb8fUhSAzDhxF+l5eR5ZPQFcO6hL/J8 AB4eMkEDA0IFKX1JLaAFbyi9oGH309RPwxsxw+8el/aGlkmhLqbbt23KSwcH/3v4 5SWK6QqYAgtQ6JWI0+T9ZoFUQirC7Jiyttn/blVH6AiLD2HWrRNEvPHNwHBV+kR3 pFM+9UBlz/frO4IIAF/8jjn2nBzk4xamdb1teBLibVbo86qx4CgOzrBrvnUGSmfW l/5TLelKOc1T0TL0/+q7lnw9QMqn1l8AEGElSYfsgqePn8TTfV7t/J8igZtZeXyv 9eTG2cz1l8TMDoIvC5W2LiYoLBYRajG5F1pfohvxS6NPsjX4fK5ow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleeigdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnheptdeuudeuhfekudefgfdvtefgkeduveetvdelgfduhffhheff ieeivdeigffhgfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Feb 2022 10:16:12 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Subject: Re: [PATCH v5 06/22] gnu: racket-minimal: Change inheritance to follow bootstrapping. Date: Sat, 26 Feb 2022 10:16:11 -0500 Message-ID: <3282283.1ERUTVTWHs@bastet> In-Reply-To: References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-7-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4096064.nv8Y8llY32"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart4096064.nv8Y8llY32 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , raingloom , Maxime Devos Subject: Re: [PATCH v5 06/22] gnu: racket-minimal: Change inheritance to follow bootstrapping. Date: Sat, 26 Feb 2022 10:16:11 -0500 Message-ID: <3282283.1ERUTVTWHs@bastet> In-Reply-To: References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-7-philip@philipmcgrath.com> Hi, On Saturday, February 26, 2022 9:19:20 AM EST Liliana Marie Prikler wrote: > Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > > Having the package inheritance chain go in the same direction as the > > bootstrapping chain, rather than the opposite, is less confusing. In > > some cases, it can also help to avoid unnecessary rebuilds. > >=20 > > * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the > > root > > of the package inheritance chain. > > [version, source, inputs, native-inputs, build-system, arguments, > > home-page, license]: Inline formerly inherited values. > > (racket-minimal-bc-3m): Inherit from 'racket-minimal-bc-cgc' rather > > than > > 'racket-minimal'. > > [inputs, native-inputs, arguments, license]: Adjust accordingly. > > (racket-minimal): Inherit from 'racket-minimal-bc-3m'. > > [inputs, native-inputs, arguments, license]: Adjust accordingly. > > [properties]: Override effect of 'hidden-package'. > > --- >=20 > I think this patch might introduce some noise by moving a package to a > different location in the file. If possible, we might want to avoid > this and relocate afterwards =E2=80=93 IIUC positioning within a file sho= uld > not matter when it comes to the inherit clause. >=20 I've tested a few things, and the best result I'm getting is to keep the or= der=20 as in this patch=E2=80=94the unchanged portion of `arguments` turns out to = be longer=20 than the descriptions=E2=80=94but adjust the use of `hidden-package` vs. `p= roperties`=20 to avoid indentation changes. In particular, that helps Git to realize that= =20 `racket-minimal-bc-3m` does not move. I'll plan on a v6 with this and other things you've found. =2DPhilip --nextPart4096064.nv8Y8llY32 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIaRDsACgkQygNjjfo/ HHqvfg/+MM5GuE+Wqpmi9jFuLaQaaK2WzKmRyivYq67djW/URNz7QerxIDA4pxJq Ifl+KyvC/tvRbLjheafM5k1382QkYiGWEIFBEdjz5qTqLEe3ju2ry4MxJlmP5p0u QQ/9BAYx1OogN0FsOTg3Lrs2YtpfQZRK90THPgJqv7SDDU6+P9OtClgzLZ6YIMQB ZAspS8y49vwExNbQZH7q4JocdazlFlOmVwk4giDcWw+0sps1sxx4rSxu9zzemc1W 2V7xnPIzQ+csXyze1iSML2wIv39yC97k+82lgpw4LmJiTbegCBA0TE40tRlmKVVQ QOYldDMdZ/Vp0EDkuRswnltY/jXqEGSrlzplSpmR82ApfDmo1vpuD9qbKWHDE9hu 4UOzvflN1BsOFg/6tTaOmrdTrVnlda4Fob24XqSmgbuwDmTP6odWSO6qhVdY+wos 2MDFFiFNCs3W2BEwRfpz35yOZpR13IGNqypHkMoRX6aowdHOSOoPWrta4dQRQOEw SyQXEt+c2fPEcaZLwiXsvhBVrSscOVoW0REsZpjibSAIbhH93teUahqjuVhFpisZ Lery2bHwYPjGiY6u//Z9Pl1DH98GUMitI/zaiwYkfkxyMAP1MnFVXnJyUo9p3QPh xK5kac20DTLhycM+HVZuHM2iGlGSH7+vp0Gcq0I+ijH/CINVAto= =IMdG -----END PGP SIGNATURE----- --nextPart4096064.nv8Y8llY32-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 10:19:50 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 15:19:50 +0000 Received: from localhost ([127.0.0.1]:56139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNyrN-0005iG-PP for submit@debbugs.gnu.org; Sat, 26 Feb 2022 10:19:49 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:29137) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNyrL-0005i7-M9 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 10:19:48 -0500 Received: from kagayaki.fritz.box (85-127-52-93.dsl.dynamic.surfer.at [85.127.52.93]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4K5VgG4KQlz3xbR; Sat, 26 Feb 2022 16:19:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1645888779; bh=yRbFgaO/u57ceL/1Nfd2OUHI0zEoTyKMihyYp36IRW4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Hg1JRLRPdSxR1v6Xn8qs85NcsqXrWRh/M+xDzEPMQgmh0oWHWJIMW/0FgtXm75BnK 34tHaixJr2FlGnI3zEutAZwB25AYnPjFGmBnhTCsJR2tFWJx5UGH5VYdgIUu0jkFSQ og0brq2EuTRLRimrYpqXokv8gFAmiV0V44RO6qNM= Message-ID: <483f3a20fa9f67785d68bdd0865e8526399dd307.camel@ist.tugraz.at> Subject: Re: [PATCH v5 06/22] gnu: racket-minimal: Change inheritance to follow bootstrapping. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sat, 26 Feb 2022 16:19:37 +0100 In-Reply-To: <3282283.1ERUTVTWHs@bastet> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-7-philip@philipmcgrath.com> <3282283.1ERUTVTWHs@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Samstag, dem 26.02.2022 um 10:16 -0500 schrieb Philip McGrath: > I've tested a few things, and the best result I'm getting is to keep > the order as in this patch—the unchanged portion of `arguments` > turns out to be longer than the descriptions—but adjust the use of > `hidden-package` vs. `properties` to avoid indentation changes. In > particular, that helps Git to realize that `racket-minimal-bc-3m` > does not move. > > I'll plan on a v6 with this and other things you've found. Git lacking sexp diffs, our old nemesis! Thanks for investigating. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 10:36:30 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 15:36:30 +0000 Received: from localhost ([127.0.0.1]:56157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNz7W-0008Oq-ES for submit@debbugs.gnu.org; Sat, 26 Feb 2022 10:36:30 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:59093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNz7V-0008Of-I3 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 10:36:30 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 6B79F5800F0; Sat, 26 Feb 2022 10:36:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 26 Feb 2022 10:36:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=kxv0K9c22AoN7k nSJj4P+wsSy/sBTZaK0B/6NDsDz6U=; b=PZQkuWEdDcJ+gsjJTOnKYkShTF5hEZ AFzGUNY2TmaTlYtT9TrVS9NgtZ6Y41PyuWFZZF2FV73QL2Yz0pg+VC+q6dPKRyf2 dDNp35CgfjzDLBTAb4oU3iik92G8j20pCWJtkn4B96uD7CvFRAKbOtxaF5QYITmd xDlZuV2NjuidnGQrpF7u7jwGVZxNJplqjqVKOYsjOxy3Hh1IAEk3NjvfykQSuVLz PeD7vAHKOHGntt/RPmxKrcCrrJEOM/KWyHDDGHOzI2LBHVRUvt4+IQHNEimPhnaN NeuVoUbRHz24pB7dFG/xallZDEKRPHfyer/VOFAMy1hsKvAIO0NQOXlw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=kxv0K9c22AoN7knSJ j4P+wsSy/sBTZaK0B/6NDsDz6U=; b=Pf1Sm6DS2CJzqCKZ4yRQTZDc0MNeVxQSM cKvGjytAiwrLW+9uv65ZmN/8SUYfdtaev8uovVkRhH1skKjvTth1BZ7vhuoGWrO5 FwNI3kg/d5DDiMR4B9FQ6mL3NM1e57YuHhKhicJ/kjVo9wuLCrCelhfsERz+sGcq laJ3DNeFhEzCNIB2BUpNLMtHSOqKJpDK3ecCgRgNIGSt2yApuvDJbbFYarm4hkI8 Xvn+L/o/FV69aL8h7buKeQEhdV/lMzp5Ns2quxD4sG7gL5O5+CEWun9x0SVASil7 mwmTpXh8cSLy2TRxAtY2vWOWsGurIWP+r97gJWdd0lBsClFLErPWQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleeigdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnheptdeuudeuhfekudefgfdvtefgkeduveetvdelgfduhffhheff ieeivdeigffhgfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Feb 2022 10:36:23 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Subject: Re: [PATCH v5 00/22] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sat, 26 Feb 2022 10:36:16 -0500 Message-ID: <4187312.lXvkglyHfx@bastet> In-Reply-To: <74bab2e6a9feab707496d84870c7fc987721a17c.camel@ist.tugraz.at> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <74bab2e6a9feab707496d84870c7fc987721a17c.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5096203.ZipjhvorXk"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Liliana Marie Prikler , raingloom , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart5096203.ZipjhvorXk Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , raingloom , Maxime Devos , Liliana Marie Prikler Subject: Re: [PATCH v5 00/22] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sat, 26 Feb 2022 10:36:16 -0500 Message-ID: <4187312.lXvkglyHfx@bastet> In-Reply-To: <74bab2e6a9feab707496d84870c7fc987721a17c.camel@ist.tugraz.at> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <74bab2e6a9feab707496d84870c7fc987721a17c.camel@ist.tugraz.at> Hi, On Saturday, February 26, 2022 10:08:30 AM EST Liliana Marie Prikler wrote: > Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > > I realized that, if we just pass the origin some other way than as > > the 'source' field, we can avoid adding the > > "chez-and-racket-bootstrap.scm" file > > altogether: patch v5 10/22 does the core of that. >=20 > I did miss that nugget when I skimmed it first; is there a reason to > prefer overloading unpack and redirecting it to (package-source racket- > vm-bc) over doing the same, but using simply #$%racket-origin? >=20 I like this: > > + (replace 'unpack > > + (lambda args > > + (unpack #:source #$(or (package-source this-package) > > + (package-source racket-vm-bc)))= )) rather than: (unpack #:source #$(package-source racket-vm-bc)) to make it easier for a user to provide an alternate source. My concern with: (unpack #:source #$(or (package-source this-package) %racket-origin)) is less strong, but if `(gnu packages racket)` exports `%racket-origin`, it= =20 seems like it would be very tempting to put it in a `source` field, but of= =20 course that would cause problems. My hope was that having to write `(package-source racket-vm-bc)` might prompt a little more thought. > > I also managed to split up the update to Racket 8.4 (patch v4 15/15) > > into a number of smaller steps (or, more precisely, rewrite it now > > that I knew what the end result would be). I now have the 'racket- > > minimal*' packages gradually evolve into the corresponding 'racket- > > vm-*' packages (rather than adding the 'racket-vm-*' stack in > > parallel), then split the new 'racket-minimal' package > > out of 'racket'. Hopefully this might be somewhat easier to review. > > The downside is there are now 22 patches, rather than 15. >=20 > In general, smaller patches =3D more better. I really like this series > so far, there's only some cosmetic nitpicks, although for the record I > do have to say that I skipped over many things that felt familiar from > earlier series. Thanks! >=20 > BTW for the record, if you're dropping one of my mails from the CCs, > please make sure to include the gmail account rather than my institute > mail. This one is technically supposed to be for work and I'm using a > rather loose interpretation of "ensuring that software is up-to-date" > as part of my work when I do comment on Guix issues from it. Will do, sorry! (I've been experimenting with MUAs recently and not getting= =20 everything right=E2=80=94you may have noticed I sent mail earlier from an a= ddress I=20 wasn't intending to use.) >=20 > I'll now attempt to build racket with this patch and hopefully > encounter no error as I do. >=20 > Cheers =2DPhilip --nextPart5096203.ZipjhvorXk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIaSPAACgkQygNjjfo/ HHqfdQ//QqVQYxPTdSYS7kTEjSlQruHnl0K9MKhgNHXYhx5/xh2Vm93O+I3MULBS 60acgzrZaSLzokkhTSKoANQf24+dMk67bOh6HY5S3uFemrlLFEXsgA9ZLkGUT/sp 7jqnQrU0wcyYaS/ZVRGchqRHvpLNm9rmCDI3gzLi+s9jgSHVwrLCH4GEemucJptV uJp/yhOKYtJriRpxWlkjBW8pDbrr4wrQGpxGwC7a5H06E9Mn9MmbqkHuC1jHlicE QowAKWqlpn/KvZIOArKKpFHZvnLJk5eSWf4Jf5cQN44of5UDhkDuwaja1WeydrTS 8Ze7lMTmPCJRsyTw0PQckTuJ4/PMiVtiT1rsrAfkxY1CftwwWcVtvcHtfFPiIRTb a31KftNq1d9QqqhUWv8VwSFMiFQGlKJPtJhQFGSvxWwacofBrzW1v/Ir05tclloR VXmyEv5Jru6L1iTl9+oFfLOt0s+VND6Vh5GksqVRmPIRYO/lAzDkquyDBkR0emmO koCQxmO/1bZoqPoRiLVH9oM/AMguEm4F9Dg3+Ea3QJyM1Jf+xRLpZE9LD+Us2DLT 8NBZDVH6UdP5PLfJqAeuaQSkG7vNrIcZRiOD+a7sQ/LX5zIEVpvflKkG31ML+PjH Ox7WnSuAnJs4aDsOr3j6vdx13Tgb7H2SKTDIjNTHnEe5imcw3dI= =E8K8 -----END PGP SIGNATURE----- --nextPart5096203.ZipjhvorXk-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 11:14:48 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 16:14:48 +0000 Received: from localhost ([127.0.0.1]:56205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNzia-00012C-HM for submit@debbugs.gnu.org; Sat, 26 Feb 2022 11:14:48 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:47009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNziY-00011w-Pz for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 11:14:47 -0500 Received: by mail-ej1-f65.google.com with SMTP id qx21so16571261ejb.13 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 08:14:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=Xaqrq4+xOyN3dyjbz26Mh7FHYXptUBYq9Iud46dMJfM=; b=QrEcmxQcSM75qXGWm67wCH+QChNlDUt+YP/oSvYkY/OgZ9NPBEPus4hXSOZXhEO2+U 7dUugpQmMR+5b8v8ubgGb2tW7xsByz39nsHD2u2ozhdsxMrA4VS38kIRaQNMWd76lBmk rTotVYl/8NDtuzrTdHCtwY757a4L98WRkSrqsEpnSOSdl81NvXee3kdL7c4W7fp1jW2s AW+V9gQaYEgiiCXckjGzWQQYuIoYQySI490TjEOUAsoumtG2CjCSVcgzCOiPE7UrQ2lT DD9BMtEHg5xQW7Ifz91GHoszu9L1+TonhX12BO3LS3HyyPZVFBQ2GxmcOBP1AHWbYfll 3Vig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Xaqrq4+xOyN3dyjbz26Mh7FHYXptUBYq9Iud46dMJfM=; b=W48gtBPL485hhPnkWQYLN7y21f7puhry3MmwqbD/c9javYd4XLeEgfw+WbNiiOBc0h EHVvJIKe1K/Ng3yKvCYvYJncABNpB2JTH00GpgeBh0NziKvTZ/GZ1z3MVENXCVBFKOAf p8nP94VG8IEVQprWIFFzlo3DS/h33Eh5O2KPsupUBdT+Lb3suDYtczYuVC2hU+luZInc xon1SMgfm6kr1rofXa3q1TrjI+NinRwP2Vp7GRbUkVgKm357ycob06YafJka/W1hwKht 5lgSs7QAOIczf5CvyVtIlbBSGMdR35UlBw2SNir72+LEleX2LOqtUItX6+RjgrortFZ1 077Q== X-Gm-Message-State: AOAM530+3THTM0/ysgwnI+IrX8Wo3FxJkn/FcL3Yz4lGryPa2n7lSEKR oICVVSGqxxR1OCazRqFTpus= X-Google-Smtp-Source: ABdhPJxDCABpaveCEXIvylMp5PhD73t5TwIhnBzq6JEYcL3+xkZ2IRuvh12/bsvdRpGYg4z9REXYbQ== X-Received: by 2002:a17:906:255a:b0:6ce:3732:6f5f with SMTP id j26-20020a170906255a00b006ce37326f5fmr9952400ejb.565.1645892080970; Sat, 26 Feb 2022 08:14:40 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id ky5-20020a170907778500b006d1b2dd8d4csm2361662ejc.99.2022.02.26.08.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 08:14:40 -0800 (PST) Message-ID: Subject: Re: [PATCH v5 00/22] Update Racket to 8.4. Adjust Chez Scheme packages. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Date: Sat, 26 Feb 2022 17:14:38 +0100 In-Reply-To: <4187312.lXvkglyHfx@bastet> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <74bab2e6a9feab707496d84870c7fc987721a17c.camel@ist.tugraz.at> <4187312.lXvkglyHfx@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Am Samstag, dem 26.02.2022 um 10:36 -0500 schrieb Philip McGrath: > Hi, > > On Saturday, February 26, 2022 10:08:30 AM EST Liliana Marie Prikler > wrote: > > Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > > > I realized that, if we just pass the origin some other way than > > > as the 'source' field, we can avoid adding the > > > "chez-and-racket-bootstrap.scm" file > > > altogether: patch v5 10/22 does the core of that. > > > > I did miss that nugget when I skimmed it first; is there a reason > > to prefer overloading unpack and redirecting it to (package-source > > racket-vm-bc) over doing the same, but using simply #$%racket- > > origin? > > > > I like this: > > > > +            (replace 'unpack > > > +              (lambda args > > > +                (unpack #:source #$(or (package-source this- > > > package) > > > +                                       (package-source racket- > > > vm-bc))))) > > rather than: > >     (unpack #:source #$(package-source racket-vm-bc)) > > to make it easier for a user to provide an alternate source. Hmm, to be fair this would probably respect --with-source, which I was missing, but I'm not sure how deep into the bootstrap we could inject this. Sadly, we can't make chez-scheme-for-racket itself a transformation. > My concern with: > >     (unpack #:source #$(or (package-source this-package) %racket- > origin)) > > is less strong, but if `(gnu packages racket)` exports `%racket- > origin`, it > seems like it would be very tempting to put it in a `source` field, > but of course that would cause problems. My hope was that having to > write `(package-source racket-vm-bc)` might prompt a little more > thought. Hmm. And what if we go my earlier route of defining this as a procedure in chez and instantiating it inside racket.scm? We should not get a cycle triggered by chez-scheme-for-system if we do, but we might get one if we attempt to bind it to a variable in racket.scm. That aside, there is also the possibility of using a gexp promise as source, as is done for example in the case of linux-libre. If we wrap the chez side in a promise, that ought to resolve the cycle as well. > > > > BTW for the record, if you're dropping one of my mails from the > > CCs, please make sure to include the gmail account rather than my > > institute mail.  This one is technically supposed to be for work > > and I'm using a rather loose interpretation of "ensuring that > > software is up-to-date" as part of my work when I do comment on > > Guix issues from it. > > Will do, sorry! (I've been experimenting with MUAs recently and not > getting everything right—you may have noticed I sent mail earlier > from an address I wasn't intending to use.) I haven't noticed, but thanks for pointing this out. If a commit from the wrong address does make it into our git history, please do point that out; I'll be happy to adjust the mailmap for you. > Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 12:23:29 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 17:23:29 +0000 Received: from localhost ([127.0.0.1]:56274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO0n3-0002y3-6t for submit@debbugs.gnu.org; Sat, 26 Feb 2022 12:23:29 -0500 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:34745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO0n0-0002xn-2c for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 12:23:27 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 0170958017F; Sat, 26 Feb 2022 12:23:21 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 26 Feb 2022 12:23:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=HiP9HMgZIgAVA3 N1rfhkULGbKBNkVNWUAUOQAvlE4Gs=; b=U18bFD6X5HNsXc49NCOi6RAsAhUwtY y41WyGNU17gBIoZK5kTJ6b57gWKy2D9jY1D78Vm538MQlYTtdk/3FAxKwamHMlJD 2pExoHe9BJzQpVsnliq/WOGyegWjVvuHJHoji53pZiLCeDDtk5KvEPgh6V9BSrrk 89rZnHsbW1XebhdW/m1UqMD1VSc0llOJ3/gEFebRMHMC5Btb/5Hss43lffP7NBV5 o/wVThb1xcEzTlPXv9hWTp8qYV7R7b1T9hsMZBLHBKchJMD2nG2cW4djeGDnkD6M wcIStl3wBLK2AFjSAcTUCCray7lonVUDvfjgsvGLa2maVktGjTebwQ/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=HiP9HMgZIgAVA3N1r fhkULGbKBNkVNWUAUOQAvlE4Gs=; b=F0YpMgQeAzyhcgG8lNTOd4CnjjrPH9hNN QH8UmaH9YElBDHwdRLGKxWYj2T4R2T3V6FBjf5+NR2boorJfAQmaj7SpO2zXtK4p +r+UfMVqCafKUM9RHHMP4H+Cf43lIvc9F+TCimkYCJ/vXE+/PYC9Z5KPIxSzCBsr 2Travl4LkrMNrfF/9/7U3WLY+oVxW8/c/UzEuL8YwrP0DAJPeUa+9JKxYu9t+ZjD AH3gB5gfhTLHpQPvCWR9ksDHjWikmmEDrobklPfHtpmsltQwupV3tMd0jXkR5spZ FXbMPCC4HqIBSrqzF0+lZ61ga+1xItN8usKOYzETYDyxBQUk9inRg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleeigdeljecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttddvnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnhepkeegtedtveffueejleejueelvdevfeeivdeihfduveehueev hfffuefhieefhedtnecuffhomhgrihhnpehgihhtlhgrsgdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphesphhhihhl ihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Feb 2022 12:23:18 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. Date: Sat, 26 Feb 2022 12:23:17 -0500 Message-ID: <19823080.dSP1spjjOr@bastet> In-Reply-To: <0c9963cedab248085b106effdd68649647a41ca2.camel@ist.tugraz.at> References: <20220220060610.178131-1-philip@philipmcgrath.com> <3354324.gHnXMxdNb5@bastet> <0c9963cedab248085b106effdd68649647a41ca2.camel@ist.tugraz.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart26267686.q7ltLs4Q0i"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Liliana Marie Prikler , raingloom , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart26267686.q7ltLs4Q0i Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , raingloom , Maxime Devos , Liliana Marie Prikler Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. Date: Sat, 26 Feb 2022 12:23:17 -0500 Message-ID: <19823080.dSP1spjjOr@bastet> In-Reply-To: <0c9963cedab248085b106effdd68649647a41ca2.camel@ist.tugraz.at> References: <20220220060610.178131-1-philip@philipmcgrath.com> <3354324.gHnXMxdNb5@bastet> <0c9963cedab248085b106effdd68649647a41ca2.camel@ist.tugraz.at> Hi, On Saturday, February 26, 2022 9:26:29 AM EST Liliana Marie Prikler wrote: > Am Samstag, dem 26.02.2022 um 09:20 -0500 schrieb Philip McGrath: > > On Saturday, February 26, 2022 8:47:45 AM EST Liliana Marie Prikler > > > > wrote: > > > First, can we simplify "make-installation-layer.rkt" to "make- > > > installation-layer"? I don't think the file extension conveys much > > > meaning here, or does it? > > > > To me (I don't know about anyone else), the ".rtk" extension tells me > > that I have to pass the file as an argument to `racket`, i.e. that > > the file is not a launcher from `raco exe` or a script with a shebang > > that I could `invoke` directly. > > I'm not talking about the generated file, but the procedure that > generates it. Special characters like dots and slash are still pretty > special in Scheme, even if they're allowed as identifiers. > Do you mean A, B, C, and/or D of these: a > (replace 'configure > (lambda* (#:key inputs configure-flags #:allow-other-keys) > (let* ((racket (search-input-file inputs "bin/racket"))) > (apply invoke > racket > #$make-installation-layer.rkt ;; <--- A > `(,@configure-flags > ,(dirname (dirname racket)) > ,#$output)) > (invoke racket > "--config" (string-append #$output "/etc/racket") > "-l" "raco" "setup" > "--no-user")))) > > [...] > > (define make-installation-layer.rkt ;; <--- B > (scheme-file > "make-installation-layer.rkt" ;; <--- C > `(module > make-installation-layer racket/base ;; <--- D > (require racket/cmdline or something else? In particular, not to be dense, but B is not a function. One of the reasons I particularly like being able to use `.` in identifiers is to refer to files by name, without some ad-hoc encoding. > > > I think some way to shorten those origins would do wonders in terms > > > of the number of lines this patch adds. > > > > At one point, I had abbreviated the origins as something like: > > > > (REPO-SPEC SHA256 [COMMIT]) > > > > [...] > > I wouldn't do this inside of extract-package-source, but define a one > or two liner for adding specifically packages hosted on racket's > github. WDYT? > > > I wasn't sure about the trade-off between being slightly more cryptic > > than explicit origins, but a lot shorter. > > Note that the goal is not to code golf, but to be understandable. When > adding a bunch of origins as inputs, understandability suffers by > induced scrolling. > I've done this, and it was a very good idea. In particular, it helped find some places where I hadn't switched to using `%racket-commit` once the release was tagged. Other than potentially doing something about "make-installation-layer.rkt", I'd plan to squash the WIP/FIXUP commits in and send it as v6. -Philip --nextPart26267686.q7ltLs4Q0i Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIaYgUACgkQygNjjfo/ HHpiYBAAhgNqtXQh02QvMmLy9w9ratJOeVlrOJrw2lHS69FenYboVB1VMcxE2sy2 A2RN0UgA2F5tkaslTwy9HTVd4a7zv54rW71Xxw5n8mN458vV5ev+GcsraDYqBOrA ATwi3Dri7hL6FDH9GOmA1A9cQTIFehzAh+8JfjN0ye0uEFZYj2m0xQMZjNgDfzKl 18dYbwiDVTRfHzer1E5PmlrgnBoow4ZSxC/QA10aFDQNw1ecsYdeqx45v4UUCTwQ NgJkfWWMA4BRhPxz4y+2pUUzNHIjFfV0bL/ewpDz0Woj2VSzK+PzWOR6owKB2g8s Q1bX6vo7y3mzH8I1p9485H9aCUeXFmbnReglqyRW/+Axw855GZ94aNT6RgnesyZW dpSpm3OnLNF0yuLfb5ujlr2OUWyQWEA82VKhGVBjiB2EZQsPt7JYMmOMmxi5hNRC v++00gLG5V+HQnccm4Bk5+gqH63BipFvu32JE45I/CqEvSBFMlx5cWrbUvw7KR1z ST9BBfKSoqIhWQof6ya9RVvhlRQCfZU3XivQLk3hgJr0NO0x5DrlEJaOtFuFOjZP z35C4FQTPt6IfqMxwFRr+tRyJIQd/ZQBcH4R/J19FOW5mTUMJT8VhL23t6aXisYX LJaqLHgdKSM23/mNDIWKu80m41UCTMY7MwxFEPuPH0C6qRX62mQ= =HkXh -----END PGP SIGNATURE----- --nextPart26267686.q7ltLs4Q0i-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 12:31:10 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 17:31:11 +0000 Received: from localhost ([127.0.0.1]:56286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO0uU-0003DI-Gt for submit@debbugs.gnu.org; Sat, 26 Feb 2022 12:31:10 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:50759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO0uS-0003D0-H7 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 12:31:08 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 665E35800CD; Sat, 26 Feb 2022 12:31:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 26 Feb 2022 12:31:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=53YWM251H9VWzP wZLGa/y3E7M8h1O10R0/jh3YgaxAo=; b=ba5RmVjlHC9WsH/H3pjzKtCmI0uY1c WS7tWwo+3nB7D6Mon+OlGylhSxhqJU24BrBagtoLN5HDuMq3jIO4OJqGuOf0Fo1N pNXVoko/QIKqbb5/jGnkqK6ctRoZ+86ruyIOCisB7arh1osHQ9NHYiVPg1dvWPHg AmiPVufZpFtzM5A4HNVr2xExw6bNvbYG6LPL6D+ENZcxk02M5zKd8CQx7zAIR/jG Cp1+9mQ4Z0Ma1SIWy44PIW0Odn3sdKp78jadl9xiLi11xlo2RSQygYPKxemdCO2q ObrIcyyZdNuA5kE52DI/3pU4Ynid168qu+7t3AtuVBvqWbWa/F+z4fKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=53YWM251H9VWzPwZL Ga/y3E7M8h1O10R0/jh3YgaxAo=; b=NI+zKEIlD0SKdM08AWUHyBpTGkQ805WAr 5a/LCwY27WlnEgDBvHwMBRg2vXt+39oOiGqgPwEjZvkfh4h06RddmiqNyf+GKwOY a3SpbN2Bk8LLD5PuMQhNR8Pt2iiTB31x8dpI6LCnhI2AJGebaarTF0X8RL4ZNuTo xHmciKo3zEB2OfBG7+X6c5PxGuxHNIRPWVSQrJvSN74vpeFpEUcCkyUk+10jtUKz 6JfahP0/GuJrb+Vv/2jB/5UVo7w9ZsjNeqq/NW8ks9uVGzlViwA1GK8KBxJY2bXy NnG1TZw2EAM2yLBY0rIJ3aRvjbKvuu0D/BTMVBGjAG7H1fAVZ88pQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleeigdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfgggtsehgtderredttdejnecuhfhrohhmpefrhhhilhhiphcu ofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomheqne cuggftrfgrthhtvghrnheptdeuudeuhfekudefgfdvtefgkeduveetvdelgfduhffhheff ieeivdeigffhgfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Feb 2022 12:31:02 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler , Liliana Marie Prikler Subject: Re: [PATCH v5 00/22] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sat, 26 Feb 2022 12:31:01 -0500 Message-ID: <3062387.UNBJiXZ2us@bastet> In-Reply-To: References: <20220220060610.178131-1-philip@philipmcgrath.com> <4187312.lXvkglyHfx@bastet> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4621658.hZGDtEnxQe"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart4621658.hZGDtEnxQe Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler , Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , raingloom , Maxime Devos Subject: Re: [PATCH v5 00/22] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sat, 26 Feb 2022 12:31:01 -0500 Message-ID: <3062387.UNBJiXZ2us@bastet> In-Reply-To: References: <20220220060610.178131-1-philip@philipmcgrath.com> <4187312.lXvkglyHfx@bastet> Hi, On Saturday, February 26, 2022 11:14:38 AM EST Liliana Marie Prikler wrote: > Hi, >=20 > Am Samstag, dem 26.02.2022 um 10:36 -0500 schrieb Philip McGrath: > > Hi, > >=20 > > On Saturday, February 26, 2022 10:08:30 AM EST Liliana Marie Prikler > >=20 > > wrote: > > > Am Samstag, dem 26.02.2022 um 08:02 -0500 schrieb Philip McGrath: > > > > I realized that, if we just pass the origin some other way than > > > > as the 'source' field, we can avoid adding the > > > > "chez-and-racket-bootstrap.scm" file > > > > altogether: patch v5 10/22 does the core of that. > > >=20 > > > I did miss that nugget when I skimmed it first; is there a reason > > > to prefer overloading unpack and redirecting it to (package-source > > > racket-vm-bc) over doing the same, but using simply #$%racket- > > > origin? > >=20 > > I like this: > > > > + (replace 'unpack > > > > + (lambda args > > > > + (unpack #:source #$(or (package-source this- > > > > package) > > > > + (package-source racket- > > > > vm-bc))))) > >=20 > > rather than: > >=20 > > (unpack #:source #$(package-source racket-vm-bc)) > >=20 > > to make it easier for a user to provide an alternate source. >=20 > Hmm, to be fair this would probably respect --with-source, which I was > missing, but I'm not sure how deep into the bootstrap we could inject > this. Sadly, we can't make chez-scheme-for-racket itself a > transformation. >=20 > > My concern with: > >=20 > > (unpack #:source #$(or (package-source this-package) %racket- > > origin)) > >=20 > > is less strong, but if `(gnu packages racket)` exports `%racket- > > origin`, it > > seems like it would be very tempting to put it in a `source` field, > > but of course that would cause problems. My hope was that having to > > write `(package-source racket-vm-bc)` might prompt a little more > > thought. >=20 > Hmm. And what if we go my earlier route of defining this as a > procedure in chez and instantiating it inside racket.scm? We should > not get a cycle triggered by chez-scheme-for-system if we do, but we > might get one if we attempt to bind it to a variable in racket.scm. >=20 > That aside, there is also the possibility of using a gexp promise as > source, as is done for example in the case of linux-libre. If we wrap > the chez side in a promise, that ought to resolve the cycle as well. >=20 Interesting ... I'll have to take a look at that. In the medium term, for Racket packages, I think the 'racket-build-system'= =20 ought to provide some support for using a different Racket. For Chez Scheme= =20 packages it's probably less complicated. (At least, I've had no problems wi= th=20 the things I've tried.) =46or now, mostly I thought it would be very surprising if `unpack` silentl= y=20 ignored the package's `source` and unpacked something else, instead. > > > BTW for the record, if you're dropping one of my mails from the > > > CCs, please make sure to include the gmail account rather than my > > > institute mail. This one is technically supposed to be for work > > > and I'm using a rather loose interpretation of "ensuring that > > > software is up-to-date" as part of my work when I do comment on > > > Guix issues from it. > >=20 > > Will do, sorry! (I've been experimenting with MUAs recently and not > > getting everything right=E2=80=94you may have noticed I sent mail earli= er > > from an address I wasn't intending to use.) >=20 > I haven't noticed, but thanks for pointing this out. If a commit from > the wrong address does make it into our git history, please do point > that out; I'll be happy to adjust the mailmap for you. >=20 Thankfully git and git-send-email have been fine; only a couple prose messa= ges=20 came from the wrong address. =2DPhilip --nextPart4621658.hZGDtEnxQe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIaY9UACgkQygNjjfo/ HHqVAA//akUhtXsqPUe0RXHqVd0wrH9lAZJuycrALXlFWE86kcB2SsPFRWa0TVfa XHEBqS565DJrZqpBm7t4Vry3Sqc1YgW8wRrCzXbJfQX0qi2ooXQNg+pz7TExxeJB CKbbrIyFxsBLL1Ci6U6GbRuqh6DziAWIXz6N9MHYJuQ2IEkJMKZRibeg9HDMUy3o GVuasqaYfo04Bavh3vEFFrtiRnrAjFSHsW/bbRD+0Soi8bBxYchdTRL/Co/3KcrX acxdjYlw2z9d+yBrzAtq2z0gwsfTZVEu2n8+/TTuPlKXB+BSL+fokNw2lliEvwmZ 5eGCPDX9BnCVz/OqCnk8uFTyr+Br0tIEfzhMrgD8RMu+juauIDOVb7VaMLlL099u 3i1pmkLz8y2Yr7nKImLYrIzmJYa+hKKDGtE2ifUVLQQQ66KEQzu74YQiKoWoGhnx edmU/FQbY9TY8WPzmRF+WUpws0Ki058Sg16yX+lNb/A4iBPWmg/PVzcm2Ztpb5W0 EoAptMR12KMN/+NxCjuh/Wwbu8tRwezNp2wPoUAhZbHJU731scoHKIAJIk841XIV ImJA8gr4nL7gbxAGsHP4o32kBLXOIDh4VftNoZt/Fm29NImS1TYFvPenT+cloLGP Sq7o2vopFteLAQ4nXNbKodzr0Hl7D3yJ/IlIUUySwelJS4D3g8g= =Zzo6 -----END PGP SIGNATURE----- --nextPart4621658.hZGDtEnxQe-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 13:30:18 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 18:30:18 +0000 Received: from localhost ([127.0.0.1]:56334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO1pi-0004sL-3c for submit@debbugs.gnu.org; Sat, 26 Feb 2022 13:30:18 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:37547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO1pg-0004rw-2F for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 13:30:16 -0500 Received: by mail-ej1-f65.google.com with SMTP id bg10so17068047ejb.4 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 10:30:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=OMLZYrJOolGABSw+BgPM+Eu54MQvy5S1iysDJhNy6t4=; b=XHT/odSHZgWW3ZFhTiT3MJ5PS9ykn1JHxQtAAorCmnE8CsC5UCjSpJsex3EdvtRMb2 MO96KZr98gEMfmH9Qs75j/xJMfGsE7gSp4DxXQ2VsqboM60PWOp4r4CWzBNAvostKGX5 ty98sy4FlO44VA+pxAGvqRIP8UZENHNasGCvQpfvqMjv5OLCUQbXivJP/CHYFjyd8uz2 KTAQfEiv3sgc0/wfIxo+lX0Uh80nQXtngfMkNv7hagti+QdPxGqHQIvj6/VN2g0z/xVg G1UiLKJE0A8Oc9QkFc64U3m3cdGiCTxivbaO/zUIngEUyNQA0hjz3BS4LTXUBuVPRh0E 9DaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=OMLZYrJOolGABSw+BgPM+Eu54MQvy5S1iysDJhNy6t4=; b=o3dvAQJwYOcFemUxTqKpkHeXD7KB4BDBXFdiR3LIFXw2Lzb+9P4+d+LShDP9tfzy+m 7O9pvp3uIjtsnnjowGdq2BWfWgWZvk55JVlOyFttGl9Iexk/pf7dH7E6j2gwHLv8MS2B RwYC1a/HWp2smlwWNJOUj07yCTm2b3Z/FHezYUVpg1dbyo9qylnkymkiZ2hKuXuy00Un yPfDK3dcIzZUN+MeGD9BDSq2jXSLu8by8Chn7YMWlq3vzJvTU9An8bWEWowf5zxX+oA8 qrvZJxstK1tLLzf5qcZoPHKKAytHBSSh5Ru3FUUDqSggwlTn/HyU4Yv2pEyblHyvn3bW KBfg== X-Gm-Message-State: AOAM530lgqHfKAkZ6XC4mYRQg6x82Oct3y9Q+YboJuS8oCp/46OasVrb kJFk1ve+72To7V0LBeMsgFM= X-Google-Smtp-Source: ABdhPJz5NqOsmOoO0r6siH7ItgKBglAtxvjD/HmKsuI7SwtrKGIsdbXeqiJIOAehgD56o7ppxSHY7w== X-Received: by 2002:a17:906:3ac6:b0:6cb:6808:95f9 with SMTP id z6-20020a1709063ac600b006cb680895f9mr10494985ejd.375.1645900210220; Sat, 26 Feb 2022 10:30:10 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id d25-20020aa7d699000000b004128cfcc228sm3258052edr.5.2022.02.26.10.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 10:30:09 -0800 (PST) Message-ID: <6a35fdea04cdf461a662830efc5bfd84fee60ec1.camel@gmail.com> Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Date: Sat, 26 Feb 2022 19:30:08 +0100 In-Reply-To: <19823080.dSP1spjjOr@bastet> References: <20220220060610.178131-1-philip@philipmcgrath.com> <3354324.gHnXMxdNb5@bastet> <0c9963cedab248085b106effdd68649647a41ca2.camel@ist.tugraz.at> <19823080.dSP1spjjOr@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Am Samstag, dem 26.02.2022 um 12:23 -0500 schrieb Philip McGrath: > Hi, > > On Saturday, February 26, 2022 9:26:29 AM EST Liliana Marie Prikler > wrote: > > I'm not talking about the generated file, but the procedure that > > generates it.  Special characters like dots and slash are still > > pretty special in Scheme, even if they're allowed as identifiers. > > Do you mean A, B, C, and/or D of these: > a > >           (replace 'configure > >             (lambda* (#:key inputs configure-flags #:allow-other- > > keys) > >               (let* ((racket (search-input-file inputs > > "bin/racket"))) > >                 (apply invoke > >                        racket > >                        #$make-installation-layer.rkt ;; <--- A > >                        `(,@configure-flags > >                          ,(dirname (dirname racket)) > >                          ,#$output)) > >                 (invoke racket > >                         "--config" (string-append #$output > > "/etc/racket") > >                         "-l" "raco" "setup" > >                         "--no-user")))) > > > > [...] > > > > (define make-installation-layer.rkt ;; <--- B > >   (scheme-file > >    "make-installation-layer.rkt" ;; <--- C > >    `(module > >      make-installation-layer racket/base ;; <--- D > >      (require racket/cmdline > > or something else? The name in B is confusing imo, because it implies a procedure when it is in fact a file. Of course, that'd affect A as well. The file name in C does not matter too much, but should probably be matched with B to some extent (but importantly keeping the .rkt extension even if we drop it from B). I'm not sure if D is a function call or not, but if it's a module name perhaps we should make it match B. Given that we pass configure-flags to this thing, how about "configure- racket-layer", "configure-layer.rkt" or something along those lines? > In particular, not to be dense, but B is not a function. Yeah, that's my bad for only skimming these and not paying too close attention to brackets. The name itself implies a function, hence my confusion. Looking at things closely would make me see more typos like ";; workaroung Guile reader/printer:" workaround. > One of the reasons I particularly like being able to use `.` in > identifiers is to refer to files by name, without some ad-hoc > encoding. I do admit that is helpful, but in this context, metaphors were mixed in a way that conveyed the wrong message. > > > > I think some way to shorten those origins would do wonders in > > > > terms > > > > of the number of lines this patch adds. > > > > > > At one point, I had abbreviated the origins as something like: > > > > > >   (REPO-SPEC SHA256 [COMMIT]) > > > > > > [...] > > > > I wouldn't do this inside of extract-package-source, but define a > > one or two liner for adding specifically packages hosted on > > racket's github.  WDYT? > > > > > I wasn't sure about the trade-off between being slightly more > > > cryptic > > > than explicit origins, but a lot shorter. > > > > Note that the goal is not to code golf, but to be understandable.  > > When adding a bunch of origins as inputs, understandability suffers > > by induced scrolling. > > > > I've done this, and it was a very good idea. In particular, it helped > find some places where I hadn't switched to using `%racket-commit` > once the release was tagged. That is better, but can still be improved. As hinted at in my comment to your tree, origin snippets might be a better solution here unless I'm missing something in the heat of the moment. > Other than potentially doing something about "make-installation- > layer.rkt", > I'd plan to squash the WIP/FIXUP commits in > < > https://gitlab.com/philip1/guix-patches/-/tree/racket-chez-refactor-hist-28 > > > and send it as v6. I did have a short look at it and apart from the above comment it appears fine, but I'll have to reevaluate it when it's a full v6 anyway. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 14:56:15 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 19:56:15 +0000 Received: from localhost ([127.0.0.1]:56361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO3At-0007CV-6S for submit@debbugs.gnu.org; Sat, 26 Feb 2022 14:56:15 -0500 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:50283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO3Ar-0007CH-BU for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 14:56:13 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id E2A262B001FF; Sat, 26 Feb 2022 14:56:06 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 26 Feb 2022 14:56:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=/WrC8PomR8thek FJA8o1pM0qQZihzP2DUNTsgNTTV0A=; b=FuvLFzAxBcxROt0P0/hyEEoW+1ItG8 NbEglo3KrCPB1JlIftMtVhUlhQJB3fQ/hHf3omxXm2xlXglUAXlHGMHvj73nCJB+ 5oEOF27F9S8QyiQskswgb2oVuw+9uDxIZUBdqo/Cf2pqbb4WgSuxq2q3WiQcMOQj gEC9tY4Bf5GmRqkTZ34l688VmSEL6Fs7kEiTikmW/RMwBch0yIUZHnjc1fh/gGIc +LTrLk5FTizjJ3TZt2LlRT9b8RXVYVZKkOty4PiGekz9CNFcFa34r1y/dJ+7A6iC cMQplMPZPgIjlFtKeTY9vZOlN9faRr9Nk2HG7wrTA9bwdFARXH7w78uw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=/WrC8PomR8thekFJA 8o1pM0qQZihzP2DUNTsgNTTV0A=; b=gKDe/hHJGQEcb5MChNZWLmaLuX+wxvvcE KTR7Md/YxEJq/1S36AOmTro4baKFRXWNdqyCtEIkj3C07ZQsABdlLRgMgArJbqzY M4NJJXOl6lztv2qvIW2VQsF7WqUmeS1Njs8TkD0PZDG5HiEi8gSHPfU7EQKJLCCo ewOk7HKqtPF8XdJ2VeOJ7JDme11ns6+fYxUnFgfRBXcqNMr6IBrbGhYMs3A+jCWt 9X3kHo++QxljbwbWTfDbNnrMY/bGD84Mzx84VvN7GVkVl+PThLMy3Um/I09XaPaz PJl8/dQnORVw3CgbcmC/SPUhgLfokPnFYNFZpZgxKW8HKyb2b350w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleeigdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhggtgesghdtreertddtvdenucfhrhhomheprfhhihhlihhp ucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhmqe enucggtffrrghtthgvrhhnpeeiieefheeutedutdfgffdtheehtedtudevtedtgfeludel leekgfduteejkefggfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Feb 2022 14:56:04 -0500 (EST) From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler , Liliana Marie Prikler Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. Date: Sat, 26 Feb 2022 14:55:59 -0500 Message-ID: <3566149.rYT2d9vS2d@bastet> In-Reply-To: <6a35fdea04cdf461a662830efc5bfd84fee60ec1.camel@gmail.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <19823080.dSP1spjjOr@bastet> <6a35fdea04cdf461a662830efc5bfd84fee60ec1.camel@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3472970.ViWdsapti3"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --nextPart3472970.ViWdsapti3 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Philip McGrath To: 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler , Liliana Marie Prikler Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , raingloom , Maxime Devos Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. Date: Sat, 26 Feb 2022 14:55:59 -0500 Message-ID: <3566149.rYT2d9vS2d@bastet> In-Reply-To: <6a35fdea04cdf461a662830efc5bfd84fee60ec1.camel@gmail.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <19823080.dSP1spjjOr@bastet> <6a35fdea04cdf461a662830efc5bfd84fee60ec1.camel@gmail.com> On Saturday, February 26, 2022 1:30:08 PM EST Liliana Marie Prikler wrote: > Hi, > > Am Samstag, dem 26.02.2022 um 12:23 -0500 schrieb Philip McGrath: > > Hi, > > > > On Saturday, February 26, 2022 9:26:29 AM EST Liliana Marie Prikler > > > > wrote: > > > I'm not talking about the generated file, but the procedure that > > > generates it. Special characters like dots and slash are still > > > pretty special in Scheme, even if they're allowed as identifiers. > > > > Do you mean A, B, C, and/or D of these: > > a > > > > > (replace 'configure > > > (lambda* (#:key inputs configure-flags #:allow-other- > > > keys) > > > (let* ((racket (search-input-file inputs > > > "bin/racket"))) > > > (apply invoke > > > racket > > > #$make-installation-layer.rkt ;; <--- A > > > `(,@configure-flags > > > ,(dirname (dirname racket)) > > > ,#$output)) > > > (invoke racket > > > "--config" (string-append #$output > > > "/etc/racket") > > > "-l" "raco" "setup" > > > "--no-user")))) > > > > > > [...] > > > > > > (define make-installation-layer.rkt ;; <--- B > > > (scheme-file > > > "make-installation-layer.rkt" ;; <--- C > > > `(module > > > make-installation-layer racket/base ;; <--- D > > > (require racket/cmdline > > > > or something else? > > The name in B is confusing imo, because it implies a procedure when it > is in fact a file. Of course, that'd affect A as well. The file name > in C does not matter too much, but should probably be matched with B to > some extent (but importantly keeping the .rkt extension even if we drop > it from B). I'm not sure if D is a function call or not, but if it's a > module name perhaps we should make it match B. > > Given that we pass configure-flags to this thing, how about "configure- > racket-layer", "configure-layer.rkt" or something along those lines? > "configure-layer.rkt" seems fine. I do see the potential for confusion about whether this was "making" an "installation-layer.rkt". (D is a module name and should for clarity match C without the suffix. Ultimately, for a module that is not a submodule, it is ignored and the name comes from context. This is an older way of writing modules that predates "#lang" (which would be inconvenient with `scheme-file`). Calling `read` with the appropriate parameters on the input "#lang racket/base 42" would produce the datum `(module anonymous-module racket/base (#%module-begin 42))`.) > > In particular, not to be dense, but B is not a function. > > Yeah, that's my bad for only skimming these and not paying too close > attention to brackets. The name itself implies a function, hence my > confusion. Looking at things closely would make me see more typos like > ";; workaroung Guile reader/printer:" > workaround. > Thanks. > > > > > I think some way to shorten those origins would do wonders in > > > > > terms > > > > > of the number of lines this patch adds. > > > > > > > > At one point, I had abbreviated the origins as something like: > > > > > > > > (REPO-SPEC SHA256 [COMMIT]) > > > > > > > > [...] > > > > > > I wouldn't do this inside of extract-package-source, but define a > > > one or two liner for adding specifically packages hosted on > > > racket's github. WDYT? > > > > > > > I wasn't sure about the trade-off between being slightly more > > > > cryptic > > > > than explicit origins, but a lot shorter. > > > > > > Note that the goal is not to code golf, but to be understandable. > > > When adding a bunch of origins as inputs, understandability suffers > > > by induced scrolling. > > > > I've done this, and it was a very good idea. In particular, it helped > > find some places where I hadn't switched to using `%racket-commit` > > once the release was tagged. > > That is better, but can still be improved. As hinted at in my comment > to your tree, origin snippets might be a better solution here unless > I'm missing something in the heat of the moment. Could you give an example of what you imagine the result might look like in use? E.g. (but I'm not sure this would really be an improvement): > (cons* > ... > libedit > racket-minimal > (append > (racket-package-sources > "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") > "2d" "2d-doc" "2d-lib") > (racket-package-sources > "algol60" (base32 "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") > '("algol60" ".")) > ...)) -Philip --nextPart3472970.ViWdsapti3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE9GWrrNY3rqwUFVXPygNjjfo/HHoFAmIahc8ACgkQygNjjfo/ HHrIfxAApQt8KeuiaXltoyLKUkwtufzJgzRmu0EYtKjKglt+g8RQfl7FoRWwmQq8 Ib2p+c4mCwiiwwfEmuSi+UfMf2ZjR76u+uAQbvPXEyCLOkMrD/JuUZd9LMuDuBbD 7aTGJbLKWgGaZQ1+ly22cvJ1vTR0uDKCiJlgGZBS2GjrXmRdoHjoeeCJCeT4Qb47 5dw8hjaNEKcPZuqP2A0/6ETqoIuUg4BdhUn4tYnFTfX8SLx2jLiXYTmDUrbpVh2k h0yeypVA0dU53RmZQ54ATGCHSyCpiZvm7kgvOffB2zVB4N+IB7TYlxIvjUdGeCIk 7C+U1RbdRvWAG4kUuOQ0hWCHhPOzPwfd3yNEubszMV6YZ2Vbrx7LdfMEfHXWfJ9S IaMJ8jCjZ3X0Ym98JsV9hLriZUvz/2OblyqaZZR0bpBXtaSANg8Plcme+hIz87Fd umnuoAC6oL9G+ZMXCkfh5r1CG8q2fWvHBUyRmw4BYVJpls7BWruf2GJQ87JtwIL2 ajsGuGcc/hwAZdT9iwTioFt5T9dslLGIhRsTt2fwxxXccz3Y+6DsFy58jJfbxUw5 J+BxJ+MkP3UFedIEnDk9BODApHpoE//OaXsyiddToe77o19cJHLwfSGMySCUk7sW +BoXmDzqcVPDLoBidR8b1B+DZGV+AAhw1zRWBwk0c5f1UHxLq/Q= =BixL -----END PGP SIGNATURE----- --nextPart3472970.ViWdsapti3-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 16:09:35 2022 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 21:09:35 +0000 Received: from localhost ([127.0.0.1]:56385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO4Jr-0000i8-BJ for submit@debbugs.gnu.org; Sat, 26 Feb 2022 16:09:35 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:46804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO4Jq-0000hv-4A for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 16:09:34 -0500 Received: by mail-wm1-f68.google.com with SMTP id p184-20020a1c29c1000000b0037f76d8b484so3744266wmp.5 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 13:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=dCYwVsvV/DKujusD3t2sGsUGjcNPE+s9I8fWLUG1cGk=; b=WL3YMghQreemp212XbQVagQ071eDXzT+0bMfb559mPzJfhwg1ASDAHc01lvqrj0y1u NSE2d9usX7J1Ioj/17cXXFBwhjFmf/xP2hT1aaDZubpOEfrEp3k5BxIsr9gSW8NwRiOp oknwb3ghZnaxE4K/FGrnRd/bAF3xUU4TkICz2kJ0ShCoS1Q68+4s56I0KCtRULoxQY48 Qvld2RpSrvZWOHy/I5febpHJHJEaGrFsfBqenSWZt3L9fy1zgouvB86KLcV4hN9eIFjc M5IhWmTfMcd14ia8tiecxH1l5aFc5O2DxSPDNZQNS3OAT2QyAz5aghlyDoOAu2we1NrJ yFQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=dCYwVsvV/DKujusD3t2sGsUGjcNPE+s9I8fWLUG1cGk=; b=mEFq3s1exp2kzqDFTDwimvcnYV+2KZ/k/Ch4NNqD2RBFXiUbm0NAcIqw3HBfbnsTgm 3w6VwKUqrEj0gGXbHQ/iayCVOPJ8sHEdCzJjcInRfZMBmPkj982yZYyx21L0zCQR8Hf4 eSqPSsxMfpxkuIVBY3R3kNZilYCa2vjjkrnw2QftWAXUdKwFZl5M2+CBz0u4MV5/5Is8 x7BG56Kj1jQGAZxZTR6JpEdwUjpkb64nA1H6b6FDKjzlASiITIlJ2TmqWQxv2P0T7Hje W/PIZ906gNbE2qgz281pFyqBe5S9kFRo7ZsLplKOWstCxirERa4puLBOb3QlX57G870r 9n1w== X-Gm-Message-State: AOAM533qhVziN2nDdl16iVBo+54iOTB83dY9xm6hQfSCv1Gg8D2mUcpX siDuQiTzuUWDMlw3M9aQEbo= X-Google-Smtp-Source: ABdhPJzotSwRLaJuHopAtkguhtdDnb7KYfos65BPPyI/UrP59J8L+XVLXzHOpELsXrqecM5XUvqi4w== X-Received: by 2002:a1c:4604:0:b0:381:139:e54e with SMTP id t4-20020a1c4604000000b003810139e54emr7812719wma.151.1645909768173; Sat, 26 Feb 2022 13:09:28 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id m18-20020a5d56d2000000b001edc00dbeeasm5709253wrw.69.2022.02.26.13.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 13:09:27 -0800 (PST) Message-ID: <2dc808eb7328149b3974d4dac50d3da1b8e4d416.camel@gmail.com> Subject: Re: [PATCH v5 03/22] gnu: racket: Use Git origins for Racket packages. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun , Liliana Marie Prikler Date: Sat, 26 Feb 2022 22:09:26 +0100 In-Reply-To: <3566149.rYT2d9vS2d@bastet> References: <20220220060610.178131-1-philip@philipmcgrath.com> <19823080.dSP1spjjOr@bastet> <6a35fdea04cdf461a662830efc5bfd84fee60ec1.camel@gmail.com> <3566149.rYT2d9vS2d@bastet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Am Samstag, dem 26.02.2022 um 14:55 -0500 schrieb Philip McGrath: > "configure-layer.rkt" seems fine. I do see the potential for confusion > about whether this was "making" an "installation-layer.rkt". configure-layer.rkt it is then :) > > > > > > I think some way to shorten those origins would do wonders in > > > > > > terms of the number of lines this patch adds. > > > > > > > > > > At one point, I had abbreviated the origins as something like: > > > > > > > > > >   (REPO-SPEC SHA256 [COMMIT]) > > > > > > > > > > [...] > > > > > > > > I wouldn't do this inside of extract-package-source, but define a > > > > one or two liner for adding specifically packages hosted on > > > > racket's github.  WDYT? > > > > > > > > > I wasn't sure about the trade-off between being slightly more > > > > > cryptic > > > > > than explicit origins, but a lot shorter. > > > > > > > > Note that the goal is not to code golf, but to be understandable. > > > > When adding a bunch of origins as inputs, understandability > > > > suffers > > > > by induced scrolling. > > > > > > I've done this, and it was a very good idea. In particular, it > > > helped > > > find some places where I hadn't switched to using `%racket-commit` > > > once the release was tagged. > > > > That is better, but can still be improved.  As hinted at in my > > comment > > to your tree, origin snippets might be a better solution here unless > > I'm missing something in the heat of the moment. > > Could you give an example of what you imagine the result might look > like in use? E.g. (but I'm not sure this would really be an > improvement): > > > (cons* > >  ... > >  libedit > >  racket-minimal > >  (append > >   (racket-package-sources > >    "2d" (base32 > > "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") > >    "2d" "2d-doc" "2d-lib") > >   (racket-package-sources > >    "algol60" (base32 > > "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") > >    '("algol60" ".")) > >   ...)) I'd write this as  --8<---------------cut here---------------start------------->8--- (list ... libedit racket-minimal (simple-racket-origin "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") '("2d" "2d-doc" "2d-lib") (simple-racket-origin "algol60" (base32 "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") '("algol60" ".") ...) --8<---------------cut here---------------end--------------->8--- I do wonder whether these packages can further be modularized (i.e. so that they build as packages) with configure-layer.rkt acting as a profile hook and some racket meta package simply adding racket-minimal and all the base stuff into the profile, but for now let's just have an easy way of formulating origins. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:35:42 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:35:42 +0000 Received: from localhost ([127.0.0.1]:56518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9PR-00047j-N1 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:35:41 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:39538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9PP-00047U-Pw for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:35:40 -0500 Received: by mail-qv1-f53.google.com with SMTP id a1so9817159qvl.6 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:35:39 -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=jd3v/tVuIc7hYmsVoxmEs4oIVaOgDaXFYoxTxRSvXrs=; b=LSFmDOrCY68CATT5JSk/0iQ4/y0l4EDUcT4F8ES77I9w8DUUgSRsytc5KrUqGLfisG gb2t6RMZoDvQ9VOM2YAZEAeenZlcPOhOOvQVoxxCPC0FFVjtwaCZ6ipi31Kp+8MT92g1 +HPfS9qvJrlFmgyYWsCNusU4A7AY+oQNBU35WUu6SIEkWE7uIKVqwl/1rfKaXXTutumI 9TNQIANI79D41oMtxKQUlCPKseHL0vxn1avKNtFXsVehmM8I9ViKscYbfZHW3J9/FyzN mbbagcxT+9RhvAoSx3ByXvFKm/9ViDHWvT/By/CT7ZaO8ZoNyo8iKJNsDtnUbREFZlEC bu8A== 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=jd3v/tVuIc7hYmsVoxmEs4oIVaOgDaXFYoxTxRSvXrs=; b=AbMcpXrVEaCGxBFJ90GodYgwVoh8ID1AXniAzVWa6IIakRtZmtUi3Lm1wrzpmsGtzE YwN+fHVuRr7CWzFZMGyUQEa11vNo08aQ3GOUcj4DCzqP4vy/DhNvSW06rrmBdLlTVd4E bOVE8uGvxiADbR3ioeMCSESa4lQSMJ3RR+iiC8F//wdQzX/zAMxH/9I9eYeBrmtaeBbX q/KfxxgrkacEJUSFjxldbGIleV2iuP7bWRBnlCHZuwY4+swJVekcEni9JuTN0AwljDSs 3G1VN5EFNjtrWfu7Gpqa6b1yWpJQ/tEfHPDuzyY9DuNRzLhn7U1k680nChpNZ1wq+SMd leCg== X-Gm-Message-State: AOAM530GFg7Usy1/suPa1N4YkWr/BMm1MEsJjwTzAcvDEeQhEOIK+p+8 4xNxxmJHH2avqRjtqRc/u/p+Pyun9K9hMT+Qcik= X-Google-Smtp-Source: ABdhPJybWQIyIaA3p6j7U+sYgr45BBY0Y2gTE7SMEwj6uX87CCeEy2i/CAgoBnkcXSwmB+btM5WJ4A== X-Received: by 2002:a0c:ebcf:0:b0:432:deca:eae8 with SMTP id k15-20020a0cebcf000000b00432decaeae8mr5222709qvq.43.1645929333923; Sat, 26 Feb 2022 18:35:33 -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 de18-20020a05620a371200b00662cf4b5631sm1270827qkb.23.2022.02.26.18.35.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:35:33 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 00/24] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sat, 26 Feb 2022 21:34:26 -0500 Message-Id: <20220227023450.1877215-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Here is v6, reflecting (I hope) Liliana's suggestions. Compared to v5: Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.53 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.53 listed in list.dnswl.org] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Here is v6, reflecting (I hope) Liliana's suggestions. Compared to v5: Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.53 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.53 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hi, Here is v6, reflecting (I hope) Liliana's suggestions. Compared to v5: - The first two patches are the same. - Patch 03 uses "configure-layer.rkt" rather than "make-installation-layer.rkt", fixes a typo, and uses 'racket-packages-origin' and 'simple-racket-origin' rather than 'extract-package-source{,*}'. - Patch 04 has a typo fix. - Patch 05 is the same. - Patch v6 06/24 is like v5 06/22, but with a smaller diff, because it avoids changing indentation. - Patch v6 07/24 makes the indentation changes that were part of v5 06/22. - Patches 08/24 through 13/24 are like v5 07/22 through 12/22. - Patch v6 14/24 includes only the style changes from v5 13/22. - Patch v6 15/24 is the substantive part of v5 13/22. - Patches 16/24 through 24/24 correspond to v5 14/22 through 22/22. Thanks! -Philip Philip McGrath (24): gnu: Use license prefix in (gnu packages racket). gnu: racket: Update to 8.4. gnu: racket: Use Git origins for Racket packages. gnu: racket-minimal: Use new package style. gnu: racket-minimal: Don't configure non-existant catalogs. gnu: racket-minimal: Change inheritance to follow bootstrapping. gnu: racket-minimal: Adjust indentation. gnu: racket-minimal: Add "debug" output. gnu: configure-layer.rkt: Adjust indentation. gnu: racket-minimal: Separate from the Racket VM. gnu: racket: Move Chez bootfiles to (gnu packages chez). gnu: chez: Add utilities for Chez machine types. gnu: racket: Add 'racket-vm-for-system'. gnu: chez-scheme: Use new style for Chez packages. gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-scheme: Use new package style. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: chez-mit: Support chez-scheme-for-racket. gnu: Add chez-scheme-for-racket. gnu: chez: Add 'chez-scheme-for-system'. gnu: racket-vm-cs: Build with "--enable-scheme". gnu/local.mk | 4 +- gnu/packages/chez.scm | 1264 ++++++++++----- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- .../racket-enable-scheme-backport.patch | 465 ++++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1433 +++++++++++------ 7 files changed, 2342 insertions(+), 854 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:36:10 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:36:10 +0000 Received: from localhost ([127.0.0.1]:56522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Pu-000490-1r for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:36:10 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:43844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Ps-00048l-JJ for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:36:09 -0500 Received: by mail-qv1-f49.google.com with SMTP id c14so4981308qvk.10 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:36:08 -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=im2eB4m2cw9htGdEwc+CW/YqzVpAKz+5GUbS5TUWUbs=; b=FxcuJwzjOPe9i0MYOx77iiv0/7P5cm+amd/JRO6g0v21tXidN2JdbpE5KMbqrkZB93 zyfdoFspyoVu0UcnzxtyjFaMhob1OAU4VGQFnbDw9xHU38AN46b7Xu7x/YZfgY8SiLcr 7VtpPwmCroIPkSGqRoQIGm/RJutkVFJ57CaUE3EdO5m40xAYDSp0A8mONDvP9fVKFcDM deFeGU6Mc4U3Ta1TmWxfzcF6kUoZqPqZmf4E5rtwHMSnln1iUId+Kc1jJrr9m6TUmbwa ySyu8vAevpgJiEakWH2i4+oEM9FdrEzn3yJRbfGeZsmn01XNGWYDjAhQuJBQi0/WgAkH xJOw== 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=im2eB4m2cw9htGdEwc+CW/YqzVpAKz+5GUbS5TUWUbs=; b=2tAmZjooQyOW6C+Og3/wt0J5cABuyK3deLcHCWKEAPKYJUvEySeH+PpqhaTRQ2dcRZ BepLAWG0N5PRr3tuznyOj1XNE5AtXcdZXGyK6g/mOY2roqK5QSA+Qp8d1m95i0JxzQ4+ Dux+ASmLlenMFJjT1pE4+tKTj4zkLgxW5gvPHSL8wVLAe3Wrdg7BoVFW+cCF5KPiNe8Z XEV2aSgT4ipvrN4yY+4pNGOZgYkpyAnUUgolfGgOQ1P+sBpSMPjGeOskfHqpbe86ZFK8 Cp7yhcstQG00toM7LLmMQ9B0d6An8/1JdHYr9GgX81klN0JtlBAPvig26ViJbkv3tBZL KT8A== X-Gm-Message-State: AOAM532fWBRIheYn1nN9NS+HreVaI9KP4GEarVUZAEzUP/VUGEtbLuoV KvTaz/65gvhpGk2w6yii36kAkfnHRdouibkxSSg= X-Google-Smtp-Source: ABdhPJy4dreQVWSX4vqmFvrdkiSHEddY4OtklRVwJd0QU/AtQq+FAEZiXcMM3jC9FXx/8QxPTtHqUg== X-Received: by 2002:ad4:4ea7:0:b0:42c:b235:aa7 with SMTP id ed7-20020ad44ea7000000b0042cb2350aa7mr10610157qvb.19.1645929362908; Sat, 26 Feb 2022 18:36:02 -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 o1-20020a37be01000000b00648eadafd9bsm3269463qkf.24.2022.02.26.18.35.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:36:02 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 01/24] gnu: Use license prefix in (gnu packages racket). Date: Sat, 26 Feb 2022 21:34:27 -0500 Message-Id: <20220227023450.1877215-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-minimal, racket-minimal-bc-3m, racket-bootstrap-chez-bootfiles): Use license prefix. --- gnu/packages/racket.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 d [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.49 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.49 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-minimal, racket-minimal-bc-3m, racket-bootstrap-chez-bootfiles): Use license prefix. --- gnu/packages/racket.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 d [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.49 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.49 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (racket-minimal, racket-minimal-bc-3m, racket-bootstrap-chez-bootfiles): Use license prefix. --- gnu/packages/racket.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d0a5ca494b..ec9e836a4c 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -21,8 +21,6 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages racket) - #:use-module ((guix licenses) - #:select (asl2.0 expat lgpl3+)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -47,7 +45,8 @@ (define-module (gnu packages racket) #:use-module (gnu packages multiprecision) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) #:prefix license:)) ;; Commentary: ;; @@ -254,7 +253,7 @@ (define (write-racket-hash alist) DrRacket IDE, are not included.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list asl2.0 expat)))) + (license (list license:asl2.0 license:expat)))) (define-public racket-minimal-bc-3m @@ -295,7 +294,7 @@ (define-public racket-minimal-bc-3m collector, 3M (``Moving Memory Manager'').") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list lgpl3+ asl2.0 expat))))) + (license (list license:lgpl3+ license:asl2.0 license:expat))))) (define-public racket-minimal-bc-cgc @@ -372,7 +371,7 @@ (define-public racket-bootstrap-chez-bootfiles 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.") - (license (list asl2.0))))) + (license (list license:asl2.0))))) (define %installer-mirrors -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:36:37 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:36:37 +0000 Received: from localhost ([127.0.0.1]:56526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9QA-00049Y-E9 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:36:36 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:39765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Q5-00049F-Kq for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:36:25 -0500 Received: by mail-qk1-f177.google.com with SMTP id t21so7814228qkg.6 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:36:21 -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=z0pcZSlzKw/cUO7uj/U8mdQ+2/FnmZU2cO/RKK1LnLk=; b=Wa35XZjEZem08focqe0Ut7w/dEkavHRD/sRPtIo3CeKYX90fJXNlVjeiehdDVaaGyv 4CxgwfaK4T8Ndsfwb1WiDOF9C1DyUz7gZ2EpbthTVQ9LAKvn02WdPQerauWK+6NDwsaw GKAhjHuM0J+X9Xyfz7qCWiBGJkY9os2QeiDG9k2LEdXEfTOypo4J5Rwzxdl+GQ9bsZRp nKi9pFJ9czk4qNA1nLnK4+544r6f4SgUEvFKW8BpCsxJst0k16WgRF+Lzk/3hjuUchRt ljE51ZaZNmqbE3mJWOCcXXqbu5qRbIF+6/qgSpB7QNdFD7ihYASU8cp6+OJDXU5kBChZ vLYw== 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=z0pcZSlzKw/cUO7uj/U8mdQ+2/FnmZU2cO/RKK1LnLk=; b=Eln86fAz7m+YtwfZXsGo3IjkVWwEL2nZep9EgQHabnO9Kn8m3V6Ar0K7rgeEt30LR4 oM7s5b0owdeiXfzZ8lpjPUWupTvilNq3pSrm6W36PoiHp1ACdURzwYbCvYpi9gA6F9xT ipYpDKWMyST2fTfWOWazYu97Ac4amjthN4DQ54hQSWqgFrittIZzsRRh/cUc09RsBUzI rJDJmcSdd8xN9cW4i/sn2oOziu7twNHw3Okh4StoPYdfh1zhjr9Aiaf5k015zLUeJtqz 079yiEb6/8CQadsmVCHqmTPHkpjPUgSCQTbPI2S5f18imdWupCrk+WmV/oEN3BflBKZk si9A== X-Gm-Message-State: AOAM530HMWAhQaRZzzNlxHk/2Vk6Z2szhXDmRjJ0WsouMvJzNdz1MbXf teVpJUN218cTqgc3Z5hBCkDflyCw31dXbZD7oms= X-Google-Smtp-Source: ABdhPJz8sqXUcvQiDISwbnTVOQlVfP+JMnvgzWygB25fVHy9t7OPdnK9EtzL2k5JzE8zY3WcR590YA== X-Received: by 2002:a05:620a:2981:b0:649:68a4:e4ea with SMTP id r1-20020a05620a298100b0064968a4e4eamr7672506qkp.462.1645929375445; Sat, 26 Feb 2022 18:36:15 -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 v26-20020a05620a0a9a00b00605c6dbe40asm3167325qkg.87.2022.02.26.18.36.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:36:15 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 02/24] gnu: racket: Update to 8.4. Date: Sat, 26 Feb 2022 21:34:28 -0500 Message-Id: <20220227023450.1877215-3-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/ra [...] Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.177 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.177 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/ra [...] Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/racket.scm (%racket-version): New variable. (%racket-commit): New variable. (%racket-origin): New variable. [patches]: Add "racket-enable-scheme-backport.patch". (racket-minimal): Update to 8.4. [version]: Use '%racket-version'. [source]: Use '%racket-origin'. [inputs]: Add 'ncurses'. Remove 'zlib:static' and 'lz4:static'. (racket-minimal-bc-3m)[inputs]: Adjust accordingly. (racket-bootstrap-chez-bootfiles)[version]: Use Chez Scheme's '(scheme-fork-version-number)'. (racket)[version]: Use '%racket-version'. [native-inputs]: Use '%racket-origin'. [source]: Update to 8.4. : Use "racket-gui-tethered-launcher-backport.patch". : Remove "srfi-doc-nonfree". --- gnu/local.mk | 4 +- .../racket-enable-scheme-backport.patch | 465 ++++++++++++++++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 99 ++-- 4 files changed, 557 insertions(+), 37 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index 98f2d4ac30..cf34905431 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright © 2020 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan -# Copyright © 2021 Philip McGrath +# Copyright © 2021, 2022 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher # Copyright © 2021 Dmitry Polyakov @@ -1749,6 +1749,8 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-enable-scheme-backport.patch \ + %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch new file mode 100644 index 0000000000..3a5a4a3d82 --- /dev/null +++ b/gnu/packages/patches/racket-enable-scheme-backport.patch @@ -0,0 +1,465 @@ +From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 10:36:09 -0700 +Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` + +(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) + +(Fixed conflicts by dropping pbchunks and pbarch changes.) +--- + racket/src/ChezScheme/configure | 15 ++++++++++++++- + racket/src/ChezScheme/s/Mf-base | 4 ++-- + racket/src/ChezScheme/s/Mf-cross | 4 +++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 4515ffc105..0098829091 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -45,6 +45,7 @@ threads=yes + nothreads=no + temproot="" + help=no ++forceworkarea=no + gzipmanpages=yes + installowner="" + installgroup="" +@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do + --pb) + pb=yes + ;; ++ --force) ++ forceworkarea=yes ++ ;; + --installprefix=*) + installprefix=`echo $1 | sed -e 's/^--installprefix=//'` + ;; +@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then + echo " --toolprefix= prefix tool (compiler, linker, ...) names" + echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" + echo " --workarea= build directory ($w)" ++ echo " --force configure even without boot files" + echo " CC= C compiler" + echo " CPPFLAGS= C preprocessor flags" + echo " CFLAGS= C compiler flags" +@@ -721,8 +726,16 @@ case "${flagsmuni}" in + ;; + esac + ++if [ "$w" = "$m" ] ; then ++ configuringin="" ++else ++ configuringin=" in $w" ++fi ++ + if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then +- echo "Configuring for $m" ++ echo "Configuring for $m$configuringin" ++elif [ "$forceworkarea" = yes ] ; then ++ echo "Configuring for $m$configuringin despite missing boot files" + else + if [ "$m" = "" ] ; then + maybem="" +diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base +index cc6178c973..1f4a967998 100644 +--- a/racket/src/ChezScheme/s/Mf-base ++++ b/racket/src/ChezScheme/s/Mf-base +@@ -94,7 +94,7 @@ endif + # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme + # implementation + Scheme = ../bin/$m/scheme${ExeSuffix} +-export SCHEMEHEAPDIRS=../boot/%m ++export SCHEMEHEAPDIRS=../boot/$m + export CHEZSCHEMELIBDIRS=. + + # Define the libdirs separator character +@@ -691,4 +691,4 @@ reset-one: + + .PHONY: run + run: +- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) ++ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) +diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross +index d796cbb459..397af59a28 100644 +--- a/racket/src/ChezScheme/s/Mf-cross ++++ b/racket/src/ChezScheme/s/Mf-cross +@@ -43,5 +43,7 @@ x$(xm).$(m): + $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch + mv xpatch x$(xm).$(m) + ++ifneq ($(SCHEMEHEAPDIRS),:) + # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed +-nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++endif +-- +2.32.0 + + +From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 11:03:30 -0700 +Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable + +When the same Chez Scheme version as used by Racket is already +available, then `--enable-scheme=...` can supply an executable. For +cross builds, `--enable-scheme=...` can still supply a build +directory, instead, as before. + +(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) +--- + racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ + racket/src/README.txt | 30 +++++++++++--- + racket/src/configure | 8 +++- + racket/src/cs/README.txt | 6 ++- + racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- + racket/src/cs/c/configure | 24 +++++++++-- + racket/src/cs/c/configure.ac | 21 ++++++++-- + 7 files changed, 112 insertions(+), 24 deletions(-) + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index c396efc851..3998ef9ccd 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -59,6 +59,9 @@ reset: + %.boot: + (cd $(workarea) && $(MAKE) $*.boot) + ++auto.boot: ++ (cd $(workarea) && $(MAKE) $(defaultm).boot) ++ + # .bootquick to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine +diff --git a/racket/src/README.txt b/racket/src/README.txt +index 98647aebce..d77310b4a4 100644 +--- a/racket/src/README.txt ++++ b/racket/src/README.txt +@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of + ======================================================================== + + Cross-compilation requires at least two flags to `configure`: ++`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) ++`--enable-scheme-SCHEME`. ++ ++More information: + + * `--host=OS`, where OS is something like `i386-gnu-linux` to + indicate the target platform. +@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: + run `configure` again (with no arguments) in a "local" subdirectory + to create a build for the current platform. + +-An additional flag is needed for building Racket CS, unless the flag +-`--enable-racket=auto` is used: +- +- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" +- directory where Chez Scheme is built for the host system. ++ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable ++ executable that runs on the build platform; the executable must be ++ the same version as used in Racket built for the target platform. ++ ++ Supplying `--enable-scheme=DIR` is also supported in cross-build ++ mode, where DIR is a path that has a "ChezScheme" directory where ++ Chez Scheme is built for the host system. ++ ++The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are ++allowed for non-cross builds, too: ++ ++ * For Racket CS, supplying either selects a Racket or Chez Scheme ++ implementation used to create boot files to the build platform. ++ Suppling Chez Scheme is a much more direct path, but when Racket is ++ supplied, its version does not have to match the version being ++ built. ++ ++ * For Racket BC, `--enable-racket=RACKET` selects a Racket for ++ prepare C sources to cooperate with garbage collection. Its version ++ needs to be close to the one being built, and potentially exactly ++ the same version. + + Some less commonly needed `configure` flags are for Racket BC: + +diff --git a/racket/src/configure b/racket/src/configure +index c9f3ba4419..1b53ec7ce2 100755 +--- a/racket/src/configure ++++ b/racket/src/configure +@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" + use_cs=maybe + use_bc=maybe + supplied_racket=no ++supplied_scheme=no + enable_boothelp= + + # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, +@@ -34,6 +35,9 @@ for arg in $*; do + --enable-racket=*) + supplied_racket=yes + ;; ++ --enable-scheme=*) ++ supplied_scheme=yes ++ ;; + --help | -h) + echo $0: + echo see --help-bc or --help-cs, since the Racket CS build and the +@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then + fi + + if test "$use_cs" = "yes" ; then +- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then +- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly ++ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then ++ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly + exit 1 + fi + +diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt +index 2ece417b78..8e6fc57b74 100644 +--- a/racket/src/cs/README.txt ++++ b/racket/src/cs/README.txt +@@ -39,6 +39,11 @@ build: + installed in the "../ChezScheme/boot/pb" directory as described by + "../ChezScheme/BUILDING". + ++ Supplying `--enable-scheme=...` is also an option if you alerady ++ have the same version of Chez Scheme built on the current platform. ++ Another build will be created, anyway, but more quickly than ++ without Chez Scheme. ++ + * Racket is needed to generate the files in the "schemified" + directory from the sources in sibling directories like "../io". The + Racket version must be practically the same as the current Racket +@@ -48,7 +53,6 @@ build: + Unlike Chez Scheme boot files, the files generated in "schemified" + are human-readable and -editable Scheme code. That provides a way + out of bootstrapping black holes, even without BC. +- + + + ======================================================================== +diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in +index 54a644a1d9..d73993f0fc 100644 +--- a/racket/src/cs/c/Makefile.in ++++ b/racket/src/cs/c/Makefile.in +@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ + SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) + SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme + SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) +-SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_existing = @MAKE_SCHEME_SCHEME@ ++SCHEME = $(SCHEME@USE_SCHEME_MODE@) + + TARGET_MACH = @TARGET_MACH@ + SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) +@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. + @INCLUDEDEP@ @srcdir@/../../version/version.mak + + cs: +- $(MAKE) scheme@T_CROSS_MODE@ ++ $(MAKE) scheme@MAKE_SCHEME_MODE@ + $(MAKE) racket-so + cd rktio; $(MAKE) + $(MAKE) racketcs +@@ -121,9 +123,13 @@ racket-so: + + RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ + ++TARGET_MACH_built = $(TARGET_MACH) ++TARGET_MACH_existing = xc-$(TARGET_MACH) ++XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch ++ + CS_PROGS = SCHEME="$(SCHEME)" + CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ +-CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" ++CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" + PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" + + build-racket-so: +@@ -163,6 +169,15 @@ pb-bootquick: + cd $(SCHEME_WORKAREA) && $(MAKE) reset + $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) + ++scheme-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot ++ $(MAKE) mach-make ++ ++$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: ++ mkdir -p $(SCHEME_WORKAREA) ++ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" ++ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all ++ + mach-make: + $(MAKE) config-scheme + cd $(SCHEME_WORKAREA) && $(MAKE) +@@ -182,24 +197,33 @@ config-scheme: + + scheme-cross: + env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt ++ $(MAKE) finish-scheme-cross ++ ++finish-scheme-cross: + $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) + cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) + cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t +- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch ++ $(MAKE) $(XPATCH_FILE) ++ ++scheme-cross-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) ++ $(MAKE) finish-scheme-cross + + # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older +-# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files +-XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ +- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot ++# than the build- use as Racket for build; or "auto" to create +- --enable-scheme= use as host's build directory for cross ++ --enable-scheme= use as host build for cross + --enable-mach= use Chez Scheme machine type + --enable-target= cross-build for Chez Scheme machine type + --enable-portable prefer portable to host-specific +@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" + show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' + + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + show_explicitly_enabled "${enable_portable}" "portable" +@@ -4745,9 +4748,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags + + + ++ ++ ++ + + + +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 464ebe1760..aaee88156d 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev + AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) + m4_include(../ac/path_arg.m4) + AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket for build; or "auto" to create]) +-AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host's build directory for cross]) ++AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host build for cross]) + AC_ARG_ENABLE(mach, [ --enable-mach= use Chez Scheme machine type ]) + AC_ARG_ENABLE(target, [ --enable-target= cross-build for Chez Scheme machine type ]) + m4_include(../ac/portable_arg.m4) +@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" + show_explicitly_enabled "${enable_xonx}" "Unix style" + m4_include(../ac/path_show.m4) + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + m4_include(../ac/portable_show.m4) +@@ -504,9 +504,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) + AC_SUBST(CROSS_MODE) + AC_SUBST(T_CROSS_MODE) + AC_SUBST(TT_CROSS_MODE) ++AC_SUBST(MAKE_SCHEME_MODE) ++AC_SUBST(MAKE_SCHEME_SCHEME) ++AC_SUBST(USE_SCHEME_MODE) + AC_SUBST(SETUP_BOOT_MODE) + AC_SUBST(OSX) + AC_SUBST(NOT_OSX) +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch new file mode 100644 index 0000000000..abf253486f --- /dev/null +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -0,0 +1,26 @@ +From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Mon, 31 Jan 2022 15:31:22 -0700 +Subject: [PATCH] fix creation of tethered launchers + +Related to racket/racket#4133 + +(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) +--- + share/pkgs/gui-lib/mred/installer.rkt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt +index b1691472..9ef06c53 100644 +--- a/share/pkgs/gui-lib/mred/installer.rkt ++++ b/share/pkgs/gui-lib/mred/installer.rkt +@@ -72,4 +72,5 @@ + (list "-A" (path->string (find-system-path 'addon-dir))))) + + (define (config-flags) +- (list "-G" (path->string (find-config-dir)))) ++ (list "-X" (path->string (find-collects-dir)) ++ "-G" (path->string (find-config-dir)))) +-- +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index ec9e836a4c..00ec587eeb 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -43,6 +43,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages libedit) #:use-module (gnu packages libffi) #:use-module (gnu packages multiprecision) + #:use-module (gnu packages ncurses) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) #:use-module (gnu packages xorg) @@ -95,6 +96,41 @@ (define-module (gnu packages racket) ;; ;; Code: +(define %racket-version "8.4") +;; ^ Remember to update racket-bootstrap-chez-bootfiles! +(define %racket-commit + (string-append "v" %racket-version)) +(define %racket-origin + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racket") + (commit %racket-commit))) + (sha256 + (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (file-name (git-file-name "racket" %racket-version)) + (patches (search-patches "racket-minimal-sh-via-rktio.patch" + ;; Remove by Racket 8.5: + "racket-enable-scheme-backport.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + (use-modules (guix build utils)) + ;; Unbundle Chez submodules. + (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 + ;; without cyclic issues. + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib"))) + ;; Unbundle libffi. + (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + (define cfg-flag:sh-for-rktio `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" (assoc-ref %build-inputs "sh") @@ -128,41 +164,17 @@ (define src (define-public racket-minimal (package (name "racket-minimal") - (version "8.3") ; note: remember to also update racket! - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit (string-append "v" version)))) - (sha256 - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") - (file-name (git-file-name name version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) - (modules '((guix build utils))) - (snippet - (with-imported-modules '((guix build utils)) - #~(begin - ;; Unbundle Chez submodules. - (with-directory-excursion "racket/src/ChezScheme" - ;; Remove bundled libraries (copied from 'chez-scheme'). - (for-each delete-file-recursively - '("stex" - "nanopass" - "lz4" - "zlib"))) - ;; Unbundle libffi. - (delete-file-recursively "racket/src/bc/foreign/libffi")))))) + (version %racket-version) + (source %racket-origin) (inputs `(;; common to all racket-minimal variants: ("openssl" ,openssl) ("sqlite" ,sqlite) - ("sh" ,bash-minimal) + ("sh" ,bash-minimal) ;; <- for `system` + ("ncurses" ,ncurses) ;; <- for #%terminal ;; only for CS ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static"))) + ("lz4" ,lz4))) (native-inputs `(("bootfiles" ,racket-bootstrap-chez-bootfiles) ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) @@ -263,9 +275,8 @@ (define-public racket-minimal-bc-3m (name "racket-minimal-bc-3m") (inputs (modify-inputs (package-inputs racket-minimal) - (delete "zlib" "zlib:static" "lz4" "lz4:static") - (prepend libffi ;; <- only for BC variants - ))) + (prepend libffi) ;; <- only for BC variants + (delete "zlib" "lz4"))) (native-inputs `(("libtool" ,libtool) ("racket" ,(if (%current-target-system) @@ -327,6 +338,11 @@ (define-public racket-bootstrap-chez-bootfiles (package (inherit racket-minimal) (name "racket-bootstrap-chez-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. (inputs `()) (native-inputs `(("racket" ,(if (%current-target-system) @@ -416,7 +432,7 @@ (define-public racket (package (inherit racket-minimal) (name "racket") - (version (package-version racket-minimal)) ; needed for origin uri to work + (version %racket-version) (source (origin (method url-fetch) @@ -425,7 +441,11 @@ (define-public racket %installer-mirrors)) (sha256 (base32 - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) + "0dsv7br85nvh5gjfihznq9jb1dzas0f6gnv5qwc9zmb7yn75nrp5")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) (snippet #~(begin (use-modules (guix build utils) @@ -442,7 +462,14 @@ (define-public racket (with-directory-excursion "share/pkgs" (for-each delete-file-recursively '#+%main-repo-main-distribution-pkgs)) - #t)))) + ;; Minimal workaround for FSDG issue: + ;; see . + ;; We will backport a better fix once we use Git + ;; origins for Racket packages. + (delete-file-recursively "share/pkgs/srfi-doc-nonfree") + (substitute* "share/pkgs/srfi/info.rkt" + (("\"srfi-doc-nonfree\"") + "")))))) (inputs `(("cairo" ,cairo) ("fontconfig" ,fontconfig) @@ -461,7 +488,7 @@ (define-public racket (native-inputs `(("racket" ,racket-minimal) ("extend-layer" ,extend-layer) - ("main-repo" ,(package-source racket-minimal)))) + ("main-repo" ,%racket-origin))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:36:45 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:36:45 +0000 Received: from localhost ([127.0.0.1]:56529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9QN-00049z-0U for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:36:45 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:33651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9QK-00049f-KJ for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:36:38 -0500 Received: by mail-qt1-f171.google.com with SMTP id bt3so6087878qtb.0 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:36:36 -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=P8SOnIgvEN/0r3Bf4tS0jhH2DUB199lAJxBXeywbOYA=; b=QNzIQ6xrG0BCSr6/2YJFKMaibAV54UNhUzHaeih3zScK3qLjjjwLK/N9KQfu9AIU3t X+HvOJrQJTlhE0Bg+zUPbyP8kO9J6v8sDYHlqiRYlBe6Ld0UfkFsPHu60Ow9g1/bQOfu +JY0pX9ssksbZ2DAtT8nBAHvMb09iZ68FmPc2BmV+wH4k/Vq3l4KDfuhb5NNm64tQEC2 8xP0BLorbcBmemGzsJC5Xjbzn8B0n5A0u2Kq0ABknH6Iv9U4QTohZWAvzxL0vIxYwrgU JaMFwSsdpx6baK0LYxCSOGaWVA1yusTjqPGgn0vkbExmyXK2ld34Y+1nIB5hLXWUQfIX Hx1A== 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=P8SOnIgvEN/0r3Bf4tS0jhH2DUB199lAJxBXeywbOYA=; b=PDCKKi4qfVpmqbwmj2s8mr6K19GfMXM38neJETcZwuQJCe25vFCoF7zWVxTm5tcBg4 Do3eulkSx1a8IANcZQKtw6nj/cy0XeivqbIGkAswgpc1toz3Z85zY/g7sNFRUmhK13Z+ EIMyiqt6k40tmSwRCvKYwgzdwUu0fQ6XfK1hVbotOKZqCWuwKip/lRcMrXhMIKahzsea zwCI6H1tqQ43Ur3nHjBx18IUZkJE1wrh2ufb4S61c6T33XGk3By5ywr8HK/c2gXRoxMw NBPeBo5VNw+MHB+bqa9hWkjXfPt9sSXq8iXfmsOe5eaPqBy2zXro29mOWENMCHNlHgSK 9IOA== X-Gm-Message-State: AOAM530s45ZTg/C32scISSND8Q4aw+BUJV8WVXSXEQYGcdUT43+1PM24 XFV9KcH+/d4P5x15YbmdmvJYw3UC7wYHwqn/fz4= X-Google-Smtp-Source: ABdhPJykVMOsCAmUVcMcO+Sd0rWRBW3Bvrtrz0W6hq0lW2MxNYFFgPwkcRU70VnhApfxuCheLs3KgQ== X-Received: by 2002:a05:622a:314:b0:2de:766:edf4 with SMTP id q20-20020a05622a031400b002de0766edf4mr12197949qtw.651.1645929390584; Sat, 26 Feb 2022 18:36:30 -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 20-20020ac84e94000000b002de8f564305sm4561744qtp.1.2022.02.26.18.36.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:36:30 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 03/24] gnu: racket: Use Git origins for Racket packages. Date: Sat, 26 Feb 2022 21:34:29 -0500 Message-Id: <20220227023450.1877215-4-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: Adjust path. * gnu/packages/racket.scm (racket-packages-origin, simple-racket-origin): New procedures. (extend-layer): Rename to ... [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.171 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.171 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: Adjust path. * gnu/packages/racket.scm (racket-packages-origin, simple-racket-origin): New procedures. (extend-layer): Rename to ... [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: Adjust path. * gnu/packages/racket.scm (racket-packages-origin, simple-racket-origin): New procedures. (extend-layer): Rename to ... (configure-layer.rkt): ... this variable. Tweak command-line arguments. Adapt to 'config-tethered-apps-dir'. (racket): Stop inheriting from 'racket-minimal'. [version]: Use '%racket-version'. [source]: Stop using bundled tarball. [inputs]: Remove labels. Add 'racket-minimal' and package sources. [native-inputs]: Remove, since cross-compilation doesn't work yet. [arguments]: Rewrite to use G-expressions, package sources from 'inputs', an explicit 'install' phase, and the revised 'configure-layer.rkt'. --- ...acket-gui-tethered-launcher-backport.patch | 6 +- gnu/packages/racket.scm | 714 +++++++++++++----- 2 files changed, 539 insertions(+), 181 deletions(-) diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch index abf253486f..1e018eaa79 100644 --- a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -7,13 +7,13 @@ Related to racket/racket#4133 (cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) --- - share/pkgs/gui-lib/mred/installer.rkt | 3 ++- + gui-lib/mred/installer.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt index b1691472..9ef06c53 100644 ---- a/share/pkgs/gui-lib/mred/installer.rkt -+++ b/share/pkgs/gui-lib/mred/installer.rkt +--- a/gui-lib/mred/installer.rkt ++++ b/gui-lib/mred/installer.rkt @@ -72,4 +72,5 @@ (list "-A" (path->string (find-system-path 'addon-dir))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 00ec587eeb..c4e5ee1311 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -28,7 +28,9 @@ (define-module (gnu packages racket) #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 exceptions) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) @@ -389,172 +391,504 @@ (define-public racket-bootstrap-chez-bootfiles Chez Scheme.") (license (list license:asl2.0))))) +(define (racket-packages-origin name origin spec0 . spec*) + "Extract from ORIGIN the sources for the Racket packages specified by SPEC0 +and any additional arguments SPEC*. In the resulting file-like object, each +package's source will be in the directory \"/share/racket/pkgs/PKG/\", where +PKG is the Racket name for the package. The NAME will be used in the store +file name for the resulting file-like object. -(define %installer-mirrors - ;; Source: - ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58 - ;; Matthew Flatt says: "note that many are commented out" - ;; INVARIANT: End with a trailing "/"! - '("https://mirror.racket-lang.org/installers/" - "https://www.cs.utah.edu/plt/installers/" - "https://plt.cs.northwestern.edu/racket-mirror/" - "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" - ;; Universität Tübingen is using a self-signed HTTPS certificate: - "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" - "https://racket.infogroep.be/" - )) +A package specification is a list of the form: -(define %main-repo-main-distribution-pkgs - ;; These are the packages developed in the main Racket Git repository - ;; that are part of the main distribution. - '("at-exp-lib" - "base" - "compiler-lib" - ;; NOT "compiler-test" - "compiler" - "net-doc" - "net-lib" - ;; NOT "net-test" - "net" - ;; NOT "plt-services" - ;; NOT "racket-benchmarks" - ;; NOT "racket-build-guide" - "racket-doc" - "racket-index" - "racket-lib" - ;; NOT "racket-test-core" - ;; NOT "racket-test-extra" - ;; NOT "racket-test" - "zo-lib")) + (PKG PATH) +where PATH is the path to the package source relative to ORIGIN---possibly +\".\". As a special case, a package specification may also be a string, which +is equivalent to: + + (PKG PKG) + +Examples: + +- \"expeditor\" +- (\"main-distribution\" \".\") +- (\"racket-lib\" \"pkgs/racket-lib\")" + (computed-file + (string-append "racket-pkg-" name "-sources") + (with-imported-modules `((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p (string-append #$output "/share/racket/pkgs")) + (chdir (string-append #$output "/share/racket/pkgs")) + #$@(map (match-lambda + ((? string? name) + #~(copy-recursively #$(file-append origin (string-append "/" name)) + #$name)) + ((name ".") + #~(copy-recursively #$origin #$name)) + ((name path) + #~(copy-recursively #$(file-append origin (string-append "/" path)) + #$name))) + (cons spec0 spec*)))))) + +(define (simple-racket-origin repo hash spec0 . spec*) + "Like 'racket-packages-origin', but specialized for packages hosted at +\"https://github.com/racket/REPO\" with sha256 checksum HASH. REPO is also +used to build the name of the resulting store item." + (apply racket-packages-origin + repo + (origin + (method git-fetch) + (uri (git-reference + (url (format #f "https://github.com/racket/~a" repo)) + (commit %racket-commit))) + (sha256 hash) + (file-name (git-file-name (string-append "racket-" repo) + %racket-version))) + spec0 + spec*)) (define-public racket (package - (inherit racket-minimal) (name "racket") (version %racket-version) - (source - (origin - (method url-fetch) - (uri (map (lambda (base) - (string-append base version "/racket-src.tgz")) - %installer-mirrors)) - (sha256 - (base32 - "0dsv7br85nvh5gjfihznq9jb1dzas0f6gnv5qwc9zmb7yn75nrp5")) - (patches - ;; remove in Racket 8.5 - ;; see https://github.com/racket/racket/issues/4133 - (search-patches "racket-gui-tethered-launcher-backport.patch")) - (snippet - #~(begin - (use-modules (guix build utils) - (ice-9 match) - (ice-9 regex)) - ;; unbundle minimal Racket - (for-each delete-file-recursively - '("collects" - "doc" - "etc" - "README" - "src")) - ;; unbundle package sources included elsewhere - (with-directory-excursion "share/pkgs" - (for-each delete-file-recursively - '#+%main-repo-main-distribution-pkgs)) - ;; Minimal workaround for FSDG issue: - ;; see . - ;; We will backport a better fix once we use Git - ;; origins for Racket packages. - (delete-file-recursively "share/pkgs/srfi-doc-nonfree") - (substitute* "share/pkgs/srfi/info.rkt" - (("\"srfi-doc-nonfree\"") - "")))))) + (source #f) (inputs - `(("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("glib" ,glib) - ("glu" ,glu) - ("gmp" ,gmp) - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("mpfr" ,mpfr) - ("pango" ,pango) - ("unixodbc" ,unixodbc) - ("libedit" ,libedit))) - (native-inputs - `(("racket" ,racket-minimal) - ("extend-layer" ,extend-layer) - ("main-repo" ,%racket-origin))) + (list + cairo + fontconfig + glib + glu + gmp + gtk+ ;; propagates gdk-pixbuf+svg + libjpeg-turbo + libpng + libx11 ;; ?? wayland ?? + mesa + mpfr + pango + unixodbc + libedit ;; TODO reconsider in light of expeditor and readline-gpl + racket-minimal ;; <-- TODO non-tethered layer + (simple-racket-origin + "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") + "2d" "2d-doc" "2d-lib") + (simple-racket-origin + "algol60" (base32 "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") + '("algol60" ".")) + (racket-packages-origin + "racket" %racket-origin + '("base" "pkgs/base") ;; FIXME belongs in racket-minimal + '("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in racket-minimal + '("at-exp-lib" "pkgs/at-exp-lib") + '("compiler" "pkgs/compiler") + '("compiler-lib" "pkgs/compiler-lib") + '("net" "pkgs/net") + '("net-doc" "pkgs/net-doc") + '("net-lib" "pkgs/net-lib") + '("racket-doc" "pkgs/racket-doc") + '("racket-index" "pkgs/racket-index") + '("sandbox-lib" "pkgs/sandbox-lib") + '("zo-lib" "pkgs/zo-lib")) + (simple-racket-origin + "cext-lib" (base32 "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341") + "cext-lib" "dynext-lib") + (simple-racket-origin + "class-iop" (base32 "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l") + "class-iop-lib") + (simple-racket-origin + "compatibility" (base32 "0bfqwscjpyi325br5pa6g62g9c8lq18a80zp5g3d2qzn3n3mi6x0") + "compatibility" "compatibility-doc" "compatibility-lib") + (simple-racket-origin + "contract-profile" (base32 "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3") + '("contract-profile" ".")) + (simple-racket-origin + "data" (base32 "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55") + "data" "data-doc" "data-enumerate-lib" "data-lib") + (simple-racket-origin + "datalog" (base32 "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp") + '("datalog" ".")) + (simple-racket-origin + "db" (base32 "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5") + "db" "db-doc" "db-lib") + (simple-racket-origin + "deinprogramm" (base32 "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd") + "deinprogramm" "deinprogramm-signature") + (simple-racket-origin + "distributed-places" (base32 "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0") + "distributed-places" "distributed-places-doc" "distributed-places-lib") + (simple-racket-origin + "draw" (base32 "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly") + "draw" "draw-doc" "draw-lib") + (simple-racket-origin + "drracket" (base32 "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c") + "drracket" + "drracket-plugin-lib" + "drracket-tool" + "drracket-tool-doc" + "drracket-tool-lib" + "drracket-tool-text-lib") + (simple-racket-origin + "ds-store" (base32 "0ajr27kipp4dr1qlisaghsb3h7lhhjwrfw2r79b5myczsa1mp661") + "ds-store" "ds-store-doc" "ds-store-lib") + (simple-racket-origin + "eli-tester" (base32 "0icx6wn14gjm8kdmq1jppqgq87sxkras4qb5xmdr6wigxafhjqyk") + '("eli-tester" ".")) + (simple-racket-origin + "eopl" (base32 "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s") + '("eopl" ".")) + (simple-racket-origin + "errortrace" (base32 "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip") + "errortrace" "errortrace-doc" "errortrace-lib") + (simple-racket-origin + "expeditor" (base32 "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf") + "expeditor" "expeditor-doc" "expeditor-lib") + (simple-racket-origin + "frtime" (base32 "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5") + '("frtime" ".")) + (simple-racket-origin + "future-visualizer" (base32 "1758qq769m0r14xf64sl2ix2l9z340kvapar0j7s5kdg42lmvnhm") + "future-visualizer" + "future-visualizer-pict" + "future-visualizer-typed") + (simple-racket-origin + "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d") + '("games" ".")) + (racket-packages-origin + "gui" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui") + (commit %racket-commit))) + (sha256 (base32 + "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) + (file-name (git-file-name "racket-gui" %racket-version))) + "gui" "gui-doc" "gui-lib" "tex-table") + (simple-racket-origin + "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") + "gui-pkg-manager-lib") + (simple-racket-origin + "htdp" (base32 "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl") + "htdp" "htdp-doc" "htdp-lib") + (simple-racket-origin + "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") + "html" "html-doc" "html-lib") + (simple-racket-origin + "icons" (base32 "1s5a6j11fg3fdr6b7vm2q7q178d7q8b8igy73bs211r27qrd1gg7") + '("icons" ".")) + (simple-racket-origin + "images" (base32 "0rpjxqw34bq5m08kh1ldl1mr7s9z1lyydxxcyzb292kqh9qiqvfl") + "images" "images-doc" "images-gui-lib" "images-lib") + (simple-racket-origin + "lazy" (base32 "176ylzgbdsbmqknpihaz519afq71pyjkv1h87j5v8jfbpbddyfsf") + '("lazy" ".")) + (simple-racket-origin + "macro-debugger" (base32 "14hyrwbkffr61fk44l02xb47bhv5zccw0ymaa9kxld86hvyqhqbm") + "macro-debugger" "macro-debugger-text-lib") + (simple-racket-origin + "main-distribution" (base32 "0m2n9s32s8a4a2gn4ywrm9l8jycdm5ayi5w9kh5wchhrrw7qzq7y") + '("main-distribution" ".")) + (simple-racket-origin + "make" (base32 "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa") + '("make" ".")) + (simple-racket-origin + "math" (base32 "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac") + "math" "math-doc" "math-lib") + (simple-racket-origin + "mysterx" (base32 "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48") + '("mysterx" ".")) + (simple-racket-origin + "mzcom" (base32 "0rc9pfj7gwm5azghqvcibz6si1x5s2v8mr2yngk7ssq9gzfbi6a4") + '("mzcom" ".")) + (simple-racket-origin + "mzscheme" (base32 "192c52zi726h5wjamxrhivjw2waq1im0zpyxhbrkrxknm8x84bs9") + "mzscheme" "mzscheme-doc" "mzscheme-lib") + (racket-packages-origin + "net-cookies" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RenaissanceBug/racket-cookies") + (commit %racket-commit))) + (sha256 (base32 + "0k0hifxhywl5c3hjcaiizc098dpyk001d981p572gly116yvjxc1")) + (file-name + (git-file-name "RenaissanceBug-racket-cookies" %racket-version))) + "net-cookies" "net-cookies-doc" "net-cookies-lib") + (racket-packages-origin + "optimization-coach" + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stamourv/optimization-coach") + (commit %racket-commit))) + (sha256 (base32 + "0b27sw48d7rhz0hin88c7rbr9vpg1c23sn82nd4jkmq54h6gasr1")) + (file-name + (git-file-name "stamourv-optimization-coach" %racket-version))) + '("optimization-coach" ".")) + (simple-racket-origin + "option-contract" (base32 "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk") + "option-contract" "option-contract-doc" "option-contract-lib") + (simple-racket-origin + "parser-tools" (base32 "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3") + "parser-tools" "parser-tools-doc" "parser-tools-lib") + (simple-racket-origin + "pconvert" (base32 "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1") + "pconvert-lib") + (simple-racket-origin + "pict" (base32 "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x") + "pict" "pict-doc" "pict-lib") + (simple-racket-origin + "pict-snip" (base32 "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x") + "pict-snip" "pict-snip-doc" "pict-snip-lib") + (simple-racket-origin + "picturing-programs" (base32 "1g6xr39hx1j03gb3d4dljm3v91xcj2gfpq3dgy5xvplzr6cmmxgr") + '("picturing-programs" ".")) + (simple-racket-origin + "plai" (base32 "0i983sh0r0zm2ng4j44m5aw9669kh5fhp91bzpc9jm280rfcqvyl") + "plai" "plai-doc" "plai-lib") + (simple-racket-origin + "planet" (base32 "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9") + "planet" "planet-doc" "planet-lib") + (simple-racket-origin + "plot" (base32 "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7") + "plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib") + (simple-racket-origin + "preprocessor" (base32 "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg") + '("preprocessor" ".")) + (simple-racket-origin + "profile" (base32 "179i86lyby29nywz60l4vnadi02w8b12h7501nm5h5g4pq9jjmbb") + "profile" "profile-doc" "profile-lib") + (racket-packages-origin + "quickscript" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Metaxal/quickscript") + (commit %racket-commit))) + (sha256 (base32 + "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + (file-name (git-file-name "Metaxal-quickscript" %racket-version))) + '("quickscript" ".")) + (simple-racket-origin + "r5rs" (base32 "1g3cysj7z88r38vkzvi8g2fb2hn4yg1fdhy5smxw303jxgl3inp6") + "r5rs" "r5rs-doc" "r5rs-lib") + (simple-racket-origin + "r6rs" (base32 "0b1ymzdp10r0flw2acbidjsh5ma1pm5hy54jss37sxf89z3xbvm4") + "r6rs" "r6rs-doc" "r6rs-lib") + (racket-packages-origin + "racket-cheat" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeapostrophe/racket-cheat") + (commit %racket-commit))) + (sha256 (base32 + "06wcj558rzkbl2bwkmikyspya9v1f4iwlzwnwxpkc33h2xapwabr")) + (file-name + (git-file-name "jeapostrophe-racket-cheat" %racket-version))) + '("racket-cheat" ".")) + (simple-racket-origin + "racklog" (base32 "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb") + '("racklog" ".")) + (simple-racket-origin + "rackunit" (base32 "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p") + "rackunit" + "rackunit-doc" + "rackunit-gui" + "rackunit-lib" + "rackunit-plugin-lib" + "rackunit-typed" + "schemeunit" + "testing-util-lib") + (simple-racket-origin + "readline" (base32 "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn") + "readline" "readline-doc" "readline-lib") + (simple-racket-origin + "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi") + '("realm" ".")) + (simple-racket-origin + "redex" (base32 "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f") + "redex" + "redex-benchmark" + "redex-doc" + "redex-examples" + "redex-gui-lib" + "redex-lib" + "redex-pict-lib") + (simple-racket-origin + "sasl" (base32 "0ibh4wb4gn8pggx6gkv4vk4d6rwzn5nrvjibhvkzhaynf6lhb824") + "sasl" "sasl-doc" "sasl-lib") + (simple-racket-origin + "scheme-lib" (base32 "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x") + '("scheme-lib" ".")) + (simple-racket-origin + "scribble" (base32 "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm") + "scribble" + "scribble-doc" + "scribble-html-lib" + "scribble-lib" + "scribble-text-lib") + (simple-racket-origin + "serialize-cstruct-lib" + (base32 "1rq3n1fa7ldjwx3lrh9ybhig7jlsw1crpzyklbzp3xqdw6jymfnz") + '("serialize-cstruct-lib" ".")) + (simple-racket-origin + "sgl" (base32 "0nkymhdyjrwi5h199j4w5zh7y3x3ai42gsiwxzh0hy7yqrqqg9zv") + '("sgl" ".")) + (simple-racket-origin + "shell-completion" (base32 "04m144gy2mp4fiq6rcbf12wjr8mws8k9scfhg9lc38vqppp4lxsj") + '("shell-completion" ".")) + (simple-racket-origin + "simple-tree-text-markup" + (base32 "0fyd9gfz6bnv0m1901wv5mnhc05rm8hw9i6ddrqx33hs6qsg2zqr") + "simple-tree-text-markup" + "simple-tree-text-markup-doc" + "simple-tree-text-markup-lib") + (simple-racket-origin + "slatex" (base32 "0pkm2isbbdk63slrbsxcql7rr0wdrw5kapw1xq4ps5k8dhlzv8x0") + '("slatex" ".")) + (simple-racket-origin + "slideshow" (base32 "1znv1i2d0610hhy71q932xy7wka00q3q50in1xfnk8ibg7nzkagm") + "slideshow" "slideshow-doc" "slideshow-exe" "slideshow-lib" "slideshow-plugin") + (simple-racket-origin + "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj") + "snip" "snip-lib") + (simple-racket-origin + "typed-racket" (base32 "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv") + "source-syntax" + "typed-racket" + "typed-racket-compatibility" + "typed-racket-doc" + "typed-racket-lib" + "typed-racket-more") + (racket-packages-origin + "srfi" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/srfi") + ;; Includes an FSDG fix: return to %racket-commit in 8.5. + ;; See . + (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) + (sha256 (base32 + "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) + ;; Use the relevant version for srfi-doc and srfi-lib, + ;; since we're using a newer commit than the v8.4 tag. + (file-name (git-file-name "racket-srfi" "1.1"))) + "srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib") + (simple-racket-origin + "string-constants" (base32 "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6") + "string-constants" "string-constants-doc" "string-constants-lib") + (simple-racket-origin + "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67") + '("swindle" ".")) + (simple-racket-origin + "syntax-color" (base32 "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp") + "syntax-color" "syntax-color-doc" "syntax-color-lib") + (simple-racket-origin + "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia") + '("trace" ".")) + (simple-racket-origin + "unix-socket" (base32 "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y") + "unix-socket" "unix-socket-doc" "unix-socket-lib") + (simple-racket-origin + "web-server" (base32 "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn") + "web-server" "web-server-doc" "web-server-lib") + (simple-racket-origin + "wxme" (base32 "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b") + "wxme" "wxme-lib") + (simple-racket-origin + "xrepl" (base32 "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3") + "xrepl" "xrepl-doc" "xrepl-lib"))) + (build-system gnu-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'configure 'unpack-packages - (let ((unpack (assoc-ref %standard-phases 'unpack))) - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out")) - (pkgs-dir (string-append prefix "/share/racket/pkgs"))) - (mkdir-p pkgs-dir) - (copy-recursively - "share/links.rktd" - (string-append prefix "/share/racket/links.rktd")) - (copy-recursively "share/pkgs" pkgs-dir) - ;; NOTE: unpack changes the working directory - (unpack #:source (assoc-ref (or native-inputs inputs) - "main-repo")) - (for-each (lambda (pkg) - (define dest (string-append pkgs-dir "/" pkg)) - (mkdir-p dest) - (copy-recursively (string-append "pkgs/" pkg) - dest)) - ',%main-repo-main-distribution-pkgs) - #t)))) - (replace 'configure - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out"))) - (apply invoke - (string-append racket "/bin/racket") - (assoc-ref inputs "extend-layer") - racket - prefix - (map - (lambda (lib) - (string-append (assoc-ref inputs lib) "/lib")) - '("cairo" - "fontconfig" - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))) - #t))) - (replace 'build - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) - "racket") - "/bin/racket") - "--config" - (string-append (assoc-ref outputs "out") - "/etc/racket") - "-l" - "raco" - "setup") - #t)) - (delete 'install)) - ;; we still don't have these: - #:tests? #f)) + ;; We're using #:configure-flags to pass flags for + ;; `configure-layer.rkt` and #:make-flags to pass arguments for + ;; `raco pkg install`. + (list + #:configure-flags + #~`("--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit"))))) + #:make-flags #~`("main-distribution") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (guix build union) + (ice-9 match)) + #:imported-modules `((guix build union) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (delete 'unpack) + (replace 'configure + (lambda* (#:key inputs configure-flags #:allow-other-keys) + (let* ((racket (search-input-file inputs "bin/racket"))) + (apply invoke + racket + #$configure-layer.rkt + `(,@configure-flags + ,(dirname (dirname racket)) + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; We use "share/racket/pkgs" for sources to distinguish them + ;; from the "lib/racket/pkgs" of a potential parent layer. + (union-build (string-append #$output "/lib/racket/pkgs") + (search-path-as-list '("share/racket/pkgs") + (map cdr inputs)) + #:create-all-directories? #t))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket (search-input-file inputs "/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) + (home-page "https://racket-lang.org") (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -564,17 +898,20 @@ (define dest (string-append pkgs-dir "/" pkg)) The main Racket distribution comes with many bundled packages, including the DrRacket IDE, libraries for GUI and web programming, and implementations of -languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) - +languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) -(define extend-layer +(define configure-layer.rkt (scheme-file - "extend-layer.rkt" + "configure-layer.rkt" `(module - extend-layer racket/base + configure-layer racket/base (require racket/cmdline racket/match racket/file + racket/port racket/list racket/pretty) (define config-file-pth @@ -584,8 +921,14 @@ (define (build-path-string . args) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) + (define extra-foreign-lib-search-dirs '()) (command-line - #:args (parent-layer prefix . lib-dir*) + #:once-each + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (parent-layer prefix) (let* ([config (for/fold ([config (file->value (build-path parent-layer @@ -615,27 +958,42 @@ (define rx:racket (build-path-string parent-layer pth)) (filter values (hash-ref config search-key null)))))] [config - (hash-set config - 'apps-dir - (build-path-string prefix "share/applications"))] + (hash-update config + 'lib-search-dirs + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] [config - ;; place new foreign lib-search-dirs before old - ;; foreign dirs, but after Racket layers - (let-values - ([(rkt extra) - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - (hash-ref config 'lib-search-dirs))]) - (hash-set config - 'lib-search-dirs - (append rkt - lib-dir* - extra)))] + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaround Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] [bin-dir (hash-ref config 'bin-dir)] [config (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) 'config-tethered-console-bin-dir bin-dir 'config-tethered-gui-bin-dir bin-dir)] [new-config-pth -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:36:56 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:36:56 +0000 Received: from localhost ([127.0.0.1]:56532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Qd-0004AX-Ea for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:36:56 -0500 Received: from mail-qv1-f51.google.com ([209.85.219.51]:38622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Qa-0004AH-T3 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:36:53 -0500 Received: by mail-qv1-f51.google.com with SMTP id d3so9828299qvb.5 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:36:52 -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=kh4rfDLnITEVr2rk6e8MVsWsEJkJF3STyUL0fXwg1Mk=; b=Jp5HS3c678j2SyVn45bapL0v8cgEg8kwvBZDFbvsiTH4X6lCUCfDr98pn3n6Mi1HUE kjHh1d9zX/J4r7FgziqGwLKME1/rR5bRJs+5Gc7yf6yg8bBdN0dCWge40DG+vVYLcDG0 MIhF+d8M+Sm2bLeImjl+SpjJMfkKkeeP592b7VBxDuajAuEisIBFGykyd2kSyLZ5tqNE cT6uteqG+H+z/0+QTv+rxDHzFxd847qMHjtZCwJcEmcyuCnKQKLP4hbcBVwcFM9WdBJA wiOlAGgNi9FNi/Lty+LJtXikKlELVDsQ4LcbgXDhGZy+mA6ahNDSHtDDobxJ4NJytwDT oIag== 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=kh4rfDLnITEVr2rk6e8MVsWsEJkJF3STyUL0fXwg1Mk=; b=7qGx1VbjQFi9V5Z5J/uWIFfR7x+vk7w/8Q+ltXjBTz/j8oAzrmU5OiTEn7NCyNB99d BW121nQ6wriQFhqY+41FIwEAzt14pmtYKO31TR4jOtiHwKc5l4s0CCu2KIWwSX2bKYFn h15CynZjfNJt+jt+bwIqLfSCy3oXFxeT9kSjLwcTu6eOCsKYR1wM8/fGihBdADm4aY5g fSfmaVLhmaVzCFjO+Y9AGgFfeOCsVAfrwjMbbSqrWGRYUyxtnuuJ/MIsnxOlBKa+IUXd AL6Vdm6RSbBPy2wyBzMF0oKreGV8qxXjIm0q8YifnUeZD3NZ2tzlze9ZfixvGX9Z4Zc7 fh8Q== X-Gm-Message-State: AOAM530KOooRgmbS3ByPD9nsbj6RPk7bi47fwAfuAo3NMlkQ+xEusYmo jL3fCK3kM2ND8N3kS+3ZWOC5imYuTcqGN0FZBJI= X-Google-Smtp-Source: ABdhPJyThIa7HoIHhSwqsTMhZxKSGaDM5KwujwvDdnEVWidsHqw+eA5hlgZj78yxQ1uD2auX9UQCKA== X-Received: by 2002:a05:6214:d4c:b0:432:c2db:ebe3 with SMTP id 12-20020a0562140d4c00b00432c2dbebe3mr6358549qvr.115.1645929407039; Sat, 26 Feb 2022 18:36:47 -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 g2-20020a37e202000000b00607e264a208sm3208672qki.40.2022.02.26.18.36.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:36:46 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 04/24] gnu: racket-minimal: Use new package style. Date: Sat, 26 Feb 2022 21:34:30 -0500 Message-Id: <20220227023450.1877215-5-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (cfg-flag:sh-for-rktio, cfg-flag:enable-lt, cfg-glag:enable-racket): Change to G-expressions and combine in ... (racket-vm-common-configure-flags): ... this new thunk. (unpac [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.51 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.51 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (cfg-flag:sh-for-rktio, cfg-flag:enable-lt, cfg-glag:enable-racket): Change to G-expressions and combine in ... (racket-vm-common-configure-flags): ... this new thunk. (unpac [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.51 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.51 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (cfg-flag:sh-for-rktio, cfg-flag:enable-lt, cfg-glag:enable-racket): Change to G-expressions and combine in ... (racket-vm-common-configure-flags): ... this new thunk. (unpack-nanopass+stex): Change to G-expression and move to ... (make-unpack-nanopass+stex): ... this new thunk. (racket-bootstrap-chez-bootfiles): Rename to ... (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable, and stop inheriting from 'racket-minimal'. [native-inputs]: Remove labels. [build-system]: Use 'copy-build-system'. [arguments]: Use G-expressions. Install under "lib". (racket-minimal)[inputs, native-inputs]: Remove labels. [arguments]: Use G-expressions. Avoid 'assoc-ref'. Adapt to changes in 'chez-scheme-for-racket-bootstrap-bootfiles'. (racket-minimal-bc-3m)[native-inputs]: Remove labels. [arguments]: Use G-expressions. (racket-minimal-bc-cgc)[native-inputs]: Remove labels. [arguments]: Use G-expressions. --- gnu/packages/racket.scm | 332 ++++++++++++++++++++-------------------- 1 file changed, 163 insertions(+), 169 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index c4e5ee1311..55fdb28fdd 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -26,6 +26,7 @@ (define-module (gnu packages racket) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -99,7 +100,7 @@ (define-module (gnu packages racket) ;; Code: (define %racket-version "8.4") -;; ^ Remember to update racket-bootstrap-chez-bootfiles! +;; ^ Remember to update chez-scheme-for-racket-bootstrap-bootfiles! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -133,34 +134,42 @@ (define %racket-origin ;; Unbundle libffi. (delete-file-recursively "racket/src/bc/foreign/libffi"))))) -(define cfg-flag:sh-for-rktio - `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - (assoc-ref %build-inputs "sh") - "/bin/sh")) -(define cfg-flag:enable-lt - `(string-append "--enable-lt=" - (assoc-ref %build-inputs "libtool") - "/bin/libtool")) -(define cfg-flag:enable-racket - `(let ((racket (assoc-ref %build-inputs "racket"))) - (string-append "--enable-racket=" - racket - "/bin/racket"))) +(define (racket-vm-common-configure-flags) + ;; under a lambda abstraction to avoid evaluating bash-minimal too early. + #~`(,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/libtool")) + => (lambda (libtool) + (list (string-append "--enable-lt=" libtool)))) + (else + '())) + ,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/racket")) + => (lambda (racket) + (list (string-append "--enable-racket=" racket)))) + (else + '())) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")))) -(define unpack-nanopass+stex - ;; Copied from chez-scheme. - ;; TODO: Eventually, we should refactor Chez Scheme - ;; enough to share more directly, so that we can make - ;; Racket's version of Chez avalable as a Guix package, - ;; e.g. for architectures not supported upstream. - ;; For now, we let Racket drive the Chez build process - ;; other than this step. - `(for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex"))) +(define (make-unpack-nanopass+stex) + ;; Adapted from chez-scheme. + ;; Thunked to avoid evaluating 'chez-scheme' too early. + ;; TODO: Refactor enough to share this directly. + #~(begin + (copy-recursively + #$(match (assoc-ref (package-native-inputs chez-scheme) + "nanopass") + ((src) + src)) + "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-public racket-minimal @@ -169,91 +178,87 @@ (define-public racket-minimal (version %racket-version) (source %racket-origin) (inputs - `(;; common to all racket-minimal variants: - ("openssl" ,openssl) - ("sqlite" ,sqlite) - ("sh" ,bash-minimal) ;; <- for `system` - ("ncurses" ,ncurses) ;; <- for #%terminal - ;; only for CS - ("zlib" ,zlib) - ("lz4" ,lz4))) + (list + ;; common to all racket-minimal variants: + openssl + sqlite + bash-minimal ;; <- for `system` + ncurses ;; <- for #%terminal + ;; only for CS + zlib + lz4)) (native-inputs - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) + (list chez-scheme-for-racket-bootstrap-bootfiles + racket-minimal-bc-3m)) (build-system gnu-build-system) (arguments - `(#:configure-flags - (list "--enable-csonly" - "--enable-libz" - "--enable-liblz4" - ,cfg-flag:enable-racket - ,cfg-flag:sh-for-rktio) - #:out-of-source? #true - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main distribution. - #:tests? #f - #:modules ((ice-9 match) + (list + #:configure-flags + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) (guix build gnu-build-system) (guix build utils)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (string-append (assoc-ref inputs "bootfiles") "/boot") - "boot")) - #t)) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f ,@(map (lambda (lib) - (string-append (assoc-ref inputs lib) - "/lib")) - '("openssl" - "sqlite")))) - (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - ,version - "/catalog/") - #f)))))) - #t)) - (add-before 'configure 'change-directory - (lambda _ - (chdir "racket/src") - #t)) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda* (#:key outputs #:allow-other-keys) - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append (assoc-ref outputs "out") - "/share/racket/pkgs")) - #t))))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (with-directory-excursion "racket/src/ChezScheme" + #$(make-unpack-nanopass+stex)))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "racket/src/ChezScheme" + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot")))) + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((lib-search-dirs + . (#f #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib"))) + (build-stamp . "") + (catalogs + . (,(string-append + "https://download.racket-lang.org/releases/" + #$(package-version this-package) + "/catalog/") + #f)))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (add-after 'install 'remove-pkgs-directory + ;; If the configured pkgs-dir exists, "pkgs.rktd" does not + ;; exist, and a lock file does not exist, commands like + ;; `raco pkg show` will try to create a lock file and fail + ;; due to the read-only store. + ;; Arguably this may be a bug in `pkg/private/lock`: + ;; see . + ;; As a workaround, remove the directory. + (lambda args + ;; rmdir because we want an error if it isn't empty + (rmdir (string-append #$output "/share/racket/pkgs"))))))) (home-page "https://racket-lang.org") (synopsis "Racket without bundled packages such as DrRacket") (description @@ -269,7 +274,6 @@ (define (write-racket-hash alist) ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) - (define-public racket-minimal-bc-3m (hidden-package (package @@ -280,21 +284,19 @@ (define-public racket-minimal-bc-3m (prepend libffi) ;; <- only for BC variants (delete "zlib" "lz4"))) (native-inputs - `(("libtool" ,libtool) - ("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc)))) + (list libtool + (if (%current-target-system) + racket-minimal + racket-minimal-bc-cgc))) (arguments (substitute-keyword-arguments (package-arguments racket-minimal) ((#:configure-flags _ '()) - `(list "--enable-bconly" - ,cfg-flag:enable-racket - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)) - ((#:phases usual-phases) - `(modify-phases ,usual-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))) + ((#:phases cs-phases) + #~(modify-phases #$cs-phases + (delete 'unpack-nanopass+stex) + (delete 'unpack-bootfiles))))) (synopsis "Minimal Racket with the BC [3M] runtime system") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written @@ -309,19 +311,16 @@ (define-public racket-minimal-bc-3m ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) - (define-public racket-minimal-bc-cgc (package (inherit racket-minimal-bc-3m) (name "racket-minimal-bc-cgc") - (native-inputs - (alist-delete "racket" (package-native-inputs racket-minimal-bc-3m))) + (native-inputs (list libtool)) (arguments (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) ((#:configure-flags _ '()) - `(list "--enable-cgcdefault" - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)))) + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags))))) (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or ``bytecode'') implementation is not recommended for general use. It uses @@ -334,47 +333,42 @@ (define-public racket-minimal-bc-cgc also be used for embedding applications without the annotations needed in C code to use the 3M garbage collector."))) - -(define-public racket-bootstrap-chez-bootfiles - (hidden-package - (package - (inherit racket-minimal) - (name "racket-bootstrap-chez-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. - (inputs `()) - (native-inputs - `(("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-3m)) - ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) "stex")) - ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) - "nanopass")))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (delete 'configure) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (invoke (string-append (assoc-ref inputs "racket") - "/bin/racket") - "rktboot/main.rkt" - "--dest" (assoc-ref outputs "out"))) - #t)) - (delete 'check) - (delete 'install)))) - (synopsis "Chez Scheme bootfiles bootstrapped by Racket") - (description "Chez Scheme is a self-hosting compiler: building it +(define-public chez-scheme-for-racket-bootstrap-bootfiles + (package + (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. + (source %racket-origin) + (inputs `()) + (native-inputs (list racket-minimal-bc-3m)) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list + #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))) + (add-after 'chdir 'unpack-nanopass+stex + (lambda args + #$(make-unpack-nanopass+stex))) + (add-before 'install 'build + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (invoke (search-input-file (or native-inputs inputs) + "/bin/racket") + "rktboot/main.rkt")))))) + (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 "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 supported platforms.) @@ -389,7 +383,7 @@ (define-public racket-bootstrap-chez-bootfiles 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.") - (license (list license:asl2.0))))) + (license (list license:asl2.0)))) (define (racket-packages-origin name origin spec0 . spec*) "Extract from ORIGIN the sources for the Racket packages specified by SPEC0 -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:37:11 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:37:11 +0000 Received: from localhost ([127.0.0.1]:56539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Qt-0004Br-AP for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:11 -0500 Received: from mail-qk1-f180.google.com ([209.85.222.180]:40877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Qs-0004Bf-0q for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:10 -0500 Received: by mail-qk1-f180.google.com with SMTP id c7so7809210qka.7 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:37:09 -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=qhdWaxK2B/8GZiVT+44S8xPk0GiXuviwUE1ruX+vVGs=; b=KHGrq7Eu/kU2aQQ8bVHHmF3rhUXInngPkhvfu582EwI1w1+kmi4Eyc9WCKzYmXPkuG lmJJGezU/MraXcnT2a+ufUz/RMFoatkI9IItaYwJXINgqMgLM/LX5NpkMzmcTapxdYjg 6PGiHoc9N0nDtss7k4Cjw5UKTOVfoXr+Ump1IDJSwOwyA4M5xzYAoiUFHTIY5++/lwU6 p3MiHWod9IjP20tk+/uNYJTZsi28WFcOOISHs7aN4VpMBU80ofqBna4gtj5YupBJXRX6 zX+AwB0A/OkzJDcP182gs9kCDwNvREfJFUgjYTTxnjjKcSD6w9oCQuzmXKLu361Zs5iN rSiQ== 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=qhdWaxK2B/8GZiVT+44S8xPk0GiXuviwUE1ruX+vVGs=; b=AS+/ZR87jzCFmdD4ptQVgDE1nN9Ibom8OUX0tWfrZGOpOikL6Oqh6wrLeXmll/nEui YA8+2udFlavR0fR2EI0hHANq5z98apAqaqw630wVhN6Ul6Vp9mBxRz/Aj4RkJK48dWZs djR1B+b9CjM7fKHZaCJQYUL77kzWqVc3CZ/VRH6CTCZsI2H/mIQbTxwfGWh0H59QUylU nuI9BMuY4h8ZqC0yrSo6YSbnx9YyS+vbz8c3NyA0jSnyM0D+QYNx6DtjIH6GmTAZ8vN5 HHYm0Um5bZS4eDMdJUkrdElEA1peonTG2KlyT+MPKP/UFmlq+vVR0/wkNCuqffqGVedO /Xig== X-Gm-Message-State: AOAM530LZD7O6jYpHcI7zek47j9hj6bgJwLRPIjyHF9vC06W/N7tFqYE a8sjAfwCmxXJbuoadYLk0oJQ2t/tcFRkKk5n3d8= X-Google-Smtp-Source: ABdhPJxRUlbeRdqLVC7n7lm6BmFwF+mmJpkMViZPc4lQRrJfW7BqaXJoMb1YBhCSG3TPQSQ5ePN5dQ== X-Received: by 2002:a05:620a:3713:b0:648:d836:8153 with SMTP id de19-20020a05620a371300b00648d8368153mr8408824qkb.674.1645929424495; Sat, 26 Feb 2022 18:37:04 -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 185-20020a3706c2000000b0060df89eb3ecsm3403593qkg.60.2022.02.26.18.36.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:37:04 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 05/24] gnu: racket-minimal: Don't configure non-existant catalogs. Date: Sat, 26 Feb 2022 21:34:31 -0500 Message-Id: <20220227023450.1877215-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-minimal)[arguments]<#:phases>: Change 'initialize-config.rktd' to only add a release catalog when the package version is a release version. --- gnu/packages/racket.sc [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.180 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.180 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-minimal)[arguments]<#:phases>: Change 'initialize-config.rktd' to only add a release catalog when the package version is a release version. --- gnu/packages/racket.sc [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.180 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.180 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (racket-minimal)[arguments]<#:phases>: Change 'initialize-config.rktd' to only add a release catalog when the package version is a release version. --- gnu/packages/racket.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 55fdb28fdd..b828bbbd3d 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -231,6 +231,15 @@ (define (write-racket-hash alist) (format #t "(~s . ~s)" k v))) alist) (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) (mkdir-p "racket/etc") (with-output-to-file "racket/etc/config.rktd" (lambda () @@ -239,12 +248,8 @@ (define (write-racket-hash alist) . (#f #$(file-append (this-package-input "openssl") "/lib") #$(file-append (this-package-input "sqlite") "/lib"))) (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - #$(package-version this-package) - "/catalog/") - #f)))))))) + (catalogs ,@maybe-release-catalog + #f))))))) (add-before 'configure 'chdir (lambda _ (chdir "racket/src"))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:37:32 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:37:32 +0000 Received: from localhost ([127.0.0.1]:56542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9R9-0004CQ-L7 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:32 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:33681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9R7-0004CD-2T for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:26 -0500 Received: by mail-qt1-f171.google.com with SMTP id bt3so6088687qtb.0 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:37:25 -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=csYxz1KLSKiWhLrQOqhP0OIL5gVjxXKbeWBLNdaC9Rg=; b=OhNvuqmvJMii+fwQAq6EBmkU/fLNPhc/V796bGt8Vjc6wpWvnbuOZ/3z0HBdbIGeUs iPbnxSOJXFzdLDnobKYssJSNB0PeeudiAlSz8nvLreOoKwD3D30085W83idVtAdLYJob ifrhlaDsfkRISgyO1oMyKo7LjtcA8pIfMVpb4mIE4Iv0pkhb6RFJed7UxunL4CpX508B Mad0TdZ0P1YZT5RyuoWBwEMWzCLlAW0gscaNb1R+9Ezk0b14nb+tjgKDCJzfipDXWkYb akpUskV8sFPaVO1mBw4qkI5fiGf86daZTMenF6qp+NtZO0m3GAA/mOhQUv/VSB/SLQv5 q0UA== 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=csYxz1KLSKiWhLrQOqhP0OIL5gVjxXKbeWBLNdaC9Rg=; b=pnR6BPCTOr5FQncfDz4EyuHeb50KM4XqEE6ryX5By4+QnmMd2Jb2FhfskvWDKLlK+G qIlWuF/6ihfB4j9tiwVCoADba250m4+yg7B+O4WwyfCoLMc2UsxiRd4h+H+bzIRsBTmY wnhoNcOVGM5ymAcJqOI2WjpRiN73Os9GRnq9XtIZdj9AhJFYNKhwhOJhIhNARcm3U7AS Vd+rJlKoYWH5Xi9pm9pk1y/jMzqYq+fyAvmIbFN493jdr8zBtObgsBOjHpO9ITZZ9AK7 bde9FCYDf8RD5sMFMZDnS9fKsKP42DcjilJcDHp6/EJJ7y9qf9KZWOvr6GvfGkoQtOx4 AoOA== X-Gm-Message-State: AOAM533GfkG8DykPBKrnNvPBwvMPdZAJI+v2gwFg60LnAwyjNujX4wct rEATdL/A1KfortSlOYyOGPcSrjLmIaYyju8iN44= X-Google-Smtp-Source: ABdhPJwz3SunO7W2AsW7OhmSpZDzGxjGoD2h3dpLCvcjn+r+bfdVCT9NeD/r/cD/RMcVStqeLZxhhw== X-Received: by 2002:a05:622a:8d:b0:2dd:d979:bc46 with SMTP id o13-20020a05622a008d00b002ddd979bc46mr12374086qtw.342.1645929439440; Sat, 26 Feb 2022 18:37: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 o21-20020ac85a55000000b002d7847160c0sm4140270qta.82.2022.02.26.18.37.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:37:19 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 06/24] gnu: racket-minimal: Change inheritance to follow bootstrapping. Date: Sat, 26 Feb 2022 21:34:32 -0500 Message-Id: <20220227023450.1877215-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline [...] Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.171 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.171 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline [...] Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.171 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline formerly inherited values. (racket-minimal-bc-3m): Inherit from 'racket-minimal-bc-cgc' rather than 'racket-minimal'. [inputs, native-inputs, arguments, license]: Adjust accordingly. (racket-minimal): Inherit from 'racket-minimal-bc-3m'. [inputs, native-inputs, arguments, license]: Adjust accordingly. [properties]: Override effect of 'hidden-package'. --- gnu/packages/racket.scm | 130 +++++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 63 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index b828bbbd3d..00f4fef49f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021 Philip McGrath +;;; Copyright © 2021, 2022 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -172,9 +172,9 @@ (define (make-unpack-nanopass+stex) (display "# to placate ../configure"))))) -(define-public racket-minimal +(define-public racket-minimal-bc-cgc (package - (name "racket-minimal") + (name "racket-minimal-bc-cgc") (version %racket-version) (source %racket-origin) (inputs @@ -184,19 +184,14 @@ (define-public racket-minimal sqlite bash-minimal ;; <- for `system` ncurses ;; <- for #%terminal - ;; only for CS - zlib - lz4)) - (native-inputs - (list chez-scheme-for-racket-bootstrap-bootfiles - racket-minimal-bc-3m)) + ;; only for BC variants: + libffi)) + (native-inputs (list libtool)) ;; <- only for BC variants (build-system gnu-build-system) (arguments (list #:configure-flags - #~(cons* "--enable-csonly" - "--enable-libz" - "--enable-lz4" + #~(cons* "--enable-cgcdefault" #$(racket-vm-common-configure-flags)) ;; Tests are in packages like racket-test-core and ;; main-distribution-test that aren't part of the main @@ -210,17 +205,6 @@ (define-public racket-minimal (guix build utils)) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (with-directory-excursion "racket/src/ChezScheme" - #$(make-unpack-nanopass+stex)))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (search-input-directory (or native-inputs inputs) - "lib/chez-scheme-bootfiles") - "boot")))) (add-before 'configure 'initialize-config.rktd (lambda* (#:key inputs #:allow-other-keys) (define (write-racket-hash alist) @@ -265,43 +249,37 @@ (define maybe-release-catalog ;; rmdir because we want an error if it isn't empty (rmdir (string-append #$output "/share/racket/pkgs"))))))) (home-page "https://racket-lang.org") - (synopsis "Racket without bundled packages such as DrRacket") - (description - "Racket is a general-purpose programming language in the Scheme family, -with a large set of libraries and a compiler based on Chez Scheme. Racket is -also a platform for language-oriented programming, from small domain-specific -languages to complete language implementations. + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. -The ``minimal Racket'' distribution includes just enough of Racket for you to -use @command{raco pkg} to install more. Bundled packages, such as the -DrRacket IDE, are not included.") +Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list license:asl2.0 license:expat)))) + (license (list license:lgpl3+ license:asl2.0 license:expat)) + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (properties `((hidden? . #t))))) (define-public racket-minimal-bc-3m (hidden-package (package - (inherit racket-minimal) + (inherit racket-minimal-bc-cgc) (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (prepend libffi) ;; <- only for BC variants - (delete "zlib" "lz4"))) (native-inputs - (list libtool - (if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc))) + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (prepend racket-minimal-bc-cgc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) + (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) ((#:configure-flags _ '()) #~(cons "--enable-bconly" - #$(racket-vm-common-configure-flags))) - ((#:phases cs-phases) - #~(modify-phases #$cs-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) + #$(racket-vm-common-configure-flags))))) (synopsis "Minimal Racket with the BC [3M] runtime system") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written @@ -316,27 +294,53 @@ (define-public racket-minimal-bc-3m ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) -(define-public racket-minimal-bc-cgc +(define-public racket-minimal (package (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs (list libtool)) + (name "racket-minimal") + (inputs + (modify-inputs (package-inputs racket-minimal-bc-cgc) + (prepend zlib lz4) + (delete "libffi"))) + (native-inputs + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (delete "libtool") + (prepend chez-scheme-for-racket-bootstrap-bootfiles + racket-minimal-bc-3m))) (arguments (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) + ((#:phases bc-phases) + #~(modify-phases #$bc-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (with-directory-excursion "racket/src/ChezScheme" + #$(make-unpack-nanopass+stex)))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "racket/src/ChezScheme" + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot")))))) ((#:configure-flags _ '()) - #~(cons "--enable-cgcdefault" - #$(racket-vm-common-configure-flags))))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the -Racket CS implementation. + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket without bundled packages such as DrRacket") + (description + "Racket is a general-purpose programming language in the Scheme family, +with a large set of libraries and a compiler based on Chez Scheme. Racket is +also a platform for language-oriented programming, from small domain-specific +languages to complete language implementations. -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) +The ``minimal Racket'' distribution includes just enough of Racket for you to +use @command{raco pkg} to install more. Bundled packages, such as the +DrRacket IDE, are not included.") + (properties `()) + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) (define-public chez-scheme-for-racket-bootstrap-bootfiles (package -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:37:39 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:37:39 +0000 Received: from localhost ([127.0.0.1]:56545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9RK-0004Cq-Oa for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:39 -0500 Received: from mail-qt1-f176.google.com ([209.85.160.176]:40654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9RJ-0004CW-3h for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:38 -0500 Received: by mail-qt1-f176.google.com with SMTP id t28so6101421qtc.7 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:37:37 -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=URmEbdRV5afr0Wl6KJozuWiNZEFz6so5nG8+6QKZKZU=; b=HtDjqqUUUQFbowFAMMBCy99xPS5V1mQ8owkm2AV8qITaRFaiYRYlOaDgwzkqzJKvj5 C2T6OO11rAKM5q5mYjvEJp+5vEIWL9hL5Vr/IWX9wiAspyYuGAqY1LAGct0gJFxMYCuC thqJMgZThJTgHbM58QAgLGXwWJ5lAfPEc85pKlMPY02uBqzNEBSm91oOIufWrvtfl1Tl AmLww36XHgjn5hdTMTb8gfHAPsFrRvq5yalQbLZxmGPhu7W8LT4jr8ugB6PQREK3uPF0 d5mbnVm/MRk1R4MOzaE/0CVmp5iwmvrcgq9n3WU4hlKlIoSrlSeQD9FUnvamtk5r4lGH FD3w== 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=URmEbdRV5afr0Wl6KJozuWiNZEFz6so5nG8+6QKZKZU=; b=6pR6U8kOPSdEdeZzuM90Wp93XSZIy1pPyePFQw3oC/Kmautojl8zP6TFXCfTsHJHBg sgWap9PkfrPNi4R78t2R85ymKOTH7C5dvRUtB80fP7vHlnNEe4tDcSzaWI8TJj4nkH4N V+4a9MPKsE3rf6CajdoXJwREoJd1Fi5uWHg2hjq5RN3YlsEL7r8UQde/ntGuSaQrkcYF Lu64zrZ7MHDLbvT8fa8IoX+XcBV6+4aU/X9q74mAcYTmVUwr9yIoiJbhas3nWgSwl6zt LMz42EMprB7qYaoVrLA6nWm+P9uPVZwDZC27VkuT9vP/cJOSvgIBER6BdYfG6jymNc8v blwA== X-Gm-Message-State: AOAM532QUL68bXzZMmyk9u/PSFGx/ktQGsEwicuKFNUuWm6gN4gomkZ8 QMRkcQbGbem1M1Q2LAnXK7psJPbZq+TnFKu/N9s= X-Google-Smtp-Source: ABdhPJwZ0znjb7ewv421jCZVxJwkZbFkLlAOnhP14jJFv8cQkcliDSrG52s7yYTIDAy8fRldNUBtzg== X-Received: by 2002:ac8:5b56:0:b0:2dd:b428:d2cc with SMTP id n22-20020ac85b56000000b002ddb428d2ccmr12225625qtw.304.1645929451411; Sat, 26 Feb 2022 18:37:31 -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 v26-20020a05622a189a00b002ddd1f76c2fsm4274384qtc.17.2022.02.26.18.37.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:37:31 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 07/24] gnu: racket-minimal: Adjust indentation. Date: Sat, 26 Feb 2022 21:34:33 -0500 Message-Id: <20220227023450.1877215-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-minimal-bc-cgc): Use 'hidden-package' rather than 'properties'. (racket-minimal-bc-3m): Remove redundant 'hidden-package' wrapper. --- gnu/packages/racket.scm | 201 + [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.176 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.176 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-minimal-bc-cgc): Use 'hidden-package' rather than 'properties'. (racket-minimal-bc-3m): Remove redundant 'hidden-package' wrapper. --- gnu/packages/racket.scm | 201 + [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.176 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.176 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (racket-minimal-bc-cgc): Use 'hidden-package' rather than 'properties'. (racket-minimal-bc-3m): Remove redundant 'hidden-package' wrapper. --- gnu/packages/racket.scm | 201 ++++++++++++++++++++-------------------- 1 file changed, 100 insertions(+), 101 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 00f4fef49f..ca0c09be58 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -173,84 +173,87 @@ (define (make-unpack-nanopass+stex) (define-public racket-minimal-bc-cgc - (package - (name "racket-minimal-bc-cgc") - (version %racket-version) - (source %racket-origin) - (inputs - (list - ;; common to all racket-minimal variants: - openssl - sqlite - bash-minimal ;; <- for `system` - ncurses ;; <- for #%terminal - ;; only for BC variants: - libffi)) - (native-inputs (list libtool)) ;; <- only for BC variants - (build-system gnu-build-system) - (arguments - (list - #:configure-flags - #~(cons* "--enable-cgcdefault" - #$(racket-vm-common-configure-flags)) - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main - ;; distribution. - #:tests? #f - ;; Upstream recommends #:out-of-source?, and it does - ;; help with debugging, but it confuses `install-license-files`. - #:modules '((ice-9 match) - (ice-9 regex) - (guix build gnu-build-system) - (guix build utils)) - #:phases - #~(modify-phases %standard-phases - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (define maybe-release-catalog - (let ((v #$(package-version this-package))) - (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" - v) - `(,(string-append - "https://download.racket-lang.org/releases/" - v - "/catalog/")) - '()))) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f #$(file-append (this-package-input "openssl") "/lib") - #$(file-append (this-package-input "sqlite") "/lib"))) - (build-stamp . "") - (catalogs ,@maybe-release-catalog - #f))))))) - (add-before 'configure 'chdir - (lambda _ - (chdir "racket/src"))) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda args - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append #$output "/share/racket/pkgs"))))))) - (home-page "https://racket-lang.org") - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (hidden-package + (package + (name "racket-minimal-bc-cgc") + (version %racket-version) + (source %racket-origin) + (inputs + (list + ;; common to all racket-minimal variants: + openssl + sqlite + bash-minimal ;; <- for `system` + ncurses ;; <- for #%terminal + ;; only for BC variants: + libffi)) + (native-inputs (list libtool)) ;; <- only for BC variants + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(cons* "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) + (guix build gnu-build-system) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((lib-search-dirs + . (#f #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib"))) + (build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (add-after 'install 'remove-pkgs-directory + ;; If the configured pkgs-dir exists, "pkgs.rktd" does not + ;; exist, and a lock file does not exist, commands like + ;; `raco pkg show` will try to create a lock file and fail + ;; due to the read-only store. + ;; Arguably this may be a bug in `pkg/private/lock`: + ;; see . + ;; As a workaround, remove the directory. + (lambda args + ;; rmdir because we want an error if it isn't empty + (rmdir (string-append #$output "/share/racket/pkgs"))))))) + (home-page "https://racket-lang.org") + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or ``bytecode'') implementation is not recommended for general use. It uses CGC (a ``Conservative Garbage Collector''), which was succeeded as default in PLT Scheme version 370 (which translates to 3.7 in the current versioning @@ -260,28 +263,24 @@ (define maybe-release-catalog Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may also be used for embedding applications without the annotations needed in C code to use the 3M garbage collector.") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list license:lgpl3+ license:asl2.0 license:expat)) - ;; Eventually, it may make sense for some vm packages to not be hidden, - ;; but this one is especially likely to remain hidden. - (properties `((hidden? . #t))))) + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat))))) (define-public racket-minimal-bc-3m - (hidden-package - (package - (inherit racket-minimal-bc-cgc) - (name "racket-minimal-bc-3m") - (native-inputs - (modify-inputs (package-native-inputs racket-minimal-bc-cgc) - (prepend racket-minimal-bc-cgc))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) - ((#:configure-flags _ '()) - #~(cons "--enable-bconly" - #$(racket-vm-common-configure-flags))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") - (description "The Racket BC (``before Chez'' or ``bytecode'') + (package + (inherit racket-minimal-bc-cgc) + (name "racket-minimal-bc-3m") + (native-inputs + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (prepend racket-minimal-bc-cgc))) + (arguments + (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) + ((#:configure-flags _ '()) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))))) + (synopsis "Minimal Racket with the BC [3M] runtime system") + (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written in C targeting architecture-independent bytecode, plus a JIT compiler on most platforms. Racket BC has a different C API and supports a slightly different @@ -290,9 +289,9 @@ (define-public racket-minimal-bc-3m This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'').") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list license:lgpl3+ license:asl2.0 license:expat))))) + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat)))) (define-public racket-minimal (package -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:37:53 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:37:53 +0000 Received: from localhost ([127.0.0.1]:56548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9RZ-0004DN-CI for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:53 -0500 Received: from mail-qt1-f173.google.com ([209.85.160.173]:38482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9RX-0004D9-9S for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:51 -0500 Received: by mail-qt1-f173.google.com with SMTP id bc10so6094742qtb.5 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:37:51 -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=vj1OeT+wQvOME+8TTCd8YZzCrRZyIzC8PkesAdhbaOQ=; b=GjOxzcSFzNUrYBdOyi5gbFjwV6wDGWmiF3pAhjh7s1+TNSG60KAe/FEjSn0zwauC7v OhrJVchPX/pG+DUU2yLGjePCVrjlvFTjDeQcaITdZyyqvScNAJXoNoQhbPlRQ/JID1uI O2r2+ll0b87tlpJz5dnhZg5RW5G0Vaa9PdN0Fo/fW2CTuzuEnMd+20DBGe9o6VJaglOS lE8vEVsp3NyKR9rPysy4DMEg0Y4BtAESCR68jn3+vVLV6XTJJ1kdxhxIChzs+i4DV5SX ocYD5rOYkR2VbE+UsbWWqd6G6M7WPi2y0LVy5nHNKHRHYg64a+QYAOfKCruBgfGbz+RZ J1+Q== 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=vj1OeT+wQvOME+8TTCd8YZzCrRZyIzC8PkesAdhbaOQ=; b=3c5f5qNAErOUGge02/ASjVZbfmsDk8R6rWcwQu8vpSuS4gJWai4/UQ6BskyQbYFk3F bDHISNZmxN3MGr4Zn53WFfHrCyY9HCnKe/xxmdg+MM2l3fFPg/1YWtbZfb8ixDxplyVE 4VlVHrh1150uOLMEnUFzxU45jq7FJON1XDlGnaa2zNjZX/lkzVQrdHhBIWeVE7sOuk4p 04trEW0Wscytw8+TqpbzCIU91Z1s+q4Y3KOGAe2Zlh6DnxIISXmYl76lqU72s9nDenBN IqVpV9eRCsopAikvMO/a9JM1OVvxfXlqr0h6QK6crxww8vAc8FR558C87K5Fgd5ctPHz +hsg== X-Gm-Message-State: AOAM533vFYWPR8hW8l9+orQg2AP2IPdosaPk+I+hrZeBR1PuJgkAP6EQ wN8PbYrmfrrif64wEwB3DhMMBMaAHJk6zqU6nz0= X-Google-Smtp-Source: ABdhPJwEaxwHWHsIu1WeP9axCTM7zRjerxzmudj3R+vWGUUt03kwuOH6t/MgHRSulSK9P7OIQ6vLNw== X-Received: by 2002:ac8:7c54:0:b0:2de:746c:bd99 with SMTP id o20-20020ac87c54000000b002de746cbd99mr12153099qtv.150.1645929465754; Sat, 26 Feb 2022 18:37:45 -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 y11-20020a05622a004b00b002dea2052d7dsm4373851qtw.12.2022.02.26.18.37.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:37:45 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 08/24] gnu: racket-minimal: Add "debug" output. Date: Sat, 26 Feb 2022 21:34:34 -0500 Message-Id: <20220227023450.1877215-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-minimal-bc-cgc)[outputs]: Add "debug". (racket-vm-common-configure-flags): Add "--disable-strip". --- gnu/packages/racket.scm | 4 +++- 1 file changed, 3 insertions(+) [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.173 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.173 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-minimal-bc-cgc)[outputs]: Add "debug". (racket-vm-common-configure-flags): Add "--disable-strip". --- gnu/packages/racket.scm | 4 +++- 1 file changed, 3 insertions(+) [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.173 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.173 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (racket-minimal-bc-cgc)[outputs]: Add "debug". (racket-vm-common-configure-flags): Add "--disable-strip". --- gnu/packages/racket.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index ca0c09be58..69c99f5764 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -151,7 +151,8 @@ (define (racket-vm-common-configure-flags) (else '())) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - #$(file-append bash-minimal "/bin/sh")))) + #$(file-append bash-minimal "/bin/sh")) + "--disable-strip")) (define (make-unpack-nanopass+stex) ;; Adapted from chez-scheme. @@ -190,6 +191,7 @@ (define-public racket-minimal-bc-cgc ;; only for BC variants: libffi)) (native-inputs (list libtool)) ;; <- only for BC variants + (outputs '("out" "debug")) (build-system gnu-build-system) (arguments (list -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:38:04 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:04 +0000 Received: from localhost ([127.0.0.1]:56554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Rj-0004EL-Jl for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:04 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:36570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Rh-0004DY-DL for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:01 -0500 Received: by mail-qt1-f175.google.com with SMTP id f18so6101400qtb.3 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:01 -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=O2S2PRHkG8IvVGmB0WnxootYPk4QM0bZwqLu/W8JFKU=; b=TzbthcmPb90eB0ZhJn/q3d/08+LiNd2zrMPuMO6gvfWeku66LpUP7u93gAO6zo7/0n XFBGFCRp+fVedF27sU0e+/dFrZeAeD2ERbFXfrOZ3b0Flhc/ivX1tdm2eU1U1K36BS8W 0huQKByDpEJeUkZ2E58LRiOAR92xtXEpY21c+3EBrJYs1foTzpT7r+szlZ9YjuoUvASL WZKV2u391ap6T7Xnuoka9IjVhNd6kkpP7TqaFqwKJJPxAX+KMFKz8i6oAZzhI+AuHbnI kYZgZqhHmNBfxe0AWICcDzU+2g2GLXEfxiXgmvq9Iqhw454/f2ZGtEG4lTvhOjYBi06j 3abQ== 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=O2S2PRHkG8IvVGmB0WnxootYPk4QM0bZwqLu/W8JFKU=; b=yV44kY2n5ZOpfigIpkQjzLkeRF1d/gHWp3uVvL+6x0hSLrHbXyVZD8Q31H7+tSLXa+ cHUcDkxEJAk9qXXZuHHZ2PRGs+GETGllsrSVNiE7zDdcKVS8HGrqYyqFWV7ez7u2HVd3 bBT/ZHM09up7MENcgwscaNV/UmB6MH8oDemyL4/P9wXfA3akqVVEuzZSf3ADFO1U4XXf KJCRfd7YVjs2tLcZWPBBnaj1mLbjlA9B3z40FO9rM5fMIeXCwyIg4C7/oP+NdsFZbOjP MFfdfEFtyr2BNGw1WBRWyoM3PQehbfQyMqqmLxAV1HyEt3O2kuxdf2aCD+7wHv7s7aPP baig== X-Gm-Message-State: AOAM53000MbeP9NedrHNeL4ICt8vLtcRlgUOwQNu9Nw/4OA17yaLrSHx mZpHaJR9TIfB922T9/p1vCyFxowk83kFlOdnqps= X-Google-Smtp-Source: ABdhPJyGSmvg9wjU/pOR6Kt5I0WdpOxWWAc/Yami+ewkE2PQYN/r+Sv1uxYtKSllsOxpjb5D+gYs7g== X-Received: by 2002:ac8:4e43:0:b0:2df:f8d1:64b3 with SMTP id e3-20020ac84e43000000b002dff8d164b3mr3057230qtw.209.1645929475789; Sat, 26 Feb 2022 18:37:55 -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 e8-20020ac85dc8000000b002de409f360fsm4317833qtx.76.2022.02.26.18.37.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:37:55 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 09/24] gnu: configure-layer.rkt: Adjust indentation. Date: Sat, 26 Feb 2022 21:34:35 -0500 Message-Id: <20220227023450.1877215-10-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (configure-layer.rkt): Wrap 'command-line' in 'define-values' to reduce rightward drift. --- gnu/packages/racket.scm | 164 ++++++++++++++++++++ 1 file cha [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.175 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.175 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (configure-layer.rkt): Wrap 'command-line' in 'define-values' to reduce rightward drift. --- gnu/packages/racket.scm | 164 ++++++++++++++++++++ 1 file cha [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.175 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.175 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (configure-layer.rkt): Wrap 'command-line' in 'define-values' to reduce rightward drift. --- gnu/packages/racket.scm | 164 ++++++++++++++++++++-------------------- 1 file changed, 83 insertions(+), 81 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 69c99f5764..4f5f0c1df2 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -926,84 +926,86 @@ (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) (define extra-foreign-lib-search-dirs '()) - (command-line - #:once-each - [("--extra-foreign-lib-search-dirs") dir-list - "foreign library directories, as a list of strings in `read` syntax" - (set! extra-foreign-lib-search-dirs - (call-with-input-string dir-list read))] - #:args (parent-layer prefix) - (let* ([config - (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) - (hash-set* - config - main-key - (build-path-string prefix pth) - search-key - (list* #f - (hash-ref config - main-key - (build-path-string parent-layer pth)) - (filter values (hash-ref config search-key null)))))] - [config - (hash-update config - 'lib-search-dirs - (lambda (dirs) - ;; add after other layers, but before older - ;; foreign lib search directories - (define-values [rkt old-foreign-dirs] - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - dirs)) - (append rkt - extra-foreign-lib-search-dirs - old-foreign-dirs)))] - [config - (hash-set* config - 'apps-dir - (build-path-string prefix "share/applications") - 'absolute-installation? #t - ;; Let Guix coexist with other installation - ;; methods without clobbering user-specific packages. - ;; This could be set in various places, but doing - ;; it here is convienient, at least until we support - ;; cross-compilation. - 'installation-name - (string-append (version) - "-guix" - (match (system-type 'gc) - ['cgc "-cgc"] - ;; workaround Guile reader/printer: - ['|3m| "-bc"] - [_ ""])))] - [bin-dir - (hash-ref config 'bin-dir)] - [config - (hash-set* config - 'config-tethered-apps-dir (hash-ref config 'apps-dir) - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) - (make-parent-directory* new-config-pth) - (call-with-output-file* - new-config-pth - (lambda (out) - (pretty-write config out)))))))) + (define-values [parent-layer prefix] + (command-line + #:once-each + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (parent-layer prefix) + (values parent-layer prefix))) + (let* ([config + (for/fold + ([config (file->value (build-path parent-layer + config-file-pth))]) + ([spec (in-list + '((lib-dir lib-search-dirs "lib/racket") + (share-dir share-search-dirs "share/racket") + (links-file + links-search-files + "share/racket/links.rktd") + (pkgs-dir pkgs-search-dirs "share/racket/pkgs") + (bin-dir bin-search-dirs "bin") + (man-dir man-search-dirs "share/man") + (doc-dir doc-search-dirs "share/doc/racket") + (include-dir + include-search-dirs + "include/racket")))]) + (match-define (list main-key search-key pth) spec) + (hash-set* + config + main-key + (build-path-string prefix pth) + search-key + (list* #f + (hash-ref config + main-key + (build-path-string parent-layer pth)) + (filter values (hash-ref config search-key null)))))] + [config + (hash-update config + 'lib-search-dirs + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] + [config + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaround Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] + [bin-dir + (hash-ref config 'bin-dir)] + [config + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [new-config-pth + (build-path prefix config-file-pth)]) + (make-parent-directory* new-config-pth) + (call-with-output-file* + new-config-pth + (lambda (out) + (pretty-write config out))))))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:38:12 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:12 +0000 Received: from localhost ([127.0.0.1]:56559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Rr-0004F8-AW for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:12 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:36577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Rm-0004Dl-LM for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:08 -0500 Received: by mail-qt1-f179.google.com with SMTP id f18so6101464qtb.3 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:06 -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=MyqBuKQrh0l2BfKrMcE8f1kV4NNl5lRbW0Psl3d3OiQ=; b=FvZGiDbkVstrWdAEyNk4LEuduQ98RCT60uqNcLZYtV1bL9qc9rUxMJyQsxacx492EF 3YQLJ2HaekqE5ofL17VDfQQ/JFVuCjCIyDNU20LsJeLH0wWFK4VHPmi7A/3Gyu0+9gln 47rc9ARUoOsAAMhjb0KQWKQoJe+i+QQ223Vms4K8Ie175X1M6xDFDufQbCz/fajXqitF fkrZk+bersI9vBZLwgr490IMgOGYa+Ahhi59Kjw3SIgbO7MmGejEm0P8uDOsU8Xs6MbZ osPPL0DCZRsx6UsEXF3KjPzZ/jF/xCdyfyYAW4+SCpLxqXIPcVLpcwK0OZrEXC02jJbn tP8Q== 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=MyqBuKQrh0l2BfKrMcE8f1kV4NNl5lRbW0Psl3d3OiQ=; b=S/kbKTU6rAXKNrb6FDVCkY4gkuJAvJ9O2D0sEdbotekROR56fbydiswFZYVrmDLy/f lahwXt2KWdV2tU0qvO+QxW6pu1YxYZZOuRT4DI+Ng21qQHPmDG2DOihljVzqDr47dejV DZ4lTnBLaLKZ0RYYAPeNx8OL4l7tAf/H+/iBuBYXcZUnjl3OBU2KAVqezsTtPMsjvtcb YDVqG9bKQC8IjgzIoKXuQG4Wbaj40pXdCmAdwdzkGWDRs4CKksixGZT3wpHlJIHA0NLr DYu8NPNTgzMLtLSKjs+wWMsQIfiaS/3ZIoJ02N7QSrCdaSMUaOT4L2nckKfeiOH3ES1O Xs6w== X-Gm-Message-State: AOAM530rwAmcn9QzBOO7BeYJl3M861RNmrh9bYkbTaJBe4Slk+lAQhy9 gspvObdAb+KPEaddJZ+/J9AMTati/SL3bEZ/utA= X-Google-Smtp-Source: ABdhPJwoWF0tZtaa+FUGbyvkM9J1w/kYkOh7gb00OeR+tjbbkH0OjtZLw/uL0kUx0bsiFnMDs329Xg== X-Received: by 2002:a05:622a:1113:b0:2dd:5385:36c3 with SMTP id e19-20020a05622a111300b002dd538536c3mr12209617qty.262.1645929480317; Sat, 26 Feb 2022 18:38:00 -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 t2-20020a05622a01c200b002de5098fbaesm4330154qtw.26.2022.02.26.18.37.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:37:59 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 10/24] gnu: racket-minimal: Separate from the Racket VM. Date: Sat, 26 Feb 2022 21:34:36 -0500 Message-Id: <20220227023450.1877215-11-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: For consistency with other Racket distributions, 'racket-minimal' should have the "racket-lib" Racket package installed: see . Happily, this gives us a clean boundary between the core Racket VM and compiler, with all of the bootstrapping involved, and building Racket packages and installation layers, which can be handled in a [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.179 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.179 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: For consistency with other Racket distributions, 'racket-minimal' should have the "racket-lib" Racket package installed: see . Happily, this gives us a clean boundary between the core Racket VM and compiler, with all of the bootstrapping involved, and building Racket packages and installation layers, which can be handled in a [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.179 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.179 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager For consistency with other Racket distributions, 'racket-minimal' should have the "racket-lib" Racket package installed: see . Happily, this gives us a clean boundary between the core Racket VM and compiler, with all of the bootstrapping involved, and building Racket packages and installation layers, which can be handled in a nice, uniform way and eventually turned into a 'racket-build-system'. Building the VM layer as an "in-place" installation should help us use it with other Racket tools. * gnu/packages/racket.scm (racket-vm-common-configure-flags): Add "--enable-origtree". Adapt "--enable-racket=" for "opt/racket-vm/" prefix. (racket-minimal-bc-cgc): Rename to ... (racket-vm-cgc): ... this new variable. [inputs]: Move 'openssl' and 'sqlite' to new 'racket-minimal'. [arguments]<#:strip-directories>: Use "opt/racket-vm/" prefix. <#:phases>: Wrap 'configure', 'patch-shebangs', 'validate-runpath', 'make-dynamic-linker-cache', and 'patch-dot-desktop-files' to use "opt/racket-vm/" prefix. Adapt 'initialize-config.rktd' for removal of 'openssl' and 'sqlite'. [description]: Tweak. (racket-minimal-bc-3m): Rename to ... (racket-vm-bc): ... this new variable. [synopsis, description]: Tweak. (racket-vm-cs): New variable, adapted from the old 'racket-minimal'. (chez-scheme-for-racket-bootstrap-bootfiles)[arguments]<#:phhases>: Adapt to the "opt/racket-vm/" prefix. (racket-minimal): Rewrite like 'racket' using 'racket-vm-cs'. (racket): Inherit from 'racket-minimal'. [inputs]: Add 'racket-vm-cs'. Move "racket-lib" and "base" to 'racket-minimal'. [arguments]<#:make-flags, #:configure-flags>: Override from 'racket-minimal'. (configure-layer.rkt): Adapt to support in-place VM build with possible intermediate layer. --- gnu/packages/racket.scm | 597 ++++++++++++++++++++++++++-------------- 1 file changed, 385 insertions(+), 212 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 4f5f0c1df2..3271e78d45 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -54,7 +54,91 @@ (define-module (gnu packages racket) ;; Commentary: ;; -;; Here's how bootstrapping minimal Racket works: +;; Anatomy of Racket: +;; ------------------ +;; +;; The main Racket Git repository () is +;; organized broadly like this: +;; +;; . +;; ├── Makefile +;; ├── pkgs/ +;; └── racket/ +;; ├── collects/ +;; └── src/ +;; ├── configure +;; ├── Makefile.in +;; ├── bc/ +;; ├── cs/ +;; ├── ChezScheme/ +;; └── ... +;; +;; The 'racket/src/' directory contains the source of the runtime system, core +;; compiler, and primitives for the major Racket implementations: this layer +;; is called the ``Racket VM''. It is basically a normal autotools +;; project. (Even when Racket VM implementations use components implemented in +;; Racket, they are compiled in special modes to produce VM primitives.) +;; (There are or have been experimental Racket VM implementations elsewhere, +;; e.g. .) +;; +;; The 'racket/collects/' directory contains ``built in'' Racket libraries +;; that are not part of any package, including the implementation of +;; 'racket/base': in particular, it must contain enough to implement `raco pkg +;; install'. It is theoretically possible to use the Racket VM layer without +;; the main collections, but it is not stable or useful. +;; +;; The 'pkgs/' directory contains Racket packages that are especially closely +;; tied to the implementation of the Racket VM, including 'compiler-lib', +;; 'racket-doc', and 'racket-test'. Some of these packages depend on Racket +;; packages that are developed in other Git repositories, predominantly but +;; not exclusively under the 'racket' GitHub organization. Conversely, not all +;; of the packages developed in the main Git repository are part of the main +;; Racket distribution. (Additionally, components of the Racket VM that are +;; implemented in Racket can be installed as packages, mostly for ease of +;; development.) +;; +;; The top-level 'Makefile' is more like a directory of scripts: it has +;; convienience targets for developing Racket, and it cooperates with the +;; 'distro-build' package to assemble custom Racket distributions. 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. +;; +;; A ''minimal Racket'' installation includes two packages: 'base', which is a +;; sort of bridge between the current ``built-in'' collections and the package +;; system's model of dependencies, and 'racket-lib', which, for installations +;; that can not rely on a system package manager, pulls in the SQLite and +;; OpenSSL shared libraries as platform-specific dependencies for use by the +;; ``built-in'' collections. +;; +;; The main Racket distribution consists of installing the 'main-distribution' +;; package and all of its dependencies. +;; +;; The default mode when building Racket (or installing it with the released +;; installers) is an ``in-place build'', which produces a self-contained, +;; relocatable, roughly FHS-like directory. (Racket also supports +;; ``Unix-style'' installations, which rearrange the parts of an in-place +;; build into Racket-specific subdirectories and generally tries to work for +;; installation into an FHS-based system.) Certain tools, e.g. 'distro-build' +;; and 'raco cross', are able to work with an in-place Racket build. +;; +;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and +;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and +;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store +;; output. The function 'racket-vm-for-system' returns the recomended Racket +;; VM package for a given system. +;; +;; The file 'racket.scm' builds on these packages to define 'racket-minimal' +;; and 'racket' packages. These use Racket's support for ``layered +;; installations'', which allow an immutable base layer to be extended with +;; additional packages. They use the layer configuration directly provide +;; ready-to-install FHS-like trees, rather than relying on the built in +;; ``Unix-style install'' mechanism. +;; +;; Bootstrapping Racket: +;; --------------------- +;; +;; Here's how bootstrapping Racket works: ;; ;; - Racket BC [CGC] can be built with only a C compiler (except for ;; one caveat discussed below). @@ -72,6 +156,10 @@ (define-module (gnu packages racket) ;; ;; So, we build CGC to build 3M to build bootfiles and CS. ;; +;; (Note: since the CGC variant is basically only for bootstrapping, we +;; often use "BC" to mean "3M", consistent with `(banner)` and the +;; suffixes used on executables when more than one variant co-exists.) +;; ;; 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 @@ -145,14 +233,15 @@ (define (racket-vm-common-configure-flags) '())) ,@(cond ((false-if-exception - (search-input-file %build-inputs "/bin/racket")) + (search-input-file %build-inputs "/opt/racket-vm/bin/racket")) => (lambda (racket) (list (string-append "--enable-racket=" racket)))) (else '())) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" #$(file-append bash-minimal "/bin/sh")) - "--disable-strip")) + "--disable-strip" + "--enable-origtree")) (define (make-unpack-nanopass+stex) ;; Adapted from chez-scheme. @@ -173,31 +262,25 @@ (define (make-unpack-nanopass+stex) (display "# to placate ../configure"))))) -(define-public racket-minimal-bc-cgc +(define-public racket-vm-cgc ;; Eventually, it may make sense for some vm packages to not be hidden, ;; but this one is especially likely to remain hidden. (hidden-package (package - (name "racket-minimal-bc-cgc") + (name "racket-vm-cgc") (version %racket-version) (source %racket-origin) - (inputs - (list - ;; common to all racket-minimal variants: - openssl - sqlite - bash-minimal ;; <- for `system` - ncurses ;; <- for #%terminal - ;; only for BC variants: - libffi)) + (inputs (list ncurses ;; <- common to all variants (for #%terminal) + bash-minimal ;; <- common to all variants (for `system`) + libffi)) ;; <- only for BC variants (native-inputs (list libtool)) ;; <- only for BC variants (outputs '("out" "debug")) (build-system gnu-build-system) (arguments (list #:configure-flags - #~(cons* "--enable-cgcdefault" - #$(racket-vm-common-configure-flags)) + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) ;; Tests are in packages like racket-test-core and ;; main-distribution-test that aren't part of the main ;; distribution. @@ -208,51 +291,72 @@ (define-public racket-minimal-bc-cgc (ice-9 regex) (guix build gnu-build-system) (guix build utils)) + #:strip-directories #~'("opt/racket-vm/bin" + "opt/racket-vm/lib") #:phases - #~(modify-phases %standard-phases - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (define maybe-release-catalog - (let ((v #$(package-version this-package))) - (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" - v) - `(,(string-append - "https://download.racket-lang.org/releases/" - v - "/catalog/")) - '()))) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f #$(file-append (this-package-input "openssl") "/lib") - #$(file-append (this-package-input "sqlite") "/lib"))) - (build-stamp . "") - (catalogs ,@maybe-release-catalog - #f))))))) - (add-before 'configure 'chdir - (lambda _ - (chdir "racket/src"))) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda args - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append #$output "/share/racket/pkgs"))))))) + #~(let () + (define* ((wrap-racket-vm-outputs phase) . args) + (apply + phase + (let loop ((args args)) + (match args + ((#:outputs outputs . args) + `(#:outputs + ,(let loop ((outputs outputs)) + (match outputs + ((("out" . out) . outputs) + `(("out" . ,(string-append out "/opt/racket-vm/")) + ,@outputs)) + ((other . outputs) + (cons other (loop outputs))))) + ,@args)) + ((arg . args) + (cons arg (loop args))))))) + (modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (replace 'configure + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'configure))) + (replace 'patch-shebangs + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-shebangs))) + (replace 'validate-runpath + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'validate-runpath))) + (replace 'make-dynamic-linker-cache + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) + (replace 'patch-dot-desktop-files + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) (home-page "https://racket-lang.org") (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or @@ -262,32 +366,33 @@ (define maybe-release-catalog scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the Racket CS implementation. -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may +Racket CGC is primarily used for bootstrapping Racket BC [3M]. It may also be used for embedding applications without the annotations needed in C code to use the 3M garbage collector.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) -(define-public racket-minimal-bc-3m +(define-public racket-vm-bc (package - (inherit racket-minimal-bc-cgc) - (name "racket-minimal-bc-3m") + (inherit racket-vm-cgc) + (name "racket-vm-bc") (native-inputs - (modify-inputs (package-native-inputs racket-minimal-bc-cgc) - (prepend racket-minimal-bc-cgc))) + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) + (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:configure-flags _ '()) #~(cons "--enable-bconly" #$(racket-vm-common-configure-flags))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") + (synopsis "Racket BC [3M] implementation") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written in C targeting architecture-independent bytecode, plus a JIT compiler on most platforms. Racket BC has a different C API and supports a slightly different set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). +on ``Chez Scheme''). It is the recommended implementation for architectures +that Racket CS doesn't support. This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'').") @@ -295,23 +400,23 @@ (define-public racket-minimal-bc-3m ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat)))) -(define-public racket-minimal +(define-public racket-vm-cs (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal") + (inherit racket-vm-bc) + (name "racket-vm-cs") (inputs - (modify-inputs (package-inputs racket-minimal-bc-cgc) + (modify-inputs (package-inputs racket-vm-cgc) (prepend zlib lz4) (delete "libffi"))) (native-inputs - (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") (prepend chez-scheme-for-racket-bootstrap-bootfiles - racket-minimal-bc-3m))) + racket-vm-bc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:phases bc-phases) - #~(modify-phases #$bc-phases + (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" @@ -328,17 +433,14 @@ (define-public racket-minimal "--enable-libz" "--enable-lz4" #$(racket-vm-common-configure-flags))))) - (synopsis "Racket without bundled packages such as DrRacket") - (description - "Racket is a general-purpose programming language in the Scheme family, -with a large set of libraries and a compiler based on Chez Scheme. Racket is -also a platform for language-oriented programming, from small domain-specific -languages to complete language implementations. + (synopsis "Racket CS implementation") + (description "The Racket CS implementation, which uses ``Chez Scheme'' as +its core compiler and runtime system, has been the default Racket VM +implemetation since Racket 8.0. It performs better than the Racket BC +implementation for most programs. -The ``minimal Racket'' distribution includes just enough of Racket for you to -use @command{raco pkg} to install more. Bundled packages, such as the -DrRacket IDE, are not included.") - (properties `()) +Using the Racket VM packages directly is not recommended: instead, install the +@code{racket-minimal} or @code{racket} packages.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) @@ -353,7 +455,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; When updating, remember to also update %racket-version in racket.scm. (source %racket-origin) (inputs `()) - (native-inputs (list racket-minimal-bc-3m)) + (native-inputs (list racket-vm-bc)) (build-system copy-build-system) ;; TODO: cross compilation (arguments @@ -371,7 +473,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) (invoke (search-input-file (or native-inputs inputs) - "/bin/racket") + "/opt/racket-vm/bin/racket") "rktboot/main.rkt")))))) (home-page "https://github.com/racket/ChezScheme") ;; ^ This is downstream of https://github.com/racket/racket, @@ -452,10 +554,116 @@ (define (simple-racket-origin repo hash spec0 . spec*) spec0 spec*)) +(define-public racket-minimal + (package + (name "racket-minimal") + (version %racket-version) + (source #f) + ;; For cross-compilation, Matthew Flatt recommends reusing + ;; as much of `raco cross` as possible. So, put that off until + ;; we have a build system for Racket packages. + (inputs + (list openssl + sqlite + racket-vm-cs ;; TODO (racket-vm-for-system) + (racket-packages-origin + "base" %racket-origin + '("base" "pkgs/base") + '("racket-lib" "pkgs/racket-lib")))) + (build-system gnu-build-system) + (arguments + ;; Here and for the `racket` package, we're using #:configure-flags + ;; to pass flags for `configure-layer.rkt` and #:make-flags + ;; to pass arguments for `raco pkg install`. + (list + #:configure-flags + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format + #f "~s" + (list #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib")))) + #:make-flags #~`("racket-lib") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (guix build union) + (ice-9 match)) + #:imported-modules `((guix build union) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (delete 'unpack) + (replace 'configure + (lambda* (#:key inputs configure-flags #:allow-other-keys) + (let* ((vm-dir (search-input-directory inputs "opt/racket-vm")) + (racket (string-append vm-dir "/bin/racket"))) + (apply invoke + racket + #$configure-layer.rkt + `(,@(cond + ((false-if-exception + (search-input-file + inputs "etc/racket/config.rktd")) + => (lambda (file) + `("--parent" + ,(dirname (dirname (dirname file)))))) + (else + '())) + ,@configure-flags + ,vm-dir + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; We use "share/racket/pkgs" for sources to distinguish them + ;; from the "lib/racket/pkgs" of a potential parent layer. + (union-build (string-append #$output "/lib/racket/pkgs") + (search-path-as-list '("share/racket/pkgs") + (map cdr inputs)) + #:create-all-directories? #t))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket + (search-input-file inputs "/opt/racket-vm/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) + (home-page "https://racket-lang.org") + (synopsis "Racket without bundled packages such as DrRacket") + (description + "Racket is a general-purpose programming language in the Scheme family, +with a large set of libraries and a compiler based on Chez Scheme. Racket is +also a platform for language-oriented programming, from small domain-specific +languages to complete language implementations. + +The ``minimal Racket'' distribution includes just enough of Racket for you to +use @command{raco pkg} to install more. Bundled packages, such as the +DrRacket IDE, are not included.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) + (define-public racket (package + (inherit racket-minimal) (name "racket") - (version %racket-version) (source #f) (inputs (list @@ -474,6 +682,7 @@ (define-public racket unixodbc libedit ;; TODO reconsider in light of expeditor and readline-gpl racket-minimal ;; <-- TODO non-tethered layer + racket-vm-cs ;; TODO (racket-vm-for-system) (simple-racket-origin "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") "2d" "2d-doc" "2d-lib") @@ -482,8 +691,6 @@ (define-public racket '("algol60" ".")) (racket-packages-origin "racket" %racket-origin - '("base" "pkgs/base") ;; FIXME belongs in racket-minimal - '("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in racket-minimal '("at-exp-lib" "pkgs/at-exp-lib") '("compiler" "pkgs/compiler") '("compiler-lib" "pkgs/compiler-lib") @@ -808,91 +1015,39 @@ (define-public racket "xrepl" "xrepl-doc" "xrepl-lib"))) (build-system gnu-build-system) (arguments - ;; We're using #:configure-flags to pass flags for - ;; `configure-layer.rkt` and #:make-flags to pass arguments for - ;; `raco pkg install`. - (list - #:configure-flags - #~`("--extra-foreign-lib-search-dirs" - ,(format #f "~s" - '(#$@(map (lambda (name) - (cond - ((this-package-input name) - => (cut file-append <> "/lib")) - (else - (raise-exception - (make-exception - (make-assertion-failure) - (make-exception-with-message - "missing input to the 'racket' package") - (make-exception-with-irritants - (list name))))))) - '("cairo" - "fontconfig-minimal" ;; aka fontconfig - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg-turbo" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))))) - #:make-flags #~`("main-distribution") - #:tests? #f ;; packaged separately - #:modules '((guix build gnu-build-system) - (guix build utils) - (guix build union) - (ice-9 match)) - #:imported-modules `((guix build union) - ,@%gnu-build-system-modules) - #:phases - #~(modify-phases %standard-phases - (delete 'unpack) - (replace 'configure - (lambda* (#:key inputs configure-flags #:allow-other-keys) - (let* ((racket (search-input-file inputs "bin/racket"))) - (apply invoke - racket - #$configure-layer.rkt - `(,@configure-flags - ,(dirname (dirname racket)) - ,#$output)) - (invoke racket - "--config" (string-append #$output "/etc/racket") - "-l" "raco" "setup" - "--no-user")))) - (replace 'build - (lambda* (#:key inputs #:allow-other-keys) - ;; We use "share/racket/pkgs" for sources to distinguish them - ;; from the "lib/racket/pkgs" of a potential parent layer. - (union-build (string-append #$output "/lib/racket/pkgs") - (search-path-as-list '("share/racket/pkgs") - (map cdr inputs)) - #:create-all-directories? #t))) - (replace 'install - (lambda* (#:key inputs make-flags #:allow-other-keys) - (let ((racket (search-input-file inputs "/bin/racket"))) - (unless (null? make-flags) - (invoke racket - "-l-" - "pkg/dirs-catalog" - "--link" - "local-catalog" - (string-append #$output "/lib/racket/pkgs")) - (apply invoke - racket - "--config" (string-append #$output "/etc/racket") - "-l" "raco" - "pkg" "install" - "--installation" - "--auto" - "--catalog" "local-catalog" - make-flags)))))))) - (home-page "https://racket-lang.org") + (substitute-keyword-arguments (package-arguments racket-minimal) + ((#:make-flags _ '()) + #~`("main-distribution")) + ((#:configure-flags _ '()) + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit")))))))) (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -902,10 +1057,7 @@ (define-public racket The main Racket distribution comes with many bundled packages, including the DrRacket IDE, libraries for GUI and web programming, and implementations of -languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list license:asl2.0 license:expat)))) +languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) (define configure-layer.rkt (scheme-file @@ -918,41 +1070,53 @@ (define configure-layer.rkt racket/port racket/list racket/pretty) - (define config-file-pth - "etc/racket/config.rktd") (define (build-path-string . args) (path->string (apply build-path args))) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) + (define tethered? #f) + (define parent #f) (define extra-foreign-lib-search-dirs '()) - (define-values [parent-layer prefix] + (define-values [vm-dir prefix] (command-line #:once-each + [("--tethered") "create a tethered layer" + (set! tethered? #t)] + [("--parent") dir "path of parent layer, if any" + (set! parent dir)] [("--extra-foreign-lib-search-dirs") dir-list "foreign library directories, as a list of strings in `read` syntax" (set! extra-foreign-lib-search-dirs (call-with-input-string dir-list read))] - #:args (parent-layer prefix) - (values parent-layer prefix))) + #:args (vm-dir prefix) + (values vm-dir prefix))) (let* ([config (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) + ([config (file->value + (if parent + (build-path parent "etc/racket/config.rktd") + (build-path vm-dir "etc/config.rktd")))]) + ([spec + (in-list + '((lib-dir lib-search-dirs "lib/racket" "lib") + (share-dir share-search-dirs "share/racket" "share") + (links-file links-search-files + "lib/racket/links.rktd" + "share/links.rktd") + (pkgs-dir pkgs-search-dirs "lib/racket/pkgs" "share/pkgs") + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(bin-dir bin-search-dirs "bin" "bin") + (bin-dir bin-search-dirs + "lib/racket/bogus-untethered-bin" + "bin") + (man-dir man-search-dirs "share/man" "share/man") + (doc-dir doc-search-dirs "share/doc/racket" "doc") + (include-dir include-search-dirs + "include/racket" + "include")))]) + (match-define (list main-key search-key pth vm-pth) spec) (hash-set* config main-key @@ -961,7 +1125,10 @@ (define-values [parent-layer prefix] (list* #f (hash-ref config main-key - (build-path-string parent-layer pth)) + (lambda () + (if parent + (build-path-string parent pth) + (build-path-string vm-dir vm-pth)))) (filter values (hash-ref config search-key null)))))] [config (hash-update config @@ -995,15 +1162,21 @@ (define-values [rkt old-foreign-dirs] ;; workaround Guile reader/printer: ['|3m| "-bc"] [_ ""])))] - [bin-dir - (hash-ref config 'bin-dir)] [config - (hash-set* config - 'config-tethered-apps-dir (hash-ref config 'apps-dir) - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) + (cond + [tethered? + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(define bin-dir (hash-ref config 'bin-dir)) + (define bin-dir (build-path-string prefix "bin")) + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [else + config])]) + (define new-config-pth + (build-path prefix "etc/racket/config.rktd")) (make-parent-directory* new-config-pth) (call-with-output-file* new-config-pth -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:38:19 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:19 +0000 Received: from localhost ([127.0.0.1]:56562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Ry-0004FU-Rn for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:19 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]:42807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Rq-0004En-EF for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:11 -0500 Received: by mail-qt1-f169.google.com with SMTP id 11so6095797qtt.9 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:10 -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=70tFTqzO7mBf03FccqMKi2uAgvJznXFOR1Dcwftwo3c=; b=NHpBMhNuRXOD1thkKek483DENU1yX1qQAGFVUi6MV1VlwF7oHBrZEOxCYq8d7FKErH ZdxauDQxg33NVpWrJDJ82DqUh4ueRGHNxmaEpo1dH3gmMSTrMC0q94aHZnjt3FMfiWyz KA2+Yy9Ti/c8FddWSAJFOGHmyhF9AuZcSFreHpfSlUlnnShTXfriNIjKNGBChLo9oLUW zWHd2iUMlCKqURJu4JHD8QQa75EfYeWMAyjiWOBTGT67PwjJLR3DD2FKSZi/oxTBXzgy irTIZTSBYTr7IjCo+cakgf/1m+Y9ZoVZ2gVljFjA0gr4qqehEhfqPhuQs8ztTaBzGT9M Porw== 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=70tFTqzO7mBf03FccqMKi2uAgvJznXFOR1Dcwftwo3c=; b=WTzsyCEAs1pIGnzBKzhugor/oV4BWWG9XNBNi/NKo1ZmbyDpv0gZOR8EzCtXhsmbvX rQtIjF64sYzeRms87fvpl+x/hqwb/KzuwO0BUalIUern1hImrzjDZnJwDLYR78FHEZaR LF7+nJSaxGm2X3ov2JWRWpDzNE4albdDd5LTYJogn5nXE3mYherKqzcUBRLpF4e5JeVb KjoIPkSUWP/PViaNWlGO3gbpdruklZPyLq3L60qcBK7pZbqdEzgSdB++SvAyQLAD2z2T z1ksPNfu8jXxjrwDDba36nDZ1AHEEqnf0pLNCrwMTb3sUyv3ohg3csKpnXgKC5tqmxRx kUEQ== X-Gm-Message-State: AOAM5317VUOXm5GnyxIoT4M2x3fwdl/NVCaNhUa5sfmxynjrFneseL+i y/npj9WuEC1mAcs5RRfffHN/DGtvO5EeisL2izI= X-Google-Smtp-Source: ABdhPJxz8ljzwFn4F7pBNfnZvtWtYbDTz0CAqi8IVWts4z2p9ZRDMfWu8kOkkkQW4gJIkm1B9olUpQ== X-Received: by 2002:a05:622a:289:b0:2de:4b60:a7e with SMTP id z9-20020a05622a028900b002de4b600a7emr11951126qtw.477.1645929484810; Sat, 26 Feb 2022 18:38:04 -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 194-20020a3706cb000000b005081e1550c8sm3275371qkg.78.2022.02.26.18.38.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:04 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 11/24] gnu: racket: Move Chez bootfiles to (gnu packages chez). Date: Sat, 26 Feb 2022 21:34:37 -0500 Message-Id: <20220227023450.1877215-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (chez-scheme-for-racket-bootstrap-bootfiles): Move to ... * gnu/packages/chez.scm (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable. [source]: Avoid problem [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.169 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.169 listed in list.dnswl.org] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (chez-scheme-for-racket-bootstrap-bootfiles): Move to ... * gnu/packages/chez.scm (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable. [source]: Avoid problem [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.169 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.169 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (chez-scheme-for-racket-bootstrap-bootfiles): Move to ... * gnu/packages/chez.scm (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable. [source]: Avoid problematic cycle with "racket.scm". [arguments]<#:phases>: Likewise. --- gnu/packages/chez.scm | 62 +++++++++++++++++++++++++++++++++++++++++ gnu/packages/racket.scm | 52 ---------------------------------- 2 files changed, 62 insertions(+), 52 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 47904e7b4e..046bb3dcdc 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -31,12 +31,14 @@ (define-module (gnu packages chez) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages compression) #:use-module (gnu packages ncurses) #:use-module (gnu packages ghostscript) #:use-module (gnu packages linux) #:use-module (gnu packages netpbm) + #:use-module (gnu packages racket) #:use-module (gnu packages tex) #:use-module (gnu packages compression) #:use-module (gnu packages image) @@ -260,6 +262,66 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license asl2.0))) +(define-public chez-scheme-for-racket-bootstrap-bootfiles + (package + (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. + (source #f) ; avoid problematic cycle with racket.scm + (inputs `()) + (native-inputs (list racket-vm-bc)) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list + #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")) + #:phases + #~(let ((unpack (assoc-ref %standard-phases 'unpack))) + (modify-phases %standard-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 + (copy-recursively + #$nanopass + "nanopass" + #:keep-mtime? #t))) + (add-before 'install 'build + (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://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 "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 +supported platforms.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +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.") + (license (list asl2.0)))) + (define-public chez-srfi (package (name "chez-srfi") diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 3271e78d45..59944031e6 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -445,58 +445,6 @@ (define-public racket-vm-cs ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) -(define-public chez-scheme-for-racket-bootstrap-bootfiles - (package - (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. - (source %racket-origin) - (inputs `()) - (native-inputs (list racket-vm-bc)) - (build-system copy-build-system) - ;; TODO: cross compilation - (arguments - (list - #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda args - (chdir "racket/src/ChezScheme"))) - (add-after 'chdir 'unpack-nanopass+stex - (lambda args - #$(make-unpack-nanopass+stex))) - (add-before 'install 'build - (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://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 "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 -supported platforms.) - -The Racket package @code{cs-bootstrap} (part of the main Racket Git -repository) implements enough of a Chez Scheme simulation to load the Chez -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.") - (license (list license:asl2.0)))) - (define (racket-packages-origin name origin spec0 . spec*) "Extract from ORIGIN the sources for the Racket packages specified by SPEC0 and any additional arguments SPEC*. In the resulting file-like object, each -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:38:20 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:20 +0000 Received: from localhost ([127.0.0.1]:56565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Rz-0004Ff-KU for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:20 -0500 Received: from mail-qk1-f174.google.com ([209.85.222.174]:39835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Ru-0004F0-NB for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:15 -0500 Received: by mail-qk1-f174.google.com with SMTP id t21so7815873qkg.6 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:14 -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=Mlc/qhGedBkcO/u3jAnfRZ74tW1eDlJyXNhnlOfQlJM=; b=URF809wdrZf2vY9u951K66zM10YZaJAeRaUa/LYklT+i9+OpIuh+A+/5TvFCLI7f+1 GyJe+u6KWTPNvYl0xGdjX6knFIPIrFCTc4mT76rAkDQhB4nk5f69w4qZF9+t8IH2HkKi OEWmd5ghRumeglKDfAzI6JB3t0tZ7V6IcusoZW2tZoh4frQqpVT/Ka5BwI4zKmUmAziD kFqIWtcB+aHDKbI3nUr3TjN4m6pYio5HIAhBrsIZQvWxJ2/0VSpbNwKwc84+pD3yySk3 Wol69p/9ulH4SM3AqwT78arcDon6lZU9q86MuzQGv2fi5mNJvEjLAa4sznsoqSt5/4Ny ydVg== 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=Mlc/qhGedBkcO/u3jAnfRZ74tW1eDlJyXNhnlOfQlJM=; b=2D09603MIiTUZVFal2OjoEalXKjoYQ4vJOriRbcnO3Yl0WpcFah0nXm8+FqC6GCCt9 WkzG5I+CdhHcUdeNpjwNlAkcqE11jNrIt2XmZE+WPu25mzWiwcV7rVw3vW4JegUoSmy7 45AvoPMbMAUS+9y01f8wlC21jZZ3WzDt/2Pe8sAUXzCtG/uAQJAwXL8vgjCSTpOtdz7w RB7Z3v2Hwnavk7KyK5hOZTpNXgZLrXMV4G+Izt7izwwd4woD3OfjhrNyQSyMjYu3dqJ9 cxtnVn+Lm3nc47wUyXaWymLr8gow212Th+rShR8MYGKvy4YFghOHHpxBvEkGBZhlU96Q vS+Q== X-Gm-Message-State: AOAM532d1nKU8UmOduxGAU+rmXAdpvrOukqhEy4qaULYaV/uHe0Un3u7 lcTXsrs3uxI6suzXPbHpp+gLke0/qreyTYRmMf0= X-Google-Smtp-Source: ABdhPJyo5V2yXzvgugfC+GcMlXjgb99mgWAeNj+ui06mCXZco2dQ7VjRGx92ao3JgKrrdNBEUYnoBA== X-Received: by 2002:a37:a515:0:b0:507:f45e:5357 with SMTP id o21-20020a37a515000000b00507f45e5357mr8310290qke.554.1645929489032; Sat, 26 Feb 2022 18:38:09 -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 k125-20020a37a183000000b005f170f7e497sm3251616qke.47.2022.02.26.18.38.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:08 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 12/24] gnu: chez: Add utilities for Chez machine types. Date: Sat, 26 Feb 2022 21:34:38 -0500 Message-Id: <20220227023450.1877215-13-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system, nix-system->chez-machine, chez-upstream-features-for-system): New functions. (%nix-arch-to-chez-al [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.174 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.174 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system, nix-system->chez-machine, chez-upstream-features-for-system): New functions. (%nix-arch-to-chez-al [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.174 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.174 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/chez.scm (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system, nix-system->chez-machine, chez-upstream-features-for-system): New functions. (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private constants. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. (chez-scheme-for-racket-bootstrap-bootfiles)[supported-systems]: Compute based on 'nix-system->chez-machine'. --- gnu/packages/chez.scm | 127 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 3 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 046bb3dcdc..603fc4201e 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -44,7 +44,119 @@ (define-module (gnu packages chez) #:use-module (gnu packages image) #:use-module (gnu packages xorg) #:use-module (ice-9 match) - #:use-module (srfi srfi-1)) + #:use-module (srfi srfi-1) + #:export (nix-system->chez-machine + chez-machine->nonthreaded + chez-machine->threaded)) + +(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 +MACHINE. The returned string may share storage with MACHINE." + ;; Chez Scheme documentation consistently uses "nonthreaded" rather than + ;; e.g. "unthreaded" + (if (eqv? #\t (string-ref machine 0)) + (substring machine 1) + machine)) +(define (chez-machine->threaded machine) + "Like @code{chez-machine->nonthreaded}, but returns the threaded machine +type." + (if (eqv? #\t (string-ref machine 0)) + machine + (string-append "t" machine))) + +;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt +;; in https://github.com/racket/raco-cross. +;; For supported platforms, refer to release_notes/release_notes.stex in the +;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md +;; in https://github.com/racket/racket. +(define %nix-arch-to-chez-alist + `(("x86_64" . "a6") + ("i386" . "i3") + ("aarch64" . "arm64") + ("armhf" . "arm32") ;; Chez supports ARM v6+ + ("ppc" . "ppc32"))) +(define %nix-os-to-chez-alist + `(("w64-mingw32" . "nt") + ("darwin" . "osx") + ("linux" . "le") + ("freebsd" . "fb") + ("openbsd" . "ob") + ("netbsd" . "nb") + ("solaris" . "s2"))) + +(define (chez-machine->nix-system machine) + "Return the Nix system type corresponding to the Chez Scheme machine type +MACHINE. If MACHINE is not a string representing a known machine type, an +exception is raised. This function does not distinguish between threaded and +nonthreaded variants of MACHINE. + +Note that this function only handles Chez Scheme machine types in the +strictest sense, not other kinds of descriptors sometimes used in place of a +Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or +@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type +for the host system is often still relevant.)" + (let ((machine (chez-machine->nonthreaded machine))) + (let find-arch ((alist %nix-arch-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (string-prefix? chez machine) + (string-append + nix "-" (let ((machine-os + (substring machine (string-length chez)))) + (let find-os ((alist %nix-os-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (equal? chez machine-os) + nix + (find-os alist))))))) + (find-arch alist))))))) + +(define* (nix-system->chez-machine #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return the Chez Scheme machine type corresponding to the Nix system +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme +machine type is undefined. + +It is unspecified whether the resulting string will name a threaded or a +nonthreaded machine type: when the distinction is relevant, use +@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust +the result." + (let* ((hyphen (string-index system #\-)) + (nix-arch (substring system 0 hyphen)) + (nix-os (substring system (+ 1 hyphen))) + (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) + (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) + (and chez-arch chez-os (string-append chez-arch chez-os)))) + +(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}. Other feature symbols may be added in the future." + (cond + ((not (nix-system->chez-machine system)) + #f) + ((target-aarch64? system) + #f) + ((target-arm32? system) + (and (target-linux? system) + '())) + ((target-ppc32? system) + (and (target-linux? system) + '(threads))) + (else + '(threads)))) + +;; +;; Chez Scheme: +;; (define nanopass (let ((version "1.9.2")) @@ -251,8 +363,11 @@ (define* (stex-make #:optional (suffix "")) ;; We should too. It is the Chez machine type arm32le ;; (no threaded version upstream yet, though there is in ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) + (supported-systems + (delete + "armhf-linux" ;; <-- should work, but reportedly broken + (filter chez-upstream-features-for-system + %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description @@ -300,6 +415,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)) (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 @@ -322,6 +439,10 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles Chez Scheme.") (license (list asl2.0)))) +;; +;; Packages: +;; + (define-public chez-srfi (package (name "chez-srfi") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:38:33 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:33 +0000 Received: from localhost ([127.0.0.1]:56570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SD-0004GO-8w for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:33 -0500 Received: from mail-qt1-f176.google.com ([209.85.160.176]:47045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Ry-0004FH-VT for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:19 -0500 Received: by mail-qt1-f176.google.com with SMTP id a1so1555931qta.13 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:18 -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=P/53BPk+7O2+InAkhrvNK9cEXw2EYbleDRYOJqJuvjc=; b=DQ7D+5LoX87TNIXosLWb6WIkTWGRDK4L/nzcWRaHLxvCfI5vKzCk3mmAl+uH4Z2ADx ISO1Uw5xEXgagtQeLq1jrUjdEct58SjqPykAtgWl5QMNztFrLd/vIlB/ldGGXJfryMcR nymFtR92P2LekM3v9i0e0Cp4WvaRgny1/rUKnlROxVIkVzbm0ni6R9wwDRapFBMABDy1 cKWJeQCqDXnHWPgxb6UFNFEqvYb836FggAiDBhQ8jPJCDqrxyqPCoq9wRYIcg/glRIXp Mff3yUtWiS53CiLEws/3tMfyizO4kVtL1chIjctMdyCtBPH1UepltogxZsdY5zv861Dd VriA== 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=P/53BPk+7O2+InAkhrvNK9cEXw2EYbleDRYOJqJuvjc=; b=f/fv+io61IrCW7gninCQkI8lZgU1foqiv5ZbrGPrLCCZUDaBqXrtTLRDTWwmj2/nGh oHYmUVruwEQWUBXa7GyRFGQ5/6B6Igit5XA6ivToaQk+KA8kllm9yhSz2iWQ6s1VYjci AVyTRwC1L3CYFPGMegt4ljZZU7KCpWcMy2phPHETTzpZUAZsX78LPHrhdLdkkTFR8MlQ AL8r1+0+2JLfohXwOpeW8WIbGS9//rvONGbYpFhDFHkyT6GxCaxX/M4TqoXVrVNV2nR/ 7Ry2XnsP5D2VEHdTSQD/wTPJ9W4lkbhcPOeFKhUaaZwOQNOIoQrZ8JhFk7/Za5b2+kFz wvyw== X-Gm-Message-State: AOAM532HaDindfBqQWVV9whRtfkm4uuM2MmeYV9l1FtKpjn/zMelLvif e1J4rclQ2Gn7hFtWuoLZC3CKe/rVQWlFtg+A0rI= X-Google-Smtp-Source: ABdhPJwOVS0f35Z8/DmyPP5qzvNnM6TNXR3OMZV9+EKMiP41XLMC5CztDM74O1N5b75KzC1XaRAXSw== X-Received: by 2002:ac8:5ac6:0:b0:2de:4b60:688 with SMTP id d6-20020ac85ac6000000b002de4b600688mr12319808qtd.251.1645929493521; Sat, 26 Feb 2022 18:38:13 -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 h14-20020ac8584e000000b002ddf8b971b2sm4463669qth.87.2022.02.26.18.38.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:13 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 13/24] gnu: racket: Add 'racket-vm-for-system'. Date: Sat, 26 Feb 2022 21:34:39 -0500 Message-Id: <20220227023450.1877215-14-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-vm-for-system): New procedure. (racket-minimal, racket)[inputs]: Use it. --- gnu/packages/racket.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(- [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.176 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.176 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-vm-for-system): New procedure. (racket-minimal, racket)[inputs]: Use it. --- gnu/packages/racket.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(- [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.176 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.176 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (racket-vm-for-system): New procedure. (racket-minimal, racket)[inputs]: Use it. --- gnu/packages/racket.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 59944031e6..10ec0591d9 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -187,6 +187,14 @@ (define-module (gnu packages racket) ;; ;; Code: +(define* (racket-vm-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." + (if (nix-system->chez-machine system) + racket-vm-cs + racket-vm-bc)) + (define %racket-version "8.4") ;; ^ Remember to update chez-scheme-for-racket-bootstrap-bootfiles! (define %racket-commit @@ -513,7 +521,7 @@ (define-public racket-minimal (inputs (list openssl sqlite - racket-vm-cs ;; TODO (racket-vm-for-system) + (racket-vm-for-system) (racket-packages-origin "base" %racket-origin '("base" "pkgs/base") @@ -630,7 +638,7 @@ (define-public racket unixodbc libedit ;; TODO reconsider in light of expeditor and readline-gpl racket-minimal ;; <-- TODO non-tethered layer - racket-vm-cs ;; TODO (racket-vm-for-system) + (racket-vm-for-system) (simple-racket-origin "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") "2d" "2d-doc" "2d-lib") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:38:33 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:33 +0000 Received: from localhost ([127.0.0.1]:56572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SD-0004GQ-HK for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:33 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:41478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9S7-0004Ft-Vy for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:28 -0500 Received: by mail-qt1-f172.google.com with SMTP id n11so6102496qtk.8 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:27 -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=c6TzP7tP4BB13MBcjLiq0wzXqF2mXc5qBVWu9Pd9w4o=; b=L39zSGW8EhA6rWq2LEN+LXb1A9Cbws9UUTf5FyZqUEaJGdU3Mg66EbCOmNW/gGNVIN yWWENPzw47Hqot280+ClIjxZ6DMLHLDZFEhLVT34iMO6ol7ZyGD49iEeMB5u5HsE9EZf qeGDGfW0d0z/Y9ta0M993N3v1Sjs35XNuuO3TJxzgQUbCGb21QNEbOI+jfavHDzzRx0y ABrbZONlxVODRjbdHHANpla0v5xd32z2uJUXUI7LKTWNP8h8+ianoOEqdcOHQoj+at1R 6kwtJRrfw6hyKpdgQs+c0QqXkmH+mSvTcPgq4rWw08RnMlnHCR1vMmVdUma/EYwj7rA1 94mg== 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=c6TzP7tP4BB13MBcjLiq0wzXqF2mXc5qBVWu9Pd9w4o=; b=1xGPNXyRXL/jqN/Zw23MDpbDScnYbrGboYwL57cRo/zzSDXLYTLJ6DruKfVWAIDh6m f7f+CKqlMAAr/8CJGdGI7xJhTxyjyxk9TF82Epclb3YLHGT3j+5T+xTWNeVLLXoeByGP j4bVQsew2aSJ0BmqZMrm1838TwaZT2aEFPVGTrOGPIjg8WwvGQYkMfduFSjOpk4CtbhM FLvjwIkqPByBJzI595e4EBTjwSq8Z1XWtWq1E4bPNBNZFR1fQ7X2d+Lq4zrZrB9p2Gil QoAPkv+1wSWZkIgT518PvKjopSsrPfk650ZDhoqQJTKI4PMJ+T/GXLNdEo8YKidz1U5K KNVw== X-Gm-Message-State: AOAM530phasT0U2OmV1lp68KJ4hOgLld2ubKlFpGBeFGbBt+BypyLtJE +QUZDJwoPM70oZReLtj6/uM1iSWTg715ftVzXVM= X-Google-Smtp-Source: ABdhPJz9MIOHdq5uUkgxTvyYO3unCN4gRgifv4VaWXXwB73GObKF4MmC/pw9cgm3RzefrIUQSsSv9w== X-Received: by 2002:a05:622a:590:b0:2de:93aa:4ff1 with SMTP id c16-20020a05622a059000b002de93aa4ff1mr12271190qtb.204.1645929502469; Sat, 26 Feb 2022 18:38:22 -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 k10-20020a05622a03ca00b002de9f8e660dsm4432519qtx.63.2022.02.26.18.38.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:22 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 15/24] gnu: chez-scheme: Use "lib/chez-scheme" for search path. Date: Sat, 26 Feb 2022 21:34:41 -0500 Message-Id: <20220227023450.1877215-16-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.172 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.172 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.172 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.172 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". (chez-make-flags): Update accordingly. (chez-sockets)[arguments]<#:phases>: Likewise. --- gnu/packages/chez.scm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 4ee9711bb4..f4c87fbcf7 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -233,7 +233,7 @@ (define-public chez-scheme (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) + (files '("lib/chez-scheme"))))) (outputs '("out" "doc")) (arguments `(#:modules @@ -458,9 +458,9 @@ (define chez-configure (define (chez-make-flags name version) #~(let ((out #$output)) (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" #$(package-version chez-scheme)) + ;; Set 'schemedir' so that libraries are installed in + ;; 'lib/chez-scheme' like Chez's 'native-search-paths' expects. + (string-append "schemedir=" out "/lib/chez-scheme") (string-append "PREFIX=" out) (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) @@ -608,9 +608,7 @@ (define-public chez-sockets (replace 'build (lambda args (let ((chez-site (string-append #$output - "/lib/csv" - (package-version chez-scheme) - "-site/arcfide"))) + "/lib/chez-scheme/arcfide"))) ;; make sure Chez Scheme can find the shared libraries. (substitute* "sockets.ss" (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" @@ -634,9 +632,7 @@ (define-public chez-sockets (lambda args (install-file "sockets.so" (string-append #$output - "/lib/csv" - #$(package-version chez-scheme) - "-site/arcfide")) + "/lib/chez-scheme/arcfide")) (install-file "sockets.pdf" (string-append #$output "/share/doc/" -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:38:34 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:35 +0000 Received: from localhost ([127.0.0.1]:56574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SD-0004GX-Rh for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:34 -0500 Received: from mail-qk1-f181.google.com ([209.85.222.181]:40922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9S3-0004FT-Ou for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:30 -0500 Received: by mail-qk1-f181.google.com with SMTP id c7so7810351qka.7 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:23 -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=io5+mYx3paMZskBxOftdGKkiJCIi2sMPPsvDv5pgL1U=; b=HzV1VqF6vvFzA1fwDri8ZyVgyMXtMi3YpVl+0bHFnkJ/PPAYb+Ix/TBtd5RJpdnb6I l1cwJjkFy7i86YMLOBvhquIjVLTuiAjSrESHIwUEAuVlIkRcPg1t+4gDDTd7EOwOrSHP gaH0gj3vqCOxvYzp+DRmHRz1n7d5d4baoCMfvW1AcpqBYzUdDo/se4oBf09kru7HR+3j pxNchdU/NEMiTeYnweBSanMe2aTvbz7WhIfHlv6Iqw59vEJSzLv8mJgzkYo3Y90yYlfZ j9/E7beEX2jgx7r1HTEgv2bvrBCLqzQ1dVRLPqdW7Nng8blivAqNz5v6dcM1YhjFFm0K E+Bw== 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=io5+mYx3paMZskBxOftdGKkiJCIi2sMPPsvDv5pgL1U=; b=CIyCDzYSZrMNvk4Ev7hMTM7maMyQXQJ+yIrY7GyL0Y4F+IxxYjAgmGTaWC/jMInevP cEVRRZYk/bkxRIUIyc2c8fPXq6fGTTs9CUg+ywVHnmKpfOZTbkYjcSjwIpHPapWZgqNP fgnRpdRi+B2b/EsHIjvy/w+w85V80Jli8h6vjkFD6Ac03tn4gQ94076clFntethtEc1j ShLYiwtFBY0o/uUucDCGMyfysphIc9IhLue5nGFhXIzEAJLv4ca3xXb7ZukU1OMu+n2S ua7syYMWNjI0W+BPWyGc5ofjzcq3WZqnQY9sqqHGGWdxQfo8Qled2eho2OPLl743ejds ugpw== X-Gm-Message-State: AOAM532XQo+JMEyyo8eJISBDp69atPxLkAUg1dhYFbhtoyDI2BaAIv7V 0DKy1YZEfiq2d/iJ3pXFH87XIixf30ekiSsHXWg= X-Google-Smtp-Source: ABdhPJxZDdLcw/yJTWLgRsr6y5uTAUFBHklfT41uRiu6MOliakrNv9ON/ao58SuhYP5mG29oNHmjHg== X-Received: by 2002:a05:620a:142:b0:648:b7e2:104c with SMTP id e2-20020a05620a014200b00648b7e2104cmr8434260qkn.728.1645929498020; Sat, 26 Feb 2022 18:38:18 -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 15-20020a37070f000000b0062cdc159505sm3235163qkh.89.2022.02.26.18.38.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:17 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 14/24] gnu: chez-scheme: Use new style for Chez packages. Date: Sat, 26 Feb 2022 21:34:40 -0500 Message-Id: <20220227023450.1877215-15-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (chez-configure, chez-make-flags): Use G-expressions. (chez-srfi)[arguments]: Use G-expressions, 'chez-configure', and 'chez-make-flags'. (chez-web, chez-sockets)[native-inputs [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.181 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.181 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (chez-configure, chez-make-flags): Use G-expressions. (chez-srfi)[arguments]: Use G-expressions, 'chez-configure', and 'chez-make-flags'. (chez-web, chez-sockets)[native-inputs [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.181 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.181 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/chez.scm (chez-configure, chez-make-flags): Use G-expressions. (chez-srfi)[arguments]: Use G-expressions, 'chez-configure', and 'chez-make-flags'. (chez-web, chez-sockets)[native-inputs]: Remove labels. [arguments]: Use G-expressions. (chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils)[arguments]: Use G-expressions. --- gnu/packages/chez.scm | 382 ++++++++++++++++++++++-------------------- 1 file changed, 196 insertions(+), 186 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 603fc4201e..4ee9711bb4 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -443,6 +443,27 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; Packages: ;; +;; Help function for Chez Scheme to add the current path to +;; CHEZSCHEMELIBDIRS. +(define chez-configure + #~(lambda _ + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) + (setenv "CHEZSCHEMELIBDIRS" + (if chez-env + (string-append ".:" chez-env) + "."))))) + +;; Help function to define make flags for some Chez Scheme custom make +;; files. +(define (chez-make-flags name version) + #~(let ((out #$output)) + (list + ;; Set 'chezversion' so that libraries are installed in + ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. + (string-append "chezversion=" #$(package-version chez-scheme)) + (string-append "PREFIX=" out) + (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) + (define-public chez-srfi (package (name "chez-srfi") @@ -460,13 +481,11 @@ (define-public chez-srfi (native-inputs (list chez-scheme)) (arguments - `(#:make-flags (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out) - "CHEZ=chez-scheme --libdirs ./" - (string-append "chezversion=" ,(package-version chez-scheme)))) - #:test-target "test" - #:phases (modify-phases %standard-phases - (delete 'configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -491,42 +510,48 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("ghostscript" ,ghostscript) - ("texlive" ,(texlive-updmap.cfg (list texlive-oberdiek - texlive-epsf - texlive-metapost - texlive-charter - texlive-pdftex - texlive-context - texlive-cm - texlive-tex-plain))))) + (list chez-scheme + ghostscript + ;; FIXME: This package fails to build with the error: + ;; mktexpk: don't know how to create bitmap font for bchr8r + ;; Replacing the following with `texlive` fixes it. + ;; What is missing? + (texlive-updmap.cfg (list texlive-oberdiek + texlive-epsf + texlive-metapost + texlive-charter + texlive-pdftex + texlive-context + texlive-cm + texlive-tex-plain)))) (arguments - `(#:make-flags (list (string-append "PREFIX=" %output) - (string-append "DOCDIR=" %output "/share/doc/" - ,name "-" ,version) - (string-append "LIBDIR=" %output "/lib/chezweb") - (string-append "TEXDIR=" %output "/share/texmf-local")) - #:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - ;; This package has a custom "bootstrap" script that - ;; is meant to be run from the Makefile. - (delete 'bootstrap) - (replace 'configure - (lambda* _ - (copy-file "config.mk.template" "config.mk") - (substitute* "tangleit" - (("\\./cheztangle\\.ss" all) - (string-append "chez-scheme --program " all))) - (substitute* "weaveit" - (("mpost chezweb\\.mp") - "mpost --tex=tex chezweb.mp") - (("\\./chezweave" all) - (string-append "chez-scheme --program " all))) - (substitute* "installit" - (("-g \\$GROUP -o \\$OWNER") "")) - #t))))) + (list + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "DOCDIR=" #$output "/share/doc/" + #$name "-" #$version) + ;; lib/chez-scheme/chezweb ??? + (string-append "LIBDIR=" #$output "/lib/chezweb") + (string-append "TEXDIR=" #$output "/share/texmf-local")) + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + ;; This package has a custom "bootstrap" script that + ;; is meant to be run from the Makefile. + (delete 'bootstrap) + (replace 'configure + (lambda* _ + (copy-file "config.mk.template" "config.mk") + (substitute* "tangleit" + (("\\./cheztangle\\.ss" all) + (string-append "scheme --program " all))) + (substitute* "weaveit" + (("mpost chezweb\\.mp") + "mpost --tex=tex chezweb.mp") + (("\\./chezweave" all) + (string-append "scheme --program " all))) + (substitute* "installit" + (("-g \\$GROUP -o \\$OWNER") ""))))))) (home-page "https://github.com/arcfide/ChezWEB") (synopsis "Hygienic Literate Programming for Chez Scheme") (description "ChezWEB is a system for doing Knuthian style WEB @@ -550,95 +575,78 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("chez-web" ,chez-web) - ("texlive" ,(texlive-updmap.cfg (list texlive-pdftex))))) + (list chez-scheme + chez-web + (texlive-updmap.cfg (list texlive-pdftex)))) (arguments - `(#:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-web (assoc-ref inputs "chez-web")) - (chez (assoc-ref inputs "chez-scheme")) - (chez-h (dirname (car (find-files chez "scheme\\.h"))))) - (substitute* "Makefile" - (("(SCHEMEH=).*$" all var) - (string-append var chez-h))) - #t))) - (add-before 'build 'tangle - (lambda* (#:key inputs #:allow-other-keys) - (setenv "TEXINPUTS" - (string-append - (getcwd) ":" - (assoc-ref inputs "chez-web") "/share/texmf-local/tex/generic:" - ":")) - ;; just using "make" tries to build the .c files before - ;; they are created. - (and (invoke "make" "sockets") - (invoke "make")))) - (replace 'build - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - ;; make sure Chez Scheme can find the shared libraries. - (substitute* "sockets.ss" - (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" - all cmd so) - (string-append cmd " \"" chez-site "/" so "\"")) - (("sockets-stub\\.[sd][oy].*" all) - (string-append chez-site "/" all))) - ;; to compile chez-sockets, the .so files must be - ;; installed (because of the absolute path we - ;; inserted above). - (for-each (lambda (f d) (install-file f d)) - '("socket-ffi-values.so" "sockets-stub.so") - (list chez-site chez-site)) - (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) - (replace 'install - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/chez-sockets")) - (doc (string-append out "/share/doc/" ,name "-" ,version)) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((scheme (search-input-file (or native-inputs inputs) + "/bin/scheme")) + (lib (string-append (dirname scheme) "/../lib")) + (header-file (car (find-files lib "scheme\\.h"))) + (include-dir (dirname header-file))) + (substitute* "Makefile" + (("(SCHEMEH=).*$" _ var) + (string-append var include-dir)))))) + (add-before 'build 'tangle + (lambda* (#:key inputs #:allow-other-keys) + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" + (assoc-ref inputs "chez-web") + "/share/texmf-local/tex/generic:" + ":")) + ;; just using "make" tries to build the .c files before + ;; they are created. + (and (invoke "make" "sockets") + (invoke "make")))) + (replace 'build + (lambda args + (let ((chez-site (string-append #$output + "/lib/csv" + (package-version chez-scheme) "-site/arcfide"))) - (for-each (lambda (f d) (install-file f d)) - '("sockets.pdf" "sockets.so") - (list doc chez-site)) - #t)))))) + ;; make sure Chez Scheme can find the shared libraries. + (substitute* "sockets.ss" + (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post)) + (("(\")(sockets-stub\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post))) + ;; to compile chez-sockets, the .so files must be + ;; installed (because of the absolute path we + ;; inserted above). + (for-each (lambda (f) + (install-file f chez-site)) + '("socket-ffi-values.so" + "sockets-stub.so")) + (invoke "bash" + "-c" + (format #f "echo '~s' | scheme -q" + '(compile-file "sockets.sls")))))) + (replace 'install + (lambda args + (install-file "sockets.so" + (string-append #$output + "/lib/csv" + #$(package-version chez-scheme) + "-site/arcfide")) + (install-file "sockets.pdf" + (string-append #$output + "/share/doc/" + #$name "-" #$version))))))) (home-page "https://github.com/arcfide/chez-sockets") (synopsis "Extensible sockets library for Chez Scheme") (description "Chez-sockets is an extensible sockets library for Chez Scheme.") (license expat)))) -;; Help function for Chez Scheme to add the current path to -;; CHEZSCHEMELIBDIRS. -(define chez-configure - '(lambda _ - (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) - (setenv "CHEZSCHEMELIBDIRS" - (if chez-env - (string-append ".:" chez-env) - ".")) - #t))) - -;; Help function to define make flags for some Chez Scheme custom make -;; files. -(define (chez-make-flags name version) - `(let ((out (assoc-ref %outputs "out"))) - (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" ,(package-version chez-scheme)) - (string-append "PREFIX=" out) - (string-append "DOCDIR=" out "/share/doc/" - ,name "-" ,version)))) - (define-public chez-matchable (package (name "chez-matchable") @@ -659,10 +667,11 @@ (define-public chez-matchable (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -690,10 +699,11 @@ (define-public chez-irregex (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -720,17 +730,18 @@ (define-public chez-fmt (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "chez-check" - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - (replace 'build - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-build" make-flags))) - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-install" make-flags)))))) + (list #:make-flags (chez-make-flags name version) + #:test-target "chez-check" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-build" make-flags))) + (replace 'install + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-install" make-flags)))))) (home-page "http://synthcode.com/scheme/fmt") (synopsis "Combinator formatting library for Chez Scheme") (description "This package provides a library of procedures for @@ -760,10 +771,11 @@ (define-public chez-mit (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -792,46 +804,44 @@ (define-public chez-scmutils (propagated-inputs (list chez-mit chez-srfi)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:tests? #f ; no test suite - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - ;; 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 - ;; in turn requires us to compile the files in the final - ;; destination. - (delete 'build) - (add-after 'install 'install-src - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-src" make-flags))) - (add-after 'install-src 'absolute-path-in-scm-files - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils") - (string-append "include \"" (dirname file))))) - (find-files out "\\.sls")) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils/simplify") - (string-append "include \"" (dirname file))))) - (find-files out "fbe-syntax\\.scm")) - #t))) - (add-after 'absolute-path-in-scm-files 'build - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (mk-file (car (find-files out "Makefile")))) - (with-directory-excursion (dirname mk-file) - (apply invoke "make" "build" make-flags))))) - (add-after 'build 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (for-each delete-file - (find-files out "Makefile|compile-all\\.ss")) - #t)))))) + (list + #:make-flags (chez-make-flags name version) + #:tests? #f ; no test suite + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + ;; 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 + ;; in turn requires us to compile the files in the final + ;; destination. + (delete 'build) + (add-after 'install 'install-src + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "install-src" make-flags))) + (add-after 'install-src 'absolute-path-in-scm-files + (lambda* (#:key #:allow-other-keys) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils") + (string-append "include \"" (dirname file))))) + (find-files #$output "\\.sls")) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils/simplify") + (string-append "include \"" (dirname file))))) + (find-files #$output "fbe-syntax\\.scm")))) + (add-after 'absolute-path-in-scm-files 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (let ((mk-file (car (find-files #$output "Makefile")))) + (with-directory-excursion (dirname mk-file) + (apply invoke "make" "build" make-flags))))) + (add-after 'build 'clean-up + (lambda args + (for-each delete-file + (find-files #$output + "Makefile|compile-all\\.ss"))))))) (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") (description "This package provides a port of the MIT/GNU Scheme Scmutils program to Chez Scheme. The port consists of a set of -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:38:35 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:38:35 +0000 Received: from localhost ([127.0.0.1]:56576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SE-0004Gg-S8 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:35 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:38677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SC-0004Fy-8x for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:32 -0500 Received: by mail-qv1-f47.google.com with SMTP id d3so9829618qvb.5 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:32 -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=vYcCJ8OzcVN6l+LnkyuEvkLv2msDMJdHSBe1qqljWPg=; b=XQCjvPvirqd/oUHhiyA0IWoaCR3fk5J6N66ZziIW4Zfr+NpLVp//RO5VMoAhrOw3lR TRw5rb4lp1bYXcv1gOvW7CG1TX2Uu1iAIYcVCuMCCFGs7emibdUxVEfCSHdRMjR1SKZ0 vgxmC/r/q6vvF1iPLNQ+JFMHuELc1J22nT53fsw9KAvKKNxpLSeGkJFVT3SmX5HNfaXd h+jkFpEJGd7w9F8ZtdmlZ51tWa4/zIPk6Hz5qyff94ICyeUQNstFjxHCKhS1gwoJ1as7 VrWO9Y/qOe4Yt5f8ZUdpQrciYGYebVVV5XEwlEzpEq2E6F/60cxWZ23KHDzILP7vY+td mcHQ== 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=vYcCJ8OzcVN6l+LnkyuEvkLv2msDMJdHSBe1qqljWPg=; b=spXYI4D6dRpLUh1eSOk+fkioYAZ8nE9XiDfLkD2BOzPG+6xAcp5syToxnPlxw1C/lv p39jJNAzkzZqgBdQkdKld7EswmJgEx/NdGCQgCXjWyZeWjpm9uEDveli0aJhtakBUDBO 0GAY4tDT8tgjgromrVveagFCYwT/ESQHS+03CrKlUrYFBxm3ywvdvizl4+Qieb10bbJc ta3Iu+3VVN5XLHYq5WJsMnv9m5jQrsBxfCZhgj1//gdt+Q0rrTOpHZDCyGxlrHPF3PLZ BAhPzMFWsd51P9kcErasqhOSoC0JAfmkVGgfHnSpgQHro5CfqeQ87r97xKkDGWJSJ1xf iOsw== X-Gm-Message-State: AOAM530ovIlKLkWbSkzr1v4nDHYSiPYrCYsIz9tgCXFXTwTMZu9XxAH6 wmOiwvEYknSftkr6DRUzWvIaSpiC1UVkrNG8bO8= X-Google-Smtp-Source: ABdhPJw6/OyAh9w/wDundD32JCd4mEvQqAqBjTXAf0o/9PuH0Mw1rB9rTl6+1gb3oKGVANywsGP7OQ== X-Received: by 2002:a0c:ab84:0:b0:432:916b:abb9 with SMTP id j4-20020a0cab84000000b00432916babb9mr10266671qvb.33.1645929506752; Sat, 26 Feb 2022 18:38:26 -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 x26-20020ae9f81a000000b005f1916fc61fsm3181897qkh.106.2022.02.26.18.38.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:26 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 16/24] gnu: chez-scheme: Use shared zlib and lz4. Date: Sat, 26 Feb 2022 21:34:42 -0500 Message-Id: <20220227023450.1877215-17-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez.scm | 18 ++++++++ 1 file changed, [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.47 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez.scm | 18 ++++++++ 1 file changed, [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.47 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index f4c87fbcf7..dd40baa719 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -211,9 +211,7 @@ (define-public chez-scheme (inputs `(("libuuid" ,util-linux "lib") ("zlib" ,zlib) - ("zlib:static" ,zlib "static") ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") ;; for expeditor: ("ncurses" ,ncurses) ;; for X11 clipboard support in expeditor: @@ -266,14 +264,14 @@ (define src (lz4-static (assoc-ref inputs "lz4:static")) (out (assoc-ref outputs "out")) ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) + (flags (cons* (string-append "--installprefix=" out) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do compress-man-pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) (format #t "configure flags: ~s~%" flags) ;; Some makefiles (for tests) don't seem to propagate CC ;; properly, so we take it out of their hands: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:39:01 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:01 +0000 Received: from localhost ([127.0.0.1]:56584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Se-0004Hs-BS for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:00 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:34761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SG-0004GF-NQ for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:37 -0500 Received: by mail-qv1-f52.google.com with SMTP id ba20so9874236qvb.1 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:36 -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=DEN9JBWT7L5sZ2kWUaZi57vTZgqR1gZML2Ph6nBGkDU=; b=cZEAuvPySeFF5nPinVOcAnBFHhnTvqiw1rkcl3BpeZ2PdsQ8qOCgVwCZAbiNbmw3Nv +mt1GVCRpFqa7E4nHFfu+882uNl7oIddwVnECrdIBzAeE3AE400NoCra7iVcq88VXzDC kRbBLnboqlJmh1HypS1WI5thlaZVS6YaDE/Jqh1GcodB9gxOeW1uxqM/BqgYTjIBD9zC n7sMB1MoIv3U5tpHHIwC7qQoQobPtjJAPMNFjlNWS6taa5lGImt69vDYrjKuIsJQSl2F YuRxlqIETX+bHsQfl3MWvK57yhpihMHzdWWZq6yH2erYrxdoGRrkHe9cEczRoQNOtCuL 9aDg== 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=DEN9JBWT7L5sZ2kWUaZi57vTZgqR1gZML2Ph6nBGkDU=; b=EPqJ455kugvJXUHY/SWJkYfQbvZUh908fnL7KrHRlkhk5eq7TnBiMgHK0ay00WJtQg eRMrve/ZOw2x2vvDfeUv10qITlHC8NMdLrgnxhY1XjwQD4mt07RvXw3vhqVle/NdbmUJ P0fQOIq+xQcpZ7EJt0LlZ/gkCvJxpi8UUKJGaOKA8v1FJv1TG5s6393iNxyHZgKFEFEf DnlRblMo98gh3mI7k44MI+zdWmgLnyr+jGOVftXrdP39sQgx3GitCO8W1U9dtx9v7Z+U iAlyfvt1eiOXk1tSsDq1dXmUqhy3ieJIU6O5OIhhJUPyC3ZJSbFAdojfl9WORuWkt1pJ 9B5g== X-Gm-Message-State: AOAM530RT9K/LSBDTswipJGRzqBdujhTn5mW3ZCwhDo2o/ewtBh5ZdVm de+3aY2GICNnQYrNb5DsaLeayGBtleLUwbxF2vk= X-Google-Smtp-Source: ABdhPJzbdNadi3uFKYoxoThvpAGPjk8TUZLXNKjQ1cHOuxIcdI2VYJ8Rsp5D1SOWhJ8+WsmMV22jgg== X-Received: by 2002:a0c:eb81:0:b0:42d:a99:b08c with SMTP id x1-20020a0ceb81000000b0042d0a99b08cmr10677116qvo.52.1645929510938; Sat, 26 Feb 2022 18:38:30 -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 h11-20020a05620a21cb00b005089fdd033bsm3195292qka.39.2022.02.26.18.38.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:30 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 17/24] gnu: chez-scheme: Use new package style. Date: Sat, 26 Feb 2022 21:34:43 -0500 Message-Id: <20220227023450.1877215-18-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove labels. [native-inputs]: Likewise. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass): Make pu [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.52 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.52 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove labels. [native-inputs]: Likewise. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass): Make pu [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.52 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.52 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove labels. [native-inputs]: Likewise. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass): Make public as a temporary workaround for Racket. * gnu/packages/racket.scm (make-unpack-nanopass+stex): Update accordingly. --- gnu/packages/chez.scm | 286 +++++++++++++++++++--------------------- gnu/packages/racket.scm | 5 +- 2 files changed, 135 insertions(+), 156 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index dd40baa719..ad263a8fe3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -158,7 +158,7 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define nanopass +(define-public nanopass (let ((version "1.9.2")) (origin (method git-fetch) @@ -185,86 +185,80 @@ (define stex (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.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))))) (build-system gnu-build-system) (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("lz4" ,lz4) - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) + (list + `(,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 - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) + (list nanopass ; source only + ;; for docs + stex + xorg-rgb + (texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") (files '("lib/chez-scheme"))))) (outputs '("out" "doc")) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* (string-append "--installprefix=" out) + #:test-target "test" + ;; TODO when we fix armhf, it may not support --threads + #:configure-flags #~'("--threads") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (copy-recursively #$nanopass + "nanopass" + #:keep-mtime? #t) + (copy-recursively #$stex + "stex" + #:keep-mtime? #t))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) + ;; add flags which are always required: + (let ((flags (cons* (string-append "--installprefix=" #$output) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" @@ -272,90 +266,78 @@ (define src ;; and letting Chez try causes an error "--nogzip-man-pages" configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke "./configure" 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* ((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 explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (let* ((stex-output "/tmp") + (doc-dir (string-append stex-output "/share/doc/stex"))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/stex") + (string-append "Scheme=" + (search-input-file outputs + "/bin/scheme"))) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (match (assoc-ref outputs "doc") + (#f + (format #t "not installing docs~%")) + (doc-prefix + (let* ((chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib "/tmp/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 10ec0591d9..73de273c64 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -257,10 +257,7 @@ (define (make-unpack-nanopass+stex) ;; TODO: Refactor enough to share this directly. #~(begin (copy-recursively - #$(match (assoc-ref (package-native-inputs chez-scheme) - "nanopass") - ((src) - src)) + #$nanopass "nanopass" #:keep-mtime? #t) (mkdir-p "stex") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:39:01 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:01 +0000 Received: from localhost ([127.0.0.1]:56586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Sf-0004Hv-12 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:01 -0500 Received: from mail-qk1-f175.google.com ([209.85.222.175]:38410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SL-0004Gu-37 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:41 -0500 Received: by mail-qk1-f175.google.com with SMTP id n185so7820789qke.5 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:41 -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=Tect9L988qv0Yb/LOD+TBbvPXO8vBf/+B4PmAkEYvLU=; b=VZ4BdIiC4E5Wkugz4uVj2kp6uEBsoWdjYrXhppgdvDiAiu1P+aZwr1W05QH/CJucAc w6PAWfLH9SRWlSfgiw2uWwBm1apIqw2cshHR9P7Ch8LKJqwbsogzdBgvS+c2CFOlUtlf 5EWO81YXhUgN6bI1DgRnFZQuZgrV5Odpx2PDdew53WKY76ziSXfTXmbweDro5fnUp5Ac GPZtzFUeLIxELu1Rf0S+u7EwM2VZ7/uesMltpWitNnmWji+wNRPOtfwLH2MBdBejga4e BYbfl2bDRPqebRCovvduKsiFJYQrivdklsKWdTASbLQJ/XMgnI2z6U34VXswYfLsWKkM WrJA== 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=Tect9L988qv0Yb/LOD+TBbvPXO8vBf/+B4PmAkEYvLU=; b=owiuAV7eWkWotBqRcXce1zGsYoMBrSTiSD6Hmx398IY23G8U8OiHqvvF7osN4YSj7V +EdeaiXpPEaJ1FchzuCp20A8nMy60uaTcp2POOn/864BSjsDm/BxOLXz1VTTvXBKvvvV QoYul3TIMR7wbrvcMSc+NTzF8kyD3yz6h8kO11GLTVvcbfUr8zixJAX9NwzGS92QFa3n tjamRWrx1HsR1Fr7IcTn8Ct4SDKjwBBQLouaybr2O5kMRsoKryvynUPNEgiuhad7sVuI pYZfWhsuZq5VdMQgdFf4G4BgeIfrN5DXqfJqnWz32AAWbSbiG9ZesnkXjlIg+owsMZ7g sYMQ== X-Gm-Message-State: AOAM530/n2oWyvtu+omMk/x8JBrR+19w03Sltk0ArJqG0a8det31j+ZJ s+cwVdTNznMHbnyX139APIhhaehSCqrHyXbWEvg= X-Google-Smtp-Source: ABdhPJy3Vn39YbWy2mBmbTjDXshRUvE8P4DYsR+kf6ILqaTCTnAeAfo7zjW5izojL+oCSI0Ei8NGaQ== X-Received: by 2002:a05:620a:48d:b0:5f1:872f:1fdb with SMTP id 13-20020a05620a048d00b005f1872f1fdbmr8266368qkr.675.1645929515338; Sat, 26 Feb 2022 18:38:35 -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 a17-20020a05622a02d100b002dd2cab0326sm4371437qtx.23.2022.02.26.18.38.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:35 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 18/24] gnu: Add stex. Date: Sat, 26 Feb 2022 21:34:44 -0500 Message-Id: <20220227023450.1877215-19-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap' (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependen [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.175 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.175 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap' (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependen [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.175 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.175 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/chez.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap' (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies of stex-bootstrap. [arguments]<#:phases>: Remove 'prepare-stex'. Adjust 'unpack-nanopass+stex' and 'install-doc'. --- gnu/packages/chez.scm | 217 ++++++++++++++++++++++++++++++------------ 1 file changed, 155 insertions(+), 62 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index ad263a8fe3..6855195cfe 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -33,6 +33,7 @@ (define-module (gnu packages chez) #:use-module (guix gexp) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) + #:use-module (guix build-system copy) #:use-module (gnu packages compression) #:use-module (gnu packages ncurses) #:use-module (gnu packages ghostscript) @@ -158,30 +159,6 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - (define-public chez-scheme (package (name "chez-scheme") @@ -218,15 +195,7 @@ (define-public chez-scheme libx11)) (native-inputs (list nanopass ; source only - ;; for docs - stex - xorg-rgb - (texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek)) - ghostscript - netpbm)) + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -249,9 +218,11 @@ (define-public chez-scheme (copy-recursively #$nanopass "nanopass" #:keep-mtime? #t) - (copy-recursively #$stex - "stex" - #: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"))))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -287,32 +258,9 @@ (define-public chez-scheme (symlink scheme.boot (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (let* ((stex-output "/tmp") - (doc-dir (string-append stex-output "/share/doc/stex"))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/stex") - (string-append "Scheme=" - (search-input-file outputs - "/bin/scheme"))) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) ;; Building the documentation requires stex and a running scheme. ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc + (add-after 'install-symlink 'install-doc (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (match (assoc-ref outputs "doc") (#f @@ -320,7 +268,9 @@ (define-public chez-scheme (doc-prefix (let* ((chez+version (strip-store-file-name #$output)) (scheme (search-input-file outputs "/bin/scheme")) - (stexlib "/tmp/lib/stex") + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) (doc-dir (string-append doc-prefix "/share/doc/" chez+version))) @@ -420,7 +370,150 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (license (list asl2.0)))) ;; -;; Packages: +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + #$(chez-machine->threaded + (nix-system->chez-machine))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine "\\."))))) + (else + ;; for bootstrapping, can run without ahead-of-time + ;; compilation + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is referenced in the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (outputs '("out" "doc")) + (properties '()))) + +(define-public nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) + +;; +;; Other Chez packages: ;; ;; Help function for Chez Scheme to add the current path to -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:39:02 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:02 +0000 Received: from localhost ([127.0.0.1]:56588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Sf-0004I3-M1 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:02 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:39638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SP-0004H4-M4 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:46 -0500 Received: by mail-qv1-f47.google.com with SMTP id a1so9819837qvl.6 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:45 -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=37H5h/fHk3NNbAT7Uc9bISFfMqOBQXf0BvVKkBIp2Fs=; b=PTHC7osGRGdFdvGB5rkcNarMJgqhYrCuRB+9Qmnms2a8HOKtdFT3FOUVjlSLv/6981 GvkFFJ0xqsLFqH5bUP+epou5Y9L+SKRyVk4FZFx8f4KI47o15cQbWC2kevGmpWbKs4Lj EWZ0SNx3eryCvc2EjB8uQV2IEF4dDUgGo4pKL5RNEsnvNCAb9k2ZeZWntpKjMAB0uXQC c+Io/Hc9l0nFcIxET5lYLWzaqsW3RhbUzLnpfVrC8+C8MJdJZahjx87KD/rIl3+0Zron yQ/n/mMorTw+0M04033Pgd1PR237BNnw+z+MrNXIq2HXbXJEM3ByuKzwzWikB3H4lCJA cCaw== 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=37H5h/fHk3NNbAT7Uc9bISFfMqOBQXf0BvVKkBIp2Fs=; b=NgghkjDJT3mgriSW+ly1UtEnQ7C1+WYgZDJiaFaujB+QjPHwj9kdxEOvf6eCoD/1Gy G33qGMHqVwkMdkJ9eAMSsAIYNUNrzH69Ll+B6/UqulDncD659vmMA/w/Fwhtn687nN2l Ybld/J6sWJTqH3wqJLfWea8yXuTogG0wk0jMfXPPTMbrmEm0VvhmwKI/rwFQ8PwjxQzk 2gHRrku1pQnb6lTyPhK888TwZtxzUUOeYTkUS3tqIebpIwUBsXJJU3s0PHLAbNtRbocL jUS0CieLYdQ7PabGiKccfEqt11woChuEqy5IR5fm1uSzH1EZgyw/ZLfn98xcGtF8PrLV f0Rg== X-Gm-Message-State: AOAM530lMgkJ2os2ZTi6xaF+sfvAaLb/98+JR7F1269Q7AtP3+l3iFEu zY0W4YcXpdw292oGbFO7Pvcpi+2CX/KFFWMc3po= X-Google-Smtp-Source: ABdhPJyk91sfi2fm5bHg8zQuR6RxVpQDGRGm8IJbESVsKhWDWMTYBZpmTa+fzbfENxWN72yRskdsCw== X-Received: by 2002:a05:6214:2482:b0:432:4bf6:47b7 with SMTP id gi2-20020a056214248200b004324bf647b7mr10640590qvb.38.1645929520031; Sat, 26 Feb 2022 18:38:40 -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 n8-20020a05620a222800b004e0e071f382sm3161150qkh.125.2022.02.26.18.38.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:39 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 19/24] gnu: Add chez-nanopass. Date: Sat, 26 Feb 2022 21:34:45 -0500 Message-Id: <20220227023450.1877215-20-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-nanopass): New variable. (unpack-nanopass+stex): N [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.47 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-nanopass): New variable. (unpack-nanopass+stex): N [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.47 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/chez.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-nanopass): New variable. (unpack-nanopass+stex): New variable using 'chez-nanopass-bootstrap'. (chez-scheme-for-racket-bootstrap-bootfiles, chez-scheme)[native-inputs]: Add 'chez-nanopass-bootstrap'. [arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase to use the eponymous new variable. * gnu/packages/racket.scm (racket-vm-cs): Likewise. (make-unpack-nanopass+stex): Remove it. --- gnu/packages/chez.scm | 122 +++++++++++++++++++++++++++++++--------- gnu/packages/racket.scm | 19 +------ 2 files changed, 98 insertions(+), 43 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 6855195cfe..43d2c764f3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -48,7 +48,8 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-1) #:export (nix-system->chez-machine chez-machine->nonthreaded - chez-machine->threaded)) + chez-machine->threaded + unpack-nanopass+stex)) (define (chez-machine->nonthreaded machine) "Given a string MACHINE naming a Chez Scheme machine type, returns a string @@ -159,6 +160,20 @@ (define* (chez-upstream-features-for-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-public chez-scheme (package (name "chez-scheme") @@ -176,6 +191,9 @@ (define-public chez-scheme (file-name (git-file-name name version)) (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))) @@ -193,9 +211,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs - (list nanopass ; source only - stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -215,14 +231,7 @@ (define-public chez-scheme #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex (lambda args - (copy-recursively #$nanopass - "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"))))) + #$unpack-nanopass+stex)) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -317,7 +326,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; When updating, remember to also update %racket-version in racket.scm. (source #f) ; avoid problematic cycle with racket.scm (inputs `()) - (native-inputs (list racket-vm-bc)) + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) (build-system copy-build-system) ;; TODO: cross compilation (arguments @@ -336,10 +345,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (chdir "racket/src/ChezScheme"))) (add-after 'chdir 'unpack-nanopass+stex (lambda args - (copy-recursively - #$nanopass - "nanopass" - #:keep-mtime? #t))) + #$unpack-nanopass+stex)) (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) (invoke (search-input-file (or native-inputs inputs) @@ -502,15 +508,79 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) ;; ;; Other Chez packages: diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 73de273c64..c96bebe325 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -251,22 +251,6 @@ (define (racket-vm-common-configure-flags) "--disable-strip" "--enable-origtree")) -(define (make-unpack-nanopass+stex) - ;; Adapted from chez-scheme. - ;; Thunked to avoid evaluating 'chez-scheme' too early. - ;; TODO: Refactor enough to share this directly. - #~(begin - (copy-recursively - #$nanopass - "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-public racket-vm-cgc ;; Eventually, it may make sense for some vm packages to not be hidden, ;; but this one is especially likely to remain hidden. @@ -417,6 +401,7 @@ (define-public racket-vm-cs (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") (prepend chez-scheme-for-racket-bootstrap-bootfiles + chez-nanopass-bootstrap racket-vm-bc))) (arguments (substitute-keyword-arguments (package-arguments racket-vm-cgc) @@ -425,7 +410,7 @@ (define-public racket-vm-cs (add-after 'unpack 'unpack-nanopass+stex (lambda args (with-directory-excursion "racket/src/ChezScheme" - #$(make-unpack-nanopass+stex)))) + #$unpack-nanopass+stex))) (add-after 'unpack-nanopass+stex 'unpack-bootfiles (lambda* (#:key native-inputs inputs #:allow-other-keys) (with-directory-excursion "racket/src/ChezScheme" -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:39:03 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:03 +0000 Received: from localhost ([127.0.0.1]:56590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Sg-0004IJ-Nt for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:03 -0500 Received: from mail-qv1-f48.google.com ([209.85.219.48]:43935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SU-0004HF-3w for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:50 -0500 Received: by mail-qv1-f48.google.com with SMTP id c14so4983571qvk.10 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:50 -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=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=IvyWGC3/WAamEPbYFZAPqXe3iN8twafURrbbabbFe3RoPHkbMaEvQUpR+maPNsESCL UvUXKl4HPYG4yn3dSMrawFRgml/9ofTlAkuQW6TQ3y7kf95x6H3pz8mpl0CSKPeuz2as /+QkhxjTL5fIRWGM9j5b/peA2f7DyUFVnvXqvdr70qV6S29e+kLRU+mZym0as/su/ObT Zm8aMKKm8KJZlVcmdxCJ5Pix0RRwoUY3yNfpCBtKLhmhFOdRgOkFzNH5Bzy6vHJ8Rdlp H3s34iVJKgfUp1dhNxDE/SDOjpgKxgRR5EaWPD3U0twy5YmZ0jbghtX9W8DRlfYjoGzs aGCg== 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=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=MMsweiI4LbZ+qmvp5+moSJ2aDkjDn2RF1U9i7vEqZVyGOX6Y/Q1FTfo0IM1GrPueUK SqR0nprZuw+Bo0FI64/Zik+PXf04F71veamdnplMp3X5F1kSM4Ke4EQ/i738z4vo4F+I UHCbA/0S1xcYWx13im/1TNM9xfTnO0PekARzosMC5pFQEHEIjOffjrOw3qmpCVSm2k6G mlMvbHg4PA0Esy1cGmNqjX4HDAcnEiDSENlz5ugWd4PhT/LizUh+Gs5ZAcbdlcQ2PQnx lokdiaFeBfOYYi2tpByNQ5G2h4y3ehyX01xrTkLJIQtlBNCPmOt+4AXJwPCea0j/irMx eipQ== X-Gm-Message-State: AOAM53110i/+nYnYeGQgXsdmvHJfu4rBFOsyMzXH/wJ7rZeujJeqIBpG +2la1WFBJaivqmzPsAQWCDOxJODGxkB3uMrRaq0= X-Google-Smtp-Source: ABdhPJw0nSr/iO642IP31ic3vIRLqIGe+JyPVh4FTtK/c3yb9++5htnvfTjBvXjADYdLOZN5NT5gcA== X-Received: by 2002:a05:6214:21ee:b0:433:baf:21a3 with SMTP id p14-20020a05621421ee00b004330baf21a3mr342992qvj.4.1645929524535; Sat, 26 Feb 2022 18:38:44 -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 f19-20020a379c13000000b006490363756fsm3269672qke.21.2022.02.26.18.38.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:44 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 20/24] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Sat, 26 Feb 2022 21:34:46 -0500 Message-Id: <20220227023450.1877215-21-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bo [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.48 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.48 listed in list.dnswl.org] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bo [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.48 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.48 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager This makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. (chez-scheme-for-racket-bootstrap-bootfiles): Inherit from 'chez-scheme-bootstrap-bootfiles'. [arguments]: Adapt accordingly. --- gnu/packages/chez.scm | 98 +++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 43d2c764f3..da267d3616 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -46,6 +46,7 @@ (define-module (gnu packages chez) #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:export (nix-system->chez-machine chez-machine->nonthreaded chez-machine->threaded @@ -211,7 +212,9 @@ (define-public chez-scheme ;; 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-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -232,6 +235,14 @@ (define-public chez-scheme (add-after 'unpack 'unpack-nanopass+stex (lambda args #$unpack-nanopass+stex)) + (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 (or native-inputs 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`. @@ -316,8 +327,46 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (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 + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %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 upsream +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."))) + (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)`. @@ -325,32 +374,30 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; 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 `()) (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) - (build-system copy-build-system) ;; TODO: cross compilation (arguments - (list - #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")) - #:phases - #~(let ((unpack (assoc-ref %standard-phases 'unpack))) - (modify-phases %standard-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) - (invoke (search-input-file (or native-inputs inputs) - "/opt/racket-vm/bin/racket") - "rktboot/main.rkt"))))))) + (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) + (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)) (home-page "https://github.com/racket/ChezScheme") @@ -372,8 +419,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles 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.") - (license (list asl2.0)))) +Chez Scheme."))) ;; ;; Chez's bootstrap dependencies: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:39:04 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:04 +0000 Received: from localhost ([127.0.0.1]:56594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Sh-0004IZ-HI for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:04 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:35402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SY-0004HR-Ht for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:54 -0500 Received: by mail-qv1-f53.google.com with SMTP id 8so9858562qvf.2 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:54 -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=rAwszW55AeDy3TSpuVQTOuAPtbNMETW3iT05z+FwR7k=; b=X3nR0Il9hgVL89qU3kmZ+JCchhV/8qYIj3/onBdwYoZS8cuuWr2rO10yPbnQcV2Gbk JD/zH6TcEKAZGctjilEo8JqdJMq4vJ19Bzw36zm+b5XSWE5/ADpXLx2bcA3Kc2rkB8iW QfjSKHidLrOB5uoyIMt7dKOcLv+Ns89DEvvh6rWxANtho5v1LGBj2RHxIUwetDqg2a8N zyjiRegll0kcpKh+O7QOcg4Mf5QiY9GpqRjSpMmExarmSdopor02h/ymRUWaytEdzmVR Ss1McolHGmXCHN8EHufhnJGai+2z8wfgdjf/ZNVE3DYtyurRWb1Kudtv7eOgRhw8XqJ0 U+Dw== 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=rAwszW55AeDy3TSpuVQTOuAPtbNMETW3iT05z+FwR7k=; b=MoAA7caRuCTwv/P4AzraiMskpKmPYAGeOX8H5/4SVOy8GmpzJfKPV9JhYGtImDC8G+ 4GMTGvFwVLsBjLcSWO3pa0an7OLsgfeFBV73wMnUIjN+rp4EAWqhu7g2LudvEF1P2WC2 ul5CLDUXCADdc6nvq/mA4GKKC6NB0i7EXhMeN3LlJK0iOU1irUhnQhmvL37KenbS+Tko xt8s2adXEnO0as8e7xZO/snQ0CLpNNNT6392tqSu5FCiGD1jrxnqR+4pRi9s9WfX+zTs t3AEu0Sa1TAKmm+sJ8mdWmf0RrUamiBDmlJvWuzQ7E8XJbT0m00kZ53pOl8kcU91DdXb kgkw== X-Gm-Message-State: AOAM530Q7PHoVecbIKXhBNupO8ht0QNUtEOsUjM+v697tvHHyPuwAlsQ mvTgHE9Ss8wmOYiGn9QXLvDugUQ5X8nkK5j5Tng= X-Google-Smtp-Source: ABdhPJzNmIxH+b7hSe6881XsxFpgjkmfXh0/TE8PTocB58E/vbcMVSft41QMaIOnnMNmIniVdQ9xLQ== X-Received: by 2002:a05:6214:1548:b0:432:a21a:2759 with SMTP id t8-20020a056214154800b00432a21a2759mr9524413qvw.88.1645929529090; Sat, 26 Feb 2022 18:38:49 -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 p12-20020a05622a048c00b002de8f67b60dsm4482354qtx.58.2022.02.26.18.38.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:48 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 21/24] gnu: chez-mit: Support chez-scheme-for-racket. Date: Sat, 26 Feb 2022 21:34:47 -0500 Message-Id: <20220227023450.1877215-22-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.53 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.53 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.53 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.53 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index da267d3616..5d5108a2b1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -949,7 +949,29 @@ (define-public chez-mit (commit (string-append "v" version)))) (sha256 (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (snippet + ;; Workaround for chez-scheme-for-racket. + ;; See: https://github.com/racket/racket/issues/4151 + #~(begin + (use-modules (guix build utils)) + (substitute* "mit/core.sls" + (("[(]import ") + "(import (only (chezscheme) import)\n") + (("[(]define string->uninterned-symbol gensym[)]") + (format #f "~s" + '(begin + (import (only (chezscheme) + meta-cond + library-exports)) + (meta-cond + ((memq 'string->uninterned-symbol + (library-exports '(chezscheme))) + (import (only (chezscheme) + string->uninterned-symbol))) + (else + (define string->uninterned-symbol + gensym))))))))))) (build-system gnu-build-system) (inputs (list chez-srfi)) ; for tests -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:39:34 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:34 +0000 Received: from localhost ([127.0.0.1]:56609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9TC-0004LD-5Y for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:34 -0500 Received: from mail-qk1-f171.google.com ([209.85.222.171]:43677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Sl-0004IG-K4 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:08 -0500 Received: by mail-qk1-f171.google.com with SMTP id z66so7796457qke.10 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:39:07 -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=fj1dWJncDJUK1qH5QCJQCmUNDvNHURG6D3Wt3WwOE4k=; b=HJfG07H2LXaShfBmfe9QZ8B3b/555PGBGUujIr6cUxH0JPq0m8uwNrV3QPBhvw5RBN JkzjkOSV8lzUlOQkTrmnKAQtqwofxztk9Y3afBOgjPuGdhELtSTRr13OYF56Ot8xNday 1BBuH5NSmT7j+HE2wSWfvW/Q2Qt+Nm1pLGyRR+04hCq6vBzy1zWQSWUiE1ypf7RMvqjY DXeoLu6AGwzACh1C8rQzAfZQGzbjEWBBwuHOrtMP+hmKl+8/OQYfbia6qyoHad5px/qg lWSDWIL4pc1DSAqsTfguWIWv3/u0VNO0/pNg4uXfL3ph/qSUi+vrwMisveVGILWseseL /DxQ== 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=fj1dWJncDJUK1qH5QCJQCmUNDvNHURG6D3Wt3WwOE4k=; b=mw9I2g+TeskQN5peXagDk/pc/x2NuwDZF0fDkA4VrXWNrhYMdQpnYAMpel0PfthGW7 x7V0/Jgdjzv5sBrzYBoWfm6/Lwbcfcx5INCms0suYJ1++u5fHTezs/0LR3QN7Dd+WiDN mJepJzK+pUvfKIGDyMUB8Hzjgwpehny4znsdH+pQ6a4crMZhdl455+K6JsCBQRvlu4E9 lWDDrVZNSR70gcS0AsVVaZZYtDn3tGzap0HJwbIlJG1gWnBaq+FpRN23jxOXQ++otPVH 8LeXhIL/ZNEhBHEcbCZVEeGl6iJAMMvPXUeIUbpZfE6C4ObrrcIgpCmn2zVCbZQMzD4W 3s3w== X-Gm-Message-State: AOAM532OFqx3nbe2V6OSoNiL3IiJH+z+pOpkjtIJBirR9idHcn6Y9Vth NqKZuA0p9s3+CXhHRW1OQYL5GSSFfeNpXJVUzhg= X-Google-Smtp-Source: ABdhPJxqw5GSjxiNC4xjE+NYk0ehDUVaF9tJvDnRezevVvrp5lrIqWl6ar1FfBa5Wpbyg4aENl1emA== X-Received: by 2002:ae9:e8cc:0:b0:506:c9aa:cd9f with SMTP id a195-20020ae9e8cc000000b00506c9aacd9fmr8234757qkg.395.1645929542098; Sat, 26 Feb 2022 18:39:02 -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 w13-20020a05622a190d00b002dd2600afc2sm4453384qtc.62.2022.02.26.18.39.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:39:01 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 24/24] gnu: racket-vm-cs: Build with "--enable-scheme". Date: Sat, 26 Feb 2022 21:34:50 -0500 Message-Id: <20220227023450.1877215-25-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-vm-cs)[native-inputs]: Remove 'chez-scheme-for-racket-bootstrap-bootfiles'. Add 'chez-scheme-for-racket'. [arguments]<#:phases>: Delete 'unpack-bootfiles'. <#:configu [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.171 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.171 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/racket.scm (racket-vm-cs)[native-inputs]: Remove 'chez-scheme-for-racket-bootstrap-bootfiles'. Add 'chez-scheme-for-racket'. [arguments]<#:phases>: Delete 'unpack-bootfiles'. <#:configu [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.171 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.171 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/racket.scm (racket-vm-cs)[native-inputs]: Remove 'chez-scheme-for-racket-bootstrap-bootfiles'. Add 'chez-scheme-for-racket'. [arguments]<#:phases>: Delete 'unpack-bootfiles'. <#:configure-flags>: Add "--enable-scheme". --- gnu/packages/racket.scm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 98dab6f743..952bec6aa9 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -399,7 +399,7 @@ (define-public racket-vm-cs (native-inputs (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") - (prepend chez-scheme-for-racket-bootstrap-bootfiles + (prepend chez-scheme-for-racket chez-nanopass-bootstrap racket-vm-bc))) (arguments @@ -409,18 +409,15 @@ (define-public racket-vm-cs (add-after 'unpack 'unpack-nanopass+stex (lambda args (with-directory-excursion "racket/src/ChezScheme" - #$unpack-nanopass+stex))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (search-input-directory (or native-inputs inputs) - "lib/chez-scheme-bootfiles") - "boot")))))) + #$unpack-nanopass+stex))))) ((#:configure-flags _ '()) #~(cons* "--enable-csonly" "--enable-libz" "--enable-lz4" + (string-append "--enable-scheme=" + #$(this-package-native-input + "chez-scheme-for-racket") + "/bin/scheme") #$(racket-vm-common-configure-flags))))) (synopsis "Racket CS implementation") (description "The Racket CS implementation, which uses ``Chez Scheme'' as -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:39:34 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:35 +0000 Received: from localhost ([127.0.0.1]:56611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9TC-0004LG-Fw for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:34 -0500 Received: from mail-qk1-f170.google.com ([209.85.222.170]:44612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Sc-0004He-VO for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:13 -0500 Received: by mail-qk1-f170.google.com with SMTP id q4so7778452qki.11 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:58 -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=ZoWBDgQKu+/EBBDnvmdQuot6TF7P+L6bwBDBflHyYro=; b=A1LIjpSTlAxwbY+PjxST/rnQMCgR5BmnQIt5rs1hiJlCDkr/dBvpp2wp0JLKlQRAe4 vNSrpTJDVOF806lXE1+M82xM+HbVf9z0XQgaWOZ5sQybfmq3H4s3ajnQ9x8tXAskoZ9b aQ0W5x4L3rMeVlrZzBMDBB7W7ejN0EjTPOaoUWDgpmRS2ZYKCeGehYYXVptaSIu39yIr cvx2S1hm5TVNEJdhP1DklpkJzYy8cSePufXpPxDQQpfNrerezhY0awjK3EX4UOpMEnqD 6o/TCUzp8fZQZsAMJaFwitY4XmyZjuORiQ+AmbYU842y6VNegAoNrE2oLwNPi2xdEgyM bWGA== 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=ZoWBDgQKu+/EBBDnvmdQuot6TF7P+L6bwBDBflHyYro=; b=4U+i/zYgiQS51LLxB5mHjsyY9O+sXFSXKw/cVOCvDXKFJUl3pLg+ErKyjPDxz3AY0U 2KN5TS47f/JfyT9Y21JepFrbFRaMfaiY9H0yB/r6EEJYbf3StC/XNyMwI5NRki4GNILC 4kMNqBzgW0z5by9MLaD9dbNIEF6h+xLUTSKBe07oRU3iDM4rnrgNNsWz4Zvx8EieBFzk sUu4dH+f2qQv19OldjqjFCxRx4mxKATTRgexAXYX+O/NnvrDZzF76SFjCJUu4q4RTvEq B2CAbo++KAphFeUD1K0aPzA17KK3dtj+fze98hbHGJaTEdTRD2kwMFsWSKo1hHUgh3cN AJ9Q== X-Gm-Message-State: AOAM531e8JA/l2zdJcyB1PSy+/WMBizegR7FfZzcvJp+xilWdqVBmEF9 FJYAT6nxz2fHWsMgXc03mcjhdZ/FyyCnBlj0S20= X-Google-Smtp-Source: ABdhPJx3NXxmC+7joC+FmFpSpbnsgDkvQ8WaftTuRBLVCKuWC9WHqIbGRB1dJxQsDBwf44VF3XdZiQ== X-Received: by 2002:a05:620a:35c:b0:648:e0da:8a64 with SMTP id t28-20020a05620a035c00b00648e0da8a64mr8275709qkm.73.1645929533361; Sat, 26 Feb 2022 18:38:53 -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 f7-20020a05622a104700b002d4b318692esm4376280qte.31.2022.02.26.18.38.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:53 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 22/24] gnu: Add chez-scheme-for-racket. Date: Sat, 26 Feb 2022 21:34:48 -0500 Message-Id: <20220227023450.1877215-23-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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.sc [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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.sc [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.170 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.170 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 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 5d5108a2b1..e7ddab0d1f 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 c96bebe325..98dab6f743 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 21:39:35 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:35 +0000 Received: from localhost ([127.0.0.1]:56613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9TC-0004LN-Um for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:35 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:39642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Sh-0004Hp-0R for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:06 -0500 Received: by mail-qv1-f41.google.com with SMTP id a1so9820053qvl.6 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:39:02 -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=U6sOEQII/nfr63USoeuo2RDShtCjrXl2+vOKM7l7ThA=; b=ipGjYQK9quEnWd3gaKrREA0GsKSW/Q8jcj/RBmfjjDy+1FKMyn0zNmORAW6ET9XhRJ hMzuBUk27efuJAfSzvBKzQ4bHXTgLc3lX/4IqICXF1FjSMVQmuqQIg9WZ5AWi5jpwk36 ZjdlN2WYseGDez/N1g6i0tYnQgQ6wDbvCCaIHHnLm+M/zsq/dhMG6uYa8xNK2hXEdlFA uYaMG5G1tg3g/Lu3EWGmzDRVKo1xY4iLdVNISMOdH2O7bGvkihoK5k5716EZLvVF3CFr s/MvH7UbXIfLwz/YmPHStT+K4+nGN1/BcvCaQ9AxuDjJxRdVioLXNk+qo63Rwmn+G1z3 L+Yg== 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=U6sOEQII/nfr63USoeuo2RDShtCjrXl2+vOKM7l7ThA=; b=j6QujG6L3d1TmqQaI7re4OtvmuuzijsZkkxa+WztkHhcAN6+R3X9YUHMtMjEWHvwPz MHKZeMhfKVimJWUuwtNYEYVD4iA6twxu+oCsEX9W08e3K1nVNimXF2AwQogYVl3kYRAE WlT5BsF8SP/YrNOv3ES1G/HtamQOioPI/eiq1DgJEof+Uqja7G1J4xngM0fn/pn57Ns1 Ruwagev56KPOf5t8EssokR+bn8ioag5O4s5Kwgt7WUIABn93ZgcHgyOrYprIiVqjUURc /t9GYwCFR6D3zZDhdWMG71Qkgf1VdpXRjDf/0aEHDCn8NPwNcmn+e4BbM55LJono2ded JQdg== X-Gm-Message-State: AOAM532j5ij3vhSEsLHesyUuwXdpvSE4yz+yDz8qbB0ZcaeGj8/yvlqC uDYyr8JbS8gWG2KK+HKPWsdyI1r1zW1P6ucZ+Wo= X-Google-Smtp-Source: ABdhPJxUNXSzgY9v2kzmBtKZzBoe5VlbFtxJNO+nHvg1kFNssp62zj8L6EMk7vCyDDUZdelDZFRu2w== X-Received: by 2002:ad4:5f06:0:b0:433:6f6:e2b7 with SMTP id fo6-20020ad45f06000000b0043306f6e2b7mr1928841qvb.114.1645929537469; Sat, 26 Feb 2022 18:38:57 -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 p20-20020a05620a22b400b00648ca1458b4sm3252776qkh.5.2022.02.26.18.38.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:57 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v6 23/24] gnu: chez: Add 'chez-scheme-for-system'. Date: Sat, 26 Feb 2022 21:34:49 -0500 Message-Id: <20220227023450.1877215-24-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (chez-scheme-for-system): New procedure. (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Use 'chez-scheme-for-system'. * g [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.41 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.41 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 T_SPF_TEMPERROR SPF: test of record failed (temperror) 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/chez.scm (chez-scheme-for-system): New procedure. (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Use 'chez-scheme-for-system'. * g [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.41 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.41 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/chez.scm (chez-scheme-for-system): New procedure. (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Use 'chez-scheme-for-system'. * gnu/packages/loko.scm (loko-scheme): Likewise. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise --- gnu/packages/chez.scm | 33 ++++++++++++++++++++++++--------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index e7ddab0d1f..b3aadf3a78 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -47,7 +47,8 @@ (define-module (gnu packages chez) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:export (nix-system->chez-machine + #:export (chez-scheme-for-system + nix-system->chez-machine chez-machine->nonthreaded chez-machine->threaded unpack-nanopass+stex)) @@ -67,6 +68,20 @@ (define-module (gnu packages chez) ;; ;; Code: +(define* (chez-scheme-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, +including support for native threads." + (if (or + ;; full support upstream + (and=> (chez-upstream-features-for-system system) + (cut memq 'threads <>)) + ;; no support anywhere + (not (nix-system->chez-machine system))) + chez-scheme + chez-scheme-for-racket)) + (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 @@ -751,7 +766,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -782,7 +797,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) ghostscript ;; FIXME: This package fails to build with the error: ;; mktexpk: don't know how to create bitmap font for bchr8r @@ -847,7 +862,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) chez-web (texlive-updmap.cfg (list texlive-pdftex)))) (arguments @@ -933,7 +948,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -965,7 +980,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -996,7 +1011,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -1059,7 +1074,7 @@ (define string->uninterned-symbol (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -1090,7 +1105,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index ef98088100..df53df61c7 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -451,7 +451,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index ef9312afe3..449c62f1f0 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -71,7 +71,7 @@ (define-public loko-scheme #t))))) (native-inputs `(("akku" ,akku) - ("chez-scheme" ,chez-scheme) + ("chez-scheme" ,(chez-scheme-for-system)) ("struct" ,guile-struct-pack) ("laesare" ,guile-laesare) ("pfds" ,guile-pfds) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 03:43:01 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 08:43:01 +0000 Received: from localhost ([127.0.0.1]:56824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOF8q-0006wk-4P for submit@debbugs.gnu.org; Sun, 27 Feb 2022 03:43:01 -0500 Received: from mail-ej1-f66.google.com ([209.85.218.66]:43663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOF8o-0006wW-0z for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 03:42:54 -0500 Received: by mail-ej1-f66.google.com with SMTP id d10so19011354eje.10 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 00:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=vGFOHGGSXYAmTmBpNW4tlRDglUmF/CfPSvu/LylXWGA=; b=gAjG7enjIO1Hmg1rxxI1v4M+a3QWX9nODXU69MAYtPzvbf44zEUXrHYeTMhv8f4vbH AdTPrWjOZyTwsrqkTd5Mf06axnaYY7KNknVUMgeq+6m229rbnxNMBftp20dDe2yd38Wb X0VgSCWgQYCT8V0fcqmpFkYAimrxD0V4qEQGWhV1UlqZKF2D8fxHZuVaJpf8TbzGbzHs kKTp41ToPyte9NsdDRcPbaCA8ifn3W2p5CAQTl+UsKO+zUtue6gFyoQfNPqSLjL71pQ8 Yh/CEze4NIAPp5bMMl19Ju2UYpk4C0lwXEmde83H4AYZRrNPXrzJ/lDwF0YAMMW4qicq xL4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=vGFOHGGSXYAmTmBpNW4tlRDglUmF/CfPSvu/LylXWGA=; b=ct6QpblXhjGnmKOVFTiEjJHvRCedgwJSbeoj26P9b/erkQTWDpXkIpJO1s7ZrinVXM SuQgOdcJhd3fRRqmcdrQRvc1cQlr7j39l85Vdhgqo2O7DakE7qmZ/FYTlELIe0yvkLxv 6IOVzZ5DfYE81TTI7CZSkDF9TYJztMkPak0tloG0h7pACZhAMhDTpC2//wCYzPERzBBp l18q32Y9Z5QtCY/63TP+0L3T2O5YInxvAAtcH5unky/LOxyEqGNno+6S5LjfJT04P5S6 XPr9fmX3SFLGiO/+KRxoITeMg0WF1nPH5XWmZkpcJG4j3Kw5rNnS+thUVOHXDJZIb4TI ZPRg== X-Gm-Message-State: AOAM530MjlOfW/Wm3SmKA7bW7u9Wea0zFgwtI5z7IT87Rvx5ZNqPRnS+ 5AI+faDS22K3CI/8CcDpHKE= X-Google-Smtp-Source: ABdhPJzJDsqpSUNcMDM6V9D5I1iD7dPiq/ylXemV6gOc46+XobZxZgL7raUTOEWnWZSS1IKCEh2mLA== X-Received: by 2002:a17:906:35ca:b0:6ce:d3b5:38f5 with SMTP id p10-20020a17090635ca00b006ced3b538f5mr11638770ejb.276.1645951367940; Sun, 27 Feb 2022 00:42:47 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id j2-20020aa7c0c2000000b00412b6b79d1asm4212131edp.10.2022.02.27.00.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 00:42:47 -0800 (PST) Message-ID: <09090412d57b03233435146bfa13eb6a73c12990.camel@gmail.com> Subject: Re: [PATCH v6 03/24] gnu: racket: Use Git origins for Racket packages. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sun, 27 Feb 2022 09:42:46 +0100 In-Reply-To: <20220227023450.1877215-4-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> <20220227023450.1877215-4-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Am Samstag, dem 26.02.2022 um 21:34 -0500 schrieb Philip McGrath: > * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: > Adjust path. > * gnu/packages/racket.scm (racket-packages-orig [...] Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.218.66 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.66 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. 1.2 URI_DOTEDU Has .edu URI X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Hi, Am Samstag, dem 26.02.2022 um 21:34 -0500 schrieb Philip McGrath: > * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: > Adjust path. > * gnu/packages/racket.scm (racket-packages-origin, > simple-racket-origin): New procedures. > (extend-layer): Rename to ... > (configure-layer.rkt): ... this variable. Tweak command-line > arguments. Adapt to 'config-tethered-apps-dir'. > (racket): Stop inheriting from 'racket-minimal'. > [version]: Use '%racket-version'. > [source]: Stop using bundled tarball. > [inputs]: Remove labels. Add 'racket-minimal' and package sources. > [native-inputs]: Remove, since cross-compilation doesn't work yet. > [arguments]: Rewrite to use G-expressions, package sources from > 'inputs', an explicit 'install' phase, and the revised > 'configure-layer.rkt'. > --- >  ...acket-gui-tethered-launcher-backport.patch |   6 +- >  gnu/packages/racket.scm                       | 714 +++++++++++++--- > -- >  2 files changed, 539 insertions(+), 181 deletions(-) > > diff --git a/gnu/packages/patches/racket-gui-tethered-launcher- > backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher- > backport.patch > index abf253486f..1e018eaa79 100644 > --- a/gnu/packages/patches/racket-gui-tethered-launcher- > backport.patch > +++ b/gnu/packages/patches/racket-gui-tethered-launcher- > backport.patch > @@ -7,13 +7,13 @@ Related to racket/racket#4133 >   >  (cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) >  --- > - share/pkgs/gui-lib/mred/installer.rkt | 3 ++- > + gui-lib/mred/installer.rkt | 3 ++- >   1 file changed, 2 insertions(+), 1 deletion(-) >   >  diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt >  index b1691472..9ef06c53 100644 > ---- a/share/pkgs/gui-lib/mred/installer.rkt > -+++ b/share/pkgs/gui-lib/mred/installer.rkt > +--- a/gui-lib/mred/installer.rkt > ++++ b/gui-lib/mred/installer.rkt >  @@ -72,4 +72,5 @@ >      (list "-A" (path->string (find-system-path 'addon-dir))))) >   > diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm > index 00ec587eeb..c4e5ee1311 100644 > --- a/gnu/packages/racket.scm > +++ b/gnu/packages/racket.scm > @@ -28,7 +28,9 @@ (define-module (gnu packages racket) >    #:use-module (guix gexp) >    #:use-module (guix build-system gnu) >    #:use-module (srfi srfi-1) > +  #:use-module (srfi srfi-26) >    #:use-module (ice-9 match) > +  #:use-module (ice-9 exceptions) >    #:use-module (gnu packages) >    #:use-module (gnu packages autotools) >    #:use-module (gnu packages bash) > @@ -389,172 +391,504 @@ (define-public racket-bootstrap-chez- > bootfiles >  Chez Scheme.") >       (license (list license:asl2.0))))) >   > +(define (racket-packages-origin name origin spec0 . spec*) > +  "Extract from ORIGIN the sources for the Racket packages specified > by SPEC0 > +and any additional arguments SPEC*.  In the resulting file-like > object, each > +package's source will be in the directory > \"/share/racket/pkgs/PKG/\", where > +PKG is the Racket name for the package.  The NAME will be used in > the store > +file name for the resulting file-like object. >   > -(define %installer-mirrors > -  ;; Source: > -  ;; > https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58 > -  ;; Matthew Flatt says: "note that many are commented out" > -  ;; INVARIANT: End with a trailing "/"! > -  '("https://mirror.racket-lang.org/installers/" > -    "https://www.cs.utah.edu/plt/installers/" > -    "https://plt.cs.northwestern.edu/racket-mirror/" > -    "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" > -    ;; Universität Tübingen is using a self-signed HTTPS > certificate: > -    "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" > -    "https://racket.infogroep.be/" > -    )) > +A package specification is a list of the form: >   > -(define %main-repo-main-distribution-pkgs > -  ;; These are the packages developed in the main Racket Git > repository > -  ;; that are part of the main distribution. > -  '("at-exp-lib" > -    "base" > -    "compiler-lib" > -    ;; NOT "compiler-test" > -    "compiler" > -    "net-doc" > -    "net-lib" > -    ;; NOT "net-test" > -    "net" > -    ;; NOT "plt-services" > -    ;; NOT "racket-benchmarks" > -    ;; NOT "racket-build-guide" > -    "racket-doc" > -    "racket-index" > -    "racket-lib" > -    ;; NOT "racket-test-core" > -    ;; NOT "racket-test-extra" > -    ;; NOT "racket-test" > -    "zo-lib")) > +  (PKG PATH) >   > +where PATH is the path to the package source relative to ORIGIN--- > possibly > +\".\".  As a special case, a package specification may also be a > string, which > +is equivalent to: > + > +  (PKG PKG) > + > +Examples: > + > +- \"expeditor\" > +- (\"main-distribution\" \".\") > +- (\"racket-lib\" \"pkgs/racket-lib\")" > +  (computed-file > +   (string-append "racket-pkg-" name "-sources") > +   (with-imported-modules `((guix build utils)) > +     #~(begin > +         (use-modules (guix build utils)) > +         (mkdir-p (string-append #$output "/share/racket/pkgs")) > +         (chdir (string-append #$output "/share/racket/pkgs")) > +         #$@(map (match-lambda > +                   ((? string? name) > +                    #~(copy-recursively #$(file-append origin > (string-append "/" name)) > +                                        #$name)) > +                   ((name ".") > +                    #~(copy-recursively #$origin #$name)) > +                   ((name path) > +                    #~(copy-recursively #$(file-append origin > (string-append "/" path)) > +                                        #$name))) > +                 (cons spec0 spec*)))))) Perhaps I wasn't clear enough about this in v5, but I think spec should be a single argument rather than multiple ones. This way, if we do find that we need to extend it to support an additional argument, we don't have to awkwardly code around the #:rest. > +(define (simple-racket-origin repo hash spec0 . spec*) > +  "Like 'racket-packages-origin', but specialized for packages > hosted at > +\"https://github.com/racket/REPO\" with sha256 checksum HASH.  REPO > is also > +used to build the name of the resulting store item." > +  (apply racket-packages-origin > +         repo > +         (origin > +           (method git-fetch) > +           (uri (git-reference > +                 (url (format #f "https://github.com/racket/~a" > repo)) > +                 (commit %racket-commit))) > +           (sha256 hash) > +           (file-name (git-file-name (string-append "racket-" repo) > +                                     %racket-version))) > +         spec0 > +         spec*)) Same here, plus it saves us the trouble of a additional "apply". The effect for  > +      (simple-racket-origin > +       "2d" (base32 > "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") > +       "2d" "2d-doc" "2d-lib") would be that '("2d" "2d-doc" "2d-lib") is more clearly delimited from the package name and hash, and > +      (racket-packages-origin > +       "racket" %racket-origin > +       '("base" "pkgs/base") ;; FIXME belongs in racket-minimal > +       '("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in racket- > minimal > +       '("at-exp-lib" "pkgs/at-exp-lib") > +       '("compiler" "pkgs/compiler") > +       '("compiler-lib" "pkgs/compiler-lib") > +       '("net" "pkgs/net") > +       '("net-doc" "pkgs/net-doc") > +       '("net-lib" "pkgs/net-lib") > +       '("racket-doc" "pkgs/racket-doc") > +       '("racket-index" "pkgs/racket-index") > +       '("sandbox-lib" "pkgs/sandbox-lib") > +       '("zo-lib" "pkgs/zo-lib")) '(("base" "pkgs/base") ("racket-lib" "pkgs/racket-lib") ...) needs less quoting over-all. > +      (simple-racket-origin > +       "class-iop" (base32 > "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l") > +       "class-iop-lib") While single strings like this do each cost three additional characters that way, I wouldn't special-case them. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 03:49:09 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 08:49:09 +0000 Received: from localhost ([127.0.0.1]:56828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOFEq-00078I-Px for submit@debbugs.gnu.org; Sun, 27 Feb 2022 03:49:08 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:38489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOFEp-000784-AQ for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 03:49:07 -0500 Received: by mail-ed1-f66.google.com with SMTP id s24so13286753edr.5 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 00:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=Itc9Xxh9JfibZ0w4mtMZ3giRKkL7cVqbqngfo9ajXjg=; b=Qmje9Tnj1rNNjg4JE9W/GZGI25sRnuoM3a48WwjYkkVGsg/FbAjxDBUdEwLp7AKxXc Bf2nOSC3KwpFo2H1j4kV8JHp982v7tkrGYce+vVYirVzyIR1HoumY2b0ETlby1I0AUtw Ln8Qg3h2aDc/HxsrYFEhYfqcrtL1vUaD6NsW3iZD8QX80jLvoTgqwoPNxg/I6cDcY/nR Ts9VhLzdR1/gu73xdN6R3FtxQnSAlMr6TQWZ6K1VgEtuQRShRPssKhBS4/PXytABpiew zIMMfiwYH+IulCQ8oOFNyiAIAwQzQpC87aFXF8b55WpS8VOQWa6MR1IJAGqj+NVYiEjE a6YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Itc9Xxh9JfibZ0w4mtMZ3giRKkL7cVqbqngfo9ajXjg=; b=hJmjh5Nh4eO2SvKivXbiGAP0SjsUbjGJ2Ay+kwb+ziFiN8IxkbKoezNgpt5uj4LZv3 XQL2wALdm5hd2UWxXmBTmmONBRYhN/qVUAkpI0cHw8x0II4HEzxpyXDAdGHrUokHcNgL 5XsGOKtueg2wpmD5CfeIHqQYsNkjB7YqL6qHJradhEXrGIBHK7QZMo7S0PQQfEn1eLry nyFgfZJAXyvQGAB69SSbJneUUJWHyM5IPWFUPUiXcu9IBlOvAxsd9zt/sIzgIvvJy0GC XwLB3xS/yp2KQ3YrF5p1A2TjhLEKsVYH2Sa/QoVNz9AbuLiQS5La7SmvCgWZJd8ymDUU 7ToA== X-Gm-Message-State: AOAM5328Miw7/DlNXTs8CkLQOkQ3AmvmO8+R/Q807JeT8MihlplqyGcf SbBLWh6C6jGVJmix73/Y9k0= X-Google-Smtp-Source: ABdhPJxMd0yXKzJa2onsxziFHdlzhJCj6+1lByqaEZq9WOqfcsWKhlwQq/MInCUevAWZ0JjgAa8fpw== X-Received: by 2002:a05:6402:190a:b0:408:9d75:eab6 with SMTP id e10-20020a056402190a00b004089d75eab6mr14127973edz.286.1645951741438; Sun, 27 Feb 2022 00:49:01 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id la3-20020a170906ad8300b006d0562a1011sm3122767ejb.21.2022.02.27.00.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 00:49:01 -0800 (PST) Message-ID: <25b0d1cd85520225008fd3a08b8597828ca71770.camel@gmail.com> Subject: Re: [PATCH v6 15/24] gnu: chez-scheme: Use "lib/chez-scheme" for search path. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org, zimoun Date: Sun, 27 Feb 2022 09:48:59 +0100 In-Reply-To: <20220227023450.1877215-16-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> <20220227023450.1877215-16-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Am Samstag, dem 26.02.2022 um 21:34 -0500 schrieb Philip McGrath: > There does not seem to be any widely accepted standard path to use > for "CHEZSCHEMELIBDIRS". Using a path without a version number [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.66 listed in wl.mailspike.net] 1.5 FROM_FMBLA_NEWDOM From domain was registered in last 7 days -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Am Samstag, dem 26.02.2022 um 21:34 -0500 schrieb Philip McGrath: > There does not seem to be any widely accepted standard path to use > for "CHEZSCHEMELIBDIRS". Using a path without a version number in it > avoids having to compute the actual path everywhere, which would be > especially unpleasant when support is added for the Racket variant of > Chez Scheme, which always has a different version number than > upstream. > > * gnu/packages/chez.scm (chez-scheme)[native-search-paths]: Change to > use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for > "CHEZSCHEMELIBDIRS". > (chez-make-flags): Update accordingly. > (chez-sockets)[arguments]<#:phases>: Likewise. Having separated this from cosmetic changes makes it much easier to review, thanks. LGTM From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:30:06 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:30:06 +0000 Received: from localhost ([127.0.0.1]:59315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7F-00089V-KT for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:05 -0500 Received: from mail-vs1-f47.google.com ([209.85.217.47]:44580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7C-00088V-Qc for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:03 -0500 Received: by mail-vs1-f47.google.com with SMTP id y4so11044643vsd.11 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:02 -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=1TD+mmEC5lXYMkOe5PlM2aylzWfpKdZ/eLU50jlGjq8=; b=Aeti9qJfnqJpWZZq9RCcGbuRZMGNT4r1/OB82LRhnKzQBdaDfKK5H47Sbjw7FrVllh DLopbqOJ4snd1rpOesxJr4yZJm/Grsbdpssxhsz0svLN4IXULyX1Hnpas2On7kiLdE6K +dVDyq3wg+09scyBOo/TIskEU2Z5Voy2odjAycCgFsWCDhoFik7RX6pFlDL8fOlsGy0e Dr3uDUWvymIxnCKzioxmPOiFqcn9zBdBl6BCpRJFaEex626uQToQbT9JDZbc/5Ei6Fi4 33EzygEQ5sJPLEWCcV1SbPhH+ZWBZlv6hCsU0VzWf7sDO0XaXCcT30PFnGldbJmIUdlI tx9Q== 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=1TD+mmEC5lXYMkOe5PlM2aylzWfpKdZ/eLU50jlGjq8=; b=5mS0XX/hgSNsmdTqsSPVaIrfm0R7q+r8VUUjzYxpl13MHNuEh/B3L1f9GkrTr3H7MN TM+WZmp0OmJOutqUqTVmihku41wNh/H7ykwmxGOHs9MQ71PZu4YQLHbhPLTc7FNMYCsD LlWFIHU8O4qn2Qvt3y3VkQYw62zY0VIKUSem2kTXEmxZZbj9mFTePPN3c/YhTJAy4+u8 yS07OooEzlV8/sMkPy+e+RAKv6EWVg0J8ukvnFhgXy0AvpNU0fi/4dHRpiXRQEmu2TXX G1Ek1sunGrT0pyjbHNB3QDE0iZAHUxWgxjtHDklpoteQrtm+bHSoX0MlxkTGnmkcwBME q1Sg== X-Gm-Message-State: AOAM530r/r6NfFhcF6oOm4t1cokfyurGRyFesrzzYM/eYAA6wNDG4XZR Z5lvHUX+MgYzy3CHwZKUvV3J1O0i7OU1mvdTYug= X-Google-Smtp-Source: ABdhPJz5N2mp1Hfi8TFXZHOu8VNFWCjASEDKmpVjt5ZwIHvJQMKttrdDDCPM/LbzP4XAjePSy8rSFQ== X-Received: by 2002:a67:d589:0:b0:31b:5561:b18e with SMTP id m9-20020a67d589000000b0031b5561b18emr6630819vsj.53.1645997397066; Sun, 27 Feb 2022 13:29:57 -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 h127-20020a676c85000000b0031c5721b5ddsm1154980vsc.32.2022.02.27.13.29.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:29:56 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 00/24] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Sun, 27 Feb 2022 16:28:56 -0500 Message-Id: <20220227212920.2009000-1-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Hi, On Sunday, February 27, 2022 3:42:46 AM EST Liliana Marie Prikler wrote: > > Perhaps I wasn't clear enough about this in v5, but I think spec should > be a single argument rather than multiple ones. This way, if we do > find that we need to extend it to support an additional argument, we > don't have to awkwardly code around the #:rest. > Rather than debate it, I'm sending a v7 with the change to patch 03/24 that Liliana requested in . In the medium term, I'd rather put effort into making a `racket-build-system` than tinker too much with the current way of doing things. -Philip Philip McGrath (24): gnu: Use license prefix in (gnu packages racket). gnu: racket: Update to 8.4. gnu: racket: Use Git origins for Racket packages. gnu: racket-minimal: Use new package style. gnu: racket-minimal: Don't configure non-existant catalogs. gnu: racket-minimal: Change inheritance to follow bootstrapping. gnu: racket-minimal: Adjust indentation. gnu: racket-minimal: Add "debug" output. gnu: configure-layer.rkt: Adjust indentation. gnu: racket-minimal: Separate from the Racket VM. gnu: racket: Move Chez bootfiles to (gnu packages chez). gnu: chez: Add utilities for Chez machine types. gnu: racket: Add 'racket-vm-for-system'. gnu: chez-scheme: Use new style for Chez packages. gnu: chez-scheme: Use "lib/chez-scheme" for search path. gnu: chez-scheme: Use shared zlib and lz4. gnu: chez-scheme: Use new package style. gnu: Add stex. gnu: Add chez-nanopass. gnu: chez-scheme: Explicitly package bootstrap bootfiles. gnu: chez-mit: Support chez-scheme-for-racket. gnu: Add chez-scheme-for-racket. gnu: chez: Add 'chez-scheme-for-system'. gnu: racket-vm-cs: Build with "--enable-scheme". gnu/local.mk | 4 +- gnu/packages/chez.scm | 1264 ++++++++++----- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- .../racket-enable-scheme-backport.patch | 465 ++++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 1433 +++++++++++------ 7 files changed, 2342 insertions(+), 854 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:30:14 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:30:14 +0000 Received: from localhost ([127.0.0.1]:59319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7O-0008Av-1A for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:14 -0500 Received: from mail-vs1-f42.google.com ([209.85.217.42]:41642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7I-00089Q-Qq for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:10 -0500 Received: by mail-vs1-f42.google.com with SMTP id y26so11060427vsq.8 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:08 -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=im2eB4m2cw9htGdEwc+CW/YqzVpAKz+5GUbS5TUWUbs=; b=G5FfUzU2/NyreN9q3FycSgczDtf9aLyhYTXxVXZqrV/F953MKaDF7pQDM0IYFK7mrf RaRnAkYFuCpB+g1AktKPXl2lGAYUHgtzR/sjGBonii/es2Wr/gX8EhlR7v/fuPo4GGjW E2TO/jVWoAFCcPIp3bBZdM4rj/OsC5n/l46R3U+sX1rnYEnWsTG5SJQAswx5zDHec7oz h76jm+oKeKe5/ll2Sv8DLWEuCIyRG5XmCpwUQbjmn+E2o/7sBIYNosQBSh2k6l5uVIlq bXEX9l8MEbPZCW7F/pbRuMx26u57oyXPhz1eQOu5W0bEl+Z8A+cfOdcuoMvEIba17ivi JkIQ== 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=im2eB4m2cw9htGdEwc+CW/YqzVpAKz+5GUbS5TUWUbs=; b=WKKSUQa2L22SmisMBO2hgIv4+reTwptX2bDETjV/KtzesI6OvYlK+R8U/msyaosaul k6ihtgguUhWmNHqb4MAoZdlbr30dqIGNvQbOd4mVdD9BHjduxwsuRxUAWTYN+c/e8DZ9 6eLkDfDRPkN7LGOMxsMB6ae/2L1qQV/rJop/9KqCWq8HpwiVZeqXlKe8dCNqH7GxgTlY kV29ojOyf5isv26ws1jmCttGY9z4NqhXfRsyXpfPcpTtEE9pUxW+rJyhJrmj+PoXDSLF NnV2lx0FqX1dJtIg/VnH6GUKvyECKUOVWmoHWNjuRqbEHiyS5HbU2VT6yNcDAC0ZfSeb ffrw== X-Gm-Message-State: AOAM5332n+6HTqz8chR4Kb86HTobotSkjxKwloT7bYvgeLjeoGvrXQah EJv6AEXGIgjjuE9DNRIwppg+H/pJuqq9CN2pcbE= X-Google-Smtp-Source: ABdhPJyRBo2gNvMsu89h8byfldCpi02kvnU4dmjyMTMR6BMBtvoKki366H8LNP7vSCnzU19JHNrppg== X-Received: by 2002:a67:f545:0:b0:31c:1bc2:9d5d with SMTP id z5-20020a67f545000000b0031c1bc29d5dmr5566935vsn.79.1645997403194; Sun, 27 Feb 2022 13:30:03 -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 q65-20020a1fa744000000b0032db512ac39sm1348926vke.46.2022.02.27.13.30.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:02 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 01/24] gnu: Use license prefix in (gnu packages racket). Date: Sun, 27 Feb 2022 16:28:57 -0500 Message-Id: <20220227212920.2009000-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-minimal, racket-minimal-bc-3m, racket-bootstrap-chez-bootfiles): Use license prefix. --- gnu/packages/racket.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d0a5ca494b..ec9e836a4c 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -21,8 +21,6 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages racket) - #:use-module ((guix licenses) - #:select (asl2.0 expat lgpl3+)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -47,7 +45,8 @@ (define-module (gnu packages racket) #:use-module (gnu packages multiprecision) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:use-module ((guix licenses) #:prefix license:)) ;; Commentary: ;; @@ -254,7 +253,7 @@ (define (write-racket-hash alist) DrRacket IDE, are not included.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list asl2.0 expat)))) + (license (list license:asl2.0 license:expat)))) (define-public racket-minimal-bc-3m @@ -295,7 +294,7 @@ (define-public racket-minimal-bc-3m collector, 3M (``Moving Memory Manager'').") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list lgpl3+ asl2.0 expat))))) + (license (list license:lgpl3+ license:asl2.0 license:expat))))) (define-public racket-minimal-bc-cgc @@ -372,7 +371,7 @@ (define-public racket-bootstrap-chez-bootfiles 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.") - (license (list asl2.0))))) + (license (list license:asl2.0))))) (define %installer-mirrors -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:30:31 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:30:31 +0000 Received: from localhost ([127.0.0.1]:59323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7X-0008BX-FO for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:31 -0500 Received: from mail-ua1-f50.google.com ([209.85.222.50]:39737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7N-0008A7-MN for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:17 -0500 Received: by mail-ua1-f50.google.com with SMTP id 102so5119170uag.6 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:13 -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=z0pcZSlzKw/cUO7uj/U8mdQ+2/FnmZU2cO/RKK1LnLk=; b=hdj2quz1oshdRkEO7pEEjftaX9ASnbXw6ZBtTdv7rIq4rGh/eECieu/1hETWMtbxU7 nHbe6KvYycsJpXZh2BwuQwQsYlxlhC6EQtuf72ffKz62GpVlhP7PCKPJ6rd0XYulTRwU piI7jkAQF8ekeF0tt4Zehz+9GkcwjACAWf1Tvgomj+7y1lYg6eFTS6/UWqY/hOO7UQa7 iX54aVnZ4kvHljVN2yous7I/sHe3jFLfb805lb8RWL2mtl0DXdScRfDcJXszerqY4Sw0 QAGklNJO+RiZBcucE/GtR4Z+fdV8c9o7y2ZRU7DLR39VBZy7OmQ2ojXasieOV2g1Y5zQ IyUQ== 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=z0pcZSlzKw/cUO7uj/U8mdQ+2/FnmZU2cO/RKK1LnLk=; b=WF1CeWuuebJcc9+Sb62XYfyHTZDtBaw5iuHwf7HrC37Mqjor4OpjAsYCBFOnRImOtq PtD0PN5gW7cBcK5rryNS4pYtPUp01c1Nrd9CR0DwT7Iil4shePDEZJwOeiSaIp+PBqip CreT4JM+JQbWFb9D8wcF0fGZAAcg0h+vXu4q2KnsG8JCzDCvV/sattRwCTYDY+7n0u3u FcrbeCfLNkVd3ka6a/3KNTgl846Fm50UYyRcUFoS3ynMbq+UcVoqtYUriYC3iGxf9zgt HkBAUuQQGxlCfOt4BB8BXac1A2ScYjk89mHdLYBUdzjhcvgtYWxtBqytOtkr9JBObdif 5lqw== X-Gm-Message-State: AOAM531V/Bpfe/MgOK9JR27XMc3TiL9dA9RqFSp9f6q0+NefxDVA1B6S iSlNmzaddQtolyU++SiDS5/LqJRMxL47T9SyWMM= X-Google-Smtp-Source: ABdhPJylB0j0YULSHJ0xT8Rw1SdTaHICWcsmie+WZPZWD+Mgjld80UJFIyTMfRIVDepGcUTg1Uqq3g== X-Received: by 2002:ab0:60b1:0:b0:341:543e:c388 with SMTP id f17-20020ab060b1000000b00341543ec388mr6682142uam.80.1645997407725; Sun, 27 Feb 2022 13:30:07 -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 d13-20020a056102222d00b0031b437600fasm1084650vsb.14.2022.02.27.13.30.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:07 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 02/24] gnu: racket: Update to 8.4. Date: Sun, 27 Feb 2022 16:28:58 -0500 Message-Id: <20220227212920.2009000-3-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/ra [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.50 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.50 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/ra [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: liltechdude.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * gnu/packages/patches/racket-enable-scheme-backport.patch, gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: New patches. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/racket.scm (%racket-version): New variable. (%racket-commit): New variable. (%racket-origin): New variable. [patches]: Add "racket-enable-scheme-backport.patch". (racket-minimal): Update to 8.4. [version]: Use '%racket-version'. [source]: Use '%racket-origin'. [inputs]: Add 'ncurses'. Remove 'zlib:static' and 'lz4:static'. (racket-minimal-bc-3m)[inputs]: Adjust accordingly. (racket-bootstrap-chez-bootfiles)[version]: Use Chez Scheme's '(scheme-fork-version-number)'. (racket)[version]: Use '%racket-version'. [native-inputs]: Use '%racket-origin'. [source]: Update to 8.4. : Use "racket-gui-tethered-launcher-backport.patch". : Remove "srfi-doc-nonfree". --- gnu/local.mk | 4 +- .../racket-enable-scheme-backport.patch | 465 ++++++++++++++++++ ...acket-gui-tethered-launcher-backport.patch | 26 + gnu/packages/racket.scm | 99 ++-- 4 files changed, 557 insertions(+), 37 deletions(-) create mode 100644 gnu/packages/patches/racket-enable-scheme-backport.patch create mode 100644 gnu/packages/patches/racket-gui-tethered-launcher-backport.patch diff --git a/gnu/local.mk b/gnu/local.mk index 98f2d4ac30..cf34905431 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -41,7 +41,7 @@ # Copyright © 2020 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan -# Copyright © 2021 Philip McGrath +# Copyright © 2021, 2022 Philip McGrath # Copyright © 2021 Arun Isaac # Copyright © 2021 Sharlatan Hellseher # Copyright © 2021 Dmitry Polyakov @@ -1749,6 +1749,8 @@ dist_patch_DATA = \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ + %D%/packages/patches/racket-enable-scheme-backport.patch \ + %D%/packages/patches/racket-gui-tethered-launcher-backport.patch \ %D%/packages/patches/racket-minimal-sh-via-rktio.patch \ %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch \ diff --git a/gnu/packages/patches/racket-enable-scheme-backport.patch b/gnu/packages/patches/racket-enable-scheme-backport.patch new file mode 100644 index 0000000000..3a5a4a3d82 --- /dev/null +++ b/gnu/packages/patches/racket-enable-scheme-backport.patch @@ -0,0 +1,465 @@ +From 8d7687842f099e3e7e60d3a83fed58b2c6a92863 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 10:36:09 -0700 +Subject: [PATCH 1/2] Chez Scheme: adapt bootfile build for supplied `Scheme=` + +(cherry picked from commit fca1e02349664060e10278ca2ce6577a949bebf5) + +(Fixed conflicts by dropping pbchunks and pbarch changes.) +--- + racket/src/ChezScheme/configure | 15 ++++++++++++++- + racket/src/ChezScheme/s/Mf-base | 4 ++-- + racket/src/ChezScheme/s/Mf-cross | 4 +++- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/racket/src/ChezScheme/configure b/racket/src/ChezScheme/configure +index 4515ffc105..0098829091 100755 +--- a/racket/src/ChezScheme/configure ++++ b/racket/src/ChezScheme/configure +@@ -45,6 +45,7 @@ threads=yes + nothreads=no + temproot="" + help=no ++forceworkarea=no + gzipmanpages=yes + installowner="" + installgroup="" +@@ -205,6 +206,9 @@ while [ $# != 0 ] ; do + --pb) + pb=yes + ;; ++ --force) ++ forceworkarea=yes ++ ;; + --installprefix=*) + installprefix=`echo $1 | sed -e 's/^--installprefix=//'` + ;; +@@ -439,6 +443,7 @@ if [ "$help" = "yes" ]; then + echo " --toolprefix= prefix tool (compiler, linker, ...) names" + echo " --[no]gzip-man-pages compress manual pages ($gzipmanpages)" + echo " --workarea= build directory ($w)" ++ echo " --force configure even without boot files" + echo " CC= C compiler" + echo " CPPFLAGS= C preprocessor flags" + echo " CFLAGS= C compiler flags" +@@ -721,8 +726,16 @@ case "${flagsmuni}" in + ;; + esac + ++if [ "$w" = "$m" ] ; then ++ configuringin="" ++else ++ configuringin=" in $w" ++fi ++ + if [ -f boot/$m/scheme.boot -o -f "$srcdir"/boot/$m/scheme.boot ] ; then +- echo "Configuring for $m" ++ echo "Configuring for $m$configuringin" ++elif [ "$forceworkarea" = yes ] ; then ++ echo "Configuring for $m$configuringin despite missing boot files" + else + if [ "$m" = "" ] ; then + maybem="" +diff --git a/racket/src/ChezScheme/s/Mf-base b/racket/src/ChezScheme/s/Mf-base +index cc6178c973..1f4a967998 100644 +--- a/racket/src/ChezScheme/s/Mf-base ++++ b/racket/src/ChezScheme/s/Mf-base +@@ -94,7 +94,7 @@ endif + # that Scheme and SCHEMEHEAPDIRS are set by Mf-cross to point to the host Scheme + # implementation + Scheme = ../bin/$m/scheme${ExeSuffix} +-export SCHEMEHEAPDIRS=../boot/%m ++export SCHEMEHEAPDIRS=../boot/$m + export CHEZSCHEMELIBDIRS=. + + # Define the libdirs separator character +@@ -691,4 +691,4 @@ reset-one: + + .PHONY: run + run: +- env SCHEMEHEAPDIRS=../boot/$m/ ../bin/$m/scheme $(ARGS) ++ env SCHEMEHEAPDIRS=${SCHEMEHEAPDIRS} ${Scheme} $(ARGS) +diff --git a/racket/src/ChezScheme/s/Mf-cross b/racket/src/ChezScheme/s/Mf-cross +index d796cbb459..397af59a28 100644 +--- a/racket/src/ChezScheme/s/Mf-cross ++++ b/racket/src/ChezScheme/s/Mf-cross +@@ -43,5 +43,7 @@ x$(xm).$(m): + $(MAKE) -f Mf-cross m=$(m) xm=$(xm) i=f o=3 d=0 xpatch + mv xpatch x$(xm).$(m) + ++ifneq ($(SCHEMEHEAPDIRS),:) + # Ensure that cross-compiling "nanopass.so" is rebuilt if the host compiler changed +-nanopass.so: ${SCHEME} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++nanopass.so: ${Scheme} ${SCHEMEHEAPDIRS}/petite.boot ${SCHEMEHEAPDIRS}/scheme.boot ++endif +-- +2.32.0 + + +From 26c8e2c1d9b02ad85acef8bda40d92154cf0b699 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sun, 6 Feb 2022 11:03:30 -0700 +Subject: [PATCH 2/2] configure: make `--enable-scheme` work with an executable + +When the same Chez Scheme version as used by Racket is already +available, then `--enable-scheme=...` can supply an executable. For +cross builds, `--enable-scheme=...` can still supply a build +directory, instead, as before. + +(cherry picked from commit 4f0e76855ce7e86107de495292a553469daf0b3f) +--- + racket/src/ChezScheme/makefiles/Makefile.in | 3 ++ + racket/src/README.txt | 30 +++++++++++--- + racket/src/configure | 8 +++- + racket/src/cs/README.txt | 6 ++- + racket/src/cs/c/Makefile.in | 44 ++++++++++++++++----- + racket/src/cs/c/configure | 24 +++++++++-- + racket/src/cs/c/configure.ac | 21 ++++++++-- + 7 files changed, 112 insertions(+), 24 deletions(-) + +diff --git a/racket/src/ChezScheme/makefiles/Makefile.in b/racket/src/ChezScheme/makefiles/Makefile.in +index c396efc851..3998ef9ccd 100644 +--- a/racket/src/ChezScheme/makefiles/Makefile.in ++++ b/racket/src/ChezScheme/makefiles/Makefile.in +@@ -59,6 +59,9 @@ reset: + %.boot: + (cd $(workarea) && $(MAKE) $*.boot) + ++auto.boot: ++ (cd $(workarea) && $(MAKE) $(defaultm).boot) ++ + # .bootquick to build boot files for + # with o=3 d=0 for the cross compiler, and only after + # building the kernel for the configured machine +diff --git a/racket/src/README.txt b/racket/src/README.txt +index 98647aebce..d77310b4a4 100644 +--- a/racket/src/README.txt ++++ b/racket/src/README.txt +@@ -354,6 +354,10 @@ variant of MinGW without "libdelayimp.a", get the implementation of + ======================================================================== + + Cross-compilation requires at least two flags to `configure`: ++`--host=OS` and either `--enable-racket=RACKET` or (for Racket CS) ++`--enable-scheme-SCHEME`. ++ ++More information: + + * `--host=OS`, where OS is something like `i386-gnu-linux` to + indicate the target platform. +@@ -374,11 +378,27 @@ Cross-compilation requires at least two flags to `configure`: + run `configure` again (with no arguments) in a "local" subdirectory + to create a build for the current platform. + +-An additional flag is needed for building Racket CS, unless the flag +-`--enable-racket=auto` is used: +- +- * `--enable-scheme=DIR`, where DIR is a path that has a "ChezScheme" +- directory where Chez Scheme is built for the host system. ++ * `--enable-scheme=SCHEME`, where SCHEME is a Chez Scheme executable ++ executable that runs on the build platform; the executable must be ++ the same version as used in Racket built for the target platform. ++ ++ Supplying `--enable-scheme=DIR` is also supported in cross-build ++ mode, where DIR is a path that has a "ChezScheme" directory where ++ Chez Scheme is built for the host system. ++ ++The `--enable-racket=RACKET` and `--enable-scheme=SCHEME` flags are ++allowed for non-cross builds, too: ++ ++ * For Racket CS, supplying either selects a Racket or Chez Scheme ++ implementation used to create boot files to the build platform. ++ Suppling Chez Scheme is a much more direct path, but when Racket is ++ supplied, its version does not have to match the version being ++ built. ++ ++ * For Racket BC, `--enable-racket=RACKET` selects a Racket for ++ prepare C sources to cooperate with garbage collection. Its version ++ needs to be close to the one being built, and potentially exactly ++ the same version. + + Some less commonly needed `configure` flags are for Racket BC: + +diff --git a/racket/src/configure b/racket/src/configure +index c9f3ba4419..1b53ec7ce2 100755 +--- a/racket/src/configure ++++ b/racket/src/configure +@@ -9,6 +9,7 @@ pb_dir="$dir/ChezScheme/boot/pb" + use_cs=maybe + use_bc=maybe + supplied_racket=no ++supplied_scheme=no + enable_boothelp= + + # We don't have to detect conflicts like `--enable-csdefault --enable-bcdefault`, +@@ -34,6 +35,9 @@ for arg in $*; do + --enable-racket=*) + supplied_racket=yes + ;; ++ --enable-scheme=*) ++ supplied_scheme=yes ++ ;; + --help | -h) + echo $0: + echo see --help-bc or --help-cs, since the Racket CS build and the +@@ -70,8 +74,8 @@ elif test "$use_cs" = "maybe" ; then + fi + + if test "$use_cs" = "yes" ; then +- if test $use_bc = no -a $supplied_racket = no -a ! -d "$pb_dir" ; then +- echo $0: must have $pb_dir or --enable-racket=... for --enable-csonly ++ if test $use_bc = no -a $supplied_racket = no -a $supplied_scheme = no -a ! -d "$pb_dir" ; then ++ echo $0: must have $pb_dir, --enable-racket=... or --enable-scheme=... for --enable-csonly + exit 1 + fi + +diff --git a/racket/src/cs/README.txt b/racket/src/cs/README.txt +index 2ece417b78..8e6fc57b74 100644 +--- a/racket/src/cs/README.txt ++++ b/racket/src/cs/README.txt +@@ -39,6 +39,11 @@ build: + installed in the "../ChezScheme/boot/pb" directory as described by + "../ChezScheme/BUILDING". + ++ Supplying `--enable-scheme=...` is also an option if you alerady ++ have the same version of Chez Scheme built on the current platform. ++ Another build will be created, anyway, but more quickly than ++ without Chez Scheme. ++ + * Racket is needed to generate the files in the "schemified" + directory from the sources in sibling directories like "../io". The + Racket version must be practically the same as the current Racket +@@ -48,7 +53,6 @@ build: + Unlike Chez Scheme boot files, the files generated in "schemified" + are human-readable and -editable Scheme code. That provides a way + out of bootstrapping black holes, even without BC. +- + + + ======================================================================== +diff --git a/racket/src/cs/c/Makefile.in b/racket/src/cs/c/Makefile.in +index 54a644a1d9..d73993f0fc 100644 +--- a/racket/src/cs/c/Makefile.in ++++ b/racket/src/cs/c/Makefile.in +@@ -12,7 +12,9 @@ CS_HOST_WORKAREA_PREFIX = @CS_HOST_WORKAREA_PREFIX@ + SCHEME_HOST_WORKAREA = $(CS_HOST_WORKAREA_PREFIX)$(SCHEME_WORKAREA) + SCHEME_BIN = $(SCHEME_HOST_WORKAREA)/$(MACH)/bin/$(MACH)/scheme + SCHEME_INC = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH) +-SCHEME = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_built = $(SCHEME_BIN) -B $(SCHEME_INC)/petite.boot -B $(SCHEME_INC)/scheme.boot ++SCHEME_existing = @MAKE_SCHEME_SCHEME@ ++SCHEME = $(SCHEME@USE_SCHEME_MODE@) + + TARGET_MACH = @TARGET_MACH@ + SCHEME_TARGET_INC = $(SCHEME_WORKAREA)/$(TARGET_MACH)/boot/$(TARGET_MACH) +@@ -88,7 +90,7 @@ mainsrcdir = @srcdir@/../.. + @INCLUDEDEP@ @srcdir@/../../version/version.mak + + cs: +- $(MAKE) scheme@T_CROSS_MODE@ ++ $(MAKE) scheme@MAKE_SCHEME_MODE@ + $(MAKE) racket-so + cd rktio; $(MAKE) + $(MAKE) racketcs +@@ -121,9 +123,13 @@ racket-so: + + RACKET_SO_ENV = @CONFIGURE_RACKET_SO_COMPILE@ + ++TARGET_MACH_built = $(TARGET_MACH) ++TARGET_MACH_existing = xc-$(TARGET_MACH) ++XPATCH_FILE = $(SCHEME_WORKAREA)/$(TARGET_MACH@USE_SCHEME_MODE@)/s/xpatch ++ + CS_PROGS = SCHEME="$(SCHEME)" + CS_OPTS = COMPRESS_COMP=@COMPRESS_COMP@ @ENABLE_OR_DISABLE_WPO@ +-CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch" ++CS_OPTScross = $(CS_OPTS) CSO=$(MACH) CROSS_COMP="--xpatch $(XPATCH_FILE)" + PASS_COMPILE_DEPS = EXTRA_COMPILE_DEPS="$(SCHEME_INC)/petite.boot $(SCHEME_INC)/scheme.boot" + + build-racket-so: +@@ -163,6 +169,15 @@ pb-bootquick: + cd $(SCHEME_WORKAREA) && $(MAKE) reset + $(SHELL) $(srcdir)/ready_boot.sh $(MACH) $(SCHEME_WORKAREA) + ++scheme-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot ++ $(MAKE) mach-make ++ ++$(SCHEME_WORKAREA)/boot/$(MACH)/scheme.boot: ++ mkdir -p $(SCHEME_WORKAREA) ++ $(MAKE) config-scheme CONFIG_SCHEME_MODE="$(CONFIG_SCHEME_MODE) --force" ++ cd $(SCHEME_WORKAREA) && $(MAKE) $(MACH).boot Scheme="$(SCHEME)" SCHEMEHEAPDIRS=: o=3 d=0 what=all ++ + mach-make: + $(MAKE) config-scheme + cd $(SCHEME_WORKAREA) && $(MAKE) +@@ -182,24 +197,33 @@ config-scheme: + + scheme-cross: + env MAKE_BOOT_FOR_CROSS=yes SCHEME_SRC="$(SCHEME_DIR)" SCHEME_WORKAREA=$(SCHEME_WORKAREA) MACH="$(TARGET_MACH)" $(BOOTSTRAP_RACKET) "$(SCHEME_DIR)"/rktboot/make-boot.rkt ++ $(MAKE) finish-scheme-cross ++ ++finish-scheme-cross: + $(SHELL) $(srcdir)/reset_boot.sh $(TARGET_MACH) $(SCHEME_WORKAREA) + cd $(SCHEME_WORKAREA) && "$(UP_SCHEME_DIR)"/configure @SCHEME_CROSS_CONFIG_ARGS@ $(SCHEME_CONFIG_VARS) + cd $(SCHEME_WORKAREA)/$(TARGET_MACH)/c && $(CHOST_HACK@T_CROSS_MODE@) $(MAKE) o=o cross=t +- $(MAKE) $(SCHEME_WORKAREA)/$(TARGET_MACH)/s/xpatch ++ $(MAKE) $(XPATCH_FILE) ++ ++scheme-cross-via-scheme: ++ $(MAKE) $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot MACH=$(TARGET_MACH) ++ $(MAKE) finish-scheme-cross + + # Rebuild patch file and cross "petite.boot" and "scheme.boot" when older +-# than the build-host "scheme.boot" or when "make-boot.rkt" touchs dummy boot files +-XPATCH_DEPS = $(SCHEME_HOST_WORKAREA)/$(MACH)/boot/$(MACH)/scheme.boot \ +- $(SCHEME_WORKAREA)/boot/$(TARGET_MACH)/scheme.boot ++# than the build- use as Racket for build; or "auto" to create +- --enable-scheme= use as host's build directory for cross ++ --enable-scheme= use as host build for cross + --enable-mach= use Chez Scheme machine type + --enable-target= cross-build for Chez Scheme machine type + --enable-portable prefer portable to host-specific +@@ -2867,7 +2870,7 @@ show_explicitly_enabled "${enable_xonx}" "Unix style" + show_explicitly_enabled "${enable_libzo}" 'Compiled ".zo" files moved to lib' + + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + show_explicitly_enabled "${enable_portable}" "portable" +@@ -4745,9 +4748,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -6012,6 +6027,9 @@ SCHEME_CROSS_CONFIG_ARGS="--machine=${TARGET_MACH} --disable-x11 ${cs_auto_flags + + + ++ ++ ++ + + + +diff --git a/racket/src/cs/c/configure.ac b/racket/src/cs/c/configure.ac +index 464ebe1760..aaee88156d 100644 +--- a/racket/src/cs/c/configure.ac ++++ b/racket/src/cs/c/configure.ac +@@ -23,7 +23,7 @@ AC_ARG_ENABLE(compressmore, [ --enable-compressmore compress compiled code ev + AC_ARG_ENABLE(compressboot, [ --enable-compressboot compress boot files]) + m4_include(../ac/path_arg.m4) + AC_ARG_ENABLE(racket, [ --enable-racket= use as Racket for build; or "auto" to create]) +-AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host's build directory for cross]) ++AC_ARG_ENABLE(scheme, [ --enable-scheme= use as host build for cross]) + AC_ARG_ENABLE(mach, [ --enable-mach= use Chez Scheme machine type ]) + AC_ARG_ENABLE(target, [ --enable-target= cross-build for Chez Scheme machine type ]) + m4_include(../ac/portable_arg.m4) +@@ -81,7 +81,7 @@ show_explicitly_disabled "${enable_compressboot}" "Compressed boot files" + show_explicitly_enabled "${enable_xonx}" "Unix style" + m4_include(../ac/path_show.m4) + show_explicitly_set "${enable_racket}" "Racket" +-show_explicitly_set "${enable_scheme}" "Chez Scheme build directory" ++show_explicitly_set "${enable_scheme}" "Chez Scheme for build" + show_explicitly_set "${enable_mach}" "machine type" + show_explicitly_set "${enable_target}" "cross-build machine type" + m4_include(../ac/portable_show.m4) +@@ -504,9 +504,21 @@ esac + + SCHEME_DIR=${srcdir}/../../ChezScheme + MAKE_BUILD_SCHEME=checkout ++USE_SCHEME_MODE="_built" ++MAKE_SCHEME_MODE="${T_CROSS_MODE}" + + if test "${enable_scheme}" != "" ; then +- CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ if test -d "${enable_scheme}" ; then ++ # Directory exists, so use it as a build directory ++ echo "Using supplied Scheme path as a build directory" ++ CS_HOST_WORKAREA_PREFIX="${enable_scheme}/" ++ else ++ # Directory does not exist, so assume it's an executable ++ echo "Using supplied Scheme path as an executable" ++ MAKE_SCHEME_MODE="${T_CROSS_MODE}-via-scheme" ++ MAKE_SCHEME_SCHEME="${enable_scheme}" ++ USE_SCHEME_MODE="_existing" ++ fi + fi + + if test "${enable_racket}" != "" ; then +@@ -821,6 +833,9 @@ AC_SUBST(DIFF_MACH) + AC_SUBST(CROSS_MODE) + AC_SUBST(T_CROSS_MODE) + AC_SUBST(TT_CROSS_MODE) ++AC_SUBST(MAKE_SCHEME_MODE) ++AC_SUBST(MAKE_SCHEME_SCHEME) ++AC_SUBST(USE_SCHEME_MODE) + AC_SUBST(SETUP_BOOT_MODE) + AC_SUBST(OSX) + AC_SUBST(NOT_OSX) +-- +2.32.0 + diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch new file mode 100644 index 0000000000..abf253486f --- /dev/null +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -0,0 +1,26 @@ +From aa792e707b1fbc5cc33691bfaee5828dc3fbebaa Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Mon, 31 Jan 2022 15:31:22 -0700 +Subject: [PATCH] fix creation of tethered launchers + +Related to racket/racket#4133 + +(cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) +--- + share/pkgs/gui-lib/mred/installer.rkt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt +index b1691472..9ef06c53 100644 +--- a/share/pkgs/gui-lib/mred/installer.rkt ++++ b/share/pkgs/gui-lib/mred/installer.rkt +@@ -72,4 +72,5 @@ + (list "-A" (path->string (find-system-path 'addon-dir))))) + + (define (config-flags) +- (list "-G" (path->string (find-config-dir)))) ++ (list "-X" (path->string (find-collects-dir)) ++ "-G" (path->string (find-config-dir)))) +-- +2.32.0 + diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index ec9e836a4c..00ec587eeb 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -43,6 +43,7 @@ (define-module (gnu packages racket) #:use-module (gnu packages libedit) #:use-module (gnu packages libffi) #:use-module (gnu packages multiprecision) + #:use-module (gnu packages ncurses) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) #:use-module (gnu packages xorg) @@ -95,6 +96,41 @@ (define-module (gnu packages racket) ;; ;; Code: +(define %racket-version "8.4") +;; ^ Remember to update racket-bootstrap-chez-bootfiles! +(define %racket-commit + (string-append "v" %racket-version)) +(define %racket-origin + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/racket") + (commit %racket-commit))) + (sha256 + (base32 "1vpl66gdgc8rnldmn8rmb7ar9l057jqjvgpfn29k57i3c5skr8s6")) + (file-name (git-file-name "racket" %racket-version)) + (patches (search-patches "racket-minimal-sh-via-rktio.patch" + ;; Remove by Racket 8.5: + "racket-enable-scheme-backport.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + (use-modules (guix build utils)) + ;; Unbundle Chez submodules. + (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 + ;; without cyclic issues. + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib"))) + ;; Unbundle libffi. + (delete-file-recursively "racket/src/bc/foreign/libffi"))))) + (define cfg-flag:sh-for-rktio `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" (assoc-ref %build-inputs "sh") @@ -128,41 +164,17 @@ (define src (define-public racket-minimal (package (name "racket-minimal") - (version "8.3") ; note: remember to also update racket! - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/racket/racket") - (commit (string-append "v" version)))) - (sha256 - "1i1jnv1wb0kanfg47hniafx2vhwjc33qqx66lq7wkf5hbmgsyws3") - (file-name (git-file-name name version)) - (patches (search-patches "racket-minimal-sh-via-rktio.patch")) - (modules '((guix build utils))) - (snippet - (with-imported-modules '((guix build utils)) - #~(begin - ;; Unbundle Chez submodules. - (with-directory-excursion "racket/src/ChezScheme" - ;; Remove bundled libraries (copied from 'chez-scheme'). - (for-each delete-file-recursively - '("stex" - "nanopass" - "lz4" - "zlib"))) - ;; Unbundle libffi. - (delete-file-recursively "racket/src/bc/foreign/libffi")))))) + (version %racket-version) + (source %racket-origin) (inputs `(;; common to all racket-minimal variants: ("openssl" ,openssl) ("sqlite" ,sqlite) - ("sh" ,bash-minimal) + ("sh" ,bash-minimal) ;; <- for `system` + ("ncurses" ,ncurses) ;; <- for #%terminal ;; only for CS ("zlib" ,zlib) - ("zlib:static" ,zlib "static") - ("lz4" ,lz4) - ("lz4:static" ,lz4 "static"))) + ("lz4" ,lz4))) (native-inputs `(("bootfiles" ,racket-bootstrap-chez-bootfiles) ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) @@ -263,9 +275,8 @@ (define-public racket-minimal-bc-3m (name "racket-minimal-bc-3m") (inputs (modify-inputs (package-inputs racket-minimal) - (delete "zlib" "zlib:static" "lz4" "lz4:static") - (prepend libffi ;; <- only for BC variants - ))) + (prepend libffi) ;; <- only for BC variants + (delete "zlib" "lz4"))) (native-inputs `(("libtool" ,libtool) ("racket" ,(if (%current-target-system) @@ -327,6 +338,11 @@ (define-public racket-bootstrap-chez-bootfiles (package (inherit racket-minimal) (name "racket-bootstrap-chez-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. (inputs `()) (native-inputs `(("racket" ,(if (%current-target-system) @@ -416,7 +432,7 @@ (define-public racket (package (inherit racket-minimal) (name "racket") - (version (package-version racket-minimal)) ; needed for origin uri to work + (version %racket-version) (source (origin (method url-fetch) @@ -425,7 +441,11 @@ (define-public racket %installer-mirrors)) (sha256 (base32 - "0jdr0y7scvv2a3sq456ifrgq0yfsbiwavdf2m86zmrapp481mby4")) + "0dsv7br85nvh5gjfihznq9jb1dzas0f6gnv5qwc9zmb7yn75nrp5")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) (snippet #~(begin (use-modules (guix build utils) @@ -442,7 +462,14 @@ (define-public racket (with-directory-excursion "share/pkgs" (for-each delete-file-recursively '#+%main-repo-main-distribution-pkgs)) - #t)))) + ;; Minimal workaround for FSDG issue: + ;; see . + ;; We will backport a better fix once we use Git + ;; origins for Racket packages. + (delete-file-recursively "share/pkgs/srfi-doc-nonfree") + (substitute* "share/pkgs/srfi/info.rkt" + (("\"srfi-doc-nonfree\"") + "")))))) (inputs `(("cairo" ,cairo) ("fontconfig" ,fontconfig) @@ -461,7 +488,7 @@ (define-public racket (native-inputs `(("racket" ,racket-minimal) ("extend-layer" ,extend-layer) - ("main-repo" ,(package-source racket-minimal)))) + ("main-repo" ,%racket-origin))) (arguments `(#:phases (modify-phases %standard-phases -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:30:33 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:30:33 +0000 Received: from localhost ([127.0.0.1]:59327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7f-0008Bt-5O for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:33 -0500 Received: from mail-vk1-f176.google.com ([209.85.221.176]:36409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7T-0008B3-Ma for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:21 -0500 Received: by mail-vk1-f176.google.com with SMTP id w128so4243558vkd.3 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:19 -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=ULmt+DzNuFEXzkr1s7B+yAFbUDhx9z7yn8VsJwwxOt0=; b=Wp4d6ZbwBu0eXKZVujzMjb5pWGd9+2uIj8//v5jmR5qVY00zVDEZK5gRLyZP+6qhGY WTl5/48QVce9r9YcjTQlukuQDJhxpezqQKdNFLheKVXLYrJdYP6sglHpzgGVtvzX7Q1O 7A+fxuQchiGwTKlruhTtfc1BmB1/wBJOOZGBgQ2Ghf8/mimr33OEd6t1kTEMRksZHT2V 6fsEzw7ltA726YJel5rVYlEUqw2PkIuY3DW16JYQ+zmBzHB3O8oWxlSH909cL4JSJdv3 CjLZxuHWf9wNLpCbhp837WvfBRcBEC9IozD19vKW8nc0KhH+XTu9P1NsFBBzj8G3PTfG 4KZw== 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=ULmt+DzNuFEXzkr1s7B+yAFbUDhx9z7yn8VsJwwxOt0=; b=Z2zSA3GHI+/xM4GQj431qdZEfQmHOF0CjkN9Y1Pg6PLQIWliY547e0NlKzZ9tgQlDW 0WHPcX5AX0W1QooqCAiX80TQhpogX6VEMa7JEdPvygcSszL7ypK0EhcgQ2LFkepWjXQO 8QUGvO0P2BAydU/jr0UmyT9vVVvAiXCQfNTDFYQ6MUeYNt0CONjAOAfaHPaVtEbpmOos mqlgLtYn4XSSSVv7FJrMscqTbt53b8onteVPmOmxFeoQWY5B8ESyxpPoOUmDFV0rhT95 xjasIAN8yJ2rIXepc/j5IPuSdboDTyQiT9fp/gGRSQjy/Z1F99dnLBzkH1gXr/zdAkrF Pgzw== X-Gm-Message-State: AOAM531Y90avUPjcdvoSiNYrsT2JxFDhIQxU14qK4xxwZ8g13OJN+CV6 +CQcZEeIpOXTqdcLuPiT/HNHaJcOPvGiGLpf1Pg= X-Google-Smtp-Source: ABdhPJwLGyhy3tvgDicYU0V6X7DNO/FenU4UiRF2svROmNiKgmTtRRMEDqy2B8Wjf5j2ZxElCtZDfA== X-Received: by 2002:a1f:9493:0:b0:332:59d4:cd69 with SMTP id w141-20020a1f9493000000b0033259d4cd69mr6803425vkd.9.1645997413515; Sun, 27 Feb 2022 13:30:13 -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 p14-20020a67f34e000000b0031c28ace25asm1082287vsm.9.2022.02.27.13.30.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:13 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 03/24] gnu: racket: Use Git origins for Racket packages. Date: Sun, 27 Feb 2022 16:28:59 -0500 Message-Id: <20220227212920.2009000-4-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/patches/racket-gui-tethered-launcher-backport.patch: Adjust path. * gnu/packages/racket.scm (racket-packages-origin, simple-racket-origin): New procedures. (extend-layer): Rename to ... (configure-layer.rkt): ... this variable. Tweak command-line arguments. Adapt to 'config-tethered-apps-dir'. (racket): Stop inheriting from 'racket-minimal'. [version]: Use '%racket-version'. [source]: Stop using bundled tarball. [inputs]: Remove labels. Add 'racket-minimal' and package sources. [native-inputs]: Remove, since cross-compilation doesn't work yet. [arguments]: Rewrite to use G-expressions, package sources from 'inputs', an explicit 'install' phase, and the revised 'configure-layer.rkt'. --- ...acket-gui-tethered-launcher-backport.patch | 6 +- gnu/packages/racket.scm | 714 +++++++++++++----- 2 files changed, 539 insertions(+), 181 deletions(-) diff --git a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch index abf253486f..1e018eaa79 100644 --- a/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch +++ b/gnu/packages/patches/racket-gui-tethered-launcher-backport.patch @@ -7,13 +7,13 @@ Related to racket/racket#4133 (cherry picked from commit 563c68432f127729592f234ef30c31e92618b517) --- - share/pkgs/gui-lib/mred/installer.rkt | 3 ++- + gui-lib/mred/installer.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui-lib/mred/installer.rkt b/gui-lib/mred/installer.rkt index b1691472..9ef06c53 100644 ---- a/share/pkgs/gui-lib/mred/installer.rkt -+++ b/share/pkgs/gui-lib/mred/installer.rkt +--- a/gui-lib/mred/installer.rkt ++++ b/gui-lib/mred/installer.rkt @@ -72,4 +72,5 @@ (list "-A" (path->string (find-system-path 'addon-dir))))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 00ec587eeb..a37442edc2 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -28,7 +28,9 @@ (define-module (gnu packages racket) #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) + #:use-module (ice-9 exceptions) #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages bash) @@ -389,172 +391,504 @@ (define-public racket-bootstrap-chez-bootfiles Chez Scheme.") (license (list license:asl2.0))))) +(define (racket-packages-origin name origin specs) + "Extract from ORIGIN the sources for the Racket packages specified by SPECS, +a non-empty list of package specifications. In the resulting file-like +object, each package's source will be in the directory +\"/share/racket/pkgs/PKG/\", where PKG is the Racket name for the package. +The NAME will be used in the store file name for the resulting file-like +object. -(define %installer-mirrors - ;; Source: - ;; https://github.com/racket/racket-lang-org/blob/master/download/data.rkt#L58 - ;; Matthew Flatt says: "note that many are commented out" - ;; INVARIANT: End with a trailing "/"! - '("https://mirror.racket-lang.org/installers/" - "https://www.cs.utah.edu/plt/installers/" - "https://plt.cs.northwestern.edu/racket-mirror/" - "https://mirror.csclub.uwaterloo.ca/racket/racket-installers/" - ;; Universität Tübingen is using a self-signed HTTPS certificate: - "http://mirror.informatik.uni-tuebingen.de/mirror/racket/" - "https://racket.infogroep.be/" - )) +A package specification is a list of the form: -(define %main-repo-main-distribution-pkgs - ;; These are the packages developed in the main Racket Git repository - ;; that are part of the main distribution. - '("at-exp-lib" - "base" - "compiler-lib" - ;; NOT "compiler-test" - "compiler" - "net-doc" - "net-lib" - ;; NOT "net-test" - "net" - ;; NOT "plt-services" - ;; NOT "racket-benchmarks" - ;; NOT "racket-build-guide" - "racket-doc" - "racket-index" - "racket-lib" - ;; NOT "racket-test-core" - ;; NOT "racket-test-extra" - ;; NOT "racket-test" - "zo-lib")) + (PKG PATH) +where PATH is the path to the package source relative to ORIGIN---possibly +\".\". As a special case, a package specification may also be a string, which +is equivalent to: + + (PKG PKG) + +Examples: + +- \"expeditor\" +- (\"main-distribution\" \".\") +- (\"racket-lib\" \"pkgs/racket-lib\")" + (computed-file + (string-append "racket-pkg-" name "-sources") + (with-imported-modules `((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p (string-append #$output "/share/racket/pkgs")) + (chdir (string-append #$output "/share/racket/pkgs")) + #$@(map (match-lambda + ((? string? name) + #~(copy-recursively #$(file-append origin (string-append "/" name)) + #$name)) + ((name ".") + #~(copy-recursively #$origin #$name)) + ((name path) + #~(copy-recursively #$(file-append origin (string-append "/" path)) + #$name))) + specs))))) + +(define (simple-racket-origin repo hash specs) + "Like 'racket-packages-origin', but specialized for packages hosted at +\"https://github.com/racket/REPO\" with sha256 checksum HASH. REPO is also +used to build the name of the resulting store item." + (racket-packages-origin + repo + (origin + (method git-fetch) + (uri (git-reference + (url (format #f "https://github.com/racket/~a" repo)) + (commit %racket-commit))) + (sha256 hash) + (file-name (git-file-name (string-append "racket-" repo) + %racket-version))) + specs)) (define-public racket (package - (inherit racket-minimal) (name "racket") (version %racket-version) - (source - (origin - (method url-fetch) - (uri (map (lambda (base) - (string-append base version "/racket-src.tgz")) - %installer-mirrors)) - (sha256 - (base32 - "0dsv7br85nvh5gjfihznq9jb1dzas0f6gnv5qwc9zmb7yn75nrp5")) - (patches - ;; remove in Racket 8.5 - ;; see https://github.com/racket/racket/issues/4133 - (search-patches "racket-gui-tethered-launcher-backport.patch")) - (snippet - #~(begin - (use-modules (guix build utils) - (ice-9 match) - (ice-9 regex)) - ;; unbundle minimal Racket - (for-each delete-file-recursively - '("collects" - "doc" - "etc" - "README" - "src")) - ;; unbundle package sources included elsewhere - (with-directory-excursion "share/pkgs" - (for-each delete-file-recursively - '#+%main-repo-main-distribution-pkgs)) - ;; Minimal workaround for FSDG issue: - ;; see . - ;; We will backport a better fix once we use Git - ;; origins for Racket packages. - (delete-file-recursively "share/pkgs/srfi-doc-nonfree") - (substitute* "share/pkgs/srfi/info.rkt" - (("\"srfi-doc-nonfree\"") - "")))))) + (source #f) (inputs - `(("cairo" ,cairo) - ("fontconfig" ,fontconfig) - ("glib" ,glib) - ("glu" ,glu) - ("gmp" ,gmp) - ("gtk+" ,gtk+) ; propagates gdk-pixbuf+svg - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("mpfr" ,mpfr) - ("pango" ,pango) - ("unixodbc" ,unixodbc) - ("libedit" ,libedit))) - (native-inputs - `(("racket" ,racket-minimal) - ("extend-layer" ,extend-layer) - ("main-repo" ,%racket-origin))) + (list + cairo + fontconfig + glib + glu + gmp + gtk+ ;; propagates gdk-pixbuf+svg + libjpeg-turbo + libpng + libx11 ;; ?? wayland ?? + mesa + mpfr + pango + unixodbc + libedit ;; TODO reconsider in light of expeditor and readline-gpl + racket-minimal ;; <-- TODO non-tethered layer + (simple-racket-origin + "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") + '("2d" "2d-doc" "2d-lib")) + (simple-racket-origin + "algol60" (base32 "09kj6asypmc24n29w0izc9p0q8hpga2hpkchsypfwn5c8zpvihlx") + '(("algol60" "."))) + (racket-packages-origin + "racket" %racket-origin + '(("base" "pkgs/base") ;; FIXME belongs in racket-minimal + ("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in racket-minimal + ("at-exp-lib" "pkgs/at-exp-lib") + ("compiler" "pkgs/compiler") + ("compiler-lib" "pkgs/compiler-lib") + ("net" "pkgs/net") + ("net-doc" "pkgs/net-doc") + ("net-lib" "pkgs/net-lib") + ("racket-doc" "pkgs/racket-doc") + ("racket-index" "pkgs/racket-index") + ("sandbox-lib" "pkgs/sandbox-lib") + ("zo-lib" "pkgs/zo-lib"))) + (simple-racket-origin + "cext-lib" (base32 "00w38jpv88fpl4pgj6ndnysvn0s21rjvj0xhznay80msan0vc341") + '("cext-lib" "dynext-lib")) + (simple-racket-origin + "class-iop" (base32 "08z57q83cr7wnh6g8ah3hdhmsmf9zp1jfs7yvxv188l3hzvygy5l") + '("class-iop-lib")) + (simple-racket-origin + "compatibility" (base32 "0bfqwscjpyi325br5pa6g62g9c8lq18a80zp5g3d2qzn3n3mi6x0") + '("compatibility" "compatibility-doc" "compatibility-lib")) + (simple-racket-origin + "contract-profile" (base32 "1xm2z8g0dpv5d9h2sg680vx1a8ix9gbsdpxxb8qv1w7akp73paj3") + '(("contract-profile" "."))) + (simple-racket-origin + "data" (base32 "10iabgrk9alaggvksnyb0hdq7f1p30pq6pq2bcakvhzpxwiv1f55") + '("data" "data-doc" "data-enumerate-lib" "data-lib")) + (simple-racket-origin + "datalog" (base32 "0n5j5gnqh7g31mvgx19ggl18hirzbvq2r189lbngmnrmbc7b73fp") + '(("datalog" "."))) + (simple-racket-origin + "db" (base32 "1n02ja0yj3mjjhmz0yv04yfhyvrsznbljn8bjviyfxnm4xf9rcc5") + '("db" "db-doc" "db-lib")) + (simple-racket-origin + "deinprogramm" (base32 "1is6fapgv6rxfjz47nh6qf3kh7y7sjdinakaxqffi46gf1al8prd") + '("deinprogramm" "deinprogramm-signature")) + (simple-racket-origin + "distributed-places" (base32 "1dajpkj9balqcpv6cdk9hwjz592h1vq8rrx5vncariiac4vbdpa0") + '("distributed-places" "distributed-places-doc" "distributed-places-lib")) + (simple-racket-origin + "draw" (base32 "1xgjfbh70hqw67z88iqqajg98d04qwbzn6im2wj47rs28jxlm9ly") + '("draw" "draw-doc" "draw-lib")) + (simple-racket-origin + "drracket" (base32 "0m3l4an3nq2ycd1h287s1az2v2zprjbzd8if2x7d5r71vaj4i00c") + '("drracket" + "drracket-plugin-lib" + "drracket-tool" + "drracket-tool-doc" + "drracket-tool-lib" + "drracket-tool-text-lib")) + (simple-racket-origin + "ds-store" (base32 "0ajr27kipp4dr1qlisaghsb3h7lhhjwrfw2r79b5myczsa1mp661") + '("ds-store" "ds-store-doc" "ds-store-lib")) + (simple-racket-origin + "eli-tester" (base32 "0icx6wn14gjm8kdmq1jppqgq87sxkras4qb5xmdr6wigxafhjqyk") + '(("eli-tester" "."))) + (simple-racket-origin + "eopl" (base32 "1fmiixj6rxsgzwvgva8lvrvv0gl49v2405mp3s0i7ipis5c4n27s") + '(("eopl" "."))) + (simple-racket-origin + "errortrace" (base32 "14m7rhaxngj36070iw15am434hm438pfgmwjfsiqhsglz4pcxhip") + '("errortrace" "errortrace-doc" "errortrace-lib")) + (simple-racket-origin + "expeditor" (base32 "07djzxs6307l51mcsk3yr2g4g47ayxa3878g7sf5xhqdr4hd9vxf") + '("expeditor" "expeditor-doc" "expeditor-lib")) + (simple-racket-origin + "frtime" (base32 "0ydz2yn8vvv6z7brwlswcyx0f31a6y6d443i89rysfvd2xkhpfd5") + '(("frtime" "."))) + (simple-racket-origin + "future-visualizer" (base32 "1758qq769m0r14xf64sl2ix2l9z340kvapar0j7s5kdg42lmvnhm") + '("future-visualizer" + "future-visualizer-pict" + "future-visualizer-typed")) + (simple-racket-origin + "games" (base32 "0kpn3izlx1ccd0pj0dnvmnrhny51b85xy418a7psj70lz8j8415d") + '(("games" "."))) + (racket-packages-origin + "gui" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/gui") + (commit %racket-commit))) + (sha256 (base32 + "1x33jgrx3r32k7hgwr591z3xqv1m2r5nc4km2fnxv0ak2xa0j3gj")) + (patches + ;; remove in Racket 8.5 + ;; see https://github.com/racket/racket/issues/4133 + (search-patches "racket-gui-tethered-launcher-backport.patch")) + (file-name (git-file-name "racket-gui" %racket-version))) + '("gui" "gui-doc" "gui-lib" "tex-table")) + (simple-racket-origin + "gui-pkg-manager" (base32 "1ji9448d723nklqvycwdswj0ni28sabrncag14f9mx47did5myb5") + '("gui-pkg-manager-lib")) + (simple-racket-origin + "htdp" (base32 "0r4ykybcpr10y2db9rlza9pr0xh58nd7ac389mjcxp8g386hgihl") + '("htdp" "htdp-doc" "htdp-lib")) + (simple-racket-origin + "html" (base32 "18n1jnjgzfknc8nv8dppi85nb8q08gqdwkg6hfjk08x0p00anx2x") + '("html" "html-doc" "html-lib")) + (simple-racket-origin + "icons" (base32 "1s5a6j11fg3fdr6b7vm2q7q178d7q8b8igy73bs211r27qrd1gg7") + '(("icons" "."))) + (simple-racket-origin + "images" (base32 "0rpjxqw34bq5m08kh1ldl1mr7s9z1lyydxxcyzb292kqh9qiqvfl") + '("images" "images-doc" "images-gui-lib" "images-lib")) + (simple-racket-origin + "lazy" (base32 "176ylzgbdsbmqknpihaz519afq71pyjkv1h87j5v8jfbpbddyfsf") + '(("lazy" "."))) + (simple-racket-origin + "macro-debugger" (base32 "14hyrwbkffr61fk44l02xb47bhv5zccw0ymaa9kxld86hvyqhqbm") + '("macro-debugger" "macro-debugger-text-lib")) + (simple-racket-origin + "main-distribution" (base32 "0m2n9s32s8a4a2gn4ywrm9l8jycdm5ayi5w9kh5wchhrrw7qzq7y") + '(("main-distribution" "."))) + (simple-racket-origin + "make" (base32 "10852fj30bz5r46c3d99s37fkgy5yh44gb01j29sf3kxnhi0g2sa") + '(("make" "."))) + (simple-racket-origin + "math" (base32 "02sqbnvxvmvslk33b44fx4v93zafcvhva0cx8z21jqbl5wp217ac") + '("math" "math-doc" "math-lib")) + (simple-racket-origin + "mysterx" (base32 "11p9jzrafw0hizhl0cs4sxx7rv281185q8hryic2rpk0kzjdyr48") + '(("mysterx" "."))) + (simple-racket-origin + "mzcom" (base32 "0rc9pfj7gwm5azghqvcibz6si1x5s2v8mr2yngk7ssq9gzfbi6a4") + '(("mzcom" "."))) + (simple-racket-origin + "mzscheme" (base32 "192c52zi726h5wjamxrhivjw2waq1im0zpyxhbrkrxknm8x84bs9") + '("mzscheme" "mzscheme-doc" "mzscheme-lib")) + (racket-packages-origin + "net-cookies" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/RenaissanceBug/racket-cookies") + (commit %racket-commit))) + (sha256 (base32 + "0k0hifxhywl5c3hjcaiizc098dpyk001d981p572gly116yvjxc1")) + (file-name + (git-file-name "RenaissanceBug-racket-cookies" %racket-version))) + '("net-cookies" "net-cookies-doc" "net-cookies-lib")) + (racket-packages-origin + "optimization-coach" + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stamourv/optimization-coach") + (commit %racket-commit))) + (sha256 (base32 + "0b27sw48d7rhz0hin88c7rbr9vpg1c23sn82nd4jkmq54h6gasr1")) + (file-name + (git-file-name "stamourv-optimization-coach" %racket-version))) + '(("optimization-coach" "."))) + (simple-racket-origin + "option-contract" (base32 "026b7n5l0c3024nymshz8zp1yhn493rdzgpflzfd52hj7awafqhk") + '("option-contract" "option-contract-doc" "option-contract-lib")) + (simple-racket-origin + "parser-tools" (base32 "08pvz4zramirzm3j64hbhjm0mmh5zfy37iv4s3vmq0rj49cr8fl3") + '("parser-tools" "parser-tools-doc" "parser-tools-lib")) + (simple-racket-origin + "pconvert" (base32 "00czi0p399mmyrvxyrs5kniizpkqfxyz2ncxqi2jy79a7wk79pb1") + '("pconvert-lib")) + (simple-racket-origin + "pict" (base32 "0g1iwdr6qh1xb0crhj96830vjjnbds409xbpqn7j5sh0ksy6vr5x") + '("pict" "pict-doc" "pict-lib")) + (simple-racket-origin + "pict-snip" (base32 "081nwiy4a0n4f7xws16hqbhf0j3kz5alizndi3nnyr3chm4kng6x") + '("pict-snip" "pict-snip-doc" "pict-snip-lib")) + (simple-racket-origin + "picturing-programs" (base32 "1g6xr39hx1j03gb3d4dljm3v91xcj2gfpq3dgy5xvplzr6cmmxgr") + '(("picturing-programs" "."))) + (simple-racket-origin + "plai" (base32 "0i983sh0r0zm2ng4j44m5aw9669kh5fhp91bzpc9jm280rfcqvyl") + '("plai" "plai-doc" "plai-lib")) + (simple-racket-origin + "planet" (base32 "0r2yqrzrmdjjyr14k6hhlzc5kzrcx3583m1s02mhrcmpfw0s85w9") + '("planet" "planet-doc" "planet-lib")) + (simple-racket-origin + "plot" (base32 "07kq32si34ybcwz8idxxcrzssg8diyrp1nfgkcj0mmvr45321zm7") + '("plot" "plot-compat" "plot-doc" "plot-gui-lib" "plot-lib")) + (simple-racket-origin + "preprocessor" (base32 "1p5aid58ifnjy4xl0ysh85cq39k25661v975jrpk182z3k5621mg") + '(("preprocessor" "."))) + (simple-racket-origin + "profile" (base32 "179i86lyby29nywz60l4vnadi02w8b12h7501nm5h5g4pq9jjmbb") + '("profile" "profile-doc" "profile-lib")) + (racket-packages-origin + "quickscript" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Metaxal/quickscript") + (commit %racket-commit))) + (sha256 (base32 + "100g3yqhbjdq06b6l6d72ywsw29awgy8crqg33wj7h12xq07nzcr")) + (file-name (git-file-name "Metaxal-quickscript" %racket-version))) + '(("quickscript" "."))) + (simple-racket-origin + "r5rs" (base32 "1g3cysj7z88r38vkzvi8g2fb2hn4yg1fdhy5smxw303jxgl3inp6") + '("r5rs" "r5rs-doc" "r5rs-lib")) + (simple-racket-origin + "r6rs" (base32 "0b1ymzdp10r0flw2acbidjsh5ma1pm5hy54jss37sxf89z3xbvm4") + '("r6rs" "r6rs-doc" "r6rs-lib")) + (racket-packages-origin + "racket-cheat" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jeapostrophe/racket-cheat") + (commit %racket-commit))) + (sha256 (base32 + "06wcj558rzkbl2bwkmikyspya9v1f4iwlzwnwxpkc33h2xapwabr")) + (file-name + (git-file-name "jeapostrophe-racket-cheat" %racket-version))) + '(("racket-cheat" "."))) + (simple-racket-origin + "racklog" (base32 "1rgrvwy3kr9b9w5cghsffiv3ly00yfvvzr5xaaw83g1w7yin0mnb") + '(("racklog" "."))) + (simple-racket-origin + "rackunit" (base32 "057z31rja6h3nabh5b2xgwfrzmlm6h1cv1qcgf3xfy4g2q5dqn5p") + '("rackunit" + "rackunit-doc" + "rackunit-gui" + "rackunit-lib" + "rackunit-plugin-lib" + "rackunit-typed" + "schemeunit" + "testing-util-lib")) + (simple-racket-origin + "readline" (base32 "13kbcn2wchv82d709mw3r8n37bk8iwq0y4kpvm9dbzx0w2pxkfwn") + '("readline" "readline-doc" "readline-lib")) + (simple-racket-origin + "realm" (base32 "0hxcgla08iack54j8v40fj51811chpy66ym2zq76zb52c7kzn0hi") + '(("realm" "."))) + (simple-racket-origin + "redex" (base32 "0vlgxbnbgrlihk1hh5zd6hsc4566ldi4q76f87z5vai54dxkwy2f") + '("redex" + "redex-benchmark" + "redex-doc" + "redex-examples" + "redex-gui-lib" + "redex-lib" + "redex-pict-lib")) + (simple-racket-origin + "sasl" (base32 "0ibh4wb4gn8pggx6gkv4vk4d6rwzn5nrvjibhvkzhaynf6lhb824") + '("sasl" "sasl-doc" "sasl-lib")) + (simple-racket-origin + "scheme-lib" (base32 "0pcf0y8rp4qyjhaz5ww5sr5diq0wpcdfrrnask7zapyklzx1jx8x") + '(("scheme-lib" "."))) + (simple-racket-origin + "scribble" (base32 "0rgvnsykrxkah6s5fw1vyp9lxsb4z9w6hgwk5j6wbwjp2gsfczbm") + '("scribble" + "scribble-doc" + "scribble-html-lib" + "scribble-lib" + "scribble-text-lib")) + (simple-racket-origin + "serialize-cstruct-lib" + (base32 "1rq3n1fa7ldjwx3lrh9ybhig7jlsw1crpzyklbzp3xqdw6jymfnz") + '(("serialize-cstruct-lib" "."))) + (simple-racket-origin + "sgl" (base32 "0nkymhdyjrwi5h199j4w5zh7y3x3ai42gsiwxzh0hy7yqrqqg9zv") + '(("sgl" "."))) + (simple-racket-origin + "shell-completion" (base32 "04m144gy2mp4fiq6rcbf12wjr8mws8k9scfhg9lc38vqppp4lxsj") + '(("shell-completion" "."))) + (simple-racket-origin + "simple-tree-text-markup" + (base32 "0fyd9gfz6bnv0m1901wv5mnhc05rm8hw9i6ddrqx33hs6qsg2zqr") + '("simple-tree-text-markup" + "simple-tree-text-markup-doc" + "simple-tree-text-markup-lib")) + (simple-racket-origin + "slatex" (base32 "0pkm2isbbdk63slrbsxcql7rr0wdrw5kapw1xq4ps5k8dhlzv8x0") + '(("slatex" "."))) + (simple-racket-origin + "slideshow" (base32 "1znv1i2d0610hhy71q932xy7wka00q3q50in1xfnk8ibg7nzkagm") + '("slideshow" "slideshow-doc" "slideshow-exe" "slideshow-lib" "slideshow-plugin")) + (simple-racket-origin + "snip" (base32 "01r9wc5xr3q3n4yyif6j0a37rgdzmpslxn05k13ksik73b3wj6hj") + '("snip" "snip-lib")) + (simple-racket-origin + "typed-racket" (base32 "1462kj9yswsxbnw71casylzlvhd7cxrml2v9j7rcsnn9hmrqx4vv") + '("source-syntax" + "typed-racket" + "typed-racket-compatibility" + "typed-racket-doc" + "typed-racket-lib" + "typed-racket-more")) + (racket-packages-origin + "srfi" (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/racket/srfi") + ;; Includes an FSDG fix: return to %racket-commit in 8.5. + ;; See . + (commit "7243029b135741ce08ae30f877e2f49a2a460b22"))) + (sha256 (base32 + "0aqbcdv2dfc2xnk0h6zfi56p7bpwqji8s88qds3d03hhh9k28gvn")) + ;; Use the relevant version for srfi-doc and srfi-lib, + ;; since we're using a newer commit than the v8.4 tag. + (file-name (git-file-name "racket-srfi" "1.1"))) + '("srfi" "srfi-doc" "srfi-lib" "srfi-lite-lib")) + (simple-racket-origin + "string-constants" (base32 "1qizjq4n0hzdgdcjjpr94464gsywpsk2g9mnvwzqr7dcqbrsfvn6") + '("string-constants" "string-constants-doc" "string-constants-lib")) + (simple-racket-origin + "swindle" (base32 "164gdsphjzdl2vv7zxz7dfk9jwax8njpmim6sidm8qz8a8589y67") + '(("swindle" "."))) + (simple-racket-origin + "syntax-color" (base32 "1vf2fc3qvx8a1igi7swsg8gaqhx786sa0vqxd18xhbsidfgb5ywp") + '("syntax-color" "syntax-color-doc" "syntax-color-lib")) + (simple-racket-origin + "trace" (base32 "070ihla5j796hdarn5wxdwn4xj0xnkm50shgh49jy994mribvhia") + '(("trace" "."))) + (simple-racket-origin + "unix-socket" (base32 "02dfwas5ynbpyz74w9kwb4wgb37y5wys7svrlmir8k0n9ph9vq0y") + '("unix-socket" "unix-socket-doc" "unix-socket-lib")) + (simple-racket-origin + "web-server" (base32 "1zgb6jl7zx6258ljs8f3lvryrq5n5zpd71dqzr698m92kw3x2pkn") + '("web-server" "web-server-doc" "web-server-lib")) + (simple-racket-origin + "wxme" (base32 "1qp5gr9gqsakiq3alw6m4yyv5vw4i3hp4y4nhq8vl2nkjmirvn0b") + '("wxme" "wxme-lib")) + (simple-racket-origin + "xrepl" (base32 "12zjgsy5zqm3fck3ihg4a70wj56s2cnnjyb4jlfi5nnsfqyrnxg3") + '("xrepl" "xrepl-doc" "xrepl-lib")))) + (build-system gnu-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'configure 'unpack-packages - (let ((unpack (assoc-ref %standard-phases 'unpack))) - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out")) - (pkgs-dir (string-append prefix "/share/racket/pkgs"))) - (mkdir-p pkgs-dir) - (copy-recursively - "share/links.rktd" - (string-append prefix "/share/racket/links.rktd")) - (copy-recursively "share/pkgs" pkgs-dir) - ;; NOTE: unpack changes the working directory - (unpack #:source (assoc-ref (or native-inputs inputs) - "main-repo")) - (for-each (lambda (pkg) - (define dest (string-append pkgs-dir "/" pkg)) - (mkdir-p dest) - (copy-recursively (string-append "pkgs/" pkg) - dest)) - ',%main-repo-main-distribution-pkgs) - #t)))) - (replace 'configure - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let ((racket (assoc-ref (or native-inputs inputs) "racket")) - (prefix (assoc-ref outputs "out"))) - (apply invoke - (string-append racket "/bin/racket") - (assoc-ref inputs "extend-layer") - racket - prefix - (map - (lambda (lib) - (string-append (assoc-ref inputs lib) "/lib")) - '("cairo" - "fontconfig" - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))) - #t))) - (replace 'build - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) - "racket") - "/bin/racket") - "--config" - (string-append (assoc-ref outputs "out") - "/etc/racket") - "-l" - "raco" - "setup") - #t)) - (delete 'install)) - ;; we still don't have these: - #:tests? #f)) + ;; We're using #:configure-flags to pass flags for + ;; `configure-layer.rkt` and #:make-flags to pass arguments for + ;; `raco pkg install`. + (list + #:configure-flags + #~`("--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit"))))) + #:make-flags #~`("main-distribution") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (guix build union) + (ice-9 match)) + #:imported-modules `((guix build union) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (delete 'unpack) + (replace 'configure + (lambda* (#:key inputs configure-flags #:allow-other-keys) + (let* ((racket (search-input-file inputs "bin/racket"))) + (apply invoke + racket + #$configure-layer.rkt + `(,@configure-flags + ,(dirname (dirname racket)) + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; We use "share/racket/pkgs" for sources to distinguish them + ;; from the "lib/racket/pkgs" of a potential parent layer. + (union-build (string-append #$output "/lib/racket/pkgs") + (search-path-as-list '("share/racket/pkgs") + (map cdr inputs)) + #:create-all-directories? #t))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket (search-input-file inputs "/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) + (home-page "https://racket-lang.org") (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -564,17 +898,20 @@ (define dest (string-append pkgs-dir "/" pkg)) The main Racket distribution comes with many bundled packages, including the DrRacket IDE, libraries for GUI and web programming, and implementations of -languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) - +languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) -(define extend-layer +(define configure-layer.rkt (scheme-file - "extend-layer.rkt" + "configure-layer.rkt" `(module - extend-layer racket/base + configure-layer racket/base (require racket/cmdline racket/match racket/file + racket/port racket/list racket/pretty) (define config-file-pth @@ -584,8 +921,14 @@ (define (build-path-string . args) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) + (define extra-foreign-lib-search-dirs '()) (command-line - #:args (parent-layer prefix . lib-dir*) + #:once-each + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (parent-layer prefix) (let* ([config (for/fold ([config (file->value (build-path parent-layer @@ -615,27 +958,42 @@ (define rx:racket (build-path-string parent-layer pth)) (filter values (hash-ref config search-key null)))))] [config - (hash-set config - 'apps-dir - (build-path-string prefix "share/applications"))] + (hash-update config + 'lib-search-dirs + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] [config - ;; place new foreign lib-search-dirs before old - ;; foreign dirs, but after Racket layers - (let-values - ([(rkt extra) - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - (hash-ref config 'lib-search-dirs))]) - (hash-set config - 'lib-search-dirs - (append rkt - lib-dir* - extra)))] + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaround Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] [bin-dir (hash-ref config 'bin-dir)] [config (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) 'config-tethered-console-bin-dir bin-dir 'config-tethered-gui-bin-dir bin-dir)] [new-config-pth -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:30:39 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:30:39 +0000 Received: from localhost ([127.0.0.1]:59331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7m-0008CP-Bp for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:39 -0500 Received: from mail-vs1-f43.google.com ([209.85.217.43]:33568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7X-0008BH-Qq for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:25 -0500 Received: by mail-vs1-f43.google.com with SMTP id d26so11142208vsh.0 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:23 -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=+fLJCY3vM/ADUmWIox4zLXxZi0OpOqXWcTnr9qBwQGk=; b=NhsjI3iK/fZttEuaQZvlsZLALbzPAW4zI/XdQttvypWHgnYxgB2yHLA4Ra6MOMVDB9 q9YKL+DHKGzp6VGOUoJH/bp4X70aQKWTPEn5QStaa0hGuXIOPM/BQ8Bq/6nJc0TJvpdZ oc0iEWimi9XLifcgCwNgAK8lkWO28AqVZoX2Xp6KVN4L2UHftwP2STVOoFmCd7RaKnp1 UbRXN/Lijt3zbnfwky/oSLAlngpt+cn0QlZPd8Fp6X8uUwIV3cDLGN48rmJRVAhAiEjI pZPMTAgA8ZQDXQX/mp0ybTJ4p/M6Lsi2BM6GFIXpYjlOXYEUf8LlierPHjZ0Jkyb565Q clew== 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=+fLJCY3vM/ADUmWIox4zLXxZi0OpOqXWcTnr9qBwQGk=; b=edaN596jnACAd8VCo3LZ0CNzl41pCdbONXJjj5/bWSqFCDGhSm9FovYsbEQa9ShM+C iIGZp7e8Az8eNtJiWCWqw1SpD1rTXDaVWoZBtM1/BmDxfouynBnxk6oFSrfCweXl2hmj Yr7Rlq8y2NxzeeSthJV2yxaG9AdzZYgSxqtnAxIvmF1k/Fcg2hpGK1Q+tTxszQMvigTq NyEz1ejfllj7d8sGT3QOqFuL4p0691L1YJrxY2H1Wf2UD9FZL7eq7Lzw1D3EONgArqor ZNPLHTGlKgTSo/vgzYnySAmEHtW82viDnqWn9fuULumiLUcFZphjM1hT5Cf3F++2xf4k Bz4w== X-Gm-Message-State: AOAM530As5x5A7nA+ahlyVmByf1K1ITJsphd+5PQhgTPvsTSyKKXg0HV NDR5KcBCXOCzOJYW6hQwNjAIF0Vj5MoFouJgWeg= X-Google-Smtp-Source: ABdhPJwJtGMM0HqmFIA49GPq5tX1jL0ycUwQs5/ssD82f8XVYH6h6UenHa/mjjEUEICEs981QlWhag== X-Received: by 2002:a05:6102:21ac:b0:31c:1b59:4fc6 with SMTP id i12-20020a05610221ac00b0031c1b594fc6mr6638643vsb.59.1645997417925; Sun, 27 Feb 2022 13:30:17 -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 x13-20020ab0654d000000b003420869cdd5sm1442428uap.13.2022.02.27.13.30.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:17 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 04/24] gnu: racket-minimal: Use new package style. Date: Sun, 27 Feb 2022 16:29:00 -0500 Message-Id: <20220227212920.2009000-5-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (cfg-flag:sh-for-rktio, cfg-flag:enable-lt, cfg-glag:enable-racket): Change to G-expressions and combine in ... (racket-vm-common-configure-flags): ... this new thunk. (unpack-nanopass+stex): Change to G-expression and move to ... (make-unpack-nanopass+stex): ... this new thunk. (racket-bootstrap-chez-bootfiles): Rename to ... (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable, and stop inheriting from 'racket-minimal'. [native-inputs]: Remove labels. [build-system]: Use 'copy-build-system'. [arguments]: Use G-expressions. Install under "lib". (racket-minimal)[inputs, native-inputs]: Remove labels. [arguments]: Use G-expressions. Avoid 'assoc-ref'. Adapt to changes in 'chez-scheme-for-racket-bootstrap-bootfiles'. (racket-minimal-bc-3m)[native-inputs]: Remove labels. [arguments]: Use G-expressions. (racket-minimal-bc-cgc)[native-inputs]: Remove labels. [arguments]: Use G-expressions. --- gnu/packages/racket.scm | 332 ++++++++++++++++++++-------------------- 1 file changed, 163 insertions(+), 169 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index a37442edc2..eb87eaa492 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -26,6 +26,7 @@ (define-module (gnu packages racket) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -99,7 +100,7 @@ (define-module (gnu packages racket) ;; Code: (define %racket-version "8.4") -;; ^ Remember to update racket-bootstrap-chez-bootfiles! +;; ^ Remember to update chez-scheme-for-racket-bootstrap-bootfiles! (define %racket-commit (string-append "v" %racket-version)) (define %racket-origin @@ -133,34 +134,42 @@ (define %racket-origin ;; Unbundle libffi. (delete-file-recursively "racket/src/bc/foreign/libffi"))))) -(define cfg-flag:sh-for-rktio - `(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - (assoc-ref %build-inputs "sh") - "/bin/sh")) -(define cfg-flag:enable-lt - `(string-append "--enable-lt=" - (assoc-ref %build-inputs "libtool") - "/bin/libtool")) -(define cfg-flag:enable-racket - `(let ((racket (assoc-ref %build-inputs "racket"))) - (string-append "--enable-racket=" - racket - "/bin/racket"))) +(define (racket-vm-common-configure-flags) + ;; under a lambda abstraction to avoid evaluating bash-minimal too early. + #~`(,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/libtool")) + => (lambda (libtool) + (list (string-append "--enable-lt=" libtool)))) + (else + '())) + ,@(cond + ((false-if-exception + (search-input-file %build-inputs "/bin/racket")) + => (lambda (racket) + (list (string-append "--enable-racket=" racket)))) + (else + '())) + ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" + #$(file-append bash-minimal "/bin/sh")))) -(define unpack-nanopass+stex - ;; Copied from chez-scheme. - ;; TODO: Eventually, we should refactor Chez Scheme - ;; enough to share more directly, so that we can make - ;; Racket's version of Chez avalable as a Guix package, - ;; e.g. for architectures not supported upstream. - ;; For now, we let Racket drive the Chez build process - ;; other than this step. - `(for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex"))) +(define (make-unpack-nanopass+stex) + ;; Adapted from chez-scheme. + ;; Thunked to avoid evaluating 'chez-scheme' too early. + ;; TODO: Refactor enough to share this directly. + #~(begin + (copy-recursively + #$(match (assoc-ref (package-native-inputs chez-scheme) + "nanopass") + ((src) + src)) + "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-public racket-minimal @@ -169,91 +178,87 @@ (define-public racket-minimal (version %racket-version) (source %racket-origin) (inputs - `(;; common to all racket-minimal variants: - ("openssl" ,openssl) - ("sqlite" ,sqlite) - ("sh" ,bash-minimal) ;; <- for `system` - ("ncurses" ,ncurses) ;; <- for #%terminal - ;; only for CS - ("zlib" ,zlib) - ("lz4" ,lz4))) + (list + ;; common to all racket-minimal variants: + openssl + sqlite + bash-minimal ;; <- for `system` + ncurses ;; <- for #%terminal + ;; only for CS + zlib + lz4)) (native-inputs - `(("bootfiles" ,racket-bootstrap-chez-bootfiles) - ,@(package-native-inputs racket-bootstrap-chez-bootfiles))) + (list chez-scheme-for-racket-bootstrap-bootfiles + racket-minimal-bc-3m)) (build-system gnu-build-system) (arguments - `(#:configure-flags - (list "--enable-csonly" - "--enable-libz" - "--enable-liblz4" - ,cfg-flag:enable-racket - ,cfg-flag:sh-for-rktio) - #:out-of-source? #true - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main distribution. - #:tests? #f - #:modules ((ice-9 match) + (list + #:configure-flags + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) (guix build gnu-build-system) (guix build utils)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (string-append (assoc-ref inputs "bootfiles") "/boot") - "boot")) - #t)) - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f ,@(map (lambda (lib) - (string-append (assoc-ref inputs lib) - "/lib")) - '("openssl" - "sqlite")))) - (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - ,version - "/catalog/") - #f)))))) - #t)) - (add-before 'configure 'change-directory - (lambda _ - (chdir "racket/src") - #t)) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda* (#:key outputs #:allow-other-keys) - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append (assoc-ref outputs "out") - "/share/racket/pkgs")) - #t))))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (with-directory-excursion "racket/src/ChezScheme" + #$(make-unpack-nanopass+stex)))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "racket/src/ChezScheme" + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot")))) + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((lib-search-dirs + . (#f #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib"))) + (build-stamp . "") + (catalogs + . (,(string-append + "https://download.racket-lang.org/releases/" + #$(package-version this-package) + "/catalog/") + #f)))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (add-after 'install 'remove-pkgs-directory + ;; If the configured pkgs-dir exists, "pkgs.rktd" does not + ;; exist, and a lock file does not exist, commands like + ;; `raco pkg show` will try to create a lock file and fail + ;; due to the read-only store. + ;; Arguably this may be a bug in `pkg/private/lock`: + ;; see . + ;; As a workaround, remove the directory. + (lambda args + ;; rmdir because we want an error if it isn't empty + (rmdir (string-append #$output "/share/racket/pkgs"))))))) (home-page "https://racket-lang.org") (synopsis "Racket without bundled packages such as DrRacket") (description @@ -269,7 +274,6 @@ (define (write-racket-hash alist) ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) - (define-public racket-minimal-bc-3m (hidden-package (package @@ -280,21 +284,19 @@ (define-public racket-minimal-bc-3m (prepend libffi) ;; <- only for BC variants (delete "zlib" "lz4"))) (native-inputs - `(("libtool" ,libtool) - ("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc)))) + (list libtool + (if (%current-target-system) + racket-minimal + racket-minimal-bc-cgc))) (arguments (substitute-keyword-arguments (package-arguments racket-minimal) ((#:configure-flags _ '()) - `(list "--enable-bconly" - ,cfg-flag:enable-racket - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)) - ((#:phases usual-phases) - `(modify-phases ,usual-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))) + ((#:phases cs-phases) + #~(modify-phases #$cs-phases + (delete 'unpack-nanopass+stex) + (delete 'unpack-bootfiles))))) (synopsis "Minimal Racket with the BC [3M] runtime system") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written @@ -309,19 +311,16 @@ (define-public racket-minimal-bc-3m ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) - (define-public racket-minimal-bc-cgc (package (inherit racket-minimal-bc-3m) (name "racket-minimal-bc-cgc") - (native-inputs - (alist-delete "racket" (package-native-inputs racket-minimal-bc-3m))) + (native-inputs (list libtool)) (arguments (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) ((#:configure-flags _ '()) - `(list "--enable-cgcdefault" - ,cfg-flag:enable-lt - ,cfg-flag:sh-for-rktio)))) + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags))))) (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or ``bytecode'') implementation is not recommended for general use. It uses @@ -334,47 +333,42 @@ (define-public racket-minimal-bc-cgc also be used for embedding applications without the annotations needed in C code to use the 3M garbage collector."))) - -(define-public racket-bootstrap-chez-bootfiles - (hidden-package - (package - (inherit racket-minimal) - (name "racket-bootstrap-chez-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. - (inputs `()) - (native-inputs - `(("racket" ,(if (%current-target-system) - racket-minimal - racket-minimal-bc-3m)) - ("stex" ,@(assoc-ref (package-native-inputs chez-scheme) "stex")) - ("nanopass" ,@(assoc-ref (package-native-inputs chez-scheme) - "nanopass")))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - ,unpack-nanopass+stex) - #t)) - (delete 'configure) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (invoke (string-append (assoc-ref inputs "racket") - "/bin/racket") - "rktboot/main.rkt" - "--dest" (assoc-ref outputs "out"))) - #t)) - (delete 'check) - (delete 'install)))) - (synopsis "Chez Scheme bootfiles bootstrapped by Racket") - (description "Chez Scheme is a self-hosting compiler: building it +(define-public chez-scheme-for-racket-bootstrap-bootfiles + (package + (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. + (source %racket-origin) + (inputs `()) + (native-inputs (list racket-minimal-bc-3m)) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list + #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))) + (add-after 'chdir 'unpack-nanopass+stex + (lambda args + #$(make-unpack-nanopass+stex))) + (add-before 'install 'build + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (invoke (search-input-file (or native-inputs inputs) + "/bin/racket") + "rktboot/main.rkt")))))) + (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 "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 supported platforms.) @@ -389,7 +383,7 @@ (define-public racket-bootstrap-chez-bootfiles 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.") - (license (list license:asl2.0))))) + (license (list license:asl2.0)))) (define (racket-packages-origin name origin specs) "Extract from ORIGIN the sources for the Racket packages specified by SPECS, -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:30:39 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:30:39 +0000 Received: from localhost ([127.0.0.1]:59333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7n-0008CS-AT for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:39 -0500 Received: from mail-vk1-f173.google.com ([209.85.221.173]:43918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7b-0008BS-Rz for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:28 -0500 Received: by mail-vk1-f173.google.com with SMTP id n10so4228299vkm.10 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:27 -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=iy7wy5qgxpANhyrx8IcVPlzMlPsMzrrgguU9zsUPqoY=; b=Y2ufFjFgPFEZ57PtFNP8D3UFgRh8+4B/bIstEJO5uK+klmCJ0Z2pbzNd9zWquOPsmz MUK8KkYYqAUhfQjDpgbEikWGXAx2ynWo2hB+rrRhcakl1mxI1dirgdzyiBbSK+BaWH9R 0LYPQTEqHzydW7Rcc71LldtcEwb2zSQMx6CWGt9BCcGl32lR36rl16vJIwpR1Zip00jF GsM/pR68xFJf/P09pxYmnb2opltBYn7c+Eh0UbNdMvsFP1GIgcOPHLm13xRKTaLox80t fHj6uwAYs9UR0c6n/5qv/QW0vluihaXIKde1Y4PTXawg+MklLcWSwGEhn2YJlZdZtFEv xDSg== 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=iy7wy5qgxpANhyrx8IcVPlzMlPsMzrrgguU9zsUPqoY=; b=iHEr/PgwmUIycvC7EXD/puDNIuSZwSTIPZ4bXTNTskc3kQfHroG8ubWv1jhIKHJeRt Suu2P3KyK2dpDXuK4MEgtRMMNIXyO+C8XjRTMI03gQL9wQK5K/GTn/qt2BhpRWj+QXmv tRBHNvN8Z8E4z3bKevRRbCJTxWsqXycUzFxs3Y7nTHkgn194veXqrd256gHipCu821BM gefEGJHLTdrSVOwZVncjB38EroBs/BScGcBA5F8kv/HbWZqX4zJG2yJLoncgxLAUI/OI /OTfR6cWADh0CwR/8GYw42aMWwqJmDVMakhL3pgpXLPc9Wuif7FUdNPbmWFHju/dLM8H 9JvA== X-Gm-Message-State: AOAM531864UmTskGCYATLOuOG9sPa4lx+eDMB9XbTMeLX0NS3St+DP0l ZXbze/SA8duNiq72ox186bWrhAHSVUS3NqZ/cK4= X-Google-Smtp-Source: ABdhPJzDkRDJWM0CwYvatkGISwFW8uaEcHilUGyBkbhtHw/Jg7WOf04i0MkclaEnzDTmow4HYf/0/g== X-Received: by 2002:a1f:1355:0:b0:333:40fd:64ce with SMTP id 82-20020a1f1355000000b0033340fd64cemr908624vkt.17.1645997422381; Sun, 27 Feb 2022 13:30:22 -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 j8-20020a1fa008000000b0033190c40659sm1356958vke.37.2022.02.27.13.30.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:22 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 05/24] gnu: racket-minimal: Don't configure non-existant catalogs. Date: Sun, 27 Feb 2022 16:29:01 -0500 Message-Id: <20220227212920.2009000-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-minimal)[arguments]<#:phases>: Change 'initialize-config.rktd' to only add a release catalog when the package version is a release version. --- gnu/packages/racket.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index eb87eaa492..dc392fb27d 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -231,6 +231,15 @@ (define (write-racket-hash alist) (format #t "(~s . ~s)" k v))) alist) (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) (mkdir-p "racket/etc") (with-output-to-file "racket/etc/config.rktd" (lambda () @@ -239,12 +248,8 @@ (define (write-racket-hash alist) . (#f #$(file-append (this-package-input "openssl") "/lib") #$(file-append (this-package-input "sqlite") "/lib"))) (build-stamp . "") - (catalogs - . (,(string-append - "https://download.racket-lang.org/releases/" - #$(package-version this-package) - "/catalog/") - #f)))))))) + (catalogs ,@maybe-release-catalog + #f))))))) (add-before 'configure 'chdir (lambda _ (chdir "racket/src"))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:30:43 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:30:43 +0000 Received: from localhost ([127.0.0.1]:59335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7n-0008Ca-PU for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:43 -0500 Received: from mail-vk1-f180.google.com ([209.85.221.180]:42756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7g-0008Bj-Lw for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:33 -0500 Received: by mail-vk1-f180.google.com with SMTP id l10so4243202vki.9 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:32 -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=Yq0zPrs4S7KllmXpGmTarSZjJiNT7KonIgGzWbcUl1Y=; b=OUmSW/s7QVEdEgzPfVifdM8cypk9YQYOloxnXDjNSZtdpLDxCUQzFP24qdrlfn64XE gYI/B8EgNjYHGyo3sLa86zDRozfhzELFhRY7NiItd41I73yXKN6JY2OxxylIM8g0jlBc KMP3GRaz2ksG4Os3avI/hvs/ySff53sjIwighdYpRHLA80ddDmKdCM7VR8OxxCKvQknf +3eHal327ub62JqDCz530j7wsIcv2kwobWqsj/WqNQSv/LaX8o+XvS3kmIUz01V6VdIo sskT0ZSqryCrQeWrUCf7pnam4/oMDWW+sLVF2/9787Cn+QRW0sp8fJN+fyhnGFFfkCUL MvDQ== 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=Yq0zPrs4S7KllmXpGmTarSZjJiNT7KonIgGzWbcUl1Y=; b=v/rpta90VsEgGqtJb53iangIgw2kJsyMFcThc1idQi7Mu2AHhXN7Y6Tj9D9rS2XUKw 30FqZIT+0i17By7cfasc/xu7evKj0cIt09IeVQz4DtQ9uzseyT7Xcwyxu/nS7EP1KSuQ 9eoVX2LY75rMxCBvLE//6V37vwpoLreXNZCEs5J6QnJT7KzYYFgKk5jn2Q8fajx6q77l FXrTT0CJP3HaGMZjnsqdvAWqSubipOSlpEPjfBxFAQ0nAmCgQVHWDudc2yprAYKWLD6t 9J2UIa22PtIAZ3UL6KEC/W0RIyGyTAaXetiwdplVHar26f6fNfw/zw0Trn0TOLuGD+Xh OQKw== X-Gm-Message-State: AOAM533YBPxwzLEZNM9ppi/NwskGU7AE8Bmg1ZY8tfmxU59SNsMSi24Y s4ra3iZ7kvJ/RSzXHls9S1P91YL7ip1Dy5yness= X-Google-Smtp-Source: ABdhPJyIScgLbtYGJ2jkelUAfR/y+xuLRKv5wVUUVcnyZTBHCfXUayhndVUHRsRJ7zMb7uB0JOSNag== X-Received: by 2002:a05:6122:17a6:b0:31e:d699:29e0 with SMTP id o38-20020a05612217a600b0031ed69929e0mr7188430vkf.1.1645997426938; Sun, 27 Feb 2022 13:30:26 -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 w123-20020a1fdf81000000b003322033e617sm1535459vkg.36.2022.02.27.13.30.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:26 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 06/24] gnu: racket-minimal: Change inheritance to follow bootstrapping. Date: Sun, 27 Feb 2022 16:29:02 -0500 Message-Id: <20220227212920.2009000-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.180 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.180 listed in wl.mailspike.net] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.180 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.180 listed in wl.mailspike.net] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: ambrevar.xyz (xyz)] -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline formerly inherited values. (racket-minimal-bc-3m): Inherit from 'racket-minimal-bc-cgc' rather than 'racket-minimal'. [inputs, native-inputs, arguments, license]: Adjust accordingly. (racket-minimal): Inherit from 'racket-minimal-bc-3m'. [inputs, native-inputs, arguments, license]: Adjust accordingly. [properties]: Override effect of 'hidden-package'. --- gnu/packages/racket.scm | 130 +++++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 63 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index dc392fb27d..8d12a96f22 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021 Philip McGrath +;;; Copyright © 2021, 2022 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -172,9 +172,9 @@ (define (make-unpack-nanopass+stex) (display "# to placate ../configure"))))) -(define-public racket-minimal +(define-public racket-minimal-bc-cgc (package - (name "racket-minimal") + (name "racket-minimal-bc-cgc") (version %racket-version) (source %racket-origin) (inputs @@ -184,19 +184,14 @@ (define-public racket-minimal sqlite bash-minimal ;; <- for `system` ncurses ;; <- for #%terminal - ;; only for CS - zlib - lz4)) - (native-inputs - (list chez-scheme-for-racket-bootstrap-bootfiles - racket-minimal-bc-3m)) + ;; only for BC variants: + libffi)) + (native-inputs (list libtool)) ;; <- only for BC variants (build-system gnu-build-system) (arguments (list #:configure-flags - #~(cons* "--enable-csonly" - "--enable-libz" - "--enable-lz4" + #~(cons* "--enable-cgcdefault" #$(racket-vm-common-configure-flags)) ;; Tests are in packages like racket-test-core and ;; main-distribution-test that aren't part of the main @@ -210,17 +205,6 @@ (define-public racket-minimal (guix build utils)) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (with-directory-excursion "racket/src/ChezScheme" - #$(make-unpack-nanopass+stex)))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (search-input-directory (or native-inputs inputs) - "lib/chez-scheme-bootfiles") - "boot")))) (add-before 'configure 'initialize-config.rktd (lambda* (#:key inputs #:allow-other-keys) (define (write-racket-hash alist) @@ -265,43 +249,37 @@ (define maybe-release-catalog ;; rmdir because we want an error if it isn't empty (rmdir (string-append #$output "/share/racket/pkgs"))))))) (home-page "https://racket-lang.org") - (synopsis "Racket without bundled packages such as DrRacket") - (description - "Racket is a general-purpose programming language in the Scheme family, -with a large set of libraries and a compiler based on Chez Scheme. Racket is -also a platform for language-oriented programming, from small domain-specific -languages to complete language implementations. + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. -The ``minimal Racket'' distribution includes just enough of Racket for you to -use @command{raco pkg} to install more. Bundled packages, such as the -DrRacket IDE, are not included.") +Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list license:asl2.0 license:expat)))) + (license (list license:lgpl3+ license:asl2.0 license:expat)) + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (properties `((hidden? . #t))))) (define-public racket-minimal-bc-3m (hidden-package (package - (inherit racket-minimal) + (inherit racket-minimal-bc-cgc) (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (prepend libffi) ;; <- only for BC variants - (delete "zlib" "lz4"))) (native-inputs - (list libtool - (if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc))) + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (prepend racket-minimal-bc-cgc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) + (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) ((#:configure-flags _ '()) #~(cons "--enable-bconly" - #$(racket-vm-common-configure-flags))) - ((#:phases cs-phases) - #~(modify-phases #$cs-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) + #$(racket-vm-common-configure-flags))))) (synopsis "Minimal Racket with the BC [3M] runtime system") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written @@ -316,27 +294,53 @@ (define-public racket-minimal-bc-3m ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) -(define-public racket-minimal-bc-cgc +(define-public racket-minimal (package (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs (list libtool)) + (name "racket-minimal") + (inputs + (modify-inputs (package-inputs racket-minimal-bc-cgc) + (prepend zlib lz4) + (delete "libffi"))) + (native-inputs + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (delete "libtool") + (prepend chez-scheme-for-racket-bootstrap-bootfiles + racket-minimal-bc-3m))) (arguments (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) + ((#:phases bc-phases) + #~(modify-phases #$bc-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (with-directory-excursion "racket/src/ChezScheme" + #$(make-unpack-nanopass+stex)))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "racket/src/ChezScheme" + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot")))))) ((#:configure-flags _ '()) - #~(cons "--enable-cgcdefault" - #$(racket-vm-common-configure-flags))))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the -Racket CS implementation. + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket without bundled packages such as DrRacket") + (description + "Racket is a general-purpose programming language in the Scheme family, +with a large set of libraries and a compiler based on Chez Scheme. Racket is +also a platform for language-oriented programming, from small domain-specific +languages to complete language implementations. -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) +The ``minimal Racket'' distribution includes just enough of Racket for you to +use @command{raco pkg} to install more. Bundled packages, such as the +DrRacket IDE, are not included.") + (properties `()) + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) (define-public chez-scheme-for-racket-bootstrap-bootfiles (package -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:30:44 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:30:44 +0000 Received: from localhost ([127.0.0.1]:59338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7r-0008Cq-DM for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:44 -0500 Received: from mail-vs1-f51.google.com ([209.85.217.51]:41676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7l-0008C0-5o for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:37 -0500 Received: by mail-vs1-f51.google.com with SMTP id y26so11061086vsq.8 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:37 -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=j2uLNLMZ4C94s2HgKMi8CoFqkGqCaSTgS1AwtHFkZuo=; b=ZgzjZfNolg9pMIswd+vNmzEcqjSCEQBkMBWsbTpzSpM/hog68cEXxmKDJRhv0lYwU+ TjcMRIqzGoPTWporCrjWLQCS1u4Q1rhRrFoU0LH9C5pFC9lPnOxOTe2H/FjpP+ktaFr3 3ZeTzG4ex/zbfykcprvXYAfzkpVC1EfS6ALVq/XCWzrpGTcT8S9LGfw4p0afA+HNuzMT PrQZSkzl5uAjRWPNmKJGmqqF8F7ECFFescJm2l87MzXjclW9K3hjRUlS7p/ccCKDMY/u iIvbEMTpS6h389Kbg44VrVn3aXYSngZa7szyclC69lKzvWmUNERtEO35Iwo21tnVq8Qj R5SA== 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=j2uLNLMZ4C94s2HgKMi8CoFqkGqCaSTgS1AwtHFkZuo=; b=bW9s6Ogg3w9QRaIU6bMNZVCsuqTwGSBkAIXKix6EZE1S2uL9hTw2kNAMVW/ZQeh2I5 zbi5YLma4OwBaCZgBIdUAu/8HTvfPg7GK+0BHCBfCBotrEP6IFltadIb/sBwZzsOHUGg V3wUwsOJ8o84mzz6mRdWP+Ed+G+vavAGHgnJjRqbU4fX0XKJbPWIIhi6vS+oFiDs8JvU tUZYUzlipzTjyMXMThtkjM6tV3dQtwhLAGBzwYG3HNzR8ZObjaT5I/N79bYwl2jD1nd1 BdqrSJQ/6ZKBfg0BdUUPMJwt5z8AAhlC+5Jhb/WH1WHa4YtQhokp7/48KRYKPISfBjDq yOMA== X-Gm-Message-State: AOAM531BxRQaIk58cOrS7W+gHX+vI70wmlbS/Etoye9LgZcznMdRXaDK OVxDqYXL12mzdXV+qrt8CqdQXSWgO3zFwc1HwNE= X-Google-Smtp-Source: ABdhPJyuSOWW2lRX3LMY747YLItRKHnAXEEPIPwL3piEMiGaUqhtS3bafUd9Z1DlvO2aOGtBD5v3zw== X-Received: by 2002:a67:c787:0:b0:31e:874e:b9a3 with SMTP id t7-20020a67c787000000b0031e874eb9a3mr1684593vsk.54.1645997431506; Sun, 27 Feb 2022 13:30:31 -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 n22-20020a1fa416000000b0031e658fd080sm1354591vke.43.2022.02.27.13.30.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:31 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 07/24] gnu: racket-minimal: Adjust indentation. Date: Sun, 27 Feb 2022 16:29:03 -0500 Message-Id: <20220227212920.2009000-8-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-minimal-bc-cgc): Use 'hidden-package' rather than 'properties'. (racket-minimal-bc-3m): Remove redundant 'hidden-package' wrapper. --- gnu/packages/racket.scm | 201 ++++++++++++++++++++-------------------- 1 file changed, 100 insertions(+), 101 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 8d12a96f22..3667f2df9d 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -173,84 +173,87 @@ (define (make-unpack-nanopass+stex) (define-public racket-minimal-bc-cgc - (package - (name "racket-minimal-bc-cgc") - (version %racket-version) - (source %racket-origin) - (inputs - (list - ;; common to all racket-minimal variants: - openssl - sqlite - bash-minimal ;; <- for `system` - ncurses ;; <- for #%terminal - ;; only for BC variants: - libffi)) - (native-inputs (list libtool)) ;; <- only for BC variants - (build-system gnu-build-system) - (arguments - (list - #:configure-flags - #~(cons* "--enable-cgcdefault" - #$(racket-vm-common-configure-flags)) - ;; Tests are in packages like racket-test-core and - ;; main-distribution-test that aren't part of the main - ;; distribution. - #:tests? #f - ;; Upstream recommends #:out-of-source?, and it does - ;; help with debugging, but it confuses `install-license-files`. - #:modules '((ice-9 match) - (ice-9 regex) - (guix build gnu-build-system) - (guix build utils)) - #:phases - #~(modify-phases %standard-phases - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (define maybe-release-catalog - (let ((v #$(package-version this-package))) - (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" - v) - `(,(string-append - "https://download.racket-lang.org/releases/" - v - "/catalog/")) - '()))) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f #$(file-append (this-package-input "openssl") "/lib") - #$(file-append (this-package-input "sqlite") "/lib"))) - (build-stamp . "") - (catalogs ,@maybe-release-catalog - #f))))))) - (add-before 'configure 'chdir - (lambda _ - (chdir "racket/src"))) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda args - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append #$output "/share/racket/pkgs"))))))) - (home-page "https://racket-lang.org") - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (hidden-package + (package + (name "racket-minimal-bc-cgc") + (version %racket-version) + (source %racket-origin) + (inputs + (list + ;; common to all racket-minimal variants: + openssl + sqlite + bash-minimal ;; <- for `system` + ncurses ;; <- for #%terminal + ;; only for BC variants: + libffi)) + (native-inputs (list libtool)) ;; <- only for BC variants + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(cons* "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) + ;; Tests are in packages like racket-test-core and + ;; main-distribution-test that aren't part of the main + ;; distribution. + #:tests? #f + ;; Upstream recommends #:out-of-source?, and it does + ;; help with debugging, but it confuses `install-license-files`. + #:modules '((ice-9 match) + (ice-9 regex) + (guix build gnu-build-system) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((lib-search-dirs + . (#f #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib"))) + (build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (add-after 'install 'remove-pkgs-directory + ;; If the configured pkgs-dir exists, "pkgs.rktd" does not + ;; exist, and a lock file does not exist, commands like + ;; `raco pkg show` will try to create a lock file and fail + ;; due to the read-only store. + ;; Arguably this may be a bug in `pkg/private/lock`: + ;; see . + ;; As a workaround, remove the directory. + (lambda args + ;; rmdir because we want an error if it isn't empty + (rmdir (string-append #$output "/share/racket/pkgs"))))))) + (home-page "https://racket-lang.org") + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or ``bytecode'') implementation is not recommended for general use. It uses CGC (a ``Conservative Garbage Collector''), which was succeeded as default in PLT Scheme version 370 (which translates to 3.7 in the current versioning @@ -260,28 +263,24 @@ (define maybe-release-catalog Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may also be used for embedding applications without the annotations needed in C code to use the 3M garbage collector.") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list license:lgpl3+ license:asl2.0 license:expat)) - ;; Eventually, it may make sense for some vm packages to not be hidden, - ;; but this one is especially likely to remain hidden. - (properties `((hidden? . #t))))) + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat))))) (define-public racket-minimal-bc-3m - (hidden-package - (package - (inherit racket-minimal-bc-cgc) - (name "racket-minimal-bc-3m") - (native-inputs - (modify-inputs (package-native-inputs racket-minimal-bc-cgc) - (prepend racket-minimal-bc-cgc))) - (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) - ((#:configure-flags _ '()) - #~(cons "--enable-bconly" - #$(racket-vm-common-configure-flags))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") - (description "The Racket BC (``before Chez'' or ``bytecode'') + (package + (inherit racket-minimal-bc-cgc) + (name "racket-minimal-bc-3m") + (native-inputs + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (prepend racket-minimal-bc-cgc))) + (arguments + (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) + ((#:configure-flags _ '()) + #~(cons "--enable-bconly" + #$(racket-vm-common-configure-flags))))) + (synopsis "Minimal Racket with the BC [3M] runtime system") + (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written in C targeting architecture-independent bytecode, plus a JIT compiler on most platforms. Racket BC has a different C API and supports a slightly different @@ -290,9 +289,9 @@ (define-public racket-minimal-bc-3m This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'').") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list license:lgpl3+ license:asl2.0 license:expat))))) + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:lgpl3+ license:asl2.0 license:expat)))) (define-public racket-minimal (package -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:31:09 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:09 +0000 Received: from localhost ([127.0.0.1]:59352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8H-0008F0-DI for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:09 -0500 Received: from mail-vk1-f175.google.com ([209.85.221.175]:33642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7p-0008CG-D1 for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:41 -0500 Received: by mail-vk1-f175.google.com with SMTP id j12so4269128vkr.0 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:41 -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=xAGhlobUrv6R3QAGOokifFB+qZOGf5hUiwmZev5zvws=; b=TrA+/F4GkzQYXsuIYzsMIwjp6oLAEZvS2JJJ2FPsziUIw+C81SWezNWSzt0G9RWYsw oiJWgjKlde7LikRmqlXtgFKFTyZiXRhDoz7DmdoU44dtViWGInzVCkCDCLNsVT4oIoK1 wNJRood3a1kl8opStG8hhyt+BK1uiBSdHMxBH63urxO5moJD5QwDm05LeKbOwTVK3tUu QKIvMHwoH3RSuLvuqDPWD+rZNdZhjn4kFiQNQjf4Ei3fUppgsBkZitxdTaNovc/q7PRu zeoKVBFVNx65rZcbZhw8oSLvyXDavUrG/GqLD3UKnJctZeWOkmwrW9WDjx7mF1IMXEtw c4AA== 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=xAGhlobUrv6R3QAGOokifFB+qZOGf5hUiwmZev5zvws=; b=uMjF/fvE1AxUaE476S0uK2PMthjTwTbmMPbbH0LLn5V2nh0w04v+cd4cRO7RVDC8sT 7b0tJwjJhRQy+1iD2lnp0ZwJNyg7tJ58EjS4+hQGQi8s5p+E7aHmgnRejLCZiF6D8l5b 20N/gvw0rmImOK2FC2l7DbTcQWmB7RYP5Z/hQSw74i5uJSqZtalJ3o8X9jL+7f7WzPoG BiXSpPCEL4LSU0IcKwlY6DgBJuVkMfhG6zfooXy/xib6meexNqBoXQQezV3puVumS3WV P7MkabNI0J4ujK3TO1TdYRAkZ8yQvkhMcHtqDfUrOjhziRGVkLpV4Ea2Iwx+Vw07v6+e 37JQ== X-Gm-Message-State: AOAM531c9QnmZEUHBNG+7dii4bkqzI1MfPZF4j9I51nMSEIs/6DMPODU vmoyJeq1gaalipotZ1vEHM88lNdV4bgHT2UVir4= X-Google-Smtp-Source: ABdhPJwaEV07mAOBu+EALknf7B+/zXCDRdtVELZNAszt/jDXDBY2ufe+LqfJE462qm/SjYU4QjS9sQ== X-Received: by 2002:a05:6122:17a6:b0:32d:9ed1:eccd with SMTP id o38-20020a05612217a600b0032d9ed1eccdmr6772760vkf.9.1645997435912; Sun, 27 Feb 2022 13:30:35 -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 x21-20020ab03815000000b0034295887a5bsm1287242uav.2.2022.02.27.13.30.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:35 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 08/24] gnu: racket-minimal: Add "debug" output. Date: Sun, 27 Feb 2022 16:29:04 -0500 Message-Id: <20220227212920.2009000-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-minimal-bc-cgc)[outputs]: Add "debug". (racket-vm-common-configure-flags): Add "--disable-strip". --- gnu/packages/racket.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 3667f2df9d..011577cc2e 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -151,7 +151,8 @@ (define (racket-vm-common-configure-flags) (else '())) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" - #$(file-append bash-minimal "/bin/sh")))) + #$(file-append bash-minimal "/bin/sh")) + "--disable-strip")) (define (make-unpack-nanopass+stex) ;; Adapted from chez-scheme. @@ -190,6 +191,7 @@ (define-public racket-minimal-bc-cgc ;; only for BC variants: libffi)) (native-inputs (list libtool)) ;; <- only for BC variants + (outputs '("out" "debug")) (build-system gnu-build-system) (arguments (list -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:31:10 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:10 +0000 Received: from localhost ([127.0.0.1]:59354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8H-0008F3-NR for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:10 -0500 Received: from mail-ua1-f48.google.com ([209.85.222.48]:36505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7u-0008Ch-5o for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:46 -0500 Received: by mail-ua1-f48.google.com with SMTP id t25so5115051uaa.3 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:46 -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=PutN4x7jn6ODMb7ESFDxkatnHChHdH/PL2YoIfBEHJk=; b=YnS7e0SOeJ+O+8baFRg7g1XaHQmczNeyJWouiE4NittF04DjwcDIVYyNpUDVIbDJf6 vihqlJKD8WrpCQIRcc18SBSglxV+V9w4ybVqsXEKWKGkNcVfp60VSmgwF47xBjaUikUh jidJJSxXfvD6oiekp61rtsoniEk0hvUPI1odsJe45aEqWeiyJyUrHvpjVznetZOMrq+S Zt3Og4L3TUfjSu32rqAMcz1sK7urW9GeiDArTwI4l1nWDNlW4oTI3BMzgaciqGNqscC5 WfAeS6eFb52ndXGvLeqMlBpUThgNb9MTJCtvPiGuCL07L3W80a2xt7c3d60X1CuvFhZf 0ZBg== 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=PutN4x7jn6ODMb7ESFDxkatnHChHdH/PL2YoIfBEHJk=; b=lKedBHTbAYbh5fX2jARs7ZAlav+RctPDWuf5BbPCH0KpJWPT5DDl8MjzhchW9TI+FX Vqvmk769uG0EL/vvMDAxGBlVujEDBoDereJTzZfrJd4iLt1/nKgLODhPaZsS1iGbsNlH u/NjOnPeg9pjEJrxDcLLdpMSLRRXoLeQcP16XlhM1ojvS2fM3aDwST1/687hs36+qSba GAXzOBmCHW52A9U975pN3TydouZGtEFarSgGT/IQYAWmpfcS67d9JxNrS1OrItbQ1qAs 6dtz1FellGF/RvZktmxXgOcags//C/G+a9QN6ANEjYAWmLWrYeBeJCIYEDWvkZbyOPpc +P6w== X-Gm-Message-State: AOAM5326tnpS8arycmw7zIJUGVV/FHZ75R2YzzZa+8fZaB8vBxdLinJ+ xNNB34RaA8ClVZlNLNjM33VZmf3eT9HZ/rHzZrk= X-Google-Smtp-Source: ABdhPJxpd9rpWpB8fqmjJEe/qCv4q0E0FvT+JcN0hGnEIZrjg2AI8VVQjUElsmPIf6Et/mXSxxlJ8w== X-Received: by 2002:ab0:30d6:0:b0:341:eb4f:d2d2 with SMTP id c22-20020ab030d6000000b00341eb4fd2d2mr7172073uam.103.1645997440592; Sun, 27 Feb 2022 13:30:40 -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 b5-20020a1f1b05000000b0032597a7ba97sm1550366vkb.9.2022.02.27.13.30.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:40 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 09/24] gnu: configure-layer.rkt: Adjust indentation. Date: Sun, 27 Feb 2022 16:29:05 -0500 Message-Id: <20220227212920.2009000-10-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (configure-layer.rkt): Wrap 'command-line' in 'define-values' to reduce rightward drift. --- gnu/packages/racket.scm | 164 ++++++++++++++++++++-------------------- 1 file changed, 83 insertions(+), 81 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 011577cc2e..3877837d38 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -926,84 +926,86 @@ (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) (define extra-foreign-lib-search-dirs '()) - (command-line - #:once-each - [("--extra-foreign-lib-search-dirs") dir-list - "foreign library directories, as a list of strings in `read` syntax" - (set! extra-foreign-lib-search-dirs - (call-with-input-string dir-list read))] - #:args (parent-layer prefix) - (let* ([config - (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) - (hash-set* - config - main-key - (build-path-string prefix pth) - search-key - (list* #f - (hash-ref config - main-key - (build-path-string parent-layer pth)) - (filter values (hash-ref config search-key null)))))] - [config - (hash-update config - 'lib-search-dirs - (lambda (dirs) - ;; add after other layers, but before older - ;; foreign lib search directories - (define-values [rkt old-foreign-dirs] - (partition (lambda (pth) - (or (not pth) - (regexp-match? rx:racket pth))) - dirs)) - (append rkt - extra-foreign-lib-search-dirs - old-foreign-dirs)))] - [config - (hash-set* config - 'apps-dir - (build-path-string prefix "share/applications") - 'absolute-installation? #t - ;; Let Guix coexist with other installation - ;; methods without clobbering user-specific packages. - ;; This could be set in various places, but doing - ;; it here is convienient, at least until we support - ;; cross-compilation. - 'installation-name - (string-append (version) - "-guix" - (match (system-type 'gc) - ['cgc "-cgc"] - ;; workaround Guile reader/printer: - ['|3m| "-bc"] - [_ ""])))] - [bin-dir - (hash-ref config 'bin-dir)] - [config - (hash-set* config - 'config-tethered-apps-dir (hash-ref config 'apps-dir) - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) - (make-parent-directory* new-config-pth) - (call-with-output-file* - new-config-pth - (lambda (out) - (pretty-write config out)))))))) + (define-values [parent-layer prefix] + (command-line + #:once-each + [("--extra-foreign-lib-search-dirs") dir-list + "foreign library directories, as a list of strings in `read` syntax" + (set! extra-foreign-lib-search-dirs + (call-with-input-string dir-list read))] + #:args (parent-layer prefix) + (values parent-layer prefix))) + (let* ([config + (for/fold + ([config (file->value (build-path parent-layer + config-file-pth))]) + ([spec (in-list + '((lib-dir lib-search-dirs "lib/racket") + (share-dir share-search-dirs "share/racket") + (links-file + links-search-files + "share/racket/links.rktd") + (pkgs-dir pkgs-search-dirs "share/racket/pkgs") + (bin-dir bin-search-dirs "bin") + (man-dir man-search-dirs "share/man") + (doc-dir doc-search-dirs "share/doc/racket") + (include-dir + include-search-dirs + "include/racket")))]) + (match-define (list main-key search-key pth) spec) + (hash-set* + config + main-key + (build-path-string prefix pth) + search-key + (list* #f + (hash-ref config + main-key + (build-path-string parent-layer pth)) + (filter values (hash-ref config search-key null)))))] + [config + (hash-update config + 'lib-search-dirs + (lambda (dirs) + ;; add after other layers, but before older + ;; foreign lib search directories + (define-values [rkt old-foreign-dirs] + (partition (lambda (pth) + (or (not pth) + (regexp-match? rx:racket pth))) + dirs)) + (append rkt + extra-foreign-lib-search-dirs + old-foreign-dirs)))] + [config + (hash-set* config + 'apps-dir + (build-path-string prefix "share/applications") + 'absolute-installation? #t + ;; Let Guix coexist with other installation + ;; methods without clobbering user-specific packages. + ;; This could be set in various places, but doing + ;; it here is convienient, at least until we support + ;; cross-compilation. + 'installation-name + (string-append (version) + "-guix" + (match (system-type 'gc) + ['cgc "-cgc"] + ;; workaround Guile reader/printer: + ['|3m| "-bc"] + [_ ""])))] + [bin-dir + (hash-ref config 'bin-dir)] + [config + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [new-config-pth + (build-path prefix config-file-pth)]) + (make-parent-directory* new-config-pth) + (call-with-output-file* + new-config-pth + (lambda (out) + (pretty-write config out))))))) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:31:12 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:13 +0000 Received: from localhost ([127.0.0.1]:59356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8I-0008FD-DS for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:12 -0500 Received: from mail-vk1-f172.google.com ([209.85.221.172]:43926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR7z-0008D4-4s for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:53 -0500 Received: by mail-vk1-f172.google.com with SMTP id n10so4228496vkm.10 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:51 -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=s6PbiGG76msk/ngvjWkLShHaLkGIf3xO1MahtysX1XY=; b=g6e2CUuJz7VAZWf9+pg0AK/DD3sCS1KqvI+cja928NPqKp4s8Pd2HIlPgA/T/kdX6K VX06qDOU4CYxxxrh6YypP6+hsAXPrX8wls25g9X+XRnXYiPdRysQ+ILwGiA+tib8X70U +Ye2CHwrug0bz/laGSJBFToe+LRdlrSSI3/M2uz+LCy3iPXDGzDyeF70BuGH7Fc8w+Cg 25aCPNWAb0e9gRPn+d+vWgLfzHdZS/f6WTCLSoAap9tI+/viuS0jZ2d/4Qf3aBjJLERr 1zrR87BhbTsQ3yQkUNr8nZ07qWrihE751llKCfyAyJePKdj6xDCJYV+mvvl4VWsd8S8a KsCQ== 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=s6PbiGG76msk/ngvjWkLShHaLkGIf3xO1MahtysX1XY=; b=fZJ3IMvSazLUwWJfhpdYzlFF9KePSJPamNll7ubXOHs5PHnlsdf/PQZV/+qyCffN8T cegQoSSxw53PfMdsklUtZzMWid5XnD3sRJYzItMnzkAFIB+ZfEe0CL0lRa/9B9DBYPtF ar7gtp+QZh0i2wJ4lg/P5MwbxVaeyB/1WtvBrRFaqYVabzlSoixMivHxgoq86+/B2ED4 iYFYnwiDv+xRjAtXSQDpVtyn2Sk5bg5cDQNhWPIbxYjBEMbtI9INDvef39Yy0UWtmVOq +8ezrmbj3F6Pm1KMBsmqKsL599v17zlga4Ck+LgCkF6iR3EfeDy+DfFwGhSfZuyCGEH/ HUdw== X-Gm-Message-State: AOAM531Tc/K1BTURKrYQj5T+vV+Sw/Cj/sZksYagVFuvl+uYJD7ujPYC 3uWdEzCZE+eZ8T2eDmud1OI8BO7PFkiQ4w5QwS0= X-Google-Smtp-Source: ABdhPJxNqdkRwK8iHtdhqE8bAUzh1YSVPxPu3JOOOn4aRooTOV4xPtt22CZZjCTKSLZ6AAcx9JKLGQ== X-Received: by 2002:a05:6122:88a:b0:332:6860:7b1f with SMTP id 10-20020a056122088a00b0033268607b1fmr6851424vkf.25.1645997445075; Sun, 27 Feb 2022 13:30:45 -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 d68-20020a1fcd47000000b0032db22e6d18sm1360352vkg.50.2022.02.27.13.30.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:44 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 10/24] gnu: racket-minimal: Separate from the Racket VM. Date: Sun, 27 Feb 2022 16:29:06 -0500 Message-Id: <20220227212920.2009000-11-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) For consistency with other Racket distributions, 'racket-minimal' should have the "racket-lib" Racket package installed: see . Happily, this gives us a clean boundary between the core Racket VM and compiler, with all of the bootstrapping involved, and building Racket packages and installation layers, which can be handled in a nice, uniform way and eventually turned into a 'racket-build-system'. Building the VM layer as an "in-place" installation should help us use it with other Racket tools. * gnu/packages/racket.scm (racket-vm-common-configure-flags): Add "--enable-origtree". Adapt "--enable-racket=" for "opt/racket-vm/" prefix. (racket-minimal-bc-cgc): Rename to ... (racket-vm-cgc): ... this new variable. [inputs]: Move 'openssl' and 'sqlite' to new 'racket-minimal'. [arguments]<#:strip-directories>: Use "opt/racket-vm/" prefix. <#:phases>: Wrap 'configure', 'patch-shebangs', 'validate-runpath', 'make-dynamic-linker-cache', and 'patch-dot-desktop-files' to use "opt/racket-vm/" prefix. Adapt 'initialize-config.rktd' for removal of 'openssl' and 'sqlite'. [description]: Tweak. (racket-minimal-bc-3m): Rename to ... (racket-vm-bc): ... this new variable. [synopsis, description]: Tweak. (racket-vm-cs): New variable, adapted from the old 'racket-minimal'. (chez-scheme-for-racket-bootstrap-bootfiles)[arguments]<#:phhases>: Adapt to the "opt/racket-vm/" prefix. (racket-minimal): Rewrite like 'racket' using 'racket-vm-cs'. (racket): Inherit from 'racket-minimal'. [inputs]: Add 'racket-vm-cs'. Move "racket-lib" and "base" to 'racket-minimal'. [arguments]<#:make-flags, #:configure-flags>: Override from 'racket-minimal'. (configure-layer.rkt): Adapt to support in-place VM build with possible intermediate layer. --- gnu/packages/racket.scm | 599 ++++++++++++++++++++++++++-------------- 1 file changed, 386 insertions(+), 213 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 3877837d38..d3d3eb2bbd 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -54,7 +54,91 @@ (define-module (gnu packages racket) ;; Commentary: ;; -;; Here's how bootstrapping minimal Racket works: +;; Anatomy of Racket: +;; ------------------ +;; +;; The main Racket Git repository () is +;; organized broadly like this: +;; +;; . +;; ├── Makefile +;; ├── pkgs/ +;; └── racket/ +;; ├── collects/ +;; └── src/ +;; ├── configure +;; ├── Makefile.in +;; ├── bc/ +;; ├── cs/ +;; ├── ChezScheme/ +;; └── ... +;; +;; The 'racket/src/' directory contains the source of the runtime system, core +;; compiler, and primitives for the major Racket implementations: this layer +;; is called the ``Racket VM''. It is basically a normal autotools +;; project. (Even when Racket VM implementations use components implemented in +;; Racket, they are compiled in special modes to produce VM primitives.) +;; (There are or have been experimental Racket VM implementations elsewhere, +;; e.g. .) +;; +;; The 'racket/collects/' directory contains ``built in'' Racket libraries +;; that are not part of any package, including the implementation of +;; 'racket/base': in particular, it must contain enough to implement `raco pkg +;; install'. It is theoretically possible to use the Racket VM layer without +;; the main collections, but it is not stable or useful. +;; +;; The 'pkgs/' directory contains Racket packages that are especially closely +;; tied to the implementation of the Racket VM, including 'compiler-lib', +;; 'racket-doc', and 'racket-test'. Some of these packages depend on Racket +;; packages that are developed in other Git repositories, predominantly but +;; not exclusively under the 'racket' GitHub organization. Conversely, not all +;; of the packages developed in the main Git repository are part of the main +;; Racket distribution. (Additionally, components of the Racket VM that are +;; implemented in Racket can be installed as packages, mostly for ease of +;; development.) +;; +;; The top-level 'Makefile' is more like a directory of scripts: it has +;; convienience targets for developing Racket, and it cooperates with the +;; 'distro-build' package to assemble custom Racket distributions. 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. +;; +;; A ''minimal Racket'' installation includes two packages: 'base', which is a +;; sort of bridge between the current ``built-in'' collections and the package +;; system's model of dependencies, and 'racket-lib', which, for installations +;; that can not rely on a system package manager, pulls in the SQLite and +;; OpenSSL shared libraries as platform-specific dependencies for use by the +;; ``built-in'' collections. +;; +;; The main Racket distribution consists of installing the 'main-distribution' +;; package and all of its dependencies. +;; +;; The default mode when building Racket (or installing it with the released +;; installers) is an ``in-place build'', which produces a self-contained, +;; relocatable, roughly FHS-like directory. (Racket also supports +;; ``Unix-style'' installations, which rearrange the parts of an in-place +;; build into Racket-specific subdirectories and generally tries to work for +;; installation into an FHS-based system.) Certain tools, e.g. 'distro-build' +;; and 'raco cross', are able to work with an in-place Racket build. +;; +;; This file defines the packages 'racket-vm-cgc', 'racket-vm-bc', and +;; 'racket-vm-cs'. All three are in-place builds of 'racket/src/' and +;; 'racket/collects/' and are installed to 'opt/racket-vm/' in the store +;; output. The function 'racket-vm-for-system' returns the recomended Racket +;; VM package for a given system. +;; +;; The file 'racket.scm' builds on these packages to define 'racket-minimal' +;; and 'racket' packages. These use Racket's support for ``layered +;; installations'', which allow an immutable base layer to be extended with +;; additional packages. They use the layer configuration directly provide +;; ready-to-install FHS-like trees, rather than relying on the built in +;; ``Unix-style install'' mechanism. +;; +;; Bootstrapping Racket: +;; --------------------- +;; +;; Here's how bootstrapping Racket works: ;; ;; - Racket BC [CGC] can be built with only a C compiler (except for ;; one caveat discussed below). @@ -72,6 +156,10 @@ (define-module (gnu packages racket) ;; ;; So, we build CGC to build 3M to build bootfiles and CS. ;; +;; (Note: since the CGC variant is basically only for bootstrapping, we +;; often use "BC" to mean "3M", consistent with `(banner)` and the +;; suffixes used on executables when more than one variant co-exists.) +;; ;; 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 @@ -145,14 +233,15 @@ (define (racket-vm-common-configure-flags) '())) ,@(cond ((false-if-exception - (search-input-file %build-inputs "/bin/racket")) + (search-input-file %build-inputs "/opt/racket-vm/bin/racket")) => (lambda (racket) (list (string-append "--enable-racket=" racket)))) (else '())) ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" #$(file-append bash-minimal "/bin/sh")) - "--disable-strip")) + "--disable-strip" + "--enable-origtree")) (define (make-unpack-nanopass+stex) ;; Adapted from chez-scheme. @@ -173,31 +262,25 @@ (define (make-unpack-nanopass+stex) (display "# to placate ../configure"))))) -(define-public racket-minimal-bc-cgc +(define-public racket-vm-cgc ;; Eventually, it may make sense for some vm packages to not be hidden, ;; but this one is especially likely to remain hidden. (hidden-package (package - (name "racket-minimal-bc-cgc") + (name "racket-vm-cgc") (version %racket-version) (source %racket-origin) - (inputs - (list - ;; common to all racket-minimal variants: - openssl - sqlite - bash-minimal ;; <- for `system` - ncurses ;; <- for #%terminal - ;; only for BC variants: - libffi)) + (inputs (list ncurses ;; <- common to all variants (for #%terminal) + bash-minimal ;; <- common to all variants (for `system`) + libffi)) ;; <- only for BC variants (native-inputs (list libtool)) ;; <- only for BC variants (outputs '("out" "debug")) (build-system gnu-build-system) (arguments (list #:configure-flags - #~(cons* "--enable-cgcdefault" - #$(racket-vm-common-configure-flags)) + #~(cons "--enable-cgcdefault" + #$(racket-vm-common-configure-flags)) ;; Tests are in packages like racket-test-core and ;; main-distribution-test that aren't part of the main ;; distribution. @@ -208,51 +291,72 @@ (define-public racket-minimal-bc-cgc (ice-9 regex) (guix build gnu-build-system) (guix build utils)) + #:strip-directories #~'("opt/racket-vm/bin" + "opt/racket-vm/lib") #:phases - #~(modify-phases %standard-phases - (add-before 'configure 'initialize-config.rktd - (lambda* (#:key inputs #:allow-other-keys) - (define (write-racket-hash alist) - ;; inside must use dotted pair notation - (display "#hash(") - (for-each (match-lambda - ((k . v) - (format #t "(~s . ~s)" k v))) - alist) - (display ")\n")) - (define maybe-release-catalog - (let ((v #$(package-version this-package))) - (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" - v) - `(,(string-append - "https://download.racket-lang.org/releases/" - v - "/catalog/")) - '()))) - (mkdir-p "racket/etc") - (with-output-to-file "racket/etc/config.rktd" - (lambda () - (write-racket-hash - `((lib-search-dirs - . (#f #$(file-append (this-package-input "openssl") "/lib") - #$(file-append (this-package-input "sqlite") "/lib"))) - (build-stamp . "") - (catalogs ,@maybe-release-catalog - #f))))))) - (add-before 'configure 'chdir - (lambda _ - (chdir "racket/src"))) - (add-after 'install 'remove-pkgs-directory - ;; If the configured pkgs-dir exists, "pkgs.rktd" does not - ;; exist, and a lock file does not exist, commands like - ;; `raco pkg show` will try to create a lock file and fail - ;; due to the read-only store. - ;; Arguably this may be a bug in `pkg/private/lock`: - ;; see . - ;; As a workaround, remove the directory. - (lambda args - ;; rmdir because we want an error if it isn't empty - (rmdir (string-append #$output "/share/racket/pkgs"))))))) + #~(let () + (define* ((wrap-racket-vm-outputs phase) . args) + (apply + phase + (let loop ((args args)) + (match args + ((#:outputs outputs . args) + `(#:outputs + ,(let loop ((outputs outputs)) + (match outputs + ((("out" . out) . outputs) + `(("out" . ,(string-append out "/opt/racket-vm/")) + ,@outputs)) + ((other . outputs) + (cons other (loop outputs))))) + ,@args)) + ((arg . args) + (cons arg (loop args))))))) + (modify-phases %standard-phases + (add-before 'configure 'initialize-config.rktd + (lambda* (#:key inputs #:allow-other-keys) + (define (write-racket-hash alist) + ;; inside must use dotted pair notation + (display "#hash(") + (for-each (match-lambda + ((k . v) + (format #t "(~s . ~s)" k v))) + alist) + (display ")\n")) + (define maybe-release-catalog + (let ((v #$(package-version this-package))) + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" + v) + `(,(string-append + "https://download.racket-lang.org/releases/" + v + "/catalog/")) + '()))) + (mkdir-p "racket/etc") + (with-output-to-file "racket/etc/config.rktd" + (lambda () + (write-racket-hash + `((build-stamp . "") + (catalogs ,@maybe-release-catalog + #f))))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "racket/src"))) + (replace 'configure + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'configure))) + (replace 'patch-shebangs + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-shebangs))) + (replace 'validate-runpath + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'validate-runpath))) + (replace 'make-dynamic-linker-cache + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) + (replace 'patch-dot-desktop-files + (wrap-racket-vm-outputs + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) (home-page "https://racket-lang.org") (synopsis "Old Racket implementation used for bootstrapping") (description "This variant of the Racket BC (``before Chez'' or @@ -262,32 +366,33 @@ (define maybe-release-catalog scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the Racket CS implementation. -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may +Racket CGC is primarily used for bootstrapping Racket BC [3M]. It may also be used for embedding applications without the annotations needed in C code to use the 3M garbage collector.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) -(define-public racket-minimal-bc-3m +(define-public racket-vm-bc (package - (inherit racket-minimal-bc-cgc) - (name "racket-minimal-bc-3m") + (inherit racket-vm-cgc) + (name "racket-vm-bc") (native-inputs - (modify-inputs (package-native-inputs racket-minimal-bc-cgc) - (prepend racket-minimal-bc-cgc))) + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) + (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:configure-flags _ '()) #~(cons "--enable-bconly" #$(racket-vm-common-configure-flags))))) - (synopsis "Minimal Racket with the BC [3M] runtime system") + (synopsis "Racket BC [3M] implementation") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written in C targeting architecture-independent bytecode, plus a JIT compiler on most platforms. Racket BC has a different C API and supports a slightly different set of architectures than the current default runtime system, Racket CS (based -on ``Chez Scheme''). +on ``Chez Scheme''). It is the recommended implementation for architectures +that Racket CS doesn't support. This package is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'').") @@ -295,23 +400,23 @@ (define-public racket-minimal-bc-3m ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat)))) -(define-public racket-minimal +(define-public racket-vm-cs (package - (inherit racket-minimal-bc-3m) - (name "racket-minimal") + (inherit racket-vm-bc) + (name "racket-vm-cs") (inputs - (modify-inputs (package-inputs racket-minimal-bc-cgc) + (modify-inputs (package-inputs racket-vm-cgc) (prepend zlib lz4) (delete "libffi"))) (native-inputs - (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") (prepend chez-scheme-for-racket-bootstrap-bootfiles - racket-minimal-bc-3m))) + racket-vm-bc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) - ((#:phases bc-phases) - #~(modify-phases #$bc-phases + (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" @@ -328,17 +433,14 @@ (define-public racket-minimal "--enable-libz" "--enable-lz4" #$(racket-vm-common-configure-flags))))) - (synopsis "Racket without bundled packages such as DrRacket") - (description - "Racket is a general-purpose programming language in the Scheme family, -with a large set of libraries and a compiler based on Chez Scheme. Racket is -also a platform for language-oriented programming, from small domain-specific -languages to complete language implementations. + (synopsis "Racket CS implementation") + (description "The Racket CS implementation, which uses ``Chez Scheme'' as +its core compiler and runtime system, has been the default Racket VM +implemetation since Racket 8.0. It performs better than the Racket BC +implementation for most programs. -The ``minimal Racket'' distribution includes just enough of Racket for you to -use @command{raco pkg} to install more. Bundled packages, such as the -DrRacket IDE, are not included.") - (properties `()) +Using the Racket VM packages directly is not recommended: instead, install the +@code{racket-minimal} or @code{racket} packages.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) @@ -353,7 +455,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; When updating, remember to also update %racket-version in racket.scm. (source %racket-origin) (inputs `()) - (native-inputs (list racket-minimal-bc-3m)) + (native-inputs (list racket-vm-bc)) (build-system copy-build-system) ;; TODO: cross compilation (arguments @@ -371,7 +473,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) (invoke (search-input-file (or native-inputs inputs) - "/bin/racket") + "/opt/racket-vm/bin/racket") "rktboot/main.rkt")))))) (home-page "https://github.com/racket/ChezScheme") ;; ^ This is downstream of https://github.com/racket/racket, @@ -452,10 +554,116 @@ (define (simple-racket-origin repo hash specs) %racket-version))) specs)) +(define-public racket-minimal + (package + (name "racket-minimal") + (version %racket-version) + (source #f) + ;; For cross-compilation, Matthew Flatt recommends reusing + ;; as much of `raco cross` as possible. So, put that off until + ;; we have a build system for Racket packages. + (inputs + (list openssl + sqlite + racket-vm-cs ;; TODO (racket-vm-for-system) + (racket-packages-origin + "base" %racket-origin + '(("base" "pkgs/base") + ("racket-lib" "pkgs/racket-lib"))))) + (build-system gnu-build-system) + (arguments + ;; Here and for the `racket` package, we're using #:configure-flags + ;; to pass flags for `configure-layer.rkt` and #:make-flags + ;; to pass arguments for `raco pkg install`. + (list + #:configure-flags + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format + #f "~s" + (list #$(file-append (this-package-input "openssl") "/lib") + #$(file-append (this-package-input "sqlite") "/lib")))) + #:make-flags #~`("racket-lib") + #:tests? #f ;; packaged separately + #:modules '((guix build gnu-build-system) + (guix build utils) + (guix build union) + (ice-9 match)) + #:imported-modules `((guix build union) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (delete 'unpack) + (replace 'configure + (lambda* (#:key inputs configure-flags #:allow-other-keys) + (let* ((vm-dir (search-input-directory inputs "opt/racket-vm")) + (racket (string-append vm-dir "/bin/racket"))) + (apply invoke + racket + #$configure-layer.rkt + `(,@(cond + ((false-if-exception + (search-input-file + inputs "etc/racket/config.rktd")) + => (lambda (file) + `("--parent" + ,(dirname (dirname (dirname file)))))) + (else + '())) + ,@configure-flags + ,vm-dir + ,#$output)) + (invoke racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" "setup" + "--no-user")))) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + ;; We use "share/racket/pkgs" for sources to distinguish them + ;; from the "lib/racket/pkgs" of a potential parent layer. + (union-build (string-append #$output "/lib/racket/pkgs") + (search-path-as-list '("share/racket/pkgs") + (map cdr inputs)) + #:create-all-directories? #t))) + (replace 'install + (lambda* (#:key inputs make-flags #:allow-other-keys) + (let ((racket + (search-input-file inputs "/opt/racket-vm/bin/racket"))) + (unless (null? make-flags) + (invoke racket + "-l-" + "pkg/dirs-catalog" + "--link" + "local-catalog" + (string-append #$output "/lib/racket/pkgs")) + (apply invoke + racket + "--config" (string-append #$output "/etc/racket") + "-l" "raco" + "pkg" "install" + "--installation" + "--auto" + "--catalog" "local-catalog" + make-flags)))))))) + (home-page "https://racket-lang.org") + (synopsis "Racket without bundled packages such as DrRacket") + (description + "Racket is a general-purpose programming language in the Scheme family, +with a large set of libraries and a compiler based on Chez Scheme. Racket is +also a platform for language-oriented programming, from small domain-specific +languages to complete language implementations. + +The ``minimal Racket'' distribution includes just enough of Racket for you to +use @command{raco pkg} to install more. Bundled packages, such as the +DrRacket IDE, are not included.") + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) + (define-public racket (package + (inherit racket-minimal) (name "racket") - (version %racket-version) (source #f) (inputs (list @@ -474,6 +682,7 @@ (define-public racket unixodbc libedit ;; TODO reconsider in light of expeditor and readline-gpl racket-minimal ;; <-- TODO non-tethered layer + racket-vm-cs ;; TODO (racket-vm-for-system) (simple-racket-origin "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") '("2d" "2d-doc" "2d-lib")) @@ -482,9 +691,7 @@ (define-public racket '(("algol60" "."))) (racket-packages-origin "racket" %racket-origin - '(("base" "pkgs/base") ;; FIXME belongs in racket-minimal - ("racket-lib" "pkgs/racket-lib") ;; FIXME belongs in racket-minimal - ("at-exp-lib" "pkgs/at-exp-lib") + '(("at-exp-lib" "pkgs/at-exp-lib") ("compiler" "pkgs/compiler") ("compiler-lib" "pkgs/compiler-lib") ("net" "pkgs/net") @@ -808,91 +1015,39 @@ (define-public racket '("xrepl" "xrepl-doc" "xrepl-lib")))) (build-system gnu-build-system) (arguments - ;; We're using #:configure-flags to pass flags for - ;; `configure-layer.rkt` and #:make-flags to pass arguments for - ;; `raco pkg install`. - (list - #:configure-flags - #~`("--extra-foreign-lib-search-dirs" - ,(format #f "~s" - '(#$@(map (lambda (name) - (cond - ((this-package-input name) - => (cut file-append <> "/lib")) - (else - (raise-exception - (make-exception - (make-assertion-failure) - (make-exception-with-message - "missing input to the 'racket' package") - (make-exception-with-irritants - (list name))))))) - '("cairo" - "fontconfig-minimal" ;; aka fontconfig - "glib" - "glu" - "gmp" - "gtk+" - "libjpeg-turbo" - "libpng" - "libx11" - "mesa" - "mpfr" - "pango" - "unixodbc" - "libedit"))))) - #:make-flags #~`("main-distribution") - #:tests? #f ;; packaged separately - #:modules '((guix build gnu-build-system) - (guix build utils) - (guix build union) - (ice-9 match)) - #:imported-modules `((guix build union) - ,@%gnu-build-system-modules) - #:phases - #~(modify-phases %standard-phases - (delete 'unpack) - (replace 'configure - (lambda* (#:key inputs configure-flags #:allow-other-keys) - (let* ((racket (search-input-file inputs "bin/racket"))) - (apply invoke - racket - #$configure-layer.rkt - `(,@configure-flags - ,(dirname (dirname racket)) - ,#$output)) - (invoke racket - "--config" (string-append #$output "/etc/racket") - "-l" "raco" "setup" - "--no-user")))) - (replace 'build - (lambda* (#:key inputs #:allow-other-keys) - ;; We use "share/racket/pkgs" for sources to distinguish them - ;; from the "lib/racket/pkgs" of a potential parent layer. - (union-build (string-append #$output "/lib/racket/pkgs") - (search-path-as-list '("share/racket/pkgs") - (map cdr inputs)) - #:create-all-directories? #t))) - (replace 'install - (lambda* (#:key inputs make-flags #:allow-other-keys) - (let ((racket (search-input-file inputs "/bin/racket"))) - (unless (null? make-flags) - (invoke racket - "-l-" - "pkg/dirs-catalog" - "--link" - "local-catalog" - (string-append #$output "/lib/racket/pkgs")) - (apply invoke - racket - "--config" (string-append #$output "/etc/racket") - "-l" "raco" - "pkg" "install" - "--installation" - "--auto" - "--catalog" "local-catalog" - make-flags)))))))) - (home-page "https://racket-lang.org") + (substitute-keyword-arguments (package-arguments racket-minimal) + ((#:make-flags _ '()) + #~`("main-distribution")) + ((#:configure-flags _ '()) + #~`("--tethered" + "--extra-foreign-lib-search-dirs" + ,(format #f "~s" + '(#$@(map (lambda (name) + (cond + ((this-package-input name) + => (cut file-append <> "/lib")) + (else + (raise-exception + (make-exception + (make-assertion-failure) + (make-exception-with-message + "missing input to the 'racket' package") + (make-exception-with-irritants + (list name))))))) + '("cairo" + "fontconfig-minimal" ;; aka fontconfig + "glib" + "glu" + "gmp" + "gtk+" + "libjpeg-turbo" + "libpng" + "libx11" + "mesa" + "mpfr" + "pango" + "unixodbc" + "libedit")))))))) (synopsis "Programmable programming language in the Scheme family") (description "Racket is a general-purpose programming language in the Scheme family, @@ -902,10 +1057,7 @@ (define-public racket The main Racket distribution comes with many bundled packages, including the DrRacket IDE, libraries for GUI and web programming, and implementations of -languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.") - ;; https://download.racket-lang.org/license.html - ;; The LGPL components are only used by Racket BC. - (license (list license:asl2.0 license:expat)))) +languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog."))) (define configure-layer.rkt (scheme-file @@ -918,41 +1070,53 @@ (define configure-layer.rkt racket/port racket/list racket/pretty) - (define config-file-pth - "etc/racket/config.rktd") (define (build-path-string . args) (path->string (apply build-path args))) (define rx:racket ;; Guile's reader doesn't support #rx"racket" (regexp "racket")) + (define tethered? #f) + (define parent #f) (define extra-foreign-lib-search-dirs '()) - (define-values [parent-layer prefix] + (define-values [vm-dir prefix] (command-line #:once-each + [("--tethered") "create a tethered layer" + (set! tethered? #t)] + [("--parent") dir "path of parent layer, if any" + (set! parent dir)] [("--extra-foreign-lib-search-dirs") dir-list "foreign library directories, as a list of strings in `read` syntax" (set! extra-foreign-lib-search-dirs (call-with-input-string dir-list read))] - #:args (parent-layer prefix) - (values parent-layer prefix))) + #:args (vm-dir prefix) + (values vm-dir prefix))) (let* ([config (for/fold - ([config (file->value (build-path parent-layer - config-file-pth))]) - ([spec (in-list - '((lib-dir lib-search-dirs "lib/racket") - (share-dir share-search-dirs "share/racket") - (links-file - links-search-files - "share/racket/links.rktd") - (pkgs-dir pkgs-search-dirs "share/racket/pkgs") - (bin-dir bin-search-dirs "bin") - (man-dir man-search-dirs "share/man") - (doc-dir doc-search-dirs "share/doc/racket") - (include-dir - include-search-dirs - "include/racket")))]) - (match-define (list main-key search-key pth) spec) + ([config (file->value + (if parent + (build-path parent "etc/racket/config.rktd") + (build-path vm-dir "etc/config.rktd")))]) + ([spec + (in-list + '((lib-dir lib-search-dirs "lib/racket" "lib") + (share-dir share-search-dirs "share/racket" "share") + (links-file links-search-files + "lib/racket/links.rktd" + "share/links.rktd") + (pkgs-dir pkgs-search-dirs "lib/racket/pkgs" "share/pkgs") + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(bin-dir bin-search-dirs "bin" "bin") + (bin-dir bin-search-dirs + "lib/racket/bogus-untethered-bin" + "bin") + (man-dir man-search-dirs "share/man" "share/man") + (doc-dir doc-search-dirs "share/doc/racket" "doc") + (include-dir include-search-dirs + "include/racket" + "include")))]) + (match-define (list main-key search-key pth vm-pth) spec) (hash-set* config main-key @@ -961,7 +1125,10 @@ (define-values [parent-layer prefix] (list* #f (hash-ref config main-key - (build-path-string parent-layer pth)) + (lambda () + (if parent + (build-path-string parent pth) + (build-path-string vm-dir vm-pth)))) (filter values (hash-ref config search-key null)))))] [config (hash-update config @@ -995,15 +1162,21 @@ (define-values [rkt old-foreign-dirs] ;; workaround Guile reader/printer: ['|3m| "-bc"] [_ ""])))] - [bin-dir - (hash-ref config 'bin-dir)] [config - (hash-set* config - 'config-tethered-apps-dir (hash-ref config 'apps-dir) - 'config-tethered-console-bin-dir bin-dir - 'config-tethered-gui-bin-dir bin-dir)] - [new-config-pth - (build-path prefix config-file-pth)]) + (cond + [tethered? + ;; Partial workaround for: + ;; https://github.com/racket/racket/issues/4133 + #;(define bin-dir (hash-ref config 'bin-dir)) + (define bin-dir (build-path-string prefix "bin")) + (hash-set* config + 'config-tethered-apps-dir (hash-ref config 'apps-dir) + 'config-tethered-console-bin-dir bin-dir + 'config-tethered-gui-bin-dir bin-dir)] + [else + config])]) + (define new-config-pth + (build-path prefix "etc/racket/config.rktd")) (make-parent-directory* new-config-pth) (call-with-output-file* new-config-pth -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:31:13 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:13 +0000 Received: from localhost ([127.0.0.1]:59359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8K-0008FR-P9 for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:13 -0500 Received: from mail-vs1-f52.google.com ([209.85.217.52]:44631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR83-0008DF-8z for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:30:55 -0500 Received: by mail-vs1-f52.google.com with SMTP id y4so11045819vsd.11 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:55 -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=4c+LihuPfHfcBGJwbquveRPMTwT9e1jfOQoAXBdkyyc=; b=as+jI3gSWTEAhjn9xsiozUMP4Rm3EciQNWAd60gp33rH67VBpPemKplb0RtFI2felc W5hIG+xMifpAC0mtCikVs0ch3giyai+dkOBTOUA8BPNo05KipwQgmTf1jzLOpqbBN1vS +Pd9XHZlwREagPFeXZYCX0Tk1ikPB97pRRu/90EIF+ysKVGFZavhBf1cQRQygKN/BMru I7Dz5kqlnYo7AbYkPj+7OD0rXIZkHkGzUXOGa1AYqX5JZFPSIJijujQt7tw8bqJ+0yVH IqzRbvBSu3LRcZaPtdGlZwtkgyCzO0jFe1A2/KzwPCOCzW2cn7L5sfrPl+fvMheWsIeo a4ng== 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=4c+LihuPfHfcBGJwbquveRPMTwT9e1jfOQoAXBdkyyc=; b=e0TdPnXYi+vy6eVuIkN3euPQ/zgmoI//lDYoIMgsCvaZcaZLtDNH+/4wb6iTK4BhJy TfVlZI8JW11sfiAtMLT6FNr/TGVPxgJdROcPrDlC/fuX1RNpOmD4aMxCMz1uumXGIYjC g4bNhKxrrknBsY1g0QJpElZq7HJyi93eIW6Zu8DYtnBBzQdy8+JX72BGL1Y5BXl/sBdt VZkfNJWO3EzinEDr96bwZ/kxxaLuTtu+/TKiJJ5ZUMmh0P3om/5ByaEtZDR3crAGnJus QUSgl7lpTb85f1z19UJ+loFxedkLjYGzXQkJecE2Fan3fTnW0PyKK6pLKpvZR01NXW6i ghUg== X-Gm-Message-State: AOAM530h+MU2Kvbwh+FEsk+PVdSjY0NsMKxSe0GlBRWvASyUcn762gGx cbivl5GWEMHb92xO+oyCJ9gqQwAakrggLCupM5c= X-Google-Smtp-Source: ABdhPJxVXBU404QNZtJTVeGmFwxouJLLWJm/KQQjEQKY9qGaPpi5N9pdelw+vAVrBsZ6p2MU5CBBMg== X-Received: by 2002:a05:6102:5494:b0:31b:7af4:1d5a with SMTP id bk20-20020a056102549400b0031b7af41d5amr7097212vsb.40.1645997449572; Sun, 27 Feb 2022 13:30:49 -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 e21-20020ab031d5000000b0033ffa5785cfsm1315901uan.16.2022.02.27.13.30.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:49 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 11/24] gnu: racket: Move Chez bootfiles to (gnu packages chez). Date: Sun, 27 Feb 2022 16:29:07 -0500 Message-Id: <20220227212920.2009000-12-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (chez-scheme-for-racket-bootstrap-bootfiles): Move to ... * gnu/packages/chez.scm (chez-scheme-for-racket-bootstrap-bootfiles): ... this new variable. [source]: Avoid problematic cycle with "racket.scm". [arguments]<#:phases>: Likewise. --- gnu/packages/chez.scm | 62 +++++++++++++++++++++++++++++++++++++++++ gnu/packages/racket.scm | 52 ---------------------------------- 2 files changed, 62 insertions(+), 52 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 47904e7b4e..046bb3dcdc 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -31,12 +31,14 @@ (define-module (gnu packages chez) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (gnu packages compression) #:use-module (gnu packages ncurses) #:use-module (gnu packages ghostscript) #:use-module (gnu packages linux) #:use-module (gnu packages netpbm) + #:use-module (gnu packages racket) #:use-module (gnu packages tex) #:use-module (gnu packages compression) #:use-module (gnu packages image) @@ -260,6 +262,66 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license asl2.0))) +(define-public chez-scheme-for-racket-bootstrap-bootfiles + (package + (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. + (source #f) ; avoid problematic cycle with racket.scm + (inputs `()) + (native-inputs (list racket-vm-bc)) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list + #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")) + #:phases + #~(let ((unpack (assoc-ref %standard-phases 'unpack))) + (modify-phases %standard-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 + (copy-recursively + #$nanopass + "nanopass" + #:keep-mtime? #t))) + (add-before 'install 'build + (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://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 "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 +supported platforms.) + +The Racket package @code{cs-bootstrap} (part of the main Racket Git +repository) implements enough of a Chez Scheme simulation to load the Chez +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.") + (license (list asl2.0)))) + (define-public chez-srfi (package (name "chez-srfi") diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index d3d3eb2bbd..a853e520f5 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -445,58 +445,6 @@ (define-public racket-vm-cs ;; The LGPL components are only used by Racket BC. (license (list license:asl2.0 license:expat)))) -(define-public chez-scheme-for-racket-bootstrap-bootfiles - (package - (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. - (source %racket-origin) - (inputs `()) - (native-inputs (list racket-vm-bc)) - (build-system copy-build-system) - ;; TODO: cross compilation - (arguments - (list - #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda args - (chdir "racket/src/ChezScheme"))) - (add-after 'chdir 'unpack-nanopass+stex - (lambda args - #$(make-unpack-nanopass+stex))) - (add-before 'install 'build - (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://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 "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 -supported platforms.) - -The Racket package @code{cs-bootstrap} (part of the main Racket Git -repository) implements enough of a Chez Scheme simulation to load the Chez -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.") - (license (list license:asl2.0)))) - (define (racket-packages-origin name origin specs) "Extract from ORIGIN the sources for the Racket packages specified by SPECS, a non-empty list of package specifications. In the resulting file-like -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:31:14 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:14 +0000 Received: from localhost ([127.0.0.1]:59361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8L-0008Fa-Dj for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:14 -0500 Received: from mail-vs1-f42.google.com ([209.85.217.42]:44626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR87-0008DP-Nx for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:00 -0500 Received: by mail-vs1-f42.google.com with SMTP id y4so11045925vsd.11 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:30:59 -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=Mlc/qhGedBkcO/u3jAnfRZ74tW1eDlJyXNhnlOfQlJM=; b=RBzRjCkF2Dme39f6OpQ9RHC2lvJimDSrerWEyeN40Kh9QLVmf/OLVyzxHKVT/jAZ0R WtcoPPx/MJxJvQR0XCqQWOArjni/Ecr/H+4mGgS2HaOPL9fhWW7IYfdAwudg2yxRyVWu 8tklA1XA3dOAdrk2J4wo4fTJd+xhbTV6Vlj9mQVovC5ry/MDZs+HQs24i2Kbu5jbiuBN KjFJsVK9ZDKUqzxRxe56RXNX/BpSDPuKWPEOIxbyuDIXobdeGCK1bSJDwer1f8ATbT+B UTuDb0g1BdIpQAnv3B2VvZAeO1fDnk8ZmQxd5ao3KeUKEV3vuO6wyJupE8AR/tZ4x1Ru rDMw== 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=Mlc/qhGedBkcO/u3jAnfRZ74tW1eDlJyXNhnlOfQlJM=; b=iXni2EoMAWY9sjVDOCmIrpgW4uVYXMjJrlHXp/RcJPk7J1Ywz0+OCr75e/sOJxFYxT L75nhi5QN6QcMR/1Gy2StHIZZn5XLrVN0+wRgD2OnmgL7Ak8zF0TW60X89syeO6h28Xz ZcK6XALGCFZe/acT6ao1ogoaskCb2T+ekeHXX7Lh+56wGD3YRmcwKZKcdsN5/lNckd0k l/qOqelipzzNz8wi17zAWAa5VXGtruzslwMsLB4vpghAxHnk848In/YVAkTI4SL0zPgX 5f0tCyBpFWuFQ5Q3KPbzOlAXRzCLez1qgk2io2oVOHGciJ797lPoD4qdZyn5TucKFZo3 smNA== X-Gm-Message-State: AOAM530q6IQ+0TcYzPXmf9SpBLGaGChyyobeexpUZSnyfrFsnMrk51DE grQz1kpNYAKe2yaoQZO3Foq+FnWkGNfIUWd+LGE= X-Google-Smtp-Source: ABdhPJxdQQa3UgWe/kNs4bgO+RF1rGzWumCACGlSbX7mNvU1EYIaZmvdLrx75iByRMV4UC4JAV90eg== X-Received: by 2002:a67:d29c:0:b0:31b:e21b:b4f8 with SMTP id z28-20020a67d29c000000b0031be21bb4f8mr5409843vsi.79.1645997454154; Sun, 27 Feb 2022 13:30:54 -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 k16-20020a0561023f1000b0031cc171e9a8sm1020277vsv.4.2022.02.27.13.30.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:30:53 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 12/24] gnu: chez: Add utilities for Chez machine types. Date: Sun, 27 Feb 2022 16:29:08 -0500 Message-Id: <20220227212920.2009000-13-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (chez-machine->nonthreaded, chez-machine->threaded, chez-machine->nix-system, nix-system->chez-machine, chez-upstream-features-for-system): New functions. (%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New private constants. (chez-scheme)[supported-systems]: Compute based on 'nix-system->chez-machine' and 'chez-upstream-features-for-system'. (chez-scheme-for-racket-bootstrap-bootfiles)[supported-systems]: Compute based on 'nix-system->chez-machine'. --- gnu/packages/chez.scm | 127 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 3 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 046bb3dcdc..603fc4201e 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -44,7 +44,119 @@ (define-module (gnu packages chez) #:use-module (gnu packages image) #:use-module (gnu packages xorg) #:use-module (ice-9 match) - #:use-module (srfi srfi-1)) + #:use-module (srfi srfi-1) + #:export (nix-system->chez-machine + chez-machine->nonthreaded + chez-machine->threaded)) + +(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 +MACHINE. The returned string may share storage with MACHINE." + ;; Chez Scheme documentation consistently uses "nonthreaded" rather than + ;; e.g. "unthreaded" + (if (eqv? #\t (string-ref machine 0)) + (substring machine 1) + machine)) +(define (chez-machine->threaded machine) + "Like @code{chez-machine->nonthreaded}, but returns the threaded machine +type." + (if (eqv? #\t (string-ref machine 0)) + machine + (string-append "t" machine))) + +;; Based on the implementation from raco-cross-lib/private/cross/platform.rkt +;; in https://github.com/racket/raco-cross. +;; For supported platforms, refer to release_notes/release_notes.stex in the +;; upstream Chez Scheme repository or to racket/src/ChezScheme/README.md +;; in https://github.com/racket/racket. +(define %nix-arch-to-chez-alist + `(("x86_64" . "a6") + ("i386" . "i3") + ("aarch64" . "arm64") + ("armhf" . "arm32") ;; Chez supports ARM v6+ + ("ppc" . "ppc32"))) +(define %nix-os-to-chez-alist + `(("w64-mingw32" . "nt") + ("darwin" . "osx") + ("linux" . "le") + ("freebsd" . "fb") + ("openbsd" . "ob") + ("netbsd" . "nb") + ("solaris" . "s2"))) + +(define (chez-machine->nix-system machine) + "Return the Nix system type corresponding to the Chez Scheme machine type +MACHINE. If MACHINE is not a string representing a known machine type, an +exception is raised. This function does not distinguish between threaded and +nonthreaded variants of MACHINE. + +Note that this function only handles Chez Scheme machine types in the +strictest sense, not other kinds of descriptors sometimes used in place of a +Chez Scheme machine type by Racket, such as @code{\"pb\"}, @code{#f}, or +@code{\"racket\"}. (When using such extensions, the Chez Scheme machine type +for the host system is often still relevant.)" + (let ((machine (chez-machine->nonthreaded machine))) + (let find-arch ((alist %nix-arch-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (string-prefix? chez machine) + (string-append + nix "-" (let ((machine-os + (substring machine (string-length chez)))) + (let find-os ((alist %nix-os-to-chez-alist)) + (match alist + (((nix . chez) . alist) + (if (equal? chez machine-os) + nix + (find-os alist))))))) + (find-arch alist))))))) + +(define* (nix-system->chez-machine #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return the Chez Scheme machine type corresponding to the Nix system +identifier SYSTEM, or @code{#f} if the translation of SYSTEM to a Chez Scheme +machine type is undefined. + +It is unspecified whether the resulting string will name a threaded or a +nonthreaded machine type: when the distinction is relevant, use +@code{chez-machine->nonthreaded} or @code{chez-machine->threaded} to adjust +the result." + (let* ((hyphen (string-index system #\-)) + (nix-arch (substring system 0 hyphen)) + (nix-os (substring system (+ 1 hyphen))) + (chez-arch (assoc-ref %nix-arch-to-chez-alist nix-arch)) + (chez-os (assoc-ref %nix-os-to-chez-alist nix-os))) + (and chez-arch chez-os (string-append chez-arch chez-os)))) + +(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}. Other feature symbols may be added in the future." + (cond + ((not (nix-system->chez-machine system)) + #f) + ((target-aarch64? system) + #f) + ((target-arm32? system) + (and (target-linux? system) + '())) + ((target-ppc32? system) + (and (target-linux? system) + '(threads))) + (else + '(threads)))) + +;; +;; Chez Scheme: +;; (define nanopass (let ((version "1.9.2")) @@ -251,8 +363,11 @@ (define* (stex-make #:optional (suffix "")) ;; We should too. It is the Chez machine type arm32le ;; (no threaded version upstream yet, though there is in ;; Racket's fork), more specifically (per the release notes) ARMv6. - (supported-systems (fold delete %supported-systems - '("mips64el-linux" "armhf-linux"))) + (supported-systems + (delete + "armhf-linux" ;; <-- should work, but reportedly broken + (filter chez-upstream-features-for-system + %supported-systems))) (home-page "https://cisco.github.io/ChezScheme/") (synopsis "R6RS Scheme compiler and run-time") (description @@ -300,6 +415,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)) (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 @@ -322,6 +439,10 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles Chez Scheme.") (license (list asl2.0)))) +;; +;; Packages: +;; + (define-public chez-srfi (package (name "chez-srfi") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:31:43 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:43 +0000 Received: from localhost ([127.0.0.1]:59364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8p-0008GJ-3O for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:43 -0500 Received: from mail-vs1-f52.google.com ([209.85.217.52]:46877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8J-0008Ew-Er for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:11 -0500 Received: by mail-vs1-f52.google.com with SMTP id u10so11037126vsu.13 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:31:11 -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=n8BGEmpxXWD+h6k4gjttH4eE9hhDpt7HQXaF3+MVYXg=; b=HTLvsGS8FruOBK80XWts+wbGzSHVYFmVpOPb2QdE745sgY+0UAAxZkkHjX+RPblp/F pjN7UtLR86yqAlMIfICnH/gejZ9kL81e15xSU4Zjwe81Iu+6WbPRXSi3AMCKodpIyAjW eQ4FkIQDqwASt7rRRQgdwS61izR6ajTJ2ZSY3GaTWZyyi9KMZgOQF9x5wIPdaDZgXMxw pzb5M67UNBrceKAVHARARpJ5ji/RAwMfiM0teSpzBPU1nuvQPAHb+5QEw1PEFIDf5e1E P2Kn6fsrQgDRODjB7YAU/gNAVMMla280kPZTWXf8snWfSBLhe5LmK1vDeggJNos6tUuP 2Xng== 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=n8BGEmpxXWD+h6k4gjttH4eE9hhDpt7HQXaF3+MVYXg=; b=fNWA+wrknWsRU2AjO/f4XPBN2xMkx7qTQ6YjgmwnYigsuntHqbdRccnBN6z+I1kWQ0 mhEMt47JWMgLG3weRQcrGysPfOW/3zcpDYAaOQVyiFn4YnxbaRdDNBYlGCPI+G8mbSg0 lUYOK5PgbbTIlM9nzHCyqJ/vYQwfDxIVMxqJ1k+RJSlGnBK8cqXuQc/PpFODYRu1Ctzo SVHipeefc+4yLkKG8CorlLODRqLLWOXdmTPAjWhmYsC6XP7vh0hnRvS//2iI9Qo1JKY8 REjM2a2zXVxSMg6g0qRsFrSSKXbyLSeMEby+g06hYcF8NbB0jVbxEJe3oZDRvA9A7Lt8 zj/g== X-Gm-Message-State: AOAM531/nOKSkbJb3h7o0S1j/ynE+pgvwSPIrTYwJfRVMv6KpES2eAOI DVA87+DOjhKFUPheiwiyJSxY7Jq9er3wpQKgy8Y= X-Google-Smtp-Source: ABdhPJzktN+UUWmdWvsYgWjjEPe4xBgcPE+8BfOZ+d+JngLeG1+ztJbOCEuFcpoS9OLlzHH/f2dLPg== X-Received: by 2002:a05:6102:21ac:b0:31c:1b59:4fc6 with SMTP id i12-20020a05610221ac00b0031c1b594fc6mr6639305vsb.59.1645997466013; Sun, 27 Feb 2022 13:31:06 -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 n22-20020a1fa416000000b0031e658fd080sm1354745vke.43.2022.02.27.13.30.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:31:05 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 13/24] gnu: racket: Add 'racket-vm-for-system'. Date: Sun, 27 Feb 2022 16:29:09 -0500 Message-Id: <20220227212920.2009000-14-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-vm-for-system): New procedure. (racket-minimal, racket)[inputs]: Use it. --- gnu/packages/racket.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index a853e520f5..272638ca2e 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -187,6 +187,14 @@ (define-module (gnu packages racket) ;; ;; Code: +(define* (racket-vm-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'racket-vm-cs' if it supports SYSTEM; 'racket-vm-bc' otherwise." + (if (nix-system->chez-machine system) + racket-vm-cs + racket-vm-bc)) + (define %racket-version "8.4") ;; ^ Remember to update chez-scheme-for-racket-bootstrap-bootfiles! (define %racket-commit @@ -513,7 +521,7 @@ (define-public racket-minimal (inputs (list openssl sqlite - racket-vm-cs ;; TODO (racket-vm-for-system) + (racket-vm-for-system) (racket-packages-origin "base" %racket-origin '(("base" "pkgs/base") @@ -630,7 +638,7 @@ (define-public racket unixodbc libedit ;; TODO reconsider in light of expeditor and readline-gpl racket-minimal ;; <-- TODO non-tethered layer - racket-vm-cs ;; TODO (racket-vm-for-system) + (racket-vm-for-system) (simple-racket-origin "2d" (base32 "1zzcz5qyjv7syi41vb8jkxjp1rqgj61zbsdrg0nlc4qy9qsafzgr") '("2d" "2d-doc" "2d-lib")) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:31:44 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:44 +0000 Received: from localhost ([127.0.0.1]:59366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8p-0008GM-C9 for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:44 -0500 Received: from mail-vs1-f41.google.com ([209.85.217.41]:34396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8a-0008Ft-3z for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:29 -0500 Received: by mail-vs1-f41.google.com with SMTP id w4so11108509vsq.1 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:31:28 -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=io5+mYx3paMZskBxOftdGKkiJCIi2sMPPsvDv5pgL1U=; b=IKtHG+gBCBhORbi+tNyftqfUvZtEFu5PqVvnpUt8qOrqNqMPmvXN9VHKLAaiQ+m7dF QCtUaRrYePL11cjqI3pdXTSM7bgO1u4KRM44vhQ5rxLr28837Ib5su6VObczK8n/+Em6 M1Agr/Ak7ifik08SvG1SFIrNbvZbkE3IxdiOjUMSlF6V2d8MRB06Ns6jt83Sb9m64rJI J6raFFEX8Y8aCtlH/oFqFs/wXxVL2GHwIy1UXnH0YSHohp0k+/GyqKBz4L7sYwT89B4w DFSRHMdBYWx+g1ea6FjUCibEOuDfZPVrMyY67LEkt1GjcbkeapeS3hkmd4tTo3jtwsNb NVWQ== 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=io5+mYx3paMZskBxOftdGKkiJCIi2sMPPsvDv5pgL1U=; b=fFZvYcMc5TZs77Yv6qbO0gQYJ9fK/dLvpafjwSOnZltCFwdMh/hwKIdcpxt1Zj9L0v aUcz3N1bdzdOSOsbqkL43ZNbp6kDdtZFq13nmR+HIHn4xVI4thu/JeOXe4FdaC41gtC5 NtE0fd5hqUwPcyLZEWGOPRO93AGfWicDtVutdlIKgM0Q4uLP4KZI5Tk7QA0X0vQ35C6W HLcNkgOR6pHf2S/hnSmW0vjPJp5Gdjg2qKEHg7XrnOJf90domYlcOv382me+DZR/D8Vu iDVxcoCi00//4xZ9wR84kQRi2uM3ios2C2WN1vlwmqbtUxpvVo8Icjq5T9vyz03ZASeh EyRg== X-Gm-Message-State: AOAM533NVrFux2kM/C8gvtUN0GIuf/5CIDfHFn+X9qBfHzGEKFfEjvMo F+O4ShN/WLIZwZrZ20kYy0zjsIyiat2iRDLZdx8= X-Google-Smtp-Source: ABdhPJza1R2lMTDtWUEc/Kib++wWaK+sd8n1uZ07DihB+hxib97T1Ze3V4/OXvgPWET9nEytDdTqtA== X-Received: by 2002:a05:6102:104a:b0:31d:da1b:fed3 with SMTP id h10-20020a056102104a00b0031dda1bfed3mr7235581vsq.18.1645997482312; Sun, 27 Feb 2022 13:31:22 -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 o22-20020a056122179600b0032f7563a15esm1326957vkf.13.2022.02.27.13.31.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:31:22 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 14/24] gnu: chez-scheme: Use new style for Chez packages. Date: Sun, 27 Feb 2022 16:29:10 -0500 Message-Id: <20220227212920.2009000-15-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (chez-configure, chez-make-flags): Use G-expressions. (chez-srfi)[arguments]: Use G-expressions, 'chez-configure', and 'chez-make-flags'. (chez-web, chez-sockets)[native-inputs]: Remove labels. [arguments]: Use G-expressions. (chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils)[arguments]: Use G-expressions. --- gnu/packages/chez.scm | 382 ++++++++++++++++++++++-------------------- 1 file changed, 196 insertions(+), 186 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 603fc4201e..4ee9711bb4 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -443,6 +443,27 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; Packages: ;; +;; Help function for Chez Scheme to add the current path to +;; CHEZSCHEMELIBDIRS. +(define chez-configure + #~(lambda _ + (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) + (setenv "CHEZSCHEMELIBDIRS" + (if chez-env + (string-append ".:" chez-env) + "."))))) + +;; Help function to define make flags for some Chez Scheme custom make +;; files. +(define (chez-make-flags name version) + #~(let ((out #$output)) + (list + ;; Set 'chezversion' so that libraries are installed in + ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. + (string-append "chezversion=" #$(package-version chez-scheme)) + (string-append "PREFIX=" out) + (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) + (define-public chez-srfi (package (name "chez-srfi") @@ -460,13 +481,11 @@ (define-public chez-srfi (native-inputs (list chez-scheme)) (arguments - `(#:make-flags (let ((out (assoc-ref %outputs "out"))) - (list (string-append "PREFIX=" out) - "CHEZ=chez-scheme --libdirs ./" - (string-append "chezversion=" ,(package-version chez-scheme)))) - #:test-target "test" - #:phases (modify-phases %standard-phases - (delete 'configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-srfi") (synopsis "SRFI libraries for Chez Scheme") (description @@ -491,42 +510,48 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("ghostscript" ,ghostscript) - ("texlive" ,(texlive-updmap.cfg (list texlive-oberdiek - texlive-epsf - texlive-metapost - texlive-charter - texlive-pdftex - texlive-context - texlive-cm - texlive-tex-plain))))) + (list chez-scheme + ghostscript + ;; FIXME: This package fails to build with the error: + ;; mktexpk: don't know how to create bitmap font for bchr8r + ;; Replacing the following with `texlive` fixes it. + ;; What is missing? + (texlive-updmap.cfg (list texlive-oberdiek + texlive-epsf + texlive-metapost + texlive-charter + texlive-pdftex + texlive-context + texlive-cm + texlive-tex-plain)))) (arguments - `(#:make-flags (list (string-append "PREFIX=" %output) - (string-append "DOCDIR=" %output "/share/doc/" - ,name "-" ,version) - (string-append "LIBDIR=" %output "/lib/chezweb") - (string-append "TEXDIR=" %output "/share/texmf-local")) - #:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - ;; This package has a custom "bootstrap" script that - ;; is meant to be run from the Makefile. - (delete 'bootstrap) - (replace 'configure - (lambda* _ - (copy-file "config.mk.template" "config.mk") - (substitute* "tangleit" - (("\\./cheztangle\\.ss" all) - (string-append "chez-scheme --program " all))) - (substitute* "weaveit" - (("mpost chezweb\\.mp") - "mpost --tex=tex chezweb.mp") - (("\\./chezweave" all) - (string-append "chez-scheme --program " all))) - (substitute* "installit" - (("-g \\$GROUP -o \\$OWNER") "")) - #t))))) + (list + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "DOCDIR=" #$output "/share/doc/" + #$name "-" #$version) + ;; lib/chez-scheme/chezweb ??? + (string-append "LIBDIR=" #$output "/lib/chezweb") + (string-append "TEXDIR=" #$output "/share/texmf-local")) + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + ;; This package has a custom "bootstrap" script that + ;; is meant to be run from the Makefile. + (delete 'bootstrap) + (replace 'configure + (lambda* _ + (copy-file "config.mk.template" "config.mk") + (substitute* "tangleit" + (("\\./cheztangle\\.ss" all) + (string-append "scheme --program " all))) + (substitute* "weaveit" + (("mpost chezweb\\.mp") + "mpost --tex=tex chezweb.mp") + (("\\./chezweave" all) + (string-append "scheme --program " all))) + (substitute* "installit" + (("-g \\$GROUP -o \\$OWNER") ""))))))) (home-page "https://github.com/arcfide/ChezWEB") (synopsis "Hygienic Literate Programming for Chez Scheme") (description "ChezWEB is a system for doing Knuthian style WEB @@ -550,95 +575,78 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - `(("chez-scheme" ,chez-scheme) - ("chez-web" ,chez-web) - ("texlive" ,(texlive-updmap.cfg (list texlive-pdftex))))) + (list chez-scheme + chez-web + (texlive-updmap.cfg (list texlive-pdftex)))) (arguments - `(#:tests? #f ; no tests - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-web (assoc-ref inputs "chez-web")) - (chez (assoc-ref inputs "chez-scheme")) - (chez-h (dirname (car (find-files chez "scheme\\.h"))))) - (substitute* "Makefile" - (("(SCHEMEH=).*$" all var) - (string-append var chez-h))) - #t))) - (add-before 'build 'tangle - (lambda* (#:key inputs #:allow-other-keys) - (setenv "TEXINPUTS" - (string-append - (getcwd) ":" - (assoc-ref inputs "chez-web") "/share/texmf-local/tex/generic:" - ":")) - ;; just using "make" tries to build the .c files before - ;; they are created. - (and (invoke "make" "sockets") - (invoke "make")))) - (replace 'build - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) - "-site/arcfide"))) - ;; make sure Chez Scheme can find the shared libraries. - (substitute* "sockets.ss" - (("(load-shared-object) \"(socket-ffi-values\\.[sd][oy].*)\"" - all cmd so) - (string-append cmd " \"" chez-site "/" so "\"")) - (("sockets-stub\\.[sd][oy].*" all) - (string-append chez-site "/" all))) - ;; to compile chez-sockets, the .so files must be - ;; installed (because of the absolute path we - ;; inserted above). - (for-each (lambda (f d) (install-file f d)) - '("socket-ffi-values.so" "sockets-stub.so") - (list chez-site chez-site)) - (zero? (system "echo '(compile-file \"sockets.sls\")' | scheme -q"))))) - (replace 'install - (lambda* (#:key outputs inputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/chez-sockets")) - (doc (string-append out "/share/doc/" ,name "-" ,version)) - (chez-site (string-append out "/lib/csv" - ,(package-version chez-scheme) + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((scheme (search-input-file (or native-inputs inputs) + "/bin/scheme")) + (lib (string-append (dirname scheme) "/../lib")) + (header-file (car (find-files lib "scheme\\.h"))) + (include-dir (dirname header-file))) + (substitute* "Makefile" + (("(SCHEMEH=).*$" _ var) + (string-append var include-dir)))))) + (add-before 'build 'tangle + (lambda* (#:key inputs #:allow-other-keys) + (setenv "TEXINPUTS" + (string-append + (getcwd) ":" + (assoc-ref inputs "chez-web") + "/share/texmf-local/tex/generic:" + ":")) + ;; just using "make" tries to build the .c files before + ;; they are created. + (and (invoke "make" "sockets") + (invoke "make")))) + (replace 'build + (lambda args + (let ((chez-site (string-append #$output + "/lib/csv" + (package-version chez-scheme) "-site/arcfide"))) - (for-each (lambda (f d) (install-file f d)) - '("sockets.pdf" "sockets.so") - (list doc chez-site)) - #t)))))) + ;; make sure Chez Scheme can find the shared libraries. + (substitute* "sockets.ss" + (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post)) + (("(\")(sockets-stub\\.[sd][oy][^\"]*)(\")" + _ pre file post) + (string-append pre chez-site "/" file post))) + ;; to compile chez-sockets, the .so files must be + ;; installed (because of the absolute path we + ;; inserted above). + (for-each (lambda (f) + (install-file f chez-site)) + '("socket-ffi-values.so" + "sockets-stub.so")) + (invoke "bash" + "-c" + (format #f "echo '~s' | scheme -q" + '(compile-file "sockets.sls")))))) + (replace 'install + (lambda args + (install-file "sockets.so" + (string-append #$output + "/lib/csv" + #$(package-version chez-scheme) + "-site/arcfide")) + (install-file "sockets.pdf" + (string-append #$output + "/share/doc/" + #$name "-" #$version))))))) (home-page "https://github.com/arcfide/chez-sockets") (synopsis "Extensible sockets library for Chez Scheme") (description "Chez-sockets is an extensible sockets library for Chez Scheme.") (license expat)))) -;; Help function for Chez Scheme to add the current path to -;; CHEZSCHEMELIBDIRS. -(define chez-configure - '(lambda _ - (let ((chez-env (getenv "CHEZSCHEMELIBDIRS"))) - (setenv "CHEZSCHEMELIBDIRS" - (if chez-env - (string-append ".:" chez-env) - ".")) - #t))) - -;; Help function to define make flags for some Chez Scheme custom make -;; files. -(define (chez-make-flags name version) - `(let ((out (assoc-ref %outputs "out"))) - (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" ,(package-version chez-scheme)) - (string-append "PREFIX=" out) - (string-append "DOCDIR=" out "/share/doc/" - ,name "-" ,version)))) - (define-public chez-matchable (package (name "chez-matchable") @@ -659,10 +667,11 @@ (define-public chez-matchable (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -690,10 +699,11 @@ (define-public chez-irregex (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (home-page "https://github.com/fedeinthemix/chez-irregex") (synopsis "Portable regular expression library for Scheme") (description "This package provides a portable and efficient @@ -720,17 +730,18 @@ (define-public chez-fmt (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "chez-check" - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - (replace 'build - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-build" make-flags))) - (replace 'install - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "chez-install" make-flags)))))) + (list #:make-flags (chez-make-flags name version) + #:test-target "chez-check" + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-build" make-flags))) + (replace 'install + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "chez-install" make-flags)))))) (home-page "http://synthcode.com/scheme/fmt") (synopsis "Combinator formatting library for Chez Scheme") (description "This package provides a library of procedures for @@ -760,10 +771,11 @@ (define-public chez-mit (native-inputs (list chez-scheme)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:test-target "test" - #:phases (modify-phases %standard-phases - (replace 'configure ,chez-configure)))) + (list #:make-flags (chez-make-flags name version) + #:test-target "test" + #:phases #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure)))) (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 @@ -792,46 +804,44 @@ (define-public chez-scmutils (propagated-inputs (list chez-mit chez-srfi)) (arguments - `(#:make-flags ,(chez-make-flags name version) - #:tests? #f ; no test suite - #:phases - (modify-phases %standard-phases - (replace 'configure ,chez-configure) - ;; 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 - ;; in turn requires us to compile the files in the final - ;; destination. - (delete 'build) - (add-after 'install 'install-src - (lambda* (#:key (make-flags '()) #:allow-other-keys) - (apply invoke "make" "install-src" make-flags))) - (add-after 'install-src 'absolute-path-in-scm-files - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils") - (string-append "include \"" (dirname file))))) - (find-files out "\\.sls")) - (for-each (lambda (file) - (substitute* file - (("include +\"\\./scmutils/simplify") - (string-append "include \"" (dirname file))))) - (find-files out "fbe-syntax\\.scm")) - #t))) - (add-after 'absolute-path-in-scm-files 'build - (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (mk-file (car (find-files out "Makefile")))) - (with-directory-excursion (dirname mk-file) - (apply invoke "make" "build" make-flags))))) - (add-after 'build 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (for-each delete-file - (find-files out "Makefile|compile-all\\.ss")) - #t)))))) + (list + #:make-flags (chez-make-flags name version) + #:tests? #f ; no test suite + #:phases + #~(modify-phases %standard-phases + (replace 'configure + #$chez-configure) + ;; 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 + ;; in turn requires us to compile the files in the final + ;; destination. + (delete 'build) + (add-after 'install 'install-src + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" "install-src" make-flags))) + (add-after 'install-src 'absolute-path-in-scm-files + (lambda* (#:key #:allow-other-keys) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils") + (string-append "include \"" (dirname file))))) + (find-files #$output "\\.sls")) + (for-each (lambda (file) + (substitute* file + (("include +\"\\./scmutils/simplify") + (string-append "include \"" (dirname file))))) + (find-files #$output "fbe-syntax\\.scm")))) + (add-after 'absolute-path-in-scm-files 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (let ((mk-file (car (find-files #$output "Makefile")))) + (with-directory-excursion (dirname mk-file) + (apply invoke "make" "build" make-flags))))) + (add-after 'build 'clean-up + (lambda args + (for-each delete-file + (find-files #$output + "Makefile|compile-all\\.ss"))))))) (synopsis "Port of MIT/GNU Scheme Scmutils to Chez Scheme") (description "This package provides a port of the MIT/GNU Scheme Scmutils program to Chez Scheme. The port consists of a set of -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:31:57 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:31:57 +0000 Received: from localhost ([127.0.0.1]:59369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR93-0008Gt-Hw for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:57 -0500 Received: from mail-qk1-f178.google.com ([209.85.222.178]:36388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR8p-0008GD-K5 for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:44 -0500 Received: by mail-qk1-f178.google.com with SMTP id g24so9008093qkl.3 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:31:43 -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=c6TzP7tP4BB13MBcjLiq0wzXqF2mXc5qBVWu9Pd9w4o=; b=Jz0jdKoEbGrUhpw14HKNTYAeAtljTdq6GXAU6+RERIyIzSCXbp113frdKD20IfhFPG 1CbtBgYxg3fu6B0nMiMrja/kFbZXtoDsfAJekYENPCTWCLL9BA68psFAmd0jFY5iQx/Q iBlFY/mDuIg30J1J8z+1Y7wPsZ/2arBsSz2WtyJCHEP9gZXWN4gUbLW1YqTW+EfZ9Zin 5MwOQBKmakTaDPk43E8dRa5YZQVaLfLoJNsc0V5oGhuUrho73MVz+hiNYw/ZJQ4n+fYY pvb7zA01LSwZnfTL1Tme7pKju57Ovk6c92Kji1kxgAQN4ZuR7+bcLgsV9vLlbkI0V+Gz jw6Q== 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=c6TzP7tP4BB13MBcjLiq0wzXqF2mXc5qBVWu9Pd9w4o=; b=wKRhH5s6kgluMdIpmu4TQX/ZMAFfccRFI1opjsEqIHGcqtdglVWUKo7THIQ29yaCC/ 68WY13cvtsiuEuI4Ep/NZsjLwX99K7tbVMaeSAvj+AcYRo9jVdUndih18frNyRrr3b/+ AyX7GMPKeDyqt+ze/EsUY23Bjt408wOEpqodT07Nt7oApYtl/pjqrA5V0AJnDpd67e8N Jk+hd+WAdHriZ/rXjrXB7aTKWuvEGSu3SY4BxRVPjXNNAILzhZT9car6T4Gt5jOdtWUL FL1Y1+r7nv4uN/McABlBAb4Xi0fqKCnrxVX24H7ryf/Gh7Qa3EeBvKnqpyZyfrbDsxfF Jnzg== X-Gm-Message-State: AOAM531MCmHDGVi+kFLLHymWEU1qZlJYwuBEueBANQu6FlZrWkBU7Xgh uTUoYWsRqed0ZzeTcM8S2BQRhLtWFy/DRVEAuwg= X-Google-Smtp-Source: ABdhPJxpUXGbxjZWYcoDRskZr35jvEHGN0XpwvzPTyYl0+6cU27KydJomXmAJmnNt6zr/J2Ln1nUWA== X-Received: by 2002:a05:620a:ecb:b0:646:d52f:6424 with SMTP id x11-20020a05620a0ecb00b00646d52f6424mr9935320qkm.375.1645997498019; Sun, 27 Feb 2022 13:31:38 -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 k10-20020ac85fca000000b002dce6b890casm5601067qta.40.2022.02.27.13.31.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:31:37 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 15/24] gnu: chez-scheme: Use "lib/chez-scheme" for search path. Date: Sun, 27 Feb 2022 16:29:11 -0500 Message-Id: <20220227212920.2009000-16-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) There does not seem to be any widely accepted standard path to use for "CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids having to compute the actual path everywhere, which would be especially unpleasant when support is added for the Racket variant of Chez Scheme, which always has a different version number than upstream. * gnu/packages/chez.scm (chez-scheme)[native-search-paths]: Change to use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for "CHEZSCHEMELIBDIRS". (chez-make-flags): Update accordingly. (chez-sockets)[arguments]<#:phases>: Likewise. --- gnu/packages/chez.scm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 4ee9711bb4..f4c87fbcf7 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -233,7 +233,7 @@ (define-public chez-scheme (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") - (files (list (string-append "lib/csv" version "-site")))))) + (files '("lib/chez-scheme"))))) (outputs '("out" "doc")) (arguments `(#:modules @@ -458,9 +458,9 @@ (define chez-configure (define (chez-make-flags name version) #~(let ((out #$output)) (list - ;; Set 'chezversion' so that libraries are installed in - ;; 'lib/csvX.Y.Z-site' like Chez's 'native-search-paths' expects. - (string-append "chezversion=" #$(package-version chez-scheme)) + ;; Set 'schemedir' so that libraries are installed in + ;; 'lib/chez-scheme' like Chez's 'native-search-paths' expects. + (string-append "schemedir=" out "/lib/chez-scheme") (string-append "PREFIX=" out) (string-append "DOCDIR=" out "/share/doc/" #$name "-" #$version)))) @@ -608,9 +608,7 @@ (define-public chez-sockets (replace 'build (lambda args (let ((chez-site (string-append #$output - "/lib/csv" - (package-version chez-scheme) - "-site/arcfide"))) + "/lib/chez-scheme/arcfide"))) ;; make sure Chez Scheme can find the shared libraries. (substitute* "sockets.ss" (("(object \")(socket-ffi-values\\.[sd][oy][^\"]*)(\")" @@ -634,9 +632,7 @@ (define-public chez-sockets (lambda args (install-file "sockets.so" (string-append #$output - "/lib/csv" - #$(package-version chez-scheme) - "-site/arcfide")) + "/lib/chez-scheme/arcfide")) (install-file "sockets.pdf" (string-append #$output "/share/doc/" -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:32:06 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:32:06 +0000 Received: from localhost ([127.0.0.1]:59380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR9B-0008IR-Tw for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:32:06 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:36770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR93-0008Gm-Va for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:31:58 -0500 Received: by mail-qv1-f42.google.com with SMTP id w7so11006304qvr.3 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:31:57 -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=vYcCJ8OzcVN6l+LnkyuEvkLv2msDMJdHSBe1qqljWPg=; b=IPorIX7r+FsRmtND+GpPcIiTAgwZBRSol5ueCBMQJsxmVPNWeckTnk7B88IJVTgy3r EOAFs7CjcnUGU5sA78Me64uT3S2crP8HDfrbXzQnTRH3eQb6T6wj7Bunra0HXULIofKG M66bS/QPuzTD4GyK3e28jEd51r6d2IoFM4KbJ1u/EzpjjyjzgbQUDimUF9VZZu24yeZI ydKHxt3NEY0v77c5qTo24vEj8utZAN+HPQ0yzZcrdVX4YMrHUPE/oEAd8Spvq4CrArg5 QRFw6vOXkt0MceGTv2lpQxJPYGNTc5S8MNrXBWVpYttEL9JrxOUzEPcHqBphgLmeGC8N nXxA== 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=vYcCJ8OzcVN6l+LnkyuEvkLv2msDMJdHSBe1qqljWPg=; b=1W0looIXIPhdxA127JJbmdjXMRl7qBgLQg4WksKV8RH4zqHowUQfPNLhxm/pjClgi8 MHUOIgUOS7aB2Cnt86kNB8x4na72BkcicSg0O6fMP0nN2tSH8T/HOZFZfRRTWrVuvrPW 4RNi5UrIENubdThqot3RKJya30FGY2X2FdVPWBaxy/elEU8gUZcihhtaW4j+iL7MTgp6 XXyoEfL7n1BObZV6szQh3NB/ev/QOvzjdjIZiZ8DG9rf0WRQ/MvS5Kje2pUWrN0vyR72 a+d/b/N2Ir1Pj+oxx8ernuyt2xwODyk5KV7DigSRmlyzSZfzIg3NWAwh3BynWZtzvQPR thRA== X-Gm-Message-State: AOAM533kDIPAytxlHgbDOhi4tstL4yJ1tyVmD4/aQq4HszbMVzxKwnq/ oc2QeERM+3+QKYwjWoxsyvnxshYFECtdiUg0TIY= X-Google-Smtp-Source: ABdhPJw1IRvYjzO8oBWeHNwMmdkS1almQPl+B+nf5WyloOphCunyVVZUZi0RXUicYPBisAhYFRQqKw== X-Received: by 2002:ad4:5f4b:0:b0:432:2ab5:e670 with SMTP id p11-20020ad45f4b000000b004322ab5e670mr12116555qvg.50.1645997512417; Sun, 27 Feb 2022 13:31:52 -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 i133-20020a379f8b000000b0060ded9f21d6sm4268458qke.102.2022.02.27.13.31.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:31:52 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 16/24] gnu: chez-scheme: Use shared zlib and lz4. Date: Sun, 27 Feb 2022 16:29:12 -0500 Message-Id: <20220227212920.2009000-17-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This change also involves building 'libkernel.a' instead of 'kernel.o'. Support for these build options was merged upstream in 2019: see discussion at . * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove 'zlib:static' and 'lz4:static'. [arguments]: Adjust configure phase accordingly. --- gnu/packages/chez.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index f4c87fbcf7..dd40baa719 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -211,9 +211,7 @@ (define-public chez-scheme (inputs `(("libuuid" ,util-linux "lib") ("zlib" ,zlib) - ("zlib:static" ,zlib "static") ("lz4" ,lz4) - ("lz4:static" ,lz4 "static") ;; for expeditor: ("ncurses" ,ncurses) ;; for X11 clipboard support in expeditor: @@ -266,14 +264,14 @@ (define src (lz4-static (assoc-ref inputs "lz4:static")) (out (assoc-ref outputs "out")) ;; add flags which are always required: - (flags (cons* - (string-append "--installprefix=" out) - (string-append "ZLIB=" zlib-static "/lib/libz.a") - (string-append "LZ4=" lz4-static "/lib/liblz4.a") - ;; Guix will do compress man pages, - ;; and letting Chez try causes an error - "--nogzip-man-pages" - configure-flags))) + (flags (cons* (string-append "--installprefix=" out) + "ZLIB=-lz" + "LZ4=-llz4" + "--libkernel" + ;; Guix will do compress-man-pages, + ;; and letting Chez try causes an error + "--nogzip-man-pages" + configure-flags))) (format #t "configure flags: ~s~%" flags) ;; Some makefiles (for tests) don't seem to propagate CC ;; properly, so we take it out of their hands: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:32:18 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:32:19 +0000 Received: from localhost ([127.0.0.1]:59383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR9O-0008Is-7k for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:32:18 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:36403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR9M-0008If-Ne for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:32:17 -0500 Received: by mail-qk1-f172.google.com with SMTP id g24so9008612qkl.3 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:32:16 -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=uPIL5IDRL6r3Vp/3b7kyLhVyDcXw0EZXoLTn9G04Hwg=; b=aQWg3FAJOFFgLnofUhznfAEnHT0g8IGOShcAyMH66G87E6cHWRTjzkjoAVDd0CFa5r DHcx9WfrniHYotXmZkYdphE+8vnUXH7ul/ED01u35s+t3i0xBohXKXK0vd8nPdn+SCfG JoFG1jp565ruyTOrMRB+HZwot3C6nAiZJvj8NQn1n5jSrSZC+Ub4Y3lBaTaW8QM2HOg+ T2J+j8LPpyKaLuYyVw7k9PR6RDNX937taljemsqCaM+LIsoxAjMezRGfBGXAN0uxa1bZ J9TMrEOiRQJDrlVTdS0IY1DaStqK44i0uR6C82YvqhoJ+WaO0o2txhJ6URJhCWXaQPSY 5ebQ== 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=uPIL5IDRL6r3Vp/3b7kyLhVyDcXw0EZXoLTn9G04Hwg=; b=f2jXGMR+nGiBbMJRIqVteDxmnRISTvHnVjgZtIYyOnOZVKLJRiwq/vzl5jG4LdFAZv XJDgv7OEy9Ge++dX7oOo9R09t5K4TxEBK0ILfQNqSNXzp6adH+ZaP3t90dKXwl4ldqrp xtL4mXIR3oTLrn3EEdAvXlqlMQIZqAACOl+wXiqO+G4M4iVmc3OGOpIWYTQXjRFfZXcc nCwMWy6KACd/JHIL9TnyDMDxtcyC/FKHxF523FDnJH5y08MGbyaJ3oNSoSf3uE4B5Rbq F1QiPAfdylpjMP0pJKwI/dnhM+hbgkY/exeQsQw18pDS6UiovzaoHyESKDaKcZuybpPO 8dtw== X-Gm-Message-State: AOAM532Jr96Vx0nHParbQf2aGLAEumJ+74E5laockGCb4j8YhcfHwJJm RnN3lglPgQUx9EcOxTbt/T1o3drUSWzmso3DAVw= X-Google-Smtp-Source: ABdhPJw/zLiBoiY3ZF4GUpdrQHYVOMAB44yqt2egVzxGzT+6FWSq+ROFdvKl+MOjMY3dwr40xdXLHA== X-Received: by 2002:ae9:e714:0:b0:608:b52d:87f3 with SMTP id m20-20020ae9e714000000b00608b52d87f3mr9991622qka.171.1645997530918; Sun, 27 Feb 2022 13:32:10 -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 d12-20020a05620a158c00b00648ec3fcbdfsm4099972qkk.72.2022.02.27.13.32.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:32:10 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 17/24] gnu: chez-scheme: Use new package style. Date: Sun, 27 Feb 2022 16:29:13 -0500 Message-Id: <20220227212920.2009000-18-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (chez-scheme)[inputs]: Remove labels. [native-inputs]: Likewise. [arguments]: Use G-expressions. <#:phases>: Use 'search-input-file' instead of 'assoc-ref'. (nanopass): Make public as a temporary workaround for Racket. * gnu/packages/racket.scm (make-unpack-nanopass+stex): Update accordingly. --- gnu/packages/chez.scm | 286 +++++++++++++++++++--------------------- gnu/packages/racket.scm | 5 +- 2 files changed, 135 insertions(+), 156 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index dd40baa719..ad263a8fe3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -158,7 +158,7 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define nanopass +(define-public nanopass (let ((version "1.9.2")) (origin (method git-fetch) @@ -185,86 +185,80 @@ (define stex (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.6") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cisco/ChezScheme") - (commit (string-append "v" version)))) - (sha256 - (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) - (snippet - ;; Remove bundled libraries. - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (for-each (lambda (dir) - (when (directory-exists? dir) - (delete-file-recursively dir))) - '("stex" - "nanopass" - "lz4" - "zlib"))))))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cisco/ChezScheme") + (commit (string-append "v" version)))) + (sha256 + (base32 + "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) + (file-name (git-file-name name version)) + (snippet #~(begin + (use-modules (guix build utils)) + (for-each (lambda (dir) + (when (directory-exists? dir) + (delete-file-recursively dir))) + '("stex" + "nanopass" + "lz4" + "zlib")))))) (build-system gnu-build-system) (inputs - `(("libuuid" ,util-linux "lib") - ("zlib" ,zlib) - ("lz4" ,lz4) - ;; for expeditor: - ("ncurses" ,ncurses) - ;; for X11 clipboard support in expeditor: - ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 - ("libx11" ,libx11))) + (list + `(,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 - `(("nanopass" ,nanopass) ; source only - ;; for docs - ("stex" ,stex) - ("xorg-rgb" ,xorg-rgb) - ("texlive" ,(texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek))) - ("ghostscript" ,ghostscript) - ("netpbm" ,netpbm))) + (list nanopass ; source only + ;; for docs + stex + xorg-rgb + (texlive-updmap.cfg (list texlive-dvips-l3backend + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") (files '("lib/chez-scheme"))))) (outputs '("out" "doc")) (arguments - `(#:modules - ((guix build gnu-build-system) + (list + #:modules + '((guix build gnu-build-system) (guix build utils) (ice-9 ftw) (ice-9 match)) - #:test-target "test" - #:configure-flags - '("--threads") ;; TODO when we fix armhf, it doesn't support --threads - #:phases - (modify-phases %standard-phases - ;; put these where configure expects them to be - (add-after 'unpack 'unpack-nanopass+stex - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (for-each (lambda (dep) - (define src - (assoc-ref (or native-inputs inputs) dep)) - (copy-recursively src dep - #:keep-mtime? #t)) - '("nanopass" "stex")))) - ;; NOTE: the custom Chez 'configure' script doesn't allow - ;; unrecognized flags, such as those automatically added - ;; by `gnu-build-system`. - (replace 'configure - (lambda* (#:key inputs outputs - (configure-flags '()) - #:allow-other-keys) - (let* ((zlib-static (assoc-ref inputs "zlib:static")) - (lz4-static (assoc-ref inputs "lz4:static")) - (out (assoc-ref outputs "out")) - ;; add flags which are always required: - (flags (cons* (string-append "--installprefix=" out) + #:test-target "test" + ;; TODO when we fix armhf, it may not support --threads + #:configure-flags #~'("--threads") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (copy-recursively #$nanopass + "nanopass" + #:keep-mtime? #t) + (copy-recursively #$stex + "stex" + #:keep-mtime? #t))) + ;; NOTE: the custom Chez 'configure' script doesn't allow + ;; unrecognized flags, such as those automatically added + ;; by `gnu-build-system`. + (replace 'configure + (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys) + ;; add flags which are always required: + (let ((flags (cons* (string-append "--installprefix=" #$output) "ZLIB=-lz" "LZ4=-llz4" "--libkernel" @@ -272,90 +266,78 @@ (define src ;; and letting Chez try causes an error "--nogzip-man-pages" configure-flags))) - (format #t "configure flags: ~s~%" flags) - ;; Some makefiles (for tests) don't seem to propagate CC - ;; properly, so we take it out of their hands: - (setenv "CC" ,(cc-for-target)) - (setenv "HOME" "/tmp") - (apply invoke - "./configure" - 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* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (lib (string-append out "/lib")) - (name "chez-scheme")) - (symlink (string-append bin "/scheme") - (string-append bin "/" name)) - (map (lambda (file) - (symlink file (string-append (dirname file) - "/" name ".boot"))) - (find-files lib "scheme.boot"))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (stex-output "/tmp") - (doc-dir (string-append stex-output - "/share/doc/" - stex+version))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/" - stex+version) - (string-append "Scheme=" - (assoc-ref outputs "out") - "/bin/scheme")) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) - ;; Building the documentation requires stex and a running scheme. - ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - (let* ((chez+version (strip-store-file-name - (assoc-ref outputs "out"))) - (stex+version - (strip-store-file-name - (assoc-ref (or native-inputs inputs) "stex"))) - (scheme (string-append (assoc-ref outputs "out") - "/bin/scheme")) - ;; see note on stex-output in phase build-stex, above: - (stexlib (string-append "/tmp" - "/lib/" - stex+version)) - (doc-dir (string-append (assoc-ref outputs "doc") - "/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")) - (with-directory-excursion doc-dir - (symlink "release_notes/release_notes.pdf" - "release_notes.pdf") - (symlink "csug/csug9_5.pdf" - "csug.pdf")))))))) + (format #t "configure flags: ~s~%" flags) + ;; Some makefiles (for tests) don't seem to propagate CC + ;; properly, so we take it out of their hands: + (setenv "CC" #$(cc-for-target)) + (setenv "HOME" "/tmp") + (apply invoke "./configure" 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* ((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 explicitly lets us avoid using substitute* + ;; to re-write makefiles. + (add-after 'install-symlink 'prepare-stex + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + ;; Eventually we want to install stex as a real + ;; package so it's reusable. For now: + (let* ((stex-output "/tmp") + (doc-dir (string-append stex-output "/share/doc/stex"))) + (with-directory-excursion "stex" + (invoke "make" + "install" + (string-append "LIB=" + stex-output + "/lib/stex") + (string-append "Scheme=" + (search-input-file outputs + "/bin/scheme"))) + (for-each (lambda (pth) + (install-file pth doc-dir)) + '("ReadMe" ; includes the license + "doc/stex.html" + "doc/stex.css" + "doc/stex.pdf")))))) + ;; Building the documentation requires stex and a running scheme. + ;; FIXME: this is probably wrong for cross-compilation + (add-after 'prepare-stex 'install-doc + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (match (assoc-ref outputs "doc") + (#f + (format #t "not installing docs~%")) + (doc-prefix + (let* ((chez+version (strip-store-file-name #$output)) + (scheme (search-input-file outputs "/bin/scheme")) + (stexlib "/tmp/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")) + (with-directory-excursion doc-dir + (symlink "release_notes/release_notes.pdf" + "release_notes.pdf") + (symlink "csug/csug9_5.pdf" + "csug.pdf")))))))))) ;; Chez Scheme does not have a MIPS backend. ;; FIXME: Debian backports patches to get armhf working. ;; We should too. It is the Chez machine type arm32le diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 272638ca2e..035d93bfb5 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -257,10 +257,7 @@ (define (make-unpack-nanopass+stex) ;; TODO: Refactor enough to share this directly. #~(begin (copy-recursively - #$(match (assoc-ref (package-native-inputs chez-scheme) - "nanopass") - ((src) - src)) + #$nanopass "nanopass" #:keep-mtime? #t) (mkdir-p "stex") -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:32:37 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:32:37 +0000 Received: from localhost ([127.0.0.1]:59386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR9g-0008JO-UV for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:32:37 -0500 Received: from mail-qv1-f48.google.com ([209.85.219.48]:46982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR9e-0008JA-Tt for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:32:35 -0500 Received: by mail-qv1-f48.google.com with SMTP id j5so10911660qvs.13 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:32:34 -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=Tect9L988qv0Yb/LOD+TBbvPXO8vBf/+B4PmAkEYvLU=; b=NSv4kgpBebf0AjA5esL1lWiRNQjDzONRN+i14fdrapXHoHubod7BpJefd23SWXwa5j qgwGWuWGGZg4aBdj7wIuQq8e3cCQUvx+5ijfGOv9oR5hH6y30h0IphPMaCcJkuYdLsLD eRw3Giu6uxdTuicYeLCxpYTiHkk7vF3kM+7R+zzYiPTfQtYz7SKWkP0x4/5lvzgDeVE9 X1kkDY/FfimX2NGY3T3gaaPpDxFpLof6iEN85wqO/neHQqfw99axmdvd2TiFqfweqUb6 xuum/R6jVhTfOeC1jZZsn0riegWtOPVfGEvRAju2mQIUI9boT6iHeaLuCx4BEPHaqgI/ 5DSg== 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=Tect9L988qv0Yb/LOD+TBbvPXO8vBf/+B4PmAkEYvLU=; b=Dbe6vt5mpwBBkWdPySVj3iF5J2qkn76sIy7Rqg5CDbHjReE3idWnx7aLJobpFI8IqF YnxR9YKO/dntPZmDMdXcd5WW49JUEaAQI7JKXBUksWSI5BI3pG/7NojB3O+hH/obEwpg JPfjRHVFQRdbpkOG7UznmtzNQcCIm2gnrXuNDolaF4yGVS2BWlZDvzcouqcaBvy/JjL/ rRYldpMKd7mf2WkVO7lYAlTvWvsQUSed/eYR8xixD2Q/TzqXK5jr3OnLm2q2DTErPkP4 Gz/NaFOc+B5aQn4hqh+DCY2PbPZ5JhaWsPA2TinuTKbZfvWOlx7pVouVHN7iWtcOC3f+ DhpQ== X-Gm-Message-State: AOAM532DgjBSBs5EueVMICvVtRzgYFjMpO6Ltls6b87tfPcoDn+p3i7u I8+NZslFKIDEzFvW/hm83u75QTCb08czEeTD0G0= X-Google-Smtp-Source: ABdhPJzV4wiA6H3ZJEzpczcQR5ifcvmWH0XMa9LbAx++dfVMXKDesCga56xh0/CQVKdBfoMlS4cuuQ== X-Received: by 2002:ad4:5ceb:0:b0:431:de28:665d with SMTP id iv11-20020ad45ceb000000b00431de28665dmr12263558qvb.58.1645997549244; Sun, 27 Feb 2022 13:32:29 -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 i128-20020a378686000000b00648ddd8a5c0sm4102153qkd.100.2022.02.27.13.32.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:32:29 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 18/24] gnu: Add stex. Date: Sun, 27 Feb 2022 16:29:14 -0500 Message-Id: <20220227212920.2009000-19-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (stex-bootstrap): New hidden package. (stex): Change from origin to package inheriting from 'stex-bootstrap' (chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies of stex-bootstrap. [arguments]<#:phases>: Remove 'prepare-stex'. Adjust 'unpack-nanopass+stex' and 'install-doc'. --- gnu/packages/chez.scm | 217 ++++++++++++++++++++++++++++++------------ 1 file changed, 155 insertions(+), 62 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index ad263a8fe3..6855195cfe 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -33,6 +33,7 @@ (define-module (gnu packages chez) #:use-module (guix gexp) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) + #:use-module (guix build-system copy) #:use-module (gnu packages compression) #:use-module (gnu packages ncurses) #:use-module (gnu packages ghostscript) @@ -158,30 +159,6 @@ (define* (chez-upstream-features-for-system #:optional ;; Chez Scheme: ;; -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) - -(define stex - ;; This commit includes a fix, which we would otherwise want to use as - ;; patch. Let's revert to tagged releases as soon as one becomes available. - (let* ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") - (version "1.2.2") - (version (git-version version "1" commit))) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/dybvig/stex") - (commit commit))) - (sha256 (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) - (file-name (git-file-name "stex" version))))) - (define-public chez-scheme (package (name "chez-scheme") @@ -218,15 +195,7 @@ (define-public chez-scheme libx11)) (native-inputs (list nanopass ; source only - ;; for docs - stex - xorg-rgb - (texlive-updmap.cfg (list texlive-dvips-l3backend - texlive-epsf - texlive-fonts-ec - texlive-oberdiek)) - ghostscript - netpbm)) + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -249,9 +218,11 @@ (define-public chez-scheme (copy-recursively #$nanopass "nanopass" #:keep-mtime? #t) - (copy-recursively #$stex - "stex" - #: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"))))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -287,32 +258,9 @@ (define-public chez-scheme (symlink scheme.boot (string-append (dirname scheme.boot) "/chez-scheme.boot"))))))) - ;; Building explicitly lets us avoid using substitute* - ;; to re-write makefiles. - (add-after 'install-symlink 'prepare-stex - (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) - ;; Eventually we want to install stex as a real - ;; package so it's reusable. For now: - (let* ((stex-output "/tmp") - (doc-dir (string-append stex-output "/share/doc/stex"))) - (with-directory-excursion "stex" - (invoke "make" - "install" - (string-append "LIB=" - stex-output - "/lib/stex") - (string-append "Scheme=" - (search-input-file outputs - "/bin/scheme"))) - (for-each (lambda (pth) - (install-file pth doc-dir)) - '("ReadMe" ; includes the license - "doc/stex.html" - "doc/stex.css" - "doc/stex.pdf")))))) ;; Building the documentation requires stex and a running scheme. ;; FIXME: this is probably wrong for cross-compilation - (add-after 'prepare-stex 'install-doc + (add-after 'install-symlink 'install-doc (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (match (assoc-ref outputs "doc") (#f @@ -320,7 +268,9 @@ (define-public chez-scheme (doc-prefix (let* ((chez+version (strip-store-file-name #$output)) (scheme (search-input-file outputs "/bin/scheme")) - (stexlib "/tmp/lib/stex") + (stexlib (search-input-directory (or native-inputs + inputs) + "/lib/stex")) (doc-dir (string-append doc-prefix "/share/doc/" chez+version))) @@ -420,7 +370,150 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (license (list asl2.0)))) ;; -;; Packages: +;; Chez's bootstrap dependencies: +;; + +(define-public stex-bootstrap + ;; This commit includes a fix which we would otherwise want to use as + ;; patch. Let's revert to tagged releases as soon as one becomes available. + (let ((commit "54051494434a197772bf6ca5b4e6cf6be55f39a5") + (revision "1")) + (hidden-package + (package + (name "stex") + ;; ^ Debian calls this "stex", not "chez-stex". It is a set of + ;; command-line tools, and there isn't a Scheme API, let alone a + ;; Chez-specific one, except perhaps that the Scheme examples are + ;; assumed to be Chez-compatible. + (version (git-version "1.2.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dybvig/stex") + (commit commit))) + (sha256 + (base32 "01jnvw8qw33gnpzwrakwhsr05h6b609lm180jnspcrb7lds2p23d")) + (file-name (git-file-name name version)) + (snippet + #~(for-each delete-file + '("sbin/install" "doc/stex.pdf" "doc/stex.html"))))) + (outputs '("out")) + (build-system copy-build-system) + ;; N.B. Upstream does not seem to support cross-compilation, + ;; though it would probably be easy to add. + (propagated-inputs + (list xorg-rgb + (texlive-updmap.cfg + (list texlive-dvips-l3backend + texlive-hyperref + texlive-bibtex + texlive-epsf + texlive-fonts-ec + texlive-oberdiek)) + ghostscript + netpbm)) + ;; Debian uses a versionless path for STEXLIB, + ;; which is much more convienient. + (arguments + (list + #:install-plan #~`(("inputs" "lib/stex/") + ("gifs" "lib/stex/") + ("math" "lib/stex/") + ("src" "lib/stex/") + ("Mf-stex" "lib/stex/") + ("Makefile.template" "lib/stex/")) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'patch-sources + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (define scheme + (false-if-exception + (search-input-file inputs "/bin/scheme"))) + (when scheme + (setenv "Scheme" scheme)) + (substitute* '("Makefile.template" + "doc/Makefile") + (("STEXLIB=[^\n]*") + (string-append "STEXLIB=" #$output "/lib/stex")) + (("Scheme=[^\n]*") + (string-append "Scheme=" (or scheme "scheme")))) + (substitute* '("Mf-stex" + "math/Makefile") + (("/bin/rm") + "rm")) + (substitute* "Mf-stex" + (("SHELL=bash") + ;; avoid Solaris workaround + "#SHELL=bash")))) + (add-after 'install 'maybe-compile + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((getenv "Scheme") + => (lambda (scheme) + (define makefile + (string-append (getcwd) "/Makefile")) + (define machine + #$(chez-machine->threaded + (nix-system->chez-machine))) + (with-directory-excursion + (search-input-directory outputs "/lib/stex") + (invoke "make" + "-f" makefile + (string-append "Scheme=" scheme)) + (for-each delete-file + (find-files machine "\\."))))) + (else + ;; for bootstrapping, can run without ahead-of-time + ;; compilation + (format #t "not compiling~%"))))) + (add-after 'maybe-compile 'maybe-make-docs + (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) + (cond + ((assoc-ref outputs "doc") + => (lambda (doc-prefix) + (define doc-dir + (string-append doc-prefix "/share/doc/stex")) + ;; the Makefile is referenced in the documentation + (copy-recursively "doc" doc-dir) + (install-file "ReadMe" doc-dir) + (with-directory-excursion "doc" + (invoke "make") + (install-file "stex.html" doc-dir) + (install-file "stex.pdf" doc-dir)))) + (else + (format #t "not making docs~%")))))))) + (home-page "https://github.com/dybvig/stex") + (synopsis "LaTeX with embeded Scheme code and HTML generation") + (description "The @code{stex} package extends LaTeX with a handful of +commands for including Scheme code (or pretty much any other kind of code, as +long as you don't plan to use the Scheme-specific transcript support) in a +document. It provides the programs @code{scheme-prep} and @code{html-prep} to +convert @code{stex} documents to LaTeX and HTML, respectively, plus makefile +templates, style files, and other resources. The @code{stex} system is used +to typeset @cite{The Scheme Programming Language} and the @cite{Chez Scheme +User's Guix}, among other documents.") + (license expat))))) + +(define-public stex + (package/inherit stex-bootstrap + (inputs (modify-inputs (package-inputs stex-bootstrap) + (prepend chez-scheme))) + (outputs '("out" "doc")) + (properties '()))) + +(define-public nanopass + (let ((version "1.9.2")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass" version))))) + +;; +;; Other Chez packages: ;; ;; Help function for Chez Scheme to add the current path to -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:32:52 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:32:52 +0000 Received: from localhost ([127.0.0.1]:59389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR9v-0008Jr-JC for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:32:52 -0500 Received: from mail-qv1-f54.google.com ([209.85.219.54]:34571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOR9u-0008Jd-CB for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:32:50 -0500 Received: by mail-qv1-f54.google.com with SMTP id ba20so11031133qvb.1 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:32:50 -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=YuIdrZBKyHowWg/p07x556LhkTvzwSpYchKVBc+nIfE=; b=JSbmiqMNjXpg8u7ahYfSeZ7lvbrrgpyVDhnvMw9U27krHLDRph3xGHobQNywMFP6O8 WT3CF5jTjOZHyWZLSfZODeRbzvP6YJx6aEGL+dK+gRDXWDBqKPBYesKoWdBhL72iIJi7 MqCkPRJTvkjvjtOt7DYc5IjCm7PCsIvHGwujJFWJXXd0Jw2keAqRPGqEBLbySt2aOOPk lJY6+I9NjfaZvJx23gt17XPhHpmslNdTZiOWXliiZ4HsKhYiTUj7+GeCAvoHYAJnQs4Q +kwwrxT6ULIxeCo/S6QrQIVu2b1bN1I0C8DFpSW0L8/tQFl7EC08yxB6wtsOhCQ8yw5Q 35Pg== 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=YuIdrZBKyHowWg/p07x556LhkTvzwSpYchKVBc+nIfE=; b=loEEpV7JEf5J1YpDoL/6l4xJ7+jMzLBu1VMlAnOmT/gw2OHlqYJC+N1CElpj04eb1K 2vnmMtxwxGxU8Lpsqg2W2CTlhWwsjLm2VZ/rxbMiua9MSL3AwRiCZ11fOObOHIa2pjRE Df/SeE6cxmMwpN8fbsnpmzmpmG+qPCxs9TOHFSjrBYNU5Cgs9kmR7RqXsoxIQc7zjSUP iouC1CJ/CV6Mj4S6BraxPgauMHBS/gfAHLqAe8981JFKa7NTNGjLTClRFpi9ZGy9+Fjk rZCRZhJocP+9q00wCfocS+F/azwPsuFCgdz5WyddsWD+gzcLpCzNW/coC8PnpYWMi621 kGhQ== X-Gm-Message-State: AOAM531N6DijaXPzpedTv/W8nqigADidsoLpT8rrgxUjGmOS8qT3X02R qJ/iHF8H1RRFIOTXSel96iFVCnZduUU7Emda+TA= X-Google-Smtp-Source: ABdhPJxeCwS7kn/3yYksbkO7XqvfxfGTb3C8p2Obo7gzft0cJBV03mYYiVwRZ2cUqxjmcBetwE/OwQ== X-Received: by 2002:a0c:ec04:0:b0:432:274a:a1fe with SMTP id y4-20020a0cec04000000b00432274aa1femr12223301qvo.68.1645997564643; Sun, 27 Feb 2022 13:32:44 -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 e22-20020ac84e56000000b002dde0f47ea6sm5855924qtw.6.2022.02.27.13.32.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:32:44 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 19/24] gnu: Add chez-nanopass. Date: Sun, 27 Feb 2022 16:29:15 -0500 Message-Id: <20220227212920.2009000-20-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (nanopass): Rename to ... (chez-nanopass-bootstrap): ... this new variable, and promote it from an origin to a package. (chez-nanopass): New variable. (unpack-nanopass+stex): New variable using 'chez-nanopass-bootstrap'. (chez-scheme-for-racket-bootstrap-bootfiles, chez-scheme)[native-inputs]: Add 'chez-nanopass-bootstrap'. [arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase to use the eponymous new variable. * gnu/packages/racket.scm (racket-vm-cs): Likewise. (make-unpack-nanopass+stex): Remove it. --- gnu/packages/chez.scm | 122 +++++++++++++++++++++++++++++++--------- gnu/packages/racket.scm | 19 +------ 2 files changed, 98 insertions(+), 43 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 6855195cfe..43d2c764f3 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -48,7 +48,8 @@ (define-module (gnu packages chez) #:use-module (srfi srfi-1) #:export (nix-system->chez-machine chez-machine->nonthreaded - chez-machine->threaded)) + chez-machine->threaded + unpack-nanopass+stex)) (define (chez-machine->nonthreaded machine) "Given a string MACHINE naming a Chez Scheme machine type, returns a string @@ -159,6 +160,20 @@ (define* (chez-upstream-features-for-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-public chez-scheme (package (name "chez-scheme") @@ -176,6 +191,9 @@ (define-public chez-scheme (file-name (git-file-name name version)) (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))) @@ -193,9 +211,7 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs - (list nanopass ; source only - stex-bootstrap)) + (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -215,14 +231,7 @@ (define-public chez-scheme #~(modify-phases %standard-phases (add-after 'unpack 'unpack-nanopass+stex (lambda args - (copy-recursively #$nanopass - "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"))))) + #$unpack-nanopass+stex)) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -317,7 +326,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; When updating, remember to also update %racket-version in racket.scm. (source #f) ; avoid problematic cycle with racket.scm (inputs `()) - (native-inputs (list racket-vm-bc)) + (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) (build-system copy-build-system) ;; TODO: cross compilation (arguments @@ -336,10 +345,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles (chdir "racket/src/ChezScheme"))) (add-after 'chdir 'unpack-nanopass+stex (lambda args - (copy-recursively - #$nanopass - "nanopass" - #:keep-mtime? #t))) + #$unpack-nanopass+stex)) (add-before 'install 'build (lambda* (#:key native-inputs inputs #:allow-other-keys) (invoke (search-input-file (or native-inputs inputs) @@ -502,15 +508,79 @@ (define-public stex (outputs '("out" "doc")) (properties '()))) -(define-public nanopass - (let ((version "1.9.2")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/nanopass/nanopass-framework-scheme") - (commit (string-append "v" version)))) - (sha256 (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) - (file-name (git-file-name "nanopass" version))))) +(define-public chez-nanopass-bootstrap + (hidden-package + (package + (name "chez-nanopass") + (version "1.9.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nanopass/nanopass-framework-scheme") + (commit (string-append "v" version)))) + (sha256 + (base32 "16vjsik9rrzbabbhbxbaha51ppi3f9n8rk59pc6zdyffs0vziy4i")) + (file-name (git-file-name "nanopass-framework-scheme" version)) + (snippet + #~(begin + (use-modules (guix build utils)) + (when (file-exists? "doc/user-guide.pdf") + (delete-file "doc/user-guide.pdf")) + (substitute* "doc/Makefile" + (("include ~/stex/Mf-stex") + "include $(STEXLIB)/Mf-stex")))))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~`(("nanopass.ss" "lib/chez-scheme/") + ("nanopass" "lib/chez-scheme/")))) + (home-page "https://nanopass.org") + (synopsis "DSL for compiler development") + (description "The Nanopass framework is an embedded domain-specific +language for writing compilers composed of several simple passes that +operate over well-defined intermediate languages. The goal of this +organization is both to simplify the understanding of each pass, because it +is responsible for a single task, and to simplify the addition of new passes +anywhere in the compiler. Nanopass reduces the boilerplate required to +create compilers, making them easier to understand and maintain.") + (license expat)))) + +(define-public chez-nanopass + (package/inherit chez-nanopass-bootstrap + (properties '()) + ;; TODO: cross-compilation + (native-inputs (list chez-scheme stex)) + (arguments + (substitute-keyword-arguments (package-arguments chez-nanopass-bootstrap) + ((#:install-plan base-plan) + #~`(("nanopass.so" "lib/chez-scheme/") + ("doc/user-guide.pdf" #$(string-append + "share/doc/" + (package-name this-package) + "-" + (package-version this-package) + "/")) + ,@#$base-plan)) + ((#:phases base-phases #~%standard-phases) + #~(modify-phases #$base-phases + (add-before 'install 'compile-and-test + (lambda args + (invoke "scheme" + "--compile-imported-libraries" + "--program" "test-all.ss"))) + (add-after 'compile-and-test 'build-doc + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "doc" + (invoke "make" + (string-append "Scheme=" + (search-input-file + (or native-inputs inputs) + "/bin/scheme")) + (string-append "STEXLIB=" + (search-input-directory + (or native-inputs inputs) + "/lib/stex")))))))))))) ;; ;; Other Chez packages: diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 035d93bfb5..f29e0791a7 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -251,22 +251,6 @@ (define (racket-vm-common-configure-flags) "--disable-strip" "--enable-origtree")) -(define (make-unpack-nanopass+stex) - ;; Adapted from chez-scheme. - ;; Thunked to avoid evaluating 'chez-scheme' too early. - ;; TODO: Refactor enough to share this directly. - #~(begin - (copy-recursively - #$nanopass - "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-public racket-vm-cgc ;; Eventually, it may make sense for some vm packages to not be hidden, ;; but this one is especially likely to remain hidden. @@ -417,6 +401,7 @@ (define-public racket-vm-cs (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") (prepend chez-scheme-for-racket-bootstrap-bootfiles + chez-nanopass-bootstrap racket-vm-bc))) (arguments (substitute-keyword-arguments (package-arguments racket-vm-cgc) @@ -425,7 +410,7 @@ (define-public racket-vm-cs (add-after 'unpack 'unpack-nanopass+stex (lambda args (with-directory-excursion "racket/src/ChezScheme" - #$(make-unpack-nanopass+stex)))) + #$unpack-nanopass+stex))) (add-after 'unpack-nanopass+stex 'unpack-bootfiles (lambda* (#:key native-inputs inputs #:allow-other-keys) (with-directory-excursion "racket/src/ChezScheme" -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:33:12 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:33:12 +0000 Received: from localhost ([127.0.0.1]:59397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORAG-0008LB-6I for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:33:12 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:37776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORAD-0008Kv-Tp for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:33:10 -0500 Received: by mail-qk1-f179.google.com with SMTP id v5so8991551qkj.4 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:33:09 -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=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=Gi3RCsA57SE2QTOEWXHkP40aLW9iJKSGW0mPeQSZGxsflgf034waEq4y7vi1u6k5vO fi28GEYmoMjkUp/QjlZl51rxLkVK3cQgZiAsL67pN9aajXbkyp+FvNfpvMwy+Ye/bh10 FjKD/qgJiTEjaMaHYejtA4e3beByPVU4iHZeTET/EC4Vtv0oml4Dz5su0Q8XTA83brfR 5/NIdOU0oae4LEEYFfc6zN+JNsMjKJo5NURojY7R48QKC9Jlnex3HU4QkCJoXcu4URF4 +Km663BDxqm/exCSAglgta817p3Qw9RxcyVQc6B+7BZZhKBv/5aCiCrf4wrTXal8jVuo sHEA== 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=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=i4sU1uagCqPtr9b8dzWOBzawXXncbhKzFWV3wsO5YPsAsOaiw1w9cQUkkss1boDEVN ZD25iXQaxHEofoUtWBLfjVENr3JikbriZMmPGEyJpSkeixk9oFppYNJNJAxglYnVEq62 ZryzHzf5vPIJBiEIKZZuInoRLoFRpcW0ZXockHaXwFfIgc3/jr0vKFrOFfb+GadJ3swk w6qWIbNQ99vSK3AoX2tuqNcA25cePrwsTmyOba3BQSmap58x/VYzp8l84MyWxkNEDQxJ TTluAMFDbXIYoLqn75iK9VSjmVhHZOyKgyBCnvtdYScQbcu0HTAKrjBGSlGM96D4aIY3 IyoQ== X-Gm-Message-State: AOAM532AfhKpCkitcj1c+ncKHEd/omwvxIQJRUWy5fF+VjT4YvEWk5D2 YOHA44XvWduEnxon4z5vl/oeXyaekHCR4Z37teU= X-Google-Smtp-Source: ABdhPJyfCmR9nR+SI2rooYBw8lZm+Fnab0OmYvsg0LW7l3NFKsWlF6YaABq2QZk7RKmETWQIbaw90w== X-Received: by 2002:a37:5d2:0:b0:5e9:5876:7f0 with SMTP id 201-20020a3705d2000000b005e9587607f0mr9627180qkf.4.1645997584318; Sun, 27 Feb 2022 13:33:04 -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 p22-20020a37a616000000b00547b8839339sm4179005qke.77.2022.02.27.13.32.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:33:04 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 20/24] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Date: Sun, 27 Feb 2022 16:29:16 -0500 Message-Id: <20220227212920.2009000-21-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. (chez-scheme-for-racket-bootstrap-bootfiles): Inherit from 'chez-scheme-bootstrap-bootfiles'. [arguments]: Adapt accordingly. --- gnu/packages/chez.scm | 98 +++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 43d2c764f3..da267d3616 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -46,6 +46,7 @@ (define-module (gnu packages chez) #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:export (nix-system->chez-machine chez-machine->nonthreaded chez-machine->threaded @@ -211,7 +212,9 @@ (define-public chez-scheme ;; 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-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -232,6 +235,14 @@ (define-public chez-scheme (add-after 'unpack 'unpack-nanopass+stex (lambda args #$unpack-nanopass+stex)) + (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 (or native-inputs 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`. @@ -316,8 +327,46 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (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 + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %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 upsream +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."))) + (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)`. @@ -325,32 +374,30 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; 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 `()) (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) - (build-system copy-build-system) ;; TODO: cross compilation (arguments - (list - #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")) - #:phases - #~(let ((unpack (assoc-ref %standard-phases 'unpack))) - (modify-phases %standard-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) - (invoke (search-input-file (or native-inputs inputs) - "/opt/racket-vm/bin/racket") - "rktboot/main.rkt"))))))) + (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) + (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)) (home-page "https://github.com/racket/ChezScheme") @@ -372,8 +419,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles 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.") - (license (list asl2.0)))) +Chez Scheme."))) ;; ;; Chez's bootstrap dependencies: -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:33:27 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:33:28 +0000 Received: from localhost ([127.0.0.1]:59400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORAV-0008Ld-MD for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:33:27 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]:44914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORAU-0008LS-UK for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:33:27 -0500 Received: by mail-qt1-f181.google.com with SMTP id v3so7414139qta.11 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:33:26 -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=rAwszW55AeDy3TSpuVQTOuAPtbNMETW3iT05z+FwR7k=; b=CL0+HS4MbXEKYQkWkAzi4thNxis2mRjtn0LBJnS3ph96bm+M4sIwrFuUKrq5RvPnlu 2BKwd0APswNW2fyTrgJhjG1T+Akk/xMbvJzz3AzX8PLar3giNeH98izZHIdf0ttVe7w1 zfg23sL23dPWytF7Nvjd5qZH4lLvr7LdOozEGKQfd107S6VbTazt3CbnnmNuW4hSzSx+ VEWJMHenThOx9llnkAGz5To7F5vzOGGW9Xe9/iyXNBP8oCPrxyewUZvFEIJMUozkr4xr H6ahYPFLTGtnLqkIYorDvnU7MsiP1unupYk1onkVFH9KAVbZjaKzS/FvYac3haAJsYYW +DEQ== 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=rAwszW55AeDy3TSpuVQTOuAPtbNMETW3iT05z+FwR7k=; b=BzXCj+ehlb7aEVfQWdeH3/+fcwX+whkuwZno+dKCN0rDSFoFgmoKRorFqgOse4GJT3 MFNAvOlYD9zcSdlpC7mXpStssXXF6b+0c9D7nGxjXtVpIZbPXOLNnFuJO65yD7cOJPAm uKp2yqF/BA/Bj8MgSZgZpclt3Cx4OQDEqodJIFIjJbt6fx0QU50+pcbMWh30kcMgKvNJ LSo6u6H/Xoiyejh0/FEeCu4LEH5NG7XUTriCyzEvUQbYznlVY9yXsb3zXpa7BxaC08Ns Tu1f3qAlNrTLLGtJpujYnG3f3Ma4spL42c86ukPNHsr98h37ENAechNGERX9OsBmRYp0 yKuw== X-Gm-Message-State: AOAM530U1KurdM7wxKRtM2/zWW1C6UCpKJLgIEy2pK6KA+pKso0zDykZ erJMHjoV9rAb2FE30A5yR0Q/d4NXfR5O78Wq7U8= X-Google-Smtp-Source: ABdhPJx/WpPPfjAYl8b8p5M8EfrMNa5bh5YRSVFwSs61CneAc/i+peLCGTiHRqSz2fVTeZ2c2l0eww== X-Received: by 2002:ac8:4e82:0:b0:2dd:e5a1:3b2a with SMTP id 2-20020ac84e82000000b002dde5a13b2amr14525935qtp.196.1645997599276; Sun, 27 Feb 2022 13:33: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 h188-20020a376cc5000000b0064957b23a9csm4206954qkc.118.2022.02.27.13.33.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:33:19 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 21/24] gnu: chez-mit: Support chez-scheme-for-racket. Date: Sun, 27 Feb 2022 16:29:17 -0500 Message-Id: <20220227212920.2009000-22-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Racket's variant of Chez Scheme defines 'string->uninterned-symbol', which conflicts with the definition from '(chez mit)'. See discussion at . * gnu/packages/chez.scm (chez-mit)[origin]: Add workaround for chez-scheme-for-racket. --- gnu/packages/chez.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index da267d3616..5d5108a2b1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -949,7 +949,29 @@ (define-public chez-mit (commit (string-append "v" version)))) (sha256 (base32 "0c7i3b6i90xk96nmxn1pc9272a4yal4v40dm1a4ybdi87x53zkk0")) - (file-name (git-file-name name version)))) + (file-name (git-file-name name version)) + (snippet + ;; Workaround for chez-scheme-for-racket. + ;; See: https://github.com/racket/racket/issues/4151 + #~(begin + (use-modules (guix build utils)) + (substitute* "mit/core.sls" + (("[(]import ") + "(import (only (chezscheme) import)\n") + (("[(]define string->uninterned-symbol gensym[)]") + (format #f "~s" + '(begin + (import (only (chezscheme) + meta-cond + library-exports)) + (meta-cond + ((memq 'string->uninterned-symbol + (library-exports '(chezscheme))) + (import (only (chezscheme) + string->uninterned-symbol))) + (else + (define string->uninterned-symbol + gensym))))))))))) (build-system gnu-build-system) (inputs (list chez-srfi)) ; for tests -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:33:52 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:33:52 +0000 Received: from localhost ([127.0.0.1]:59403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORAt-0008MJ-W1 for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:33:52 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]:37815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORAr-0008M7-RG for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:33:50 -0500 Received: by mail-qt1-f174.google.com with SMTP id q10so7416073qtw.4 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:33:49 -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=b8kcA/P8AUsAZYQYuSEsSHXtcIBPJDIG5YvLBDBjlc0=; b=Yt9jB+WRXgwKdqFhPJpfw8RF5yJpFG0P7Sopi/Z+y7v48Ex3zkeYYLfZKZ9r8u25Rf lXzJpXWOwo6LeOVe6pLvWvPf/Gxj7lxcArPZ4T/8IPqEAs10jH4Vs7BaSTIbOowt+l+J EG9eAgOCPSIdPj5lOnRyL2m0w2uvzeS6c33J6UZyQs1ayjpb4/jk3IXy7cjNGLrwvQWK MwnC0gaah8LmTSvYxH78Imb/hXerDNtqBuJ0MlJH6CXHg516xQWJtRdhllA2JgNSpaqa /9gnXGqVcXfASGbT/RNG2QcAIjpIOvSNirs7yk4SWjn/MDQpFp03nMdJlxyvPRT4pOHG 7SGg== 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=b8kcA/P8AUsAZYQYuSEsSHXtcIBPJDIG5YvLBDBjlc0=; b=H0ENFYko1S3O3SDnzwZxspXVmT4XolMMD2vrV/KfJT2RmJ++goK2weslGfHY/mR9TK 3nZLCOavBevA3D0HRh81GsAetxd5vB5o2jlyWUDk49KizTqxgno+F4zXfqYKvCHWwy7/ N3lTYEscgRVBSmOssbhnmrlMyT017T9cl0T5+zd6GMVojxqCPfTThELr08ZP+23cNMoa WkvNjWoNKs+VCwTyyzAqzeYqHviy7eceuceBcjiMO1DDLW3g02H9omRyovLOcXR8HheN u4l9PreQGSS/qkKX1qjwQzsIjgCMMhspfaOuD7SqSNTNSNOfsG7YjnOrNptTqqyyCNl3 NFXg== X-Gm-Message-State: AOAM533MueWcVW2EOlvTDnh8PmnufrnKDAmtRTs8pJryW7sJ46KHNGhB xP35YNwmAub7CBFHekGTFAFLU2C/PnjlK6pBcms= X-Google-Smtp-Source: ABdhPJwHs1s5LBzf7qFdZSoqp031MmhV8BXVkw93akolkrFvAyfBm5MfNQgmRb8vFOf9rnrIEKlcYw== X-Received: by 2002:a05:622a:c:b0:2dd:b184:c181 with SMTP id x12-20020a05622a000c00b002ddb184c181mr14080429qtw.273.1645997624271; Sun, 27 Feb 2022 13:33:44 -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 p25-20020a05620a057900b005f1928e8cd0sm4084604qkp.134.2022.02.27.13.33.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:33:44 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 22/24] gnu: Add chez-scheme-for-racket. Date: Sun, 27 Feb 2022 16:29:18 -0500 Message-Id: <20220227212920.2009000-23-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) 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 5d5108a2b1..e7ddab0d1f 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 f29e0791a7..50ef8c1f5e 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:34:12 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:34:12 +0000 Received: from localhost ([127.0.0.1]:59409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORBD-0008NT-GV for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:34:11 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]:43849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORBB-0008NF-U5 for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:34:10 -0500 Received: by mail-qt1-f181.google.com with SMTP id s15so7409057qtk.10 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:34:09 -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=U6sOEQII/nfr63USoeuo2RDShtCjrXl2+vOKM7l7ThA=; b=UicR0GRq25yM8Z+Jh0DRKeKE1MrutLNYBTDdvgJ5Pxw4qJQRpe35a5NaMZqrOq3Q1C OVGEQGhpNgLufLH1oXjE7oaoPXjxa1yV1SrqbM5b7hW0nuYwmWFnMLDRbMKOPzt/cppJ /gmbJE075UdzRW2lap5oKrM5NgAPO99igVczRYbW4ZnzslsNQ2dyDN4ZkQlW1YeFLYik 00jsP0ar/9YcweS9JRaabvN40qaZlGsJavnQY726bvr5RMX2l8340PBOVVD/0epR5R2u nb60SvBEEe/JHOfAZ6nYWOtUxZUAk99pMglCGCf0L75rDcidnW33ch2Zq9sauNqAlIhT B53Q== 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=U6sOEQII/nfr63USoeuo2RDShtCjrXl2+vOKM7l7ThA=; b=0cx8pSSBAFFj/KB+4K/wiClJIqIZ7LYMY63NeHrFJvRvdiDQZ1gqAdrs7M8N1ADIJY O4SgYd+yJOb7aBH+vjuYEu2aQSzAMIqeKgLKwI3nsiRoLyWw7rflozpaP3V/PfeA4i92 TZX2ly6a/OU1BHqEy0nNfv5KMyFaazTrgsnuqhmAc290ZYMbaUbzvNcOZ95CHxyLkEmQ FeBy+HP9PHr+51Tci4Er93HJg3MeCM1hLcvczBm+4oFRV7l0sawHG5LBtir/cCmVKiUr 86TngJLzwhZx5GZBjYO9bnphNOT1G9b10ThlaPeNPuzbnMverUuZH24joWCWaS3EcVgX Nelg== X-Gm-Message-State: AOAM531W8QbL0KKKnjDLsAbzts7DpfEIPsDXrNI0i34U9XPAXZTFZVL4 456OZvxIQGdgbFh2Ya8NJ6gm/N+Erq+D5wVF2Lw= X-Google-Smtp-Source: ABdhPJzHrK3IMELSb4U1Trw5hDTNC5wB28IblUINi2oThk4dZVyh8WwcHu859J2N+eWx5n8dxy1WPA== X-Received: by 2002:ac8:130c:0:b0:2dd:d52d:325 with SMTP id e12-20020ac8130c000000b002ddd52d0325mr14740861qtj.376.1645997644493; Sun, 27 Feb 2022 13:34:04 -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 c27-20020a05620a135b00b0062cda8dab3fsm4175863qkl.46.2022.02.27.13.33.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:34:04 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 23/24] gnu: chez: Add 'chez-scheme-for-system'. Date: Sun, 27 Feb 2022 16:29:19 -0500 Message-Id: <20220227212920.2009000-24-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (chez-scheme-for-system): New procedure. (chez-srfi, chez-web, chez-sockets, chez-matchable, chez-irregex, chez-fmt, chez-mit, chez-scmutils): Use 'chez-scheme-for-system'. * gnu/packages/loko.scm (loko-scheme): Likewise. * gnu/packages/emacs-xyz.scm (emacs-geiser-chez): Likewise --- gnu/packages/chez.scm | 33 ++++++++++++++++++++++++--------- gnu/packages/emacs-xyz.scm | 2 +- gnu/packages/loko.scm | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index e7ddab0d1f..b3aadf3a78 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -47,7 +47,8 @@ (define-module (gnu packages chez) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:export (nix-system->chez-machine + #:export (chez-scheme-for-system + nix-system->chez-machine chez-machine->nonthreaded chez-machine->threaded unpack-nanopass+stex)) @@ -67,6 +68,20 @@ (define-module (gnu packages chez) ;; ;; Code: +(define* (chez-scheme-for-system #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return 'chez-scheme' unless only 'chez-scheme-for-racket' supports SYSTEM, +including support for native threads." + (if (or + ;; full support upstream + (and=> (chez-upstream-features-for-system system) + (cut memq 'threads <>)) + ;; no support anywhere + (not (nix-system->chez-machine system))) + chez-scheme + chez-scheme-for-racket)) + (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 @@ -751,7 +766,7 @@ (define-public chez-srfi (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -782,7 +797,7 @@ (define-public chez-web (base32 "1dq25qygyncbfq4kwwqqgyyakfqjwhp5q23vrf3bff1p66nyfl3b")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) ghostscript ;; FIXME: This package fails to build with the error: ;; mktexpk: don't know how to create bitmap font for bchr8r @@ -847,7 +862,7 @@ (define-public chez-sockets (base32 "1n5fbwwz51fdzvjackgmnsgh363g9inyxv7kmzi0469cwavwcx5m")))) (build-system gnu-build-system) (native-inputs - (list chez-scheme + (list (chez-scheme-for-system) chez-web (texlive-updmap.cfg (list texlive-pdftex)))) (arguments @@ -933,7 +948,7 @@ (define-public chez-matchable (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -965,7 +980,7 @@ (define-public chez-irregex (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -996,7 +1011,7 @@ (define-public chez-fmt (propagated-inputs (list chez-srfi)) ; for irregex-utils (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "chez-check" @@ -1059,7 +1074,7 @@ (define string->uninterned-symbol (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (arguments (list #:make-flags (chez-make-flags name version) #:test-target "test" @@ -1090,7 +1105,7 @@ (define-public chez-scmutils (inputs (list chez-srfi)) ; for tests (native-inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list chez-mit chez-srfi)) (arguments diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index ef98088100..df53df61c7 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -451,7 +451,7 @@ (define-public emacs-geiser-chez (string-append "(eval-after-load 'geiser-impl '" all ")")))))))) (inputs - (list chez-scheme)) + (list (chez-scheme-for-system))) (propagated-inputs (list emacs-geiser)) (home-page "https://nongnu.org/geiser/") diff --git a/gnu/packages/loko.scm b/gnu/packages/loko.scm index ef9312afe3..449c62f1f0 100644 --- a/gnu/packages/loko.scm +++ b/gnu/packages/loko.scm @@ -71,7 +71,7 @@ (define-public loko-scheme #t))))) (native-inputs `(("akku" ,akku) - ("chez-scheme" ,chez-scheme) + ("chez-scheme" ,(chez-scheme-for-system)) ("struct" ,guile-struct-pack) ("laesare" ,guile-laesare) ("pfds" ,guile-pfds) -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 27 16:34:27 2022 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:34:27 +0000 Received: from localhost ([127.0.0.1]:59412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORBT-0008Nx-0Y for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:34:27 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:45801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORBR-0008Nj-Vv for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:34:26 -0500 Received: by mail-qk1-f179.google.com with SMTP id b13so8961633qkj.12 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:34:25 -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=4sCO59XkLaPXWOjMC0ZdG9LOu8LuSFrT3gU7RQx5rKM=; b=F2O+qFI9Xxt18fLKRwmIm8mTLCIkgavsB3pZ4nOQVf16SxrGJnj64f4yaapp5Bdblk BLvC80RhuLtRFiJPaPCsRT1SgQmvAsnQ5vZbcicjmLjUpbzU/+7OZZyFVi2IhdQ/4upO UNmHLMwPiKjTYdwO9QaHc0uk5bWkt7HLuZz7Bk8p77MhzLLmjMqwLjfbzRDo9gJRF98y +fiqodRH0Oh4I17uVnHivosG3D6z6glMOS0aXr07sDzuLokz1QdSQsu3NxvX05bPsFNK Y/bGMXNrF2K1D7MocfKc0Pdb6sD/eSDdRn01UOeBzgGG5S8qnCoEK43q1vbAmetWTH+Q sgAA== 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=4sCO59XkLaPXWOjMC0ZdG9LOu8LuSFrT3gU7RQx5rKM=; b=NYM3h9AbsptO8Lt8qAlcngVfzoH6T0RelkTh6jX9sRN7Wy7QAs7NHVJefjdULAyXt7 OH9A7TegOwpiNtqIgobWFxz8sjXjbwlx4H92fTL6j9dqNdHrGsorbL6kk0tFgp1qTnJF pHBvmN6zYBhfIOIThx+LAwBAyXwCCQ88RBCYZO1D6Xp3F1u8vd/r7WgKJRVlkwxXTjT+ vlhR1CtrIdcRnJ2lIc6wWgiXvWx2CIy8EnVVreHqUVhBE2KTmNA9fokpTJQB9Pcv1c5O aRSgtxEbgLZ6vRyQlXUgXQqdO7sZKW72W1pn0HzlKxeS6B8oCmpHkKpaYuWLcerErxCK rTkA== X-Gm-Message-State: AOAM532sklc8ecn8MKm6BxixUf3kGoTBYYvBnDZWXm6chgLYzRnsCKgc dOQJU2n4ff6W5kgRO7dtxNdq+S+L1Dckc+T9lqk= X-Google-Smtp-Source: ABdhPJxwBIUii88n0wi2wVdMYW8XU2rO+MLzuo2youWN5bW5MQBVVE8IZoBsRHOaZjWQ6MGkDUpDrg== X-Received: by 2002:a37:a505:0:b0:60d:df5e:16c7 with SMTP id o5-20020a37a505000000b0060ddf5e16c7mr9962901qke.448.1645997660530; Sun, 27 Feb 2022 13:34:20 -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 p4-20020a05622a00c400b002de0b744039sm5750902qtw.43.2022.02.27.13.34.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:34:20 -0800 (PST) From: Philip McGrath To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Subject: [PATCH v7 24/24] gnu: racket-vm-cs: Build with "--enable-scheme". Date: Sun, 27 Feb 2022 16:29:20 -0500 Message-Id: <20220227212920.2009000-25-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 53878 Cc: Philip McGrath , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/racket.scm (racket-vm-cs)[native-inputs]: Remove 'chez-scheme-for-racket-bootstrap-bootfiles'. Add 'chez-scheme-for-racket'. [arguments]<#:phases>: Delete 'unpack-bootfiles'. <#:configure-flags>: Add "--enable-scheme". --- gnu/packages/racket.scm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 50ef8c1f5e..8d44241414 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -399,7 +399,7 @@ (define-public racket-vm-cs (native-inputs (modify-inputs (package-native-inputs racket-vm-cgc) (delete "libtool") - (prepend chez-scheme-for-racket-bootstrap-bootfiles + (prepend chez-scheme-for-racket chez-nanopass-bootstrap racket-vm-bc))) (arguments @@ -409,18 +409,15 @@ (define-public racket-vm-cs (add-after 'unpack 'unpack-nanopass+stex (lambda args (with-directory-excursion "racket/src/ChezScheme" - #$unpack-nanopass+stex))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (search-input-directory (or native-inputs inputs) - "lib/chez-scheme-bootfiles") - "boot")))))) + #$unpack-nanopass+stex))))) ((#:configure-flags _ '()) #~(cons* "--enable-csonly" "--enable-libz" "--enable-lz4" + (string-append "--enable-scheme=" + #$(this-package-native-input + "chez-scheme-for-racket") + "/bin/scheme") #$(racket-vm-common-configure-flags))))) (synopsis "Racket CS implementation") (description "The Racket CS implementation, which uses ``Chez Scheme'' as -- 2.32.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 04 17:59:11 2022 Received: (at 53878-done) by debbugs.gnu.org; 4 Mar 2022 22:59:11 +0000 Received: from localhost ([127.0.0.1]:46985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQGtD-0008GL-HO for submit@debbugs.gnu.org; Fri, 04 Mar 2022 17:59:11 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:43656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQGtB-0008G5-O5 for 53878-done@debbugs.gnu.org; Fri, 04 Mar 2022 17:59:10 -0500 Received: by mail-ed1-f67.google.com with SMTP id f8so12542302edf.10 for <53878-done@debbugs.gnu.org>; Fri, 04 Mar 2022 14:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=U7NGcfHMw9fIlx0zjv08u1EBzZLiWF+0Z8ViKlAJc90=; b=Kl5My12jdYypV8aC/FnZKKYzgbD9oEbAgpjcK1Dp7SG2IYJXSJTAltdsT3xXGjxor9 ZyojjZJkuNU/8ekDKLewNQwzLfG0BZGCVADFkzq1LzSydNU4biqc6xiXthWaStWiNhAK xoso1+y4Ii/1LdulblssrkAbWnnEFi0CZXPp47TJxFKLkXfdX9nSLfoppXSskJo2Ug5j 7q4V+t2yV9ul6AyFtMDkXfyTMXoFdKJBKKZZQ0D/O7EhZmwm9TTw1XEwM9wg2fEmYLKz CXR5ev7BJ+vo3HqFWLhR95ckZ7qIScdwJUA3+Lc1D0XziXT/GuPfFaVdKsEVguFs/FL0 yT1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=U7NGcfHMw9fIlx0zjv08u1EBzZLiWF+0Z8ViKlAJc90=; b=6vsY4y7rcXde9xnKVy8sr0Nyip4BykkX/02357vDgxwppgXDGr3iqxZPmiolNkIHz8 lspGckbZ6AGu/qhwjx3TmHuwpca56jxiMZ9rWFv/cnEY5RRlVtKaF4gjSpXfiUklHCEI AMsgi1BvuhDs/J9NInMBGn4w+mj4eUKyuJMcjHAmmnsePQc5UyZGaKAzOp7oprth1atL DvEtT6jkOPn+52qU/Q1QD73pGbzkDUq0uajp+Gt40I6Cr1uoDr97gdAeArgXdUXvN5aE hgvIuuOBjqFVk+L9cfo8Cu3JYAJMqDHSknFixG1whUnnxnAdPBKtY5gM2YuIW2CMoi3t IEDQ== X-Gm-Message-State: AOAM530aecbdVgvKpzj3F6PWIkIoZvuPSkk4vzJdXvTPqC7V3ciNvLef o9DNHsECDjxjukWHX/ujWhM= X-Google-Smtp-Source: ABdhPJyZ/HW+NJp7jc2y4VM3nYp6fYMiJyafQXQEx+8l5zpCcVN5K04GdXoQlYIpARpwsMxUtemLDw== X-Received: by 2002:aa7:cb18:0:b0:413:3a7a:b5d6 with SMTP id s24-20020aa7cb18000000b004133a7ab5d6mr730886edt.254.1646434743644; Fri, 04 Mar 2022 14:59:03 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id z15-20020a170906240f00b006d703ca573fsm2200270eja.85.2022.03.04.14.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 14:59:03 -0800 (PST) Message-ID: <4f9873896a7d2c42dd11e546ddda3dbf002bcf07.camel@gmail.com> Subject: Re: [PATCH v7 00/24] Update Racket to 8.4. Adjust Chez Scheme packages. From: Liliana Marie Prikler To: Philip McGrath , 53878-done@debbugs.gnu.org, zimoun Date: Fri, 04 Mar 2022 23:59:00 +0100 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878-done Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Philip, Am Sonntag, dem 27.02.2022 um 16:28 -0500 schrieb Philip McGrath: > Hi, > > On Sunday, February 27, 2022 3:42:46 AM EST Liliana Marie Prikler > wrote: > > > > Perhaps I wasn't clear enough about this in v5, but I think spec > > should > > be a single argument rather than multiple ones.  This way, if we do > > find that we need to extend it to support an additional argument, > > we > > don't have to awkwardly code around the #:rest. > > > > Rather than debate it, I'm sending a v7 with the change to patch > 03/24 that Liliana requested in > . Sorry for the delay. I cleaned up some of your commits and their messages, but apart from that pushed v7 without major changes. I'm marking this as done now; if you feel I've made a mistake somewhere, don't hesitate to reopen. Cheers From unknown Sat Jun 21 03:29:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 02 Apr 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 27 15:57:42 2022 Received: (at control) by debbugs.gnu.org; 27 Apr 2022 19:57:42 +0000 Received: from localhost ([127.0.0.1]:44477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njnnC-0000up-9a for submit@debbugs.gnu.org; Wed, 27 Apr 2022 15:57:42 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njnnA-0000ub-BG for control@debbugs.gnu.org; Wed, 27 Apr 2022 15:57:40 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 33BFA5C012E for ; Wed, 27 Apr 2022 15:57:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 27 Apr 2022 15:57:35 -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:message-id:mime-version :reply-to:sender:subject:subject:to:to; s=fm1; t=1651089455; x= 1651175855; bh=CcCauwESQ18OBzbSc8Qz1DwEGX7jY7su2GIF3lg/kzU=; b=i ygs/r6hzF3bWsfIzm8T2lfTzcyM0G3gfnuT7CJPOEiJAQd2a5Y8Bi9a4PPPHdXNO 1e2tta0eBPgnZ5uU48R5ovS1ON5GvfUtxnhqmnkvcNyZpy4tGyuXr/p7JFgnk9AH 1XQYAXQlW9M7WPHu75v2r+38oxVeLNJckBzhNFGYNEIGPsTrb9UCxvwd+LDvtvXF XdKzBTZKuiFwcwQAJ/ySYZx17wXqmEVbG2EDRCnVXBmixeaAsJCeRcWMshlcyyra NO1/zVnrGk7H77mr6tS2lYdT3VOODaMmfHcKMJMc9R8mBtPB6BXoOYeWjwZqOHcC rH/iUZ/CwmCWci/LV8sFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1651089455; x= 1651175855; bh=CcCauwESQ18OBzbSc8Qz1DwEGX7jY7su2GIF3lg/kzU=; b=O pN2D+nbRKeSngI5+bj3zBpHdiRt3H/l5PolITmtr00pMtnKQLakkGGHG5df/XhlR 093ObIGMTI9fv9+eVTPoyvVxy/JixxhtKcgGKS5BaHxHCXU6UXcjYPphBFmTx6V+ 3cDh1KP52caEZgN4RqmQ9EKUqPd8s4YcOKZk+d/LDd5vmdgSndrzVnrm5A+MNKv+ FiLP69n3LvtaoIdk1jgz0GiNT4ZlpaEE8BR2uI4R2MTDAnro2GOUOR7gNGetjAE8 f7LzjmwBCZuEN5A3YjopoTz2uKqDPKPK0an/Zd6K4M8/hBzXZvpv/hIUlL4r3AfL bri/jGI/q0EAvdHPt+ojw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudehgddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfvhffutgfgsehtjeertd dtfeejnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhh ihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnhepkedvgeffiedtgf ehhfekfeduueejgeeujeethedtgfejgfehueetjeejjeefgfeunecuvehluhhsthgvrhfu ihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiph hmtghgrhgrthhhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 27 Apr 2022 15:57:34 -0400 (EDT) Message-ID: <4e846628-6f74-ee0f-5966-7b4323a24d7e@philipmcgrath.com> Date: Wed, 27 Apr 2022 15:57:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: control@debbugs.gnu.org From: Philip McGrath Subject: debbugs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) unarchive 53878 From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 27 16:03:29 2022 Received: (at 53878) by debbugs.gnu.org; 27 Apr 2022 20:03:29 +0000 Received: from localhost ([127.0.0.1]:44484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njnsj-0003Fv-T1 for submit@debbugs.gnu.org; Wed, 27 Apr 2022 16:03:29 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njnsj-0003Fi-0Z for 53878@debbugs.gnu.org; Wed, 27 Apr 2022 16:03:25 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E12595C021C; Wed, 27 Apr 2022 16:03:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 27 Apr 2022 16:03:19 -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:sender:subject:subject:to:to; s=fm1; t=1651089799; x=1651176199; bh=+9xfCgmriagGVRs4GPw0qZplV R9eUxOVeZUNJkhw1rI=; b=Yl42UeUvTRWgalULZJ/+yCnBWi5Y9XCzcJCMbIQDs fP5t5+vAVUSh/lO3fwl9rlyTajxvnZTZ6Mxc3bTp72Y2EsTb5B477WBpsqt9s8qF S2MfQt5npOjRNLK5lduSPmnrbOJswKcg8p3JOWse3PJRLil8GL83UfQVxsW+Xl9r zMjxHLQo/4f38hrZLufTucRRQgYI3Ht2Pr+bFSi0D4rIUUWnUj3yg9eyvXEu7axR J6HG4gWjdH8SDwi5q/CNPgG13SRR2WQayMz9RZIN7nJ8H66W6TyxDo/y9ZHn4vji /EnYwl0iIOt+bFV7VUKa7xpUvKsbQfqE/GiL2f/Nb2LHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.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:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1651089799; x=1651176199; bh=+9xfCgmriagGVRs4GPw0qZplVR9e UxOVeZUNJkhw1rI=; b=GslqK7XHwihhxjWO2EPGGXKWm0/Ya0uG+BwFfeP/YlWT pX8SBMLDMupR/toDI/R1jMgXfyVPxziDrI+Q13qe49OiZerikRr9HRDaf9zOPele mrLPH0FNEXkxItb+OBONUDgxPozm9R77HNh9tQv0EztOWn3X0eIlV3kpf5K1Mx4x iwRCZY+Q1sVo5cqa4MTgzshz9/30qRTb5ywrTOV+hjGkEtXsKQsODQTBQdtLos1U feHbJOCmaYo8k1BWlRnLjcWcU34vmlBEND2e4ndbORtUWOMOE+EpSwWZTBPZDDy+ FwlNeWL2BS4feNKx0A4zrbyOhlDtOPeKpoz5evwJ+w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudehgddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfufhfvffhjggtgfesthejredttdefjeenucfhrhhomheprfhhihhl ihhpucfotgfirhgrthhhuceophhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtoh hmqeenucggtffrrghtthgvrhhnpefhvddtheefteejkeegffdtfeeigefgkeeileelgfeh vdfhvedvvdeijeefgfduteenucffohhmrghinhepghhnuhdrohhrghdprhgrtghkvghtqd hlrghnghdrohhrghdpghhithhlrggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrth hhrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 27 Apr 2022 16:03:19 -0400 (EDT) Message-ID: <6f8a5468-a62d-d54b-d1ac-c85fd32795d1@philipmcgrath.com> Date: Wed, 27 Apr 2022 16:03:19 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Fwd: [PATCH v7 00/24] Update Racket to 8.4. Adjust Chez Scheme packages. Content-Language: en-US References: To: 53878@debbugs.gnu.org, Liliana Marie Prikler From: Philip McGrath In-Reply-To: X-Forwarded-Message-Id: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) (Hopefully I've made the necessary debbugs incantations for this to go through this time.) -------- Forwarded Message -------- Subject: Re: [PATCH v7 00/24] Update Racket to 8.4. Adjust Chez Scheme packages. Date: Wed, 27 Apr 2022 15:52:49 -0400 To: Liliana Marie Prikler , 53878@debbugs.gnu.org Hi, On 3/4/22 17:59, Liliana Marie Prikler wrote: > Hi Philip, > > Am Sonntag, dem 27.02.2022 um 16:28 -0500 schrieb Philip McGrath: >> Rather than debate it, I'm sending a v7 with the change to patch >> 03/24 that Liliana requested in >> . > Sorry for the delay. I cleaned up some of your commits and their > messages, but apart from that pushed v7 without major changes. I'm > marking this as done now; if you feel I've made a mistake somewhere, > don't hesitate to reopen. > While getting ready for the upcoming Racket 8.5 release, I noticed some differences between my issue 53878 v7 patch series and the commits as applied to Guix that I hadn't noticed at the time. I don't want to make a big a deal out of it---I'm sure everyone was acting in good faith, and it isn't enormously consequential in the grand scheme of things---but it took me by surprise. Considering a diff between my v7 and the series as merged: > diff --cc gnu/packages/racket.scm > index 8d44241414,471a11dd48..0000000000 > --- a/gnu/packages/racket.scm > +++ b/gnu/packages/racket.scm > @@@ -248,7 -248,10 +248,14 @@@ > ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" > #$(file-append bash-minimal "/bin/sh")) > "--disable-strip" > ++<<<<<<< HEAD > + "--enable-origtree")) > ++======= > + ;; XXX: origtree layout is required by some other packages down the > + ;; bootstrap chain. Remove these flags as soon as we can do without them. > + "--enable-origtree" > + ,(string-append "--prefix=" #$output "/opt/racket-vm"))) > ++>>>>>>> 992ed3b4ce20335ca61df0d29bfd02495dee87e6 > This comment was what first gave me pause: I was concerned it meant something had gone, so I went looking through the Git blame to find when it was added, and Git blamed me. I think the comment is not quite right, factually (or, at least, is only true for very specific definitions of "required" and "bootstrap chain"), and, more significantly, I disagree that it should be a goal to "remove these flags": IMO, adding these flags brought us closer to being able to build the Racket VM, Racket packages, and Racket installation layers in a well-organized fashion. > (define-public racket-vm-cgc > ;; Eventually, it may make sense for some vm packages to not be hidden, > @@@ -282,69 -285,36 +289,102 @@@ > #:strip-directories #~'("opt/racket-vm/bin" > "opt/racket-vm/lib") > #:phases > ++<<<<<<< HEAD > + #~(let () > + (define* ((wrap-racket-vm-outputs phase) . args) > + (apply > + phase > + (let loop ((args args)) > + (match args > + ((#:outputs outputs . args) > + `(#:outputs > + ,(let loop ((outputs outputs)) > + (match outputs > + ((("out" . out) . outputs) > + `(("out" . ,(string-append out "/opt/racket-vm/")) > + ,@outputs)) > + ((other . outputs) > + (cons other (loop outputs))))) > + ,@args)) > + ((arg . args) > + (cons arg (loop args))))))) > + (modify-phases %standard-phases > + (add-before 'configure 'initialize-config.rktd > + (lambda* (#:key inputs #:allow-other-keys) > + (define (write-racket-hash alist) > + ;; inside must use dotted pair notation > + (display "#hash(") > + (for-each (match-lambda > + ((k . v) > + (format #t "(~s . ~s)" k v))) > + alist) > + (display ")\n")) > + (define maybe-release-catalog > + (let ((v #$(package-version this-package))) > + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" > + v) > + `(,(string-append > + "https://download.racket-lang.org/releases/" > + v > + "/catalog/")) > + '()))) > + (mkdir-p "racket/etc") > + (with-output-to-file "racket/etc/config.rktd" > + (lambda () > + (write-racket-hash > + `((build-stamp . "") > + (catalogs ,@maybe-release-catalog > + #f))))))) > + (add-before 'configure 'chdir > + (lambda _ > + (chdir "racket/src"))) > + (replace 'configure > + (wrap-racket-vm-outputs > + (assoc-ref %standard-phases 'configure))) > + (replace 'patch-shebangs > + (wrap-racket-vm-outputs > + (assoc-ref %standard-phases 'patch-shebangs))) > + (replace 'validate-runpath > + (wrap-racket-vm-outputs > + (assoc-ref %standard-phases 'validate-runpath))) > + (replace 'make-dynamic-linker-cache > + (wrap-racket-vm-outputs > + (assoc-ref %standard-phases 'make-dynamic-linker-cache))) > + (replace 'patch-dot-desktop-files > + (wrap-racket-vm-outputs > + (assoc-ref %standard-phases 'patch-dot-desktop-files))))))) > ++======= > + #~(modify-phases %standard-phases > + (add-before 'configure 'initialize-config.rktd > + (lambda* (#:key inputs #:allow-other-keys) > + (define (write-racket-hash alist) > + ;; inside must use dotted pair notation > + (display "#hash(") > + (for-each (match-lambda > + ((k . v) > + (format #t "(~s . ~s)" k v))) > + alist) > + (display ")\n")) > + (define maybe-release-catalog > + (let ((v #$(package-version this-package))) > + (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0-8][0-9]*$)" > + v) > + `(,(string-append > + "https://download.racket-lang.org/releases/" > + v > + "/catalog/")) > + '()))) > + (mkdir-p "racket/etc") > + (with-output-to-file "racket/etc/config.rktd" > + (lambda () > + (write-racket-hash > + `((build-stamp . "") > + (catalogs ,@maybe-release-catalog > + #f))))))) > + (add-before 'configure 'chdir > + (lambda _ > + (chdir "racket/src")))))) > ++>>>>>>> 992ed3b4ce20335ca61df0d29bfd02495dee87e6 > (home-page "https://racket-lang.org") > (synopsis "Old Racket implementation used for bootstrapping") > (description "This variant of the Racket BC (``before Chez'' or > @@@ -599,6 -569,7 +639,10 @@@ DrRacket IDE, are not included." More concretely, removing `wrap-racket-vm-outputs` here without a replacement means that the phases in question did not run on the relevant files/directories. For example, this interaction illustrates that the patches as applied don't generate a `ld.so.cache` for Racket: ``` philip@bastet:~$ echo v7 v7 philip@bastet:~$ ls $(guix time-machine --url=https://gitlab.com/philip1/guix-patches.git --disable-authentication --branch=racket-chez-refactor-guix-issue-53878-v7 -- build -e "(@ (gnu packages racket) racket-vm-cs)" 2>/dev/null | tail -n 1)/opt/racket-vm/etc config.rktd ld.so.cache philip@bastet:~$ echo as applied as applied philip@bastet:~$ ls $(guix time-machine --commit=992ed3b4ce20335ca61df0d29bfd02495dee87e6 -- build -e "(@ (gnu packages racket) racket-vm-cs)" 2>/dev/null | tail -n 1)/opt/racket-vm/etc config.rktd philip@bastet:~$ ``` I thought we had discussed the reason for this e.g. in . > (inherit racket-minimal) > (name "racket") > (source #f) > ++<<<<<<< HEAD > ++======= > + (native-inputs (list racket-minimal)) ; XXX: conservative estimate, untested > ++>>>>>>> 992ed3b4ce20335ca61df0d29bfd02495dee87e6 > (inputs > (list > cairo (For completeness, this was also a change: it really isn't a big deal, but much more will be needed to be able to cross-compile Racket code, and I think it would be best addressed in the context of a 'racket-build-system'.) I certainly don't want anything that would further burden reviewers or slow down the process (this patch series having taken 7 revisions and almost a month as it is). For me, at least, it would have been easier to notice these changes if they had been in their own commit (or commits), rather than mixed in with changes that had been revised and discussed several times. -Philip From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 12:17:35 2022 Received: (at 53878) by debbugs.gnu.org; 28 Apr 2022 16:17:35 +0000 Received: from localhost ([127.0.0.1]:49750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk6pi-0008Ls-78 for submit@debbugs.gnu.org; Thu, 28 Apr 2022 12:17:35 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:45627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk6pg-0008Gi-8X for 53878@debbugs.gnu.org; Thu, 28 Apr 2022 12:17:33 -0400 Received: by mail-ed1-f68.google.com with SMTP id be20so6091524edb.12 for <53878@debbugs.gnu.org>; Thu, 28 Apr 2022 09:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=l8TLHHX31Xsd2yefG4Egeo0kQpxPnlXeqetWkBRkaBQ=; b=XInaOyvBSRmCj0nxX0RZ4l3ApBvHvYj5I8fON5leXcGpDUYUqDvf/DdeussluBaxWQ 4LirYxVV0f7u78wHSespi5bz0t0TFHV5QtuGVfI3C5xcgXulYmreEJtpI5i0ZrZ6g92h O5L9I9lgI6gkoOO5MdJpLWO/9TNc8uy7s44QxqRwUbc//nZQRgAoWfTsoQHAFgdgJnil lIi3xFHLjwLiqNxh+xGb6FFsgMRlQAFAdi5O0eRSVVKI5B6OqfJqt84QfrbfRhhIIOS3 pbCbQmMQbHBrXSp0Ichv9hmTX2S0DRa3abp00GVN6PQOo1p647HbmpjoEpQ2gPz/u3Cc TbQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=l8TLHHX31Xsd2yefG4Egeo0kQpxPnlXeqetWkBRkaBQ=; b=fGr2T+sEatGxmjESzUCbu4vvnKZUapXYOqjdAveninE50MUmrFdwfYFa/zd4VaZ5FH oECy8vG9lNSixgzMH0nkmqC5R/IJlA+gqV0rejQP1DbdehJ4iKOrv+UHATg3xJzzEOFp jWV7kKIVqU8gL7Vd36CDICgnhVDhvRGE0cC+8jZHg3HpH2/FrUNVbSIeNhGfCgt5cF58 tclOAdLv4vyZY/c94Lqat/iT9Eftykk2st86NQ0B+BEFMuLoE/5hpV5+adaq+cEIiQtF VdcEX8DaLrkX1HSPzRWQH2fEjxbVcAXq2dmLA8V1wXMv5V/iKimd8UFeqNof8hj/7EUy xfrw== X-Gm-Message-State: AOAM533vC1+6z5oxtrY/VF9r2DCWEhxF+pHrE4gCeOvW1k4ZqW2d+Ki5 /Fb5cj+thPfb99BWlwlQ06U= X-Google-Smtp-Source: ABdhPJx2wcsGiTyDCZUqGts4a0AnjmqcVeEA9GsquEV9MV34n9DEz0KsbB14w1tY+BHO0VUHvLmL4Q== X-Received: by 2002:a50:ed16:0:b0:425:f420:e51a with SMTP id j22-20020a50ed16000000b00425f420e51amr19239254eds.23.1651162646156; Thu, 28 Apr 2022 09:17:26 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id v17-20020a1709060b5100b006f38cf075cbsm164883ejg.104.2022.04.28.09.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 09:17:25 -0700 (PDT) Message-ID: <67098dcc5d7670d6edf286b48aa67e56f4b66087.camel@gmail.com> Subject: Re: Fwd: [PATCH v7 00/24] Update Racket to 8.4. Adjust Chez Scheme packages. From: Liliana Marie Prikler To: Philip McGrath , 53878@debbugs.gnu.org Date: Thu, 28 Apr 2022 18:17:23 +0200 In-Reply-To: <6f8a5468-a62d-d54b-d1ac-c85fd32795d1@philipmcgrath.com> References: <6f8a5468-a62d-d54b-d1ac-c85fd32795d1@philipmcgrath.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Philip, Am Mittwoch, dem 27.04.2022 um 16:03 -0400 schrieb Philip McGrath: > [...] > On 3/4/22 17:59, Liliana Marie Prikler wrote: > > Hi Philip, > > > > Am Sonntag, dem 27.02.2022 um 16:28 -0500 schrieb Philip McGrath: > > > Rather than debate it, I'm sending a v7 with the change to patch > > > 03/24 that Liliana requested in > > > . > > Sorry for the delay.  I cleaned up some of your commits and their > > messages, but apart from that pushed v7 without major changes.  I'm > > marking this as done now; if you feel I've made a mistake > > somewhere, don't hesitate to reopen. > > > > While getting ready for the upcoming Racket 8.5 release, I noticed > some differences between my issue 53878 v7 patch series and the > commits as applied to Guix that I hadn't noticed at the time. I don't > want to make a big a deal out of it---I'm sure everyone was acting in > good faith, and it isn't enormously consequential in the grand scheme > of things---but it took me by surprise. As stated above, I find the things below to be "cleanup"s, which I will explain below. > > diff --cc gnu/packages/racket.scm > > index 8d44241414,471a11dd48..0000000000 > > --- a/gnu/packages/racket.scm > > +++ b/gnu/packages/racket.scm > > @@@ -248,7 -248,10 +248,14 @@@ > >         ,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH=" > >                         #$(file-append bash-minimal "/bin/sh")) > >         "--disable-strip" > > ++<<<<<<< HEAD > >  +      "--enable-origtree")) > > ++======= > > +       ;; XXX: origtree layout is required by some other packages > > down the > > +       ;; bootstrap chain.  Remove these flags as soon as we can > > do without them. > > +       "--enable-origtree" > > +       ,(string-append "--prefix=" #$output "/opt/racket-vm"))) > > ++>>>>>>> 992ed3b4ce20335ca61df0d29bfd02495dee87e6 > >   > > This comment was what first gave me pause: I was concerned it meant > something had gone, so I went looking through the Git blame to find > when it was added, and Git blamed me. > > I think the comment is not quite right, factually (or, at least, is > only true for very specific definitions of "required" and "bootstrap > chain"), and, more significantly, I disagree that it should be a goal > to "remove these flags": IMO, adding these flags brought us closer to > being able to build the Racket VM, Racket packages, and Racket > installation layers in a well-organized fashion. While that is true, it comes at the cost of dumping literally everything in a standard non-standard directory, which in and of itself, is bad. At the time I agreed to doing so because it moved things forward to the inclusion of Racket 8.4 (and possibly 8.5 pp as well), but getting things into an actual layout should be a long-term goal for both the Guix packaging of Racket and Racket itself. In particular, the parts of Racket that make it currently impossible to build it in a more FHS-conforming way (such as layers) should be implemented in terms of features we have and that are acceptable, such as search paths. I personally find it baffling that whatever is achieved by layers needs those in the first place and can not be achieved in a more standardized manner. > >   (define-public racket-vm-cgc > >     ;; Eventually, it may make sense for some vm packages to not be > > hidden, > > @@@ -282,69 -285,36 +289,102 @@@ > >          #:strip-directories #~'("opt/racket-vm/bin" > >                                  "opt/racket-vm/lib") > >          #:phases > > ++<<<<<<< HEAD > >  +       #~(let () > >  +           (define* ((wrap-racket-vm-outputs phase) . args) > >  +             (apply > >  +              phase > >  +              (let loop ((args args)) > >  +                (match args > >  +                  ((#:outputs outputs . args) > >  +                   `(#:outputs > >  +                     ,(let loop ((outputs outputs)) > >  +                        (match outputs > >  +                          ((("out" . out) . outputs) > >  +                           `(("out" . ,(string-append out > > "/opt/racket-vm/")) > >  +                             ,@outputs)) > >  +                          ((other . outputs) > >  +                           (cons other (loop outputs))))) > >  +                     ,@args)) > >  +                  ((arg . args) > >  +                   (cons arg (loop args))))))) > >  +           (modify-phases %standard-phases > >  +             (add-before 'configure 'initialize-config.rktd > >  +               (lambda* (#:key inputs #:allow-other-keys) > >  +                 (define (write-racket-hash alist) > >  +                   ;; inside must use dotted pair notation > >  +                   (display "#hash(") > >  +                   (for-each (match-lambda > >  +                               ((k . v) > >  +                                (format #t "(~s . ~s)" k v))) > >  +                             alist) > >  +                   (display ")\n")) > >  +                 (define maybe-release-catalog > >  +                   (let ((v #$(package-version this-package))) > >  +                     (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0- > > 8][0-9]*$)" > >  +                                       v) > >  +                         `(,(string-append > >  +                             > > "https://download.racket-lang.org/releases/" > >  +                             v > >  +                             "/catalog/")) > >  +                         '()))) > >  +                 (mkdir-p "racket/etc") > >  +                 (with-output-to-file "racket/etc/config.rktd" > >  +                   (lambda () > >  +                     (write-racket-hash > >  +                      `((build-stamp . "") > >  +                        (catalogs ,@maybe-release-catalog > >  +                                  #f))))))) > >  +             (add-before 'configure 'chdir > >  +               (lambda _ > >  +                 (chdir "racket/src"))) > >  +             (replace 'configure > >  +               (wrap-racket-vm-outputs > >  +                (assoc-ref %standard-phases 'configure))) > >  +             (replace 'patch-shebangs > >  +               (wrap-racket-vm-outputs > >  +                (assoc-ref %standard-phases 'patch-shebangs))) > >  +             (replace 'validate-runpath > >  +               (wrap-racket-vm-outputs > >  +                (assoc-ref %standard-phases 'validate-runpath))) > >  +             (replace 'make-dynamic-linker-cache > >  +               (wrap-racket-vm-outputs > >  +                (assoc-ref %standard-phases 'make-dynamic-linker- > > cache))) > >  +             (replace 'patch-dot-desktop-files > >  +               (wrap-racket-vm-outputs > >  +                (assoc-ref %standard-phases 'patch-dot-desktop- > > files))))))) > > ++======= > > +        #~(modify-phases %standard-phases > > +            (add-before 'configure 'initialize-config.rktd > > +              (lambda* (#:key inputs #:allow-other-keys) > > +                (define (write-racket-hash alist) > > +                  ;; inside must use dotted pair notation > > +                  (display "#hash(") > > +                  (for-each (match-lambda > > +                              ((k . v) > > +                               (format #t "(~s . ~s)" k v))) > > +                            alist) > > +                  (display ")\n")) > > +                (define maybe-release-catalog > > +                  (let ((v #$(package-version this-package))) > > +                    (if (string-match "^[0-9]+\\.[0-9]+($|\\.[0- > > 8][0-9]*$)" > > +                                      v) > > +                        `(,(string-append > > +                            > > "https://download.racket-lang.org/releases/" > > +                            v > > +                            "/catalog/")) > > +                        '()))) > > +                (mkdir-p "racket/etc") > > +                (with-output-to-file "racket/etc/config.rktd" > > +                  (lambda () > > +                    (write-racket-hash > > +                     `((build-stamp . "") > > +                       (catalogs ,@maybe-release-catalog > > +                                 #f))))))) > > +            (add-before 'configure 'chdir > > +              (lambda _ > > +                (chdir "racket/src")))))) > > ++>>>>>>> 992ed3b4ce20335ca61df0d29bfd02495dee87e6 > >        (home-page "https://racket-lang.org") > >        (synopsis "Old Racket implementation used for > > bootstrapping") > >        (description "This variant of the Racket BC (``before Chez'' > > or > > @@@ -599,6 -569,7 +639,10 @@@ DrRacket IDE, are not included." > > More concretely, removing `wrap-racket-vm-outputs` here without a > replacement means that the phases in question did not run on the > relevant files/directories. For example, this interaction illustrates > that the patches as applied don't generate a `ld.so.cache` for > Racket: This should tell you more so that you ought not place stuff in /opt. Just look at the code you wrote. You have to resort to an ugly hack to get indentation close to where you want and even then it's a painful read. I can not recall ever being fine with this. Most of the phases should not need patching with prefix set. For the rest... > ``` > philip@bastet:~$ echo v7 > v7 > philip@bastet:~$ ls $(guix time-machine > --url=https://gitlab.com/philip1/guix-patches.git  > --disable-authentication > --branch=racket-chez-refactor-guix-issue-53878-v7 -- build -e "(@ > (gnu > packages racket) racket-vm-cs)" 2>/dev/null | tail -n 1)/opt/racket- > vm/etc > config.rktd  ld.so.cache > philip@bastet:~$ echo as applied > as applied > philip@bastet:~$ ls $(guix time-machine > --commit=992ed3b4ce20335ca61df0d29bfd02495dee87e6 -- build -e "(@ > (gnu > packages racket) racket-vm-cs)" 2>/dev/null | tail -n 1)/opt/racket- > vm/etc > config.rktd > philip@bastet:~$ > ``` > > I thought we had discussed the reason for this e.g. in > . Note, that you would have to look for the ld.so.cache in /etc, not /opt/wherever/etc. That currently changes little, as /opt is not searched for constructing the cache. With /opt being a free for all, that is sane behaviour, though. If we find that we need to accomodate further bin-directories, perhaps we might adjust make-dynamic-linker- cache, but I wouldn't count on that necessity. > >       (inherit racket-minimal) > >       (name "racket") > >       (source #f) > > ++<<<<<<< HEAD > > ++======= > > +     (native-inputs (list racket-minimal)) ; XXX: conservative > > estimate, untested > > ++>>>>>>> 992ed3b4ce20335ca61df0d29bfd02495dee87e6 > >       (inputs > >        (list > >         cairo > > (For completeness, this was also a change: it really isn't a big > deal, but much more will be needed to be able to cross-compile Racket > code, and I think it would be best addressed in the context of a > 'racket-build-system'.) Since racket-minimal does not suffice for cross-compilation as per this comment and your words here, I decided to communicate this more clearly by not having native-inputs – which itself suggests, that cross- compilation was not yet thought of (hard enough). > I certainly don't want anything that would further burden reviewers > or slow down the process (this patch series having taken 7 revisions > and almost a month as it is). For me, at least, it would have been > easier to notice these changes if they had been in their own commit > (or commits), rather than mixed in with changes that had been revised > and discussed several times. I understand that, but for me as a reviewer and a committer it doesn't make an awful lot of sense to commit a huge chunk of garbage that will be reverted in the next. (Don't take garbage personal here, it refers more so to the fact that these are gratuitous lines of diffs that *everyone* will have to pull, which is not climate friendly.) As for discussing changes, I am personally also a fan of communicating more clearly, but I was urged for time and there is some consensus that silently improving things is okay. I would heavily advise you to not completely change things once more for Racket 8.5. That would just serve to show how bad packaging Racket really is. Improvements concerning build systems etc. are welcome, but they should overall result in less of a mess than we had before (particularly also considering the /opt mess). I know this reply was dominated by me hating on /opt and I apologize for that, but despite Guix itself not strictly adhering to FHS given the /gnu/store directory, we don't disagree with the standard in the sense that we believe separating binaries from libraries and data is a bad thing. Au contraire, this separation is important information and should be embraced! Cheers From unknown Sat Jun 21 03:29:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 May 2022 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 12 22:04:06 2022 Received: (at control) by debbugs.gnu.org; 13 Jun 2022 02:04:06 +0000 Received: from localhost ([127.0.0.1]:56805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0ZQz-0006gM-VI for submit@debbugs.gnu.org; Sun, 12 Jun 2022 22:04:06 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:39494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0ZQy-0006gE-5R for control@debbugs.gnu.org; Sun, 12 Jun 2022 22:04:04 -0400 Received: from [IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a] ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id iS43270094UW6Th01S43QG; Mon, 13 Jun 2022 04:04:03 +0200 Message-ID: Subject: Re: Archived problem report bug#53878 ([PATCH v5 04/22] gnu: racket-minimal: Use new package style.) From: Maxime Devos To: GNU bug Tracking System Date: Mon, 13 Jun 2022 04:04:03 +0200 In-Reply-To: References: <92044999eda78ff925af0d29d1bb7fcb9276e4eb.camel@telenet.be> <20220208151316.1897345-1-philip@philipmcgrath.com> Content-Type: text/plain User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1655085843; bh=34Pgj3HnaGPTD+stxwZZrtDcigwZKMRotPBfTBOIHPs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=RxUYm6DzZxwCZ3GTtetPC0s/38V0odypwJ7ykgXh/5BPdrZS1tRgv1HxhBzrw+H8Z OGwdJuppVpssusqDMakGrUGY64392glbo2K3CZHNMpPSBJuRG3WUQWq8HyKlGG5VrN envsbYWrzTW5a+lPy8HjoOLiG+nqEPGTtofGAbY/80u5roeQ7dXZ1uRh0iZlAuk1/2 JUMIALq2+9wHfphB3JkB44Xzw9G9RYf8WkDjbvOmnRRvo0ctTZnFe844AlHiePzzHS ZwkQwBczj7HJ0bcrG6jyC454mkJYMUWw04iPKerNQSFi8PtZ6oUKD5blym2VUmTvIE Yp1xbydjVi4Sg== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control Cc: control@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) unarchive 53878 thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 13 03:35:48 2022 Received: (at 53878) by debbugs.gnu.org; 13 Jun 2022 07:35:48 +0000 Received: from localhost ([127.0.0.1]:57163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0ec0-0000cS-AR for submit@debbugs.gnu.org; Mon, 13 Jun 2022 03:35:48 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:54864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0eby-0000cK-Le for 53878@debbugs.gnu.org; Mon, 13 Jun 2022 03:35:47 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id iXbk2700H4UW6Th01XbkH5; Mon, 13 Jun 2022 09:35:45 +0200 Message-ID: Subject: Re: [PATCH v5 04/22] gnu: racket-minimal: Use new package style. From: Maxime Devos To: Philip McGrath , 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Date: Mon, 13 Jun 2022 09:35:39 +0200 In-Reply-To: <20220226130254.1301333-5-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> <20220226130254.1301333-5-philip@philipmcgrath.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-7GrSDpA5cjJvcSRf+B64" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1655105745; bh=qOpRKkAiInwpPuarUItkwSq4lkCstO6zm6g3tqUKitw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=jwpv0ImHvXj8u/o//+NNAM9/eZloYsTBkDQUXwCf8jxKvUMAseO3svfAFzlk5ytU1 dfL8n0aE6E/D0GQQ4zTnshdIL0ltUuQJ2vlL0mxyIryzLQjAp++zIC6k4h+uiXgcc/ m2g3cOv6CQGHB/iDgrC2Rs+LorsjSYvEWGdQG7V1xQ4w9P95dtNaGKzFC+U8yK42jm QPD3oh6tkAwttfbXtZ0KS6N7ey5ZjHEFlWx9czavqYsWKCbKuiYMe0Wom6eRUytoeR I3k4VSNAuav8FlSaNJGVFho4dvBiDhHd+l8QQTDo7ZEUVKMRMd/U3fMlDrzsQiUU4M EuLhO9UfxHwyQ== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53878 Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Attila Lendvai , Malte Gerdes , raingloom X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-7GrSDpA5cjJvcSRf+B64 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Adding (ice-9 exceptions) to the imports caused a bug: https://issues.guix.gnu.org/54546 (resending because #53878 was archived) (re-sending the re-send because debbugs again said it was read-only even though I sent the unarchive message.) Greetings, Maxime. --=-7GrSDpA5cjJvcSRf+B64 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqboyxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7o2oAQCoJxMD/NlMLeE58jd+weCHZ/iQ MU7y4ZJeNhtuBZJh3QEAkXV/AM/tMrxg5rhQHX1Weac2lS+lm1MaRrj1+1NzQQI= =XViD -----END PGP SIGNATURE----- --=-7GrSDpA5cjJvcSRf+B64-- From unknown Sat Jun 21 03:29:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 Jul 2022 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator