GNU bug report logs - #49280
[PATCH v2 0/3] gnu: racket: Update to 8.2. Bootstrap from C.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Philip McGrath <philip@HIDDEN>; Keywords: patch; dated Tue, 29 Jun 2021 21:54:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Changed bug title to '[PATCH v2 0/3] gnu: racket: Update to 8.2. Bootstrap from C.' from '[PATCH 0/4] gnu: racket: Add racket-next. Bootstrap from C.' Request was from Philip McGrath <philip@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 19 Jul 2021 06:32:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 02:32:37 2021
Received: from localhost ([127.0.0.1]:57901 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5MpL-0005hM-2r
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 02:32:36 -0400
Received: from mail-qk1-f173.google.com ([209.85.222.173]:46790)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1m5MpH-0005gv-Qc
 for 49280 <at> debbugs.gnu.org; Mon, 19 Jul 2021 02:32:29 -0400
Received: by mail-qk1-f173.google.com with SMTP id k4so4773499qkj.13
 for <49280 <at> debbugs.gnu.org>; Sun, 18 Jul 2021 23:32:27 -0700 (PDT)
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=1WqOxOGkqa3KOCsUbo3GPku8ondikjN87V0Z1yKWg4A=;
 b=PaSKZFU6zDu+Pgv+DOHbqMr0Am4Oxm6lDd79ZKjV8uwV3emx4OHc/1iIrrJ9UXdohP
 H7CGJjr42gGL4KG6jmIljHGUkcWOMkaSqilIT4DZNzhBtK9YZmt5MwKbplwUfttq8cSE
 OvsVYcxzMhncwIZuYbQ6ywNs9piMNuQ4rPhOJJbuOfcLXX/Boeg89dz/ofy5a+1Y3Sce
 0wB4oyQ37YOCtUT3fZlrRRjKB0OLJcZebyqfNZhQQKxGsroa5uxYLg1rxpubpsZy1SX2
 4jgfQDyUZt3Fz/EQN5NfH1cFnMBiTH8lbwnEfIYlW8s2HYMZIymFprfTtv3IeTN0KbdI
 2f2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=1WqOxOGkqa3KOCsUbo3GPku8ondikjN87V0Z1yKWg4A=;
 b=hEUKYhelpyAq2Qa4Kz+3i948Jl4nXJ4iXHgeSxDD6d8aXkEDaXnbFc8sEeSLnny/fk
 HHCRlQYrey8cEhBSKvzrb9Mmpamfb4HNbh4JnbQg/7BROHmuuhrADOIBGDalMxVXFxUi
 xzr8eNevJBbfRSBDewjTY2t2Qtc4fSVVkiloVX6EwkwkHyWE3huQKDoPko2wSAmJxwDS
 gSYVVbxPOZLS/ce37h/njM1E4Ukw15niOx5De2FrVtFkGI254Dli/J5MOZJW0H7r8xCX
 aBkbsp2ZwjRR0OSab6r5Gis4vr87fgQ6afN3SlXuhYHa1aXYSZcTD7M3nqkbIAqKT/6b
 ieUQ==
X-Gm-Message-State: AOAM532etQUSilEyqG6MKKHYpiHpJOKuThozPjSRr7sBjWNoIvavIcZ0
 6NcqmLUPmhWk63PvewlhgzSsk4c9N/vQnxXcjeA=
X-Google-Smtp-Source: ABdhPJx8KU42ieT20jndHICgNk+3aRAZUFwWB/9G/K4iUhQWDOkAlgcst1qJe7OJpeMhE79V3OFKig==
X-Received: by 2002:ae9:dd46:: with SMTP id r67mr21879339qkf.380.1626676342057; 
 Sun, 18 Jul 2021 23:32:22 -0700 (PDT)
Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id m23sm6143092qtq.53.2021.07.18.23.32.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 18 Jul 2021 23:32:21 -0700 (PDT)
From: Philip McGrath <philip@HIDDEN>
To: 49280 <at> debbugs.gnu.org
Subject: [PATCH v2 3/3] gnu: racket-minimal: Bootstrap from C.
Date: Mon, 19 Jul 2021 02:31:43 -0400
Message-Id: <20210719063143.788661-3-philip@HIDDEN>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20210719063143.788661-1-philip@HIDDEN>
References: <270db91e-24f6-2754-7164-d0406aeebc60@HIDDEN>
 <20210719063143.788661-1-philip@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 49280
Cc: Philip McGrath <philip@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

This commit bootstraps the Racket compiler and runtime system from source,
including Racket CS as well as both variants of Racket BC. (One remaining
limitation is discussed in comments added to gnu/packages/racket.scm.)

In the process, it moves to building minimal Racket from the Git repository,
rather than the packaged source tarballs. The Git repository is slightly
better as the ``corresponding source'':

 1. A few packages especially closely tied to the Racket core implementation
    (like "compiler-lib", "base", and "racket-doc") are developed in the
    same Git repository. Having them use the same Guix origin, too, will
    help to keep them in sync.

 2. The top-level Makefile in the Git repository is an important
    ``script[] used to control compilation and installation.''
    In particular, it cooperates with the "distro-build" package to
    create the source tarballs and installers for a Racket distribution.
    (Racket supports a notion of custom distributions.)

 3. It is ``the preferred form ... for making modifications'' to the core
    Racket implementation.

Racket releases are tagged in the Git repository (e.g. "v8.1"). At the
beginning of each release cycle, a branch is created to stabilizer a version
for extra testing. Active development happens on the "master" branch.

* gnu/packages/racket-minimal-sh-via-rktio.patch: Adjust for extra directory
layer.
* gnu/local/racket.scm (cfg-flag:sh-for-rktio, cfg-flag:enable-lt,
cfg-flag:enable-racket, unpack-nanopass+stex,
%main-repo-main-distribution-pkgs): New private variables.
* gnu/local/racket.scm (racket-minimal)[source]: Use Git.
[source](snippet): Unbundle nanopass, stex, and libffi.
[native-inputs]: Use racket-bootstrap-chez-bootfiles, plus its
dependencies (for Chez, plus a Racket for bootstrap pig).
[arguments]: Revise extensively.
* gnu/local/racket.scm (racket-minimal-bc-3m, racket-minimal-bc-cgc): New
packages, hidden at least for now.
(racket-bootstrap-chez-bootfiles): Another new package, but this one is
especially likely to stay hidden.
* gnu/local/racket.scm (racket)[origin](snippet): Unbundle packages
developed in the main Git repository, but leave their links.rktd and
pkgs.rktd entries in place.
[native-inputs]: Add the main Racket Git repository.
[arguments](#:phases): Adjust 'unpack-packages to also unpack package
sources from the main Racket Git repository.
---
 .../patches/racket-minimal-sh-via-rktio.patch |   8 +-
 gnu/packages/racket.scm                       | 488 +++++++++++++-----
 2 files changed, 359 insertions(+), 137 deletions(-)

diff --git a/gnu/packages/patches/racket-minimal-sh-via-rktio.patch b/gnu/packages/patches/racket-minimal-sh-via-rktio.patch
index b4fefd1514..6bc2ee8331 100644
--- a/gnu/packages/patches/racket-minimal-sh-via-rktio.patch
+++ b/gnu/packages/patches/racket-minimal-sh-via-rktio.patch
@@ -35,13 +35,13 @@ making this change at the C level is both:
       conditional and a runtime check that the file in the store exists,
       we make it much less likely that it will "leak" out of Guix.
 ---
- src/rktio/rktio_process.c | 21 ++++++++++++++++++++-
+ racket/src/rktio/rktio_process.c | 21 ++++++++++++++++++++-
  1 file changed, 20 insertions(+), 1 deletion(-)
 
-diff --git a/src/rktio/rktio_process.c b/src/rktio/rktio_process.c
+diff --git a/racket/src/rktio/rktio_process.c b/racket/src/rktio/rktio_process.c
 index 89202436c0..465ebdd5c5 100644
---- a/src/rktio/rktio_process.c
-+++ b/src/rktio/rktio_process.c
+--- a/racket/src/rktio/rktio_process.c
++++ b/racket/src/rktio/rktio_process.c
 @@ -1224,12 +1224,14 @@ int rktio_process_allowed_flags(rktio_t *rktio)
  /*========================================================================*/
  
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index c095de42b3..0349b77704 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -31,7 +31,9 @@
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages chez)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages fontutils)
@@ -40,25 +42,87 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages libedit)
+  #:use-module (gnu packages libffi)
   #: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 %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 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")))
 
 
 (define-public racket-minimal
@@ -67,96 +131,113 @@
     (version "8.2")            ; note: remember to also update racket!
     (source
      (origin
-       (method url-fetch)
-       (uri (map (lambda (base)
-                   (string-append base version "/racket-minimal-src.tgz"))
-                 %installer-mirrors))
-       (sha256 "13qfg56w554vdj5iwa8lpacy83s7bzhhyr44pjns68mkhj69ring")
-       (patches (search-patches
-                 "racket-minimal-sh-via-rktio.patch"))))
-    (home-page "https://racket-lang.org")
-    (synopsis "Racket without bundled packages such as DrRacket")
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/racket/racket")
+             (commit (string-append "v" version))))
+       (sha256
+        "061bhiyjlvazph0dj9i3i3x2q5z53rp8h5cjwg3frjimkr45lncn")
+       (file-name (git-file-name name version))
+       (patches (search-patches "racket-minimal-sh-via-rktio.patch"))
+       (snippet
+        (with-imported-modules '((guix build utils))
+          #~(begin
+              (use-modules (guix build utils))
+              ;; unbundle Chez submodules
+              (with-directory-excursion "racket/src/ChezScheme"
+                #$(origin-snippet (package-source chez-scheme)))
+              ;; unbundle libffi
+              (for-each
+               delete-file-recursively
+               '("racket/src/bc/foreign/libffi")))))))
     (inputs
-     `(("openssl" ,openssl)
+     `(;; 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)))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
-       `(,(string-append "CPPFLAGS=-DGUIX_RKTIO_PATCH_BIN_SH="
-                         (assoc-ref %build-inputs "sh")
-                         "/bin/sh")
-         "--enable-libz"
-         "--enable-liblz4")
-       #:modules
-       ((guix build gnu-build-system)
-        (guix build utils)
-        (srfi srfi-1))
+       (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-before 'configure 'pre-configure-minimal
+         (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)
-             (chdir "src")
+             (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"))))
+                    (catalogs
+                     . (,(string-append
+                          "https://download.racket-lang.org/releases/"
+                          ,version
+                          "/catalog/")
+                        #f))))))
              #t))
-         (add-after 'build 'patch-config.rktd-lib-search-dirs
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             ;; We do this between the `build` and `install` phases
-             ;; so that we have racket to read and write the hash table,
-             ;; but it comes before `raco setup`, when foreign libraries
-             ;; are needed to build the documentation.
-             (define out (assoc-ref outputs "out"))
-             (apply invoke
-                    "./cs/c/racketcs"
-                    "-e"
-                    ,(format #f
-                             "~s"
-                             '(let* ((args
-                                      (vector->list
-                                       (current-command-line-arguments)))
-                                     (file (car args))
-                                     (extra-lib-search-dirs (cdr args)))
-                                (write-to-file
-                                 (hash-update
-                                  (file->value file)
-                                  'lib-search-dirs
-                                  (lambda (dirs)
-                                    (append dirs extra-lib-search-dirs))
-                                  '(#f))
-                                 #:exists 'truncate/replace
-                                 file)))
-                    "--"
-                    "../etc/config.rktd"
-                    (filter-map (lambda (lib)
-                                  (cond
-                                   ((assoc-ref inputs lib)
-                                    => (lambda (pth)
-                                         (string-append pth "/lib")))
-                                   (else
-                                    #f)))
-                                '("cairo"
-                                  "fontconfig"
-                                  "glib"
-                                  "glu"
-                                  "gmp"
-                                  "gtk+"
-                                  "libjpeg"
-                                  "libpng"
-                                  "libx11"
-                                  "mesa"
-                                  "mpfr"
-                                  "openssl"
-                                  "pango"
-                                  "sqlite"
-                                  "unixodbc"
-                                  "libedit")))
-             #t)))
-       ;; Tests are in packages like racket-test-core and
-       ;; main-distribution-test that aren't part of the main distribution.
-       #:tests? #f))
+         (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 <https://github.com/racket/racket/issues/3851>.
+           ;; 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)))))
+    (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
@@ -167,7 +248,164 @@ 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
-    (license (list lgpl3+ asl2.0 expat))))
+    ;; 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
+      `(("libffi" ,libffi) ;; <- only for BC variants
+        ,@(fold alist-delete
+                (package-inputs racket-minimal)
+                '("zlib" "zlib:static" "lz4" "lz4:static"))))
+     (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" ,@(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
+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"))
 
 
 (define-public racket
@@ -177,7 +415,7 @@ DrRacket IDE, are not included.")
     (version (package-version racket-minimal)) ; needed for origin uri to work
     (source
      (origin
-       (inherit (package-source racket-minimal))
+       (method url-fetch)
        (uri (map (lambda (base)
                    (string-append base version "/racket-src.tgz"))
                  %installer-mirrors))
@@ -200,36 +438,10 @@ DrRacket IDE, are not included.")
                           "README"
                           "src"))
               ;; unbundle package sources included elsewhere
-              (define (substitute/delete file pattern)
-                (substitute
-                 file
-                 (list (cons pattern
-                             (lambda (line matches)
-                               ;; must match exactly once
-                               (match matches
-                                 ((m)
-                                  (string-append (match:prefix m)
-                                                 (match:suffix m)))))))))
-              (define (unbundle-pkg pkg)
-                (define quoted-pkg (regexp-quote pkg))
-                (with-directory-excursion "share"
-                  (substitute/delete
-                   "links.rktd"
-                   (string-append
-                    "[(][^()]+[(]#\"pkgs\" #\""
-                    quoted-pkg
-                    "\"[)][)]"))
-                  (with-directory-excursion "pkgs"
-                    (substitute/delete
-                     "pkgs.rktd"
-                     (string-append
-                      "[(]\""
-                      quoted-pkg
-                      "\" \\. #s[(]"
-                      "(pkg-info|[(]sc-pkg-info pkg-info 3[)])"
-                      " [(][^()]+[)] [^()]+[)][)]"))
-                    (delete-file-recursively pkg))))
-              (unbundle-pkg "racket-lib"))))))
+              (with-directory-excursion "share/pkgs"
+                (for-each delete-file-recursively
+                          '#+%main-repo-main-distribution-pkgs))
+              #t)))))
     (inputs
      `(("cairo" ,cairo)
        ("fontconfig" ,fontconfig)
@@ -247,22 +459,32 @@ DrRacket IDE, are not included.")
        ("libedit" ,libedit)))
     (native-inputs
      `(("racket" ,racket-minimal)
-       ("extend-layer" ,extend-layer)))
+       ("extend-layer" ,extend-layer)
+       ("main-repo" ,(package-source racket-minimal))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (add-before 'configure 'unpack-packages
-           (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
-             (let ((racket (assoc-ref (or native-inputs inputs) "racket"))
-                   (prefix (assoc-ref outputs "out")))
-               (mkdir-p (string-append prefix "/share/racket/pkgs"))
-               (copy-recursively
-                "share/links.rktd"
-                (string-append prefix "/share/racket/links.rktd"))
-               (copy-recursively
-                "share/pkgs"
-                (string-append prefix "/share/racket/pkgs"))
-               #t)))
+           (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"))
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 19 Jul 2021 06:32:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 02:32:26 2021
Received: from localhost ([127.0.0.1]:57898 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5MpF-0005h5-F8
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 02:32:26 -0400
Received: from mail-qk1-f176.google.com ([209.85.222.176]:36684)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1m5MpE-0005gr-7v
 for 49280 <at> debbugs.gnu.org; Mon, 19 Jul 2021 02:32:24 -0400
Received: by mail-qk1-f176.google.com with SMTP id t185so15743036qkd.3
 for <49280 <at> debbugs.gnu.org>; Sun, 18 Jul 2021 23:32:24 -0700 (PDT)
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=iW96FL7EK4CBlOJb96kjN+A4Q+pp07i4Dk2TCCho+sM=;
 b=A3cs/nm+hxqcIA9InS3HYf0y7csyqKWjBErTGuM9Xii9hKhrJXbBiB8QaIKSIcg7jJ
 8nuLAH2GDQ6M7S4xbEUmQUckS9Nn5SbZGIbRCDhftn1JoKbTTJKBZt7KgyDtSV+Fzg5f
 ohnjWZzEb2ycCcLaduB3z4RjdaIe7koEBWOa+DdK0g1zw1L8R8WF6FtadJUQtp8d3fTM
 D6qrV/HUV3lPWAD6EF5j57MbofsJmC6gpKMPe8EVJIVwjy95IOiwTjss8CJ6/ljzsnGV
 tRVpu0Ut1ewaHYvWqpEA0qfrl1uovkieNiaqkW9iLGi5JcCDm7jl1MT6tgNMyGmjrFcX
 CIfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=iW96FL7EK4CBlOJb96kjN+A4Q+pp07i4Dk2TCCho+sM=;
 b=ohBm40mlfbNSCDpq2cvoUZvFRfG5dlMkpB0A91VPR6RLbwanPCmEJ3MNRkTPueSaeM
 tuStt9imDYbIRz9Noi/jLjSIIQk+FqLaH4GITmJG1ofsIEJOTYacN6iAl5W1L+x8VfLw
 sAWKZ2ZFztkHk23V4Y8xdGnsFHOQ+PD5khaJUUd3CYt4wxceOApnJK/M3nqLlvHQLX5z
 2BF5miqPYdWbhFdRgDMTPzmV75T7B8Iw2ncjtZpcEfk54hk34peJ5qjEXRSRTJ0cNko6
 RuK0S/1hNp/L0xlTEDBRcI7CLdvK4CZp4+aabMg9tpp7Bb4H0NF4LUzdpyxu4N9OfGpQ
 sXmA==
X-Gm-Message-State: AOAM532N4lMEqA4bta/7VijQIInYhGqCCC724exPx2ZF/MteGgg9tsHN
 BzbJCgTmGnxqKzZbTOfDn/HYTQTPeJCksiMI67s=
X-Google-Smtp-Source: ABdhPJy5XIuikGlq0UDxErv6Vq0OXCFZ49041o3XSxO8YAJjo4sUfdCPTi7WIbUUKE0PBWfaztkuCQ==
X-Received: by 2002:a37:66d3:: with SMTP id
 a202mr10561862qkc.262.1626676338605; 
 Sun, 18 Jul 2021 23:32:18 -0700 (PDT)
Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id o27sm3590621qkk.124.2021.07.18.23.32.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 18 Jul 2021 23:32:18 -0700 (PDT)
From: Philip McGrath <philip@HIDDEN>
To: 49280 <at> debbugs.gnu.org
Subject: [PATCH v2 2/3] gnu: racket: Unbundle racket-minimal.
Date: Mon, 19 Jul 2021 02:31:42 -0400
Message-Id: <20210719063143.788661-2-philip@HIDDEN>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20210719063143.788661-1-philip@HIDDEN>
References: <270db91e-24f6-2754-7164-d0406aeebc60@HIDDEN>
 <20210719063143.788661-1-philip@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 49280
Cc: Philip McGrath <philip@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

This change takes advantage of improved support for layered
and tethered installations in Racket 8.2.

* gnu/packages/racket.scm (extend-layer): New private variable.
This is a script for configuring a new config-tethered layer
chaining to an existing Racket installation.
* gnu/packages/racket.scm (racket)[source](snippet): Unbundle
`racket-minimal`.
[inputs]: Remove inputs that properly belong to `racket-minimal`.
[native-inputs]: Add `racket-minimal` and `extend-layer`.
[arguments]: Stop inheriting from `racket-minimal`. Add phase
'unpack-packages to move the sources and links file into place.
Replace 'configure phase using `extend-layer`.
Replace 'build phase using `raco setup`.
Delete 'install phase.
* gnu/packages/patches/racket-sh-via-rktio.patch: Rename to ...
* gnu/packages/patches/racket-minimal-sh-via-rktio.patch: ... this
file to placate `guix lint`.
* gnu/local.mk (dist_patch_DATA): Update accordingly.
* gnu/packages/racket.scm (racket-minimal)[source]: Likewise.
---
 gnu/local.mk                                  |   2 +-
 ...atch => racket-minimal-sh-via-rktio.patch} |   0
 gnu/packages/racket.scm                       | 196 +++++++++++++++++-
 3 files changed, 191 insertions(+), 7 deletions(-)
 rename gnu/packages/patches/{racket-sh-via-rktio.patch => racket-minimal-sh-via-rktio.patch} (100%)

diff --git a/gnu/local.mk b/gnu/local.mk
index 62a5e41a46..93c022d1b8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1673,7 +1673,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-sh-via-rktio.patch		\
+  %D%/packages/patches/racket-minimal-sh-via-rktio.patch	\
   %D%/packages/patches/remake-impure-dirs.patch			\
   %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch	\
   %D%/packages/patches/rnp-add-version.cmake.patch		\
diff --git a/gnu/packages/patches/racket-sh-via-rktio.patch b/gnu/packages/patches/racket-minimal-sh-via-rktio.patch
similarity index 100%
rename from gnu/packages/patches/racket-sh-via-rktio.patch
rename to gnu/packages/patches/racket-minimal-sh-via-rktio.patch
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 6b2a011d51..c095de42b3 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -73,7 +73,7 @@
                  %installer-mirrors))
        (sha256 "13qfg56w554vdj5iwa8lpacy83s7bzhhyr44pjns68mkhj69ring")
        (patches (search-patches
-                 "racket-sh-via-rktio.patch"))))
+                 "racket-minimal-sh-via-rktio.patch"))))
     (home-page "https://racket-lang.org")
     (synopsis "Racket without bundled packages such as DrRacket")
     (inputs
@@ -183,10 +183,55 @@ DrRacket IDE, are not included.")
                  %installer-mirrors))
        (sha256
         (base32
-         "10sgzsraxzxp1k2y2wvz8rcjwvhbcd6k72l9lyqr34yazlwfdz26"))))
+         "10sgzsraxzxp1k2y2wvz8rcjwvhbcd6k72l9lyqr34yazlwfdz26"))
+       (snippet
+        (with-imported-modules '((guix build utils)
+                                 (ice-9 match)
+                                 (ice-9 regex))
+          #~(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
+              (define (substitute/delete file pattern)
+                (substitute
+                 file
+                 (list (cons pattern
+                             (lambda (line matches)
+                               ;; must match exactly once
+                               (match matches
+                                 ((m)
+                                  (string-append (match:prefix m)
+                                                 (match:suffix m)))))))))
+              (define (unbundle-pkg pkg)
+                (define quoted-pkg (regexp-quote pkg))
+                (with-directory-excursion "share"
+                  (substitute/delete
+                   "links.rktd"
+                   (string-append
+                    "[(][^()]+[(]#\"pkgs\" #\""
+                    quoted-pkg
+                    "\"[)][)]"))
+                  (with-directory-excursion "pkgs"
+                    (substitute/delete
+                     "pkgs.rktd"
+                     (string-append
+                      "[(]\""
+                      quoted-pkg
+                      "\" \\. #s[(]"
+                      "(pkg-info|[(]sc-pkg-info pkg-info 3[)])"
+                      " [(][^()]+[)] [^()]+[)][)]"))
+                    (delete-file-recursively pkg))))
+              (unbundle-pkg "racket-lib"))))))
     (inputs
-     `(;; sqlite and libraries for `racket/draw' are needed to build the doc.
-       ("cairo" ,cairo)
+     `(("cairo" ,cairo)
        ("fontconfig" ,fontconfig)
        ("glib" ,glib)
        ("glu" ,glu)
@@ -199,8 +244,67 @@ DrRacket IDE, are not included.")
        ("mpfr" ,mpfr)
        ("pango" ,pango)
        ("unixodbc" ,unixodbc)
-       ("libedit" ,libedit)
-       ,@(package-inputs racket-minimal)))
+       ("libedit" ,libedit)))
+    (native-inputs
+     `(("racket" ,racket-minimal)
+       ("extend-layer" ,extend-layer)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'unpack-packages
+           (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
+             (let ((racket (assoc-ref (or native-inputs inputs) "racket"))
+                   (prefix (assoc-ref outputs "out")))
+               (mkdir-p (string-append prefix "/share/racket/pkgs"))
+               (copy-recursively
+                "share/links.rktd"
+                (string-append prefix "/share/racket/links.rktd"))
+               (copy-recursively
+                "share/pkgs"
+                (string-append prefix "/share/racket/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))
     (synopsis "A programmable programming language in the Scheme family")
     (description
      "Racket is a general-purpose programming language in the Scheme family,
@@ -211,3 +315,83 @@ languages to complete language implementations.
 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.")))
+
+
+(define extend-layer
+  (scheme-file
+   "extend-layer.rkt"
+   `(module
+     extend-layer racket/base
+     (require racket/cmdline
+              racket/match
+              racket/file
+              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
+                          '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))))))))
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 19 Jul 2021 06:32:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 02:32:17 2021
Received: from localhost ([127.0.0.1]:57895 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5Mp7-0005gi-4a
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 02:32:17 -0400
Received: from mail-qk1-f170.google.com ([209.85.222.170]:46773)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1m5Mp5-0005gU-44
 for 49280 <at> debbugs.gnu.org; Mon, 19 Jul 2021 02:32:15 -0400
Received: by mail-qk1-f170.google.com with SMTP id k4so4773152qkj.13
 for <49280 <at> debbugs.gnu.org>; Sun, 18 Jul 2021 23:32:15 -0700 (PDT)
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=vMsKNo2za+eT1rGqIPuUYMvhQu0c3btldwMi9wUHMMw=;
 b=AIups6S+ItHcXaktFB4qcgYo5w9Iegr030n5PNj2Gs+rk4f/zDmL14tX9JbJOqajNx
 c3W7QSFx409a1Ci5R7s9e8THhoC5c6CGyU80eYbet49t+y///GooIvdYsZJHQuPNewPg
 Kn0mEaSAR2jgfX/Mt09/ePUneUcU6Wu3P0BgnQGjAwQwBCzBeWW2HFHrNsY/A3ezHlS1
 QzWmHKV0qQams1YRGi4NVf0WpxtZC5lIBsWZYIgHPktQtpgiWWNs0WoqH30WqvcbHeWN
 cb8xEeg3OX3w0MPdVKc+86xZUEoyRKnKfXgEKr4eK5cs8M03J+LhS7+hhGDYxyCr6iLU
 SD3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=vMsKNo2za+eT1rGqIPuUYMvhQu0c3btldwMi9wUHMMw=;
 b=TvCQvxFDv2bMJPyD/5dn530Rg2ewlkWRig6S6McfV4KEDqFultyCYh2zCGb/0mU0X7
 UNuZQe907Oe166DbFbs+uqEekfIFOObnTA6UF7CYjPuoc5r1BIegrotRUXrpbs0j/LhX
 f6etUyxJG6hMPiIm3jmY7nBGBdUbXH5LOdKNobpbDMW7x1z9kpeWggz9vZHHhWTmSn7p
 b1blUS5GsusbI/fxnVoN9Cd95Duk/LrufR2211GVmsuTAShkM0tvEziyFLIG+KaH/Cmq
 Gdb6CMZn0zDo+E67ZIVrdPxeH3e2tIRGz5MfF8TiArvX7Mon04Zec5b3aM6WynPt9Cip
 D+og==
X-Gm-Message-State: AOAM531IsLHrw4vcAv6E+V2mDCVNR0l0k6DbsuJQCKK8h7OE73lC6iHg
 OSoR5beTeqLfv4Q6x9GOOd56+UlRinTI0dMQERw=
X-Google-Smtp-Source: ABdhPJzvwsz/DP+u25yOmDjKDhy+7/zUAMiVw0XnjdqYMKjfgCejGdnJPMoKW6kfs2vpCjFdK3rqEg==
X-Received: by 2002:a37:5d46:: with SMTP id r67mr22797494qkb.12.1626676329180; 
 Sun, 18 Jul 2021 23:32:09 -0700 (PDT)
Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id b25sm7603573qkk.111.2021.07.18.23.32.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 18 Jul 2021 23:32:08 -0700 (PDT)
From: Philip McGrath <philip@HIDDEN>
To: 49280 <at> debbugs.gnu.org
Subject: [PATCH v2 1/3] gnu: racket: Update to 8.2.
Date: Mon, 19 Jul 2021 02:31:41 -0400
Message-Id: <20210719063143.788661-1-philip@HIDDEN>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <270db91e-24f6-2754-7164-d0406aeebc60@HIDDEN>
References: <270db91e-24f6-2754-7164-d0406aeebc60@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 49280
Cc: Philip McGrath <philip@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

* gnu/packages/racket.scm (racket-minimal, racket): Update to 8.2.
* gnu/packages/racket.scm (racket-minimal)[#:arguments]: Fix
patch-config.rktd-lib-search-dirs phase. When a config.rktd file
doesn't contain an entry for `lib-search-dirs`, the default is
equivalent to `'(#f)`, not `'()`.
---
 gnu/packages/racket.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 2d606071fe..6b2a011d51 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -64,14 +64,14 @@
 (define-public racket-minimal
   (package
     (name "racket-minimal")
-    (version "8.1")            ; note: remember to also update racket!
+    (version "8.2")            ; note: remember to also update racket!
     (source
      (origin
        (method url-fetch)
        (uri (map (lambda (base)
                    (string-append base version "/racket-minimal-src.tgz"))
                  %installer-mirrors))
-       (sha256 "04zzqybpxss50n1jrwwq98539gw0y0ygpw9civl2sq3s4ww7m8l3")
+       (sha256 "13qfg56w554vdj5iwa8lpacy83s7bzhhyr44pjns68mkhj69ring")
        (patches (search-patches
                  "racket-sh-via-rktio.patch"))))
     (home-page "https://racket-lang.org")
@@ -125,7 +125,7 @@
                                   'lib-search-dirs
                                   (lambda (dirs)
                                     (append dirs extra-lib-search-dirs))
-                                  null)
+                                  '(#f))
                                  #:exists 'truncate/replace
                                  file)))
                     "--"
@@ -183,7 +183,7 @@ DrRacket IDE, are not included.")
                  %installer-mirrors))
        (sha256
         (base32
-         "0xdqwrwm604bbnr97h75dps2ixxz2svlw0fn0f674bn04dcfd60f"))))
+         "10sgzsraxzxp1k2y2wvz8rcjwvhbcd6k72l9lyqr34yazlwfdz26"))))
     (inputs
      `(;; sqlite and libraries for `racket/draw' are needed to build the doc.
        ("cairo" ,cairo)
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 18 Jul 2021 21:36:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 18 17:36:06 2021
Received: from localhost ([127.0.0.1]:57534 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5ESD-0001JP-R2
	for submit <at> debbugs.gnu.org; Sun, 18 Jul 2021 17:36:06 -0400
Received: from mail-qk1-f178.google.com ([209.85.222.178]:33768)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1m5ESC-0001Iv-B1
 for 49280 <at> debbugs.gnu.org; Sun, 18 Jul 2021 17:36:04 -0400
Received: by mail-qk1-f178.google.com with SMTP id 23so14874317qke.0
 for <49280 <at> debbugs.gnu.org>; Sun, 18 Jul 2021 14:36:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=philipmcgrath.com; s=google;
 h=subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=3V6+ktDyKbzbZxhpPTJTR09o/LWtiVUK6TWiorfjXPQ=;
 b=QDXUls7Y9HLndgfzIebGOamzAGA5CctftwAvUn3idZmMKviUft64Cy8SuPbgg6lM9k
 Std7J1fMubVFoHhtBVqmtUsx9tHjS7ftrNkbM05IWUkQjq5Ro3RX76xrUIr6MiZ+IQwM
 fd7KtS9OOkx/48u5iYSKGysHE23JiRa3E0RcazkCdiCRSFoD/EKlGGJbbQQk3Px/Bowv
 mmSIPZSHKEf7ZWEPMacXpjzEt/an9m4qRrrzlwkoy42UuHa+HVtz2GFuqNK12kX9nZKE
 uoPfTqPXW1phQoGguJaiBeknhMejYN815YwDGW98ttuUW91PEJPyWtbGHC8pnYjXdiek
 jIjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:cc:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=3V6+ktDyKbzbZxhpPTJTR09o/LWtiVUK6TWiorfjXPQ=;
 b=M6hrhgP/Un24bqYx8D99bv11lzHWPiykIIzDuzhq6eYyIFydFtiyBbdOES+1AIdd8N
 WKG9WMzow/a2rvH4oAze2wBy+ZChEXJIVMlDH8kgiUNS2mtKtmYxNAIh6mXG+eQ4KAYc
 7AtUfzzio6yREayXw0+X+4WnYj4iaVLQDjnRefP5R28h2uLEVLleoG0wTO+ODlkb0HqM
 7HkRkWLvj6/TtC5EWEchSAallK6lypkIWtKj31HnHLRfH0tX2uxm8Wx/AFqq7PEgLoIt
 CXymkeGKq7iSu4byzcFT5w2n/5r/UW3HYQcashzPQQD84uiQ8RMdqSiN+iXeqLY7BOAf
 9YeQ==
X-Gm-Message-State: AOAM533OpIqrmI+UZ5a1voXbya02khLPP5uxxsStcSFz6e3kLCto1Q0W
 qBr9x6Hzlu4pq0K/CMxfZfb1EAydUWeQ3LgJiuw=
X-Google-Smtp-Source: ABdhPJz3uD9iydIuqQZkng4FQAhTbogQ8by/jNO6WeGJTYx2/j1eEq7sjnXKcG8J4Aq2eJV7E/M6sg==
X-Received: by 2002:a37:f506:: with SMTP id l6mr21271976qkk.468.1626644158549; 
 Sun, 18 Jul 2021 14:35:58 -0700 (PDT)
Received: from Sapientia.local (c-73-125-89-242.hsd1.fl.comcast.net.
 [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id o186sm7330658qke.44.2021.07.18.14.35.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 18 Jul 2021 14:35:58 -0700 (PDT)
Subject: Re: bug#49280: [PATCH 0/4] gnu: racket: Add racket-next. Bootstrap
 from C.
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <20210629215255.3110238-1-philip@HIDDEN>
 <20210629215742.3112654-1-philip@HIDDEN>
 <20210629215742.3112654-2-philip@HIDDEN>
 <87lf6gjy5l.fsf_-_@HIDDEN>
From: Philip McGrath <philip@HIDDEN>
Message-ID: <270db91e-24f6-2754-7164-d0406aeebc60@HIDDEN>
Date: Sun, 18 Jul 2021 17:35:56 -0400
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
 Gecko/20100101 Thunderbird/78.12.0
MIME-Version: 1.0
In-Reply-To: <87lf6gjy5l.fsf_-_@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.6 (/)
X-Debbugs-Envelope-To: 49280
Cc: 49280 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

Hi!

I've been mostly offline for a bit, and Racket 8.2 was released today (a 
little ahead of schedule), so I will rework this patch series to just 
update to 8.2 and not deal with adding "-next" variants for now. I'll 
respond to here, though, to keep the discussion together.

On 7/8/21 5:25 PM, Ludovic Courtès wrote:
> Philip McGrath <philip@HIDDEN> skribis:
> 
>> * gnu/packages/racket.scm (racket-next-minimal,racket-next): New variables.
> 
> [...]
> 
>> +++ b/gnu/packages/racket.scm
>> @@ -23,6 +23,7 @@
>>     #:use-module ((guix licenses)
>>                   #:select (asl2.0 expat lgpl3+))
>>     #:use-module (guix packages)
>> +  #:use-module (guix base16)
> 
> Leftover?

Yes, thanks!

>> +;;   - `racket-pkg-` should probably be the prefix for Racket packages
>> +;;     available as Guix packages, once we're able to build those.
>> +;;     More specifically, it should correspond
>> +;;     to packages registered in the catalog at https://pkgs.rackat-lang.org.
>> +;;     This is a social convention to manage the namespace, not a technical
>> +;;     limitation: Racket can use other catalogs (e.g. for pre-built packages
>> +;;     or packages pinned to specific versions), unregistered package source
>> +;;     urls, or purely local packages. But we also need a convention to
>> +;;     manage the namespace, so we should use this one. In practice,
>> +;;     all generally useful libre Racket packages are registered there.
>> +;;     We probably will need a clever encoding scheme to deal with the fact
>> +;;     that Racket package names can contain [A-Za-z_-], i.e. including "_",
>> +;;     which is not allowed in Guix package names.
> 
> For this there’s already a documented convention (info "(guix) Package
> Naming"), although part of it is undocumented.  The prefix would rather
> be “racket-” to match what we do with other packages–“ghc-”, “ocaml-”,
> “guile-”, and so forth.

I wrote these as statements in the hope of eliciting any disagreement :)

The problem I see with using just “racket-” as the prefix is the 
potential for collisions, especially because Racket uses a lot of the 
namespace: for example, "_" is a useful example package for testing 
package issues, and I maintain the "_-exp" package. There don't seem to 
be Racket packages named "minimal" or "next" right now, but they seem 
reasonably likely to be used in the future, and Guix likewise may want 
to add packages that don't correspond directly to a single Racket-level 
package. (In fact, I think this may be necessary to build Racket 
packages with mutually recursive dependencies.) Other Racket package 
names that I think might be less confusing if prefixed with 
“racket-pkg-” include "base", "racket-lib", "unstable", "profile", 
"make", "data", "images", "compiler", "compatibility", "pkg-build", and 
"main-distribution".

But we don't need to resolve this now, and maybe actually implementing 
that support will clarify what issues really do or don't exist. I will 
just remove this whole comment for now, since I don't need to make a 
choice between "racket-next-minimal" and "racket-minimal-next".


>> +(define %pre-release-installers
>> +  "https://pre-release.racket-lang.org/installers/")
>> +
>> +(define-public racket-next-minimal
>> +  (package
>> +    (inherit racket-minimal)
>> +    (name "racket-next-minimal")
>> +    (version "8.1.900")
>> +    (source
>> +     (origin
>> +       (inherit (package-source racket-minimal))
>> +       (sha256
>> +        (base32
>> +         "0dm849wvlaxpfgz2qmgy2kwdslyi515rxn1m1yff38lagbn21vxq"))
>> +       (uri (string-append %pre-release-installers
>> +                           "racket-minimal-src.tgz"))))))
>> +
>> +(define-public racket-next
>> +  (package
>> +    (inherit racket)
>> +    (name "racket-next")
>> +    (version (package-version racket-next-minimal))
>> +    (source
>> +     (origin
>> +       (inherit (package-source racket))
>> +       (sha256
>> +        (base32
>> +         "0ysvzgm0lx4b1p4k9balvcbvh2kapbfx91c9ls80ba062cd8y5qv"))
>> +       (uri (string-append %pre-release-installers
>> +                           "racket-src.tgz"))))))
> 
> Do I get it right that *-src.tgz are not versioned?  That they’re
> updated in place regularly?
> 
> In that case, we cannot refer to them in a package definition since the
> hash is bound to become stale.
> 
> What we could do is refer to, say,
> <https://pre-release.racket-lang.org/installers/racket-8.1.900.1-src.tgz>.
> However, I suspect this file would vanish fairly quickly from the web
> site, which is not okay either.
> 
> I’m not sure what a good solution would be.  WDYT?
> 
> It may be that
> ‘--with-source=https://pre-release.racket-lang.org/installers/racket-src.tgz’
> would do the job for those who’re into that.

This is also a good catch!

For now, I will avoid the problem by just not dealing with "-next" variants.

For posterity: while working on this patch series before the release, I 
faced a similar issue, because the "snapshot" builds explicitly are not 
retained indefinitely. As a work-around, I based my work on snapshots 
from Northwestern University (as opposed to the University of Utah), 
because they retain one snapshot per week for a few months. For the 
longer term, rather than using the tarballs directly, I used them to 
produce patch files, which I checked into Guix. Since minimal Racket 
could be build from Git, I could restrict the patch to main-distribution 
Racket package sources, which kept the size manageable.

Something analogous would probably work for release candidates, but the 
right long-term solution is for Guix to be able to build Racket packages 
directly, so we don't have to rely on particular snapshot bundles.


On 7/8/21 5:43 PM, Ludovic Courtès wrote:
 > I’d find it clearer like this:
 >
 >    (add-before 'configure 'change-directory
 >      (lambda _
 >        (chdir "racket/src")))

Ah, that's nice.

 >
 >> +         (add-after 'install 'remove-pkgs-directory
 >> +           ;; otherwise, e.g., `raco pkg show` will try and fail to
 >> +           ;; create a lock file
 >> +           (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)))))
 >
 > Please write full sentences with a bit more context (“Remove package
 > directory, otherwise ‘raco pkg show’ …”).

Will do.

 >> +(define-public racket-next-minimal-bc-3m
 >> +  (hidden-package
 >> +   (package/inherit racket-next-minimal
 >> +     (name "racket-next-minimal-bc-3m")
 >
 > This is “-next” because it’s targeting 8.1, which is not released yet,
 > right?

Correct, but 8.2 (8.1 was released in May). Now that it's been released, 
the name would be "racket-minimal-bc-3m".

 > Since it’s only used for bootstrapping, perhaps use ‘define’ instead of
 > ‘define-public’ and remove the call to ‘hidden-package’.

In addition to bootstrapping, there are three reasons I know of to want 
Racket BC:

  1. The BC and CS implementations have different C APIs, so some
     low-level code may support BC but not CS. But this isn't usually a
     good reason. Racket packages should support both implementations.
     Embedding applications ideally would also be portable: if it's
     only feasible to support one implementation, it should be CS.

  2. Comparing the BC and CS implementations can be useful for testing
     and debugging, both for packages that use the FFI and when hacking
     on the Racket runtime system itself.

  3. Most importantly, BC supports some architectures that CS does not.

In particular, Racket CS does not (yet) support ppc64le, which Racket BC 
does support. The recommendation to packagers, and what Debian does, is
to explicitly use BC on platforms without CS support: 
https://github.com/racket/racket/issues/3773#issuecomment-832935403

I'm not sure what the most idiomatic way to do this is in Guix.

(Just for the record, Racket CS also supports platforms which Racket BC 
supports only partially---without the JIT, places, or futures---or does 
not support at all. One motivation of Racket CS was to make porting 
easier in general.)

 >
 > It should also be (package (inherit …) …) rather than (package/inherit
 > …).  The latter is only useful when defining variants of a package (same
 > version, same code) where the same security updates would apply.

I don't think I understand this very well. Setting aside “-next”-related 
issues, a given commit in the Racket source repository will be used to 
build CGC, 3M, and CS (the default) variants with the same version---at 
least in the Racket senses of “version” and “variant”. It's possible 
that there could be a VM-specific security issue, but usually a bug in 
Racket, security-related or otherwise, will affect all three variants.

 >> +     (inputs
 >> +      `(("libffi" ,libffi) ;; <- only for BC variants
 >> +        ,@(filter (match-lambda
 >> +                    ((label . _)
 >> +                     (not (member label
 >> +                                  '("zlib" "zlib:static"
 >> +                                    "lz4" "lz4:static")))))
 >> +                  (package-inputs racket-next-minimal))))
 >
 > Please use this more common idiom:
 >
 >    ,@(fold alist-delete (package-inputs racket-next-minimal) '("zlib" …))

Thanks, I was looking for something like `alist-delete` but didn't find it.

 >> +This packackage is the normal implementation of Racket BC with a 
precise garbage collector, 3M (``Moving Memory Mana
 >          ^
 > Typo here, and lines too long (here and in other places).  :-)

Thanks, usually I have Emacs set up to catch that.

 >> +     (license (package-license chez-scheme)))))
 >
 > You cannot do that since here since potentially we could end up with
 > circular top-level references from these two modules.
 >
 > Instead, restate what the license is.

Ok, I'd been lulled into complacency by the implicitly thunked fields.

- Philip




Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 8 Jul 2021 21:43:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 08 17:43:51 2021
Received: from localhost ([127.0.0.1]:57772 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m1boE-0008Dk-G2
	for submit <at> debbugs.gnu.org; Thu, 08 Jul 2021 17:43:50 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57752)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1m1boB-0008DU-7u
 for 49280 <at> debbugs.gnu.org; Thu, 08 Jul 2021 17:43:48 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53424)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1m1bo5-0001XV-RY; Thu, 08 Jul 2021 17:43:41 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42860 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1m1bo5-0003qb-Jy; Thu, 08 Jul 2021 17:43:41 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Philip McGrath <philip@HIDDEN>
Subject: Re: bug#49280: [PATCH 0/4] gnu: racket: Add racket-next. Bootstrap
 from C.
References: <20210629215255.3110238-1-philip@HIDDEN>
 <20210629215742.3112654-1-philip@HIDDEN>
 <20210629215742.3112654-4-philip@HIDDEN>
Date: Thu, 08 Jul 2021 23:43:39 +0200
In-Reply-To: <20210629215742.3112654-4-philip@HIDDEN> (Philip
 McGrath's message of "Tue, 29 Jun 2021 17:57:42 -0400")
Message-ID: <87eec8jxbo.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49280
Cc: 49280 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Philip McGrath <philip@HIDDEN> skribis:

> This commit bootstraps the Racket compiler and runtime system from source,
> including Racket CS as well as both variants of Racket BC. (One remaining
> limitation is discussed in comments added to gnu/packages/racket.scm.)
>
> In the process, it moves to building minimal Racket from the Git reposito=
ry,
> rather than the packaged source tarballs. The Git repository is slightly
> better as the ``corresponding source'':
>
>  1. A few packages especially closely tied to the Racket core implementat=
ion
>     (like "compiler-lib", "base", and "racket-doc") are developed in the
>     same Git repository. Having them use the same Guix origin, too, will
>     help to keep them in sync.
>
>  2. The top-level Makefile in the Git repository is an important
>     ``script[] used to control compilation and installation.''
>     In particular, it cooperates with the "distro-build" package to
>     create the source tarballs and installers for a Racket distribution.
>     (Racket supports a notion of custom distributions.)
>
>  3. It is ``the preferred form ... for making modifications'' to the core
>     Racket implementation.
>
> Racket releases are tagged in the Git repository (e.g. "v8.1"). At the
> beginning of each release cycle, a branch is created to stabalize a versi=
on
> for extra testing. Active development happens on the "master" branch.
>
> * gnu/packages/racket-next-minimal-sh-via-rktio.patch: New file, coppied
> from racket-sh-via-rktio.patch to accomodate an extra directory layer.
> When racket-next-minimal becomes racket-minimal, this version will be
> the only one needed.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/local/racket.scm (cfg-flag:sh-for-rktio, cfg-flag:enable-lt,
> cfg-flag:enable-racket, unpack-nanopass+stex,
> %main-repo-main-distribution-pkgs): New private variables.
> * gnu/local/racket.scm (racket-next-minimal)[source]: Use Git.
> [source](snippet): Unbundle nanopass, stex, and libffi.
> [inputs]: List explicitly.
> [native-inputs]: Use racket-next-bootstrap-bootfiles, plus its
> dependencies (for Chez, plus a Racket for bootstrappig).
> [arguments]: Revise extensively.
> * gnu/local/racket.scm (racket-next-minimal-bc-3m,
> racket-next-minimal-bc-cgc): New packages, hidden at least for now.
> (racket-next-bootstrap-chez-bootfiles): Another new package, but this one
> is especially likely to stay hidden.
> * gnu/local/racket.scm (racket-next)[origin](snippet): Unbundle packages
> developed in the main Git repository, but leave their links.rktd and
> pkgs.rktd entries in place.
> [native-inputs]: Add the main Racket Git repository.
> [arguments](#:phases): Adjust 'unpack-packages to also unpack package
> sources from the main Racket Git repository.

Exciting!

[...]

> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/racket/racket")
> +             (commit "0874b76de4f147ada46607857d8acf8445a1073d")))
>         (sha256
>          (base32
> -         "0dm849wvlaxpfgz2qmgy2kwdslyi515rxn1m1yff38lagbn21vxq"))
> -       (uri (string-append %pre-release-installers
> -                           "racket-minimal-src.tgz"))))))
> +         "0gy6rwyrpaij5k5pcyiif821b4vffqiaxg1vpg4iykw2c5ypfp43"))
> +       (file-name
> +        (git-file-name name version))
> +       (patches
> +        (search-patches
> +         "racket-next-minimal-sh-via-rktio.patch"))

Please keep these on a single line, as in:

  (file-name (git-file-name name version))

> +         (replace 'configure
> +           (let ((inner (assq-ref %standard-phases 'configure)))
> +             (lambda args
> +               (chdir "racket/src")
> +               (apply inner args))))

I=E2=80=99d find it clearer like this:

  (add-before 'configure 'change-directory
    (lambda _
      (chdir "racket/src")))

> +         (add-after 'install 'remove-pkgs-directory
> +           ;; otherwise, e.g., `raco pkg show` will try and fail to
> +           ;; create a lock file
> +           (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)))))

Please write full sentences with a bit more context (=E2=80=9CRemove package
directory, otherwise =E2=80=98raco pkg show=E2=80=99 =E2=80=A6=E2=80=9D).

> +(define-public racket-next-minimal-bc-3m
> +  (hidden-package
> +   (package/inherit racket-next-minimal
> +     (name "racket-next-minimal-bc-3m")

This is =E2=80=9C-next=E2=80=9D because it=E2=80=99s targeting 8.1, which i=
s not released yet,
right?

Since it=E2=80=99s only used for bootstrapping, perhaps use =E2=80=98define=
=E2=80=99 instead of
=E2=80=98define-public=E2=80=99 and remove the call to =E2=80=98hidden-pack=
age=E2=80=99.

It should also be (package (inherit =E2=80=A6) =E2=80=A6) rather than (pack=
age/inherit
=E2=80=A6).  The latter is only useful when defining variants of a package =
(same
version, same code) where the same security updates would apply.

> +     (inputs
> +      `(("libffi" ,libffi) ;; <- only for BC variants
> +        ,@(filter (match-lambda
> +                    ((label . _)
> +                     (not (member label
> +                                  '("zlib" "zlib:static"
> +                                    "lz4" "lz4:static")))))
> +                  (package-inputs racket-next-minimal))))

Please use this more common idiom:

  ,@(fold alist-delete (package-inputs racket-next-minimal) '("zlib" =E2=80=
=A6))

(It matters notably because =E2=80=98guix style=E2=80=99 recognizes it:
<https://issues.guix.gnu.org/49169>.)

> +     (synopsis "Minimal Racket with the BC [3M] runtime system")
> +     (description "The Racket BC (``before Chez'' or ``bytecode'') imple=
mentation 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 than the newer runtune system (R=
acket CS) supports a slightly different set of architectures than the curre=
nt runtime system, Racket CS (based on ``Chez Scheme'').
> +
> +This packackage is the normal implementation of Racket BC with a precise=
 garbage collector, 3M (``Moving Memory Mana
        ^
Typo here, and lines too long (here and in other places).  :-)

Please also check what =E2=80=98guix lint=E2=80=99 thinks!

> +(define-public racket-next-minimal-bc-cgc
> +  (package/inherit racket-next-minimal-bc-3m
> +    (name "racket-next-minimal-bc-cgc")
> +    (native-inputs
> +     (filter (match-lambda
> +               (("racket" . _)
> +                #f)
> +               (_
> +                #t))
> +             (package-native-inputs racket-next-minimal-bc-3m)))

Rather: (alist-delete "racket" (package-native-inputs racket-next-minimal-b=
c-3m))

> +     (license (package-license chez-scheme)))))

You cannot do that since here since potentially we could end up with
circular top-level references from these two modules.

Instead, restate what the license is.

Thanks for all this!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 8 Jul 2021 21:25:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 08 17:25:52 2021
Received: from localhost ([127.0.0.1]:57742 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m1bWp-0007kC-UX
	for submit <at> debbugs.gnu.org; Thu, 08 Jul 2021 17:25:52 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54456)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1m1bWn-0007jy-Fn
 for 49280 <at> debbugs.gnu.org; Thu, 08 Jul 2021 17:25:50 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53204)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1m1bWi-0004de-5Q; Thu, 08 Jul 2021 17:25:44 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42858 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1m1bWh-00083U-Tt; Thu, 08 Jul 2021 17:25:44 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Philip McGrath <philip@HIDDEN>
Subject: Re: bug#49280: [PATCH 0/4] gnu: racket: Add racket-next. Bootstrap
 from C.
References: <20210629215255.3110238-1-philip@HIDDEN>
 <20210629215742.3112654-1-philip@HIDDEN>
 <20210629215742.3112654-2-philip@HIDDEN>
Date: Thu, 08 Jul 2021 23:25:42 +0200
In-Reply-To: <20210629215742.3112654-2-philip@HIDDEN> (Philip
 McGrath's message of "Tue, 29 Jun 2021 17:57:40 -0400")
Message-ID: <87lf6gjy5l.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49280
Cc: 49280 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi!

Philip McGrath <philip@HIDDEN> skribis:

> * gnu/packages/racket.scm (racket-next-minimal,racket-next): New variable=
s.

[...]

> +++ b/gnu/packages/racket.scm
> @@ -23,6 +23,7 @@
>    #:use-module ((guix licenses)
>                  #:select (asl2.0 expat lgpl3+))
>    #:use-module (guix packages)
> +  #:use-module (guix base16)

Leftover?

> +;; Preliminary guidelines on naming things:
> +;;   - `racket` is the main package. It corresponds to `racket-minimal`
> +;;     with the Racket-level package "main-distribution" installed.
> +;;   - `racket-minimal` is Racket runtime system and core libraries:
> +;;     just enough to implement the package system and install the rest.
> +;;     Upstream refers to this as "minimal Racket".

Note that these two names match existing conventions in Guix.

I=E2=80=99d suggest moving the bits about the package contents/features nex=
t to
the definition of =E2=80=98racket=E2=80=99 and =E2=80=98racket-minimal=E2=
=80=99.

> +;;   - `racket-pkg-` should probably be the prefix for Racket packages
> +;;     available as Guix packages, once we're able to build those.
> +;;     More specifically, it should correspond
> +;;     to packages registered in the catalog at https://pkgs.rackat-lang=
.org.
> +;;     This is a social convention to manage the namespace, not a techni=
cal
> +;;     limitation: Racket can use other catalogs (e.g. for pre-built pac=
kages
> +;;     or packages pinned to specific versions), unregistered package so=
urce
> +;;     urls, or purely local packages. But we also need a convention to
> +;;     manage the namespace, so we should use this one. In practice,
> +;;     all generally useful libre Racket packages are registered there.
> +;;     We probably will need a clever encoding scheme to deal with the f=
act
> +;;     that Racket package names can contain [A-Za-z_-], i.e. including =
"_",
> +;;     which is not allowed in Guix package names.

For this there=E2=80=99s already a documented convention (info "(guix) Pack=
age
Naming"), although part of it is undocumented.  The prefix would rather
be =E2=80=9Cracket-=E2=80=9D to match what we do with other packages=E2=80=
=93=E2=80=9Cghc-=E2=80=9D, =E2=80=9Cocaml-=E2=80=9D,
=E2=80=9Cguile-=E2=80=9D, and so forth.

> +;;   - `racket-next` is a development version of `racket`, following eit=
her
> +;;     the upstrean Git HEAD or the release candidate, when one exists.
> +;;   - `racket-next-` is the prefix for other development packages,
> +;;     including `racket-next-minimal`. When we can build Racket packages
> +;;     individually, we will need `racket-next-pkg-` for the packages
> +;;     that make up `racket-next`.

These two are also conventional and don=E2=80=99t need to be documented here
IMO.

> +(define %pre-release-installers
> +  "https://pre-release.racket-lang.org/installers/")
> +
> +(define-public racket-next-minimal
> +  (package
> +    (inherit racket-minimal)
> +    (name "racket-next-minimal")
> +    (version "8.1.900")
> +    (source
> +     (origin
> +       (inherit (package-source racket-minimal))
> +       (sha256
> +        (base32
> +         "0dm849wvlaxpfgz2qmgy2kwdslyi515rxn1m1yff38lagbn21vxq"))
> +       (uri (string-append %pre-release-installers
> +                           "racket-minimal-src.tgz"))))))
> +
> +(define-public racket-next
> +  (package
> +    (inherit racket)
> +    (name "racket-next")
> +    (version (package-version racket-next-minimal))
> +    (source
> +     (origin
> +       (inherit (package-source racket))
> +       (sha256
> +        (base32
> +         "0ysvzgm0lx4b1p4k9balvcbvh2kapbfx91c9ls80ba062cd8y5qv"))
> +       (uri (string-append %pre-release-installers
> +                           "racket-src.tgz"))))))

Do I get it right that *-src.tgz are not versioned?  That they=E2=80=99re
updated in place regularly?

In that case, we cannot refer to them in a package definition since the
hash is bound to become stale.

What we could do is refer to, say,
<https://pre-release.racket-lang.org/installers/racket-8.1.900.1-src.tgz>.
However, I suspect this file would vanish fairly quickly from the web
site, which is not okay either.

I=E2=80=99m not sure what a good solution would be.  WDYT?

It may be that
=E2=80=98--with-source=3Dhttps://pre-release.racket-lang.org/installers/rac=
ket-src.tgz=E2=80=99
would do the job for those who=E2=80=99re into that.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 29 Jun 2021 21:58:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 29 17:58:17 2021
Received: from localhost ([127.0.0.1]:55851 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lyLkG-0003Wa-9Q
	for submit <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:58:17 -0400
Received: from mail-qk1-f174.google.com ([209.85.222.174]:37811)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1lyLkD-0003Vv-83
 for 49280 <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:58:14 -0400
Received: by mail-qk1-f174.google.com with SMTP id z3so325639qkl.4
 for <49280 <at> debbugs.gnu.org>; Tue, 29 Jun 2021 14:58:13 -0700 (PDT)
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=KJqHB3IouE86/cSOeFf5g7VR9FXYvEPEZYQlU4ol4oQ=;
 b=eM0YXhKtsmLOrVbMpusDN40AEQOCwm8beh0fJaZzS/zl8BgbXjSmmMkhI2C+CPFnwC
 nkuVXvvbDANg1/+tHspoC1XvknqTsuJ3kovZP67R4IzkFLFF4xIqbtKIpZ4KU24rFYkg
 AR74jjLXVG8An2fTaZqu8GWSRMc0TJak+b7uYSB6npvtgNNRDym0tfA3appCwjUoEAV/
 tD3Yu4u6wLfKDO6xXf5JrNHxTllHRD3rYseNaDHgADoXRitGY+0nNSMtTpt0BBtrKUJC
 f0qpiquzvImFormxdb1pO4ZM7H/0vJ5nT1G/clr7tySe8kUFUrPAb3GFaeAUy72Yh41b
 3M2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=KJqHB3IouE86/cSOeFf5g7VR9FXYvEPEZYQlU4ol4oQ=;
 b=JD9sJxmwTSyjPRTjJinmW12FNx36o5FGmAIHXRkqv2DywApSdLmWaJa9zpRrJwLFEO
 7oGHqWXe4RxBKojUlMO+HqX2W0PMhTRnHm7nQAx38MB43FoQsomJRCSRid7S1Ow5sPUn
 JpRIXJYMpTfCsMWkVE+hGSNLbj6pZUT+YqBkE8fWB2+3xhXLy50vW5KaKRwnnxW2dQ26
 4zvs6c2+CPD0Ty9uJmAXAPeM+VFcy0MwZv/rvQb4szKopzjtteMg2X6fQUJA+ZkP/Kgr
 G93VKViY6fd7FSsxu/4Y5rIVJ1RwyfwDTxOhzbeRzhJR/UI4jyRwKctuLGnm0PvEDris
 +t6w==
X-Gm-Message-State: AOAM533QMZsconc19v7gDT75GdwEKai+Wspr3ncbpzsUXeGVm87ULkHO
 hP+ZN3fY9Llk4MteZIecobPfoejpTWX1U+7spZY=
X-Google-Smtp-Source: ABdhPJw6ZQr1Di7CQQfye9l0IyK+9T4qLb84/hzT6E+GT/fSL4gp+IA7VA0jaQAZxeUAqelYdzOZYA==
X-Received: by 2002:a37:59c7:: with SMTP id
 n190mr32832441qkb.146.1625003887495; 
 Tue, 29 Jun 2021 14:58:07 -0700 (PDT)
Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id t11sm3995529qtq.75.2021.06.29.14.58.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 29 Jun 2021 14:58:07 -0700 (PDT)
From: Philip McGrath <philip@HIDDEN>
To: 49280 <at> debbugs.gnu.org
Subject: [PATCH 4/4] gnu: racket-next-minimal: Bootstrap from C.
Date: Tue, 29 Jun 2021 17:57:42 -0400
Message-Id: <20210629215742.3112654-4-philip@HIDDEN>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20210629215742.3112654-1-philip@HIDDEN>
References: <20210629215255.3110238-1-philip@HIDDEN>
 <20210629215742.3112654-1-philip@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 1.4 (+)
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 commit bootstraps the Racket compiler and runtime system
 from source, including Racket CS as well as both variants of Racket BC. (One
 remaining limitation is discussed in comments added to gnu/pa [...] 
 Content analysis details:   (1.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL
 blocklist [URIs: download.racket-lang.org]
 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL
 blocklist [URIs: download.racket-lang.org]
 -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]
X-Debbugs-Envelope-To: 49280
Cc: Philip McGrath <philip@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.4 (/)

This commit bootstraps the Racket compiler and runtime system from source,
including Racket CS as well as both variants of Racket BC. (One remaining
limitation is discussed in comments added to gnu/packages/racket.scm.)

In the process, it moves to building minimal Racket from the Git repository,
rather than the packaged source tarballs. The Git repository is slightly
better as the ``corresponding source'':

 1. A few packages especially closely tied to the Racket core implementation
    (like "compiler-lib", "base", and "racket-doc") are developed in the
    same Git repository. Having them use the same Guix origin, too, will
    help to keep them in sync.

 2. The top-level Makefile in the Git repository is an important
    ``script[] used to control compilation and installation.''
    In particular, it cooperates with the "distro-build" package to
    create the source tarballs and installers for a Racket distribution.
    (Racket supports a notion of custom distributions.)

 3. It is ``the preferred form ... for making modifications'' to the core
    Racket implementation.

Racket releases are tagged in the Git repository (e.g. "v8.1"). At the
beginning of each release cycle, a branch is created to stabalize a version
for extra testing. Active development happens on the "master" branch.

* gnu/packages/racket-next-minimal-sh-via-rktio.patch: New file, coppied
from racket-sh-via-rktio.patch to accomodate an extra directory layer.
When racket-next-minimal becomes racket-minimal, this version will be
the only one needed.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/local/racket.scm (cfg-flag:sh-for-rktio, cfg-flag:enable-lt,
cfg-flag:enable-racket, unpack-nanopass+stex,
%main-repo-main-distribution-pkgs): New private variables.
* gnu/local/racket.scm (racket-next-minimal)[source]: Use Git.
[source](snippet): Unbundle nanopass, stex, and libffi.
[inputs]: List explicitly.
[native-inputs]: Use racket-next-bootstrap-bootfiles, plus its
dependencies (for Chez, plus a Racket for bootstrappig).
[arguments]: Revise extensively.
* gnu/local/racket.scm (racket-next-minimal-bc-3m,
racket-next-minimal-bc-cgc): New packages, hidden at least for now.
(racket-next-bootstrap-chez-bootfiles): Another new package, but this one
is especially likely to stay hidden.
* gnu/local/racket.scm (racket-next)[origin](snippet): Unbundle packages
developed in the main Git repository, but leave their links.rktd and
pkgs.rktd entries in place.
[native-inputs]: Add the main Racket Git repository.
[arguments](#:phases): Adjust 'unpack-packages to also unpack package
sources from the main Racket Git repository.
---
 gnu/local.mk                                  |   1 +
 .../racket-next-minimal-sh-via-rktio.patch    |  87 +++++
 gnu/packages/racket.scm                       | 357 +++++++++++++++---
 3 files changed, 396 insertions(+), 49 deletions(-)
 create mode 100644 gnu/packages/patches/racket-next-minimal-sh-via-rktio.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 6b9202cba1..4ca35cf56a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1671,6 +1671,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-next-minimal-sh-via-rktio.patch    \
   %D%/packages/patches/racket-sh-via-rktio.patch		\
   %D%/packages/patches/remake-impure-dirs.patch			\
   %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch	\
diff --git a/gnu/packages/patches/racket-next-minimal-sh-via-rktio.patch b/gnu/packages/patches/racket-next-minimal-sh-via-rktio.patch
new file mode 100644
index 0000000000..6bc2ee8331
--- /dev/null
+++ b/gnu/packages/patches/racket-next-minimal-sh-via-rktio.patch
@@ -0,0 +1,87 @@
+From 3574b567c486d264d680a37586436c3b5a8cb978 Mon Sep 17 00:00:00 2001
+From: Philip McGrath <philip@HIDDEN>
+Date: Thu, 4 Mar 2021 04:11:50 -0500
+Subject: [PATCH] patch rktio_process for "/bin/sh" on Guix
+
+Racket provides the functions `system` and `process`,
+which execute shell commands using `sh` (or `cmd` on Windows).
+Racket assumes that `sh` can be found at "/bin/sh",
+which is not necessarily true on Guix.
+
+This patch adds a special case for "/bin/sh" to `rktio_process`,
+the C function that implements the core of `system`, `process`,
+and related Racket functions.
+
+Guix should enable the special case by defining the C preprocessor
+macro `GUIX_RKTIO_PATCH_BIN_SH` with the path to `sh` in the store.
+If:
+
+    1. The `GUIX_RKTIO_PATCH_BIN_SH` macro is defined; and
+
+    2. `rktio_process` is called with the exact path "/bin/sh"; and
+
+    3. The path specified by `GUIX_RKTIO_PATCH_BIN_SH` does exists;
+
+then `rktio_process` will execute the file specified
+by `GUIX_RKTIO_PATCH_BIN_SH` instead of "/bin/sh".
+
+Compared to previous attempts to patch the Racket sources,
+making this change at the C level is both:
+
+    - More comprehensive: it catches all attempts to execute "/bin/sh",
+      without having to track down the source of every occurance; and
+
+    - Less intrusive: by guarding the special case with a C preprocessor
+      conditional and a runtime check that the file in the store exists,
+      we make it much less likely that it will "leak" out of Guix.
+---
+ racket/src/rktio/rktio_process.c | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/racket/src/rktio/rktio_process.c b/racket/src/rktio/rktio_process.c
+index 89202436c0..465ebdd5c5 100644
+--- a/racket/src/rktio/rktio_process.c
++++ b/racket/src/rktio/rktio_process.c
+@@ -1224,12 +1224,14 @@ int rktio_process_allowed_flags(rktio_t *rktio)
+ /*========================================================================*/
+ 
+ rktio_process_result_t *rktio_process(rktio_t *rktio,
+-                                      const char *command, int argc, rktio_const_string_t *argv,
++                                      /* PATCHED for Guix (next line) */
++                                      const char *_guix_orig_command, int argc, rktio_const_string_t *argv,
+                                       rktio_fd_t *stdout_fd, rktio_fd_t *stdin_fd, rktio_fd_t *stderr_fd,
+                                       rktio_process_t *group_proc,
+                                       const char *current_directory, rktio_envvars_t *envvars,
+                                       int flags)
+ {
++  const char *command; /* PATCHED for Guix */
+   rktio_process_result_t *result;
+   intptr_t to_subprocess[2], from_subprocess[2], err_subprocess[2];
+   int pid;
+@@ -1255,6 +1257,23 @@ rktio_process_result_t *rktio_process(rktio_t *rktio,
+   int i;
+ #endif
+ 
++/* BEGIN PATCH for Guix */
++#if defined(GUIX_RKTIO_PATCH_BIN_SH)
++# define GUIX_AS_a_STR_HELPER(x) #x
++# define GUIX_AS_a_STR(x) GUIX_AS_a_STR_HELPER(x)
++  /* A level of indirection makes `#` work as needed: */
++  command =
++      ((0 == strcmp(_guix_orig_command, "/bin/sh"))
++       && rktio_file_exists(rktio, GUIX_AS_a_STR(GUIX_RKTIO_PATCH_BIN_SH)))
++      ? GUIX_AS_a_STR(GUIX_RKTIO_PATCH_BIN_SH)
++      : _guix_orig_command;
++# undef GUIX_AS_a_STR
++# undef GUIX_AS_a_STR_HELPER
++#else
++  command = _guix_orig_command;
++#endif
++/* END PATCH for Guix */
++
+   /* avoid compiler warnings: */
+   to_subprocess[0] = -1;
+   to_subprocess[1] = -1;
+-- 
+2.21.1 (Apple Git-122.3)
+
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index cf0240be5c..4e2d498364 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -32,7 +32,9 @@
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages chez)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages fontutils)
@@ -41,6 +43,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages libedit)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
@@ -49,6 +52,7 @@
 ;; Commentary:
 ;;
 ;; Preliminary guidelines on naming things:
+;;
 ;;   - `racket` is the main package. It corresponds to `racket-minimal`
 ;;     with the Racket-level package "main-distribution" installed.
 ;;   - `racket-minimal` is Racket runtime system and core libraries:
@@ -74,6 +78,49 @@
 ;;     individually, we will need `racket-next-pkg-` for the packages
 ;;     that make up `racket-next`.
 ;;
+;; 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:
 
 
@@ -200,7 +247,6 @@ DrRacket IDE, are not included.")
     ;; https://download.racket-lang.org/license.html
     (license (list lgpl3+ asl2.0 expat))))
 
-
 (define-public racket
   (package
     (inherit racket-minimal)
@@ -243,8 +289,35 @@ 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.")))
 
-(define %pre-release-installers
-  "https://pre-release.racket-lang.org/installers/")
+
+(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")))
 
 (define-public racket-next-minimal
   (package
@@ -253,12 +326,214 @@ languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.")))
     (version "8.1.900")
     (source
      (origin
-       (inherit (package-source racket-minimal))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/racket/racket")
+             (commit "0874b76de4f147ada46607857d8acf8445a1073d")))
        (sha256
         (base32
-         "0dm849wvlaxpfgz2qmgy2kwdslyi515rxn1m1yff38lagbn21vxq"))
-       (uri (string-append %pre-release-installers
-                           "racket-minimal-src.tgz"))))))
+         "0gy6rwyrpaij5k5pcyiif821b4vffqiaxg1vpg4iykw2c5ypfp43"))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "racket-next-minimal-sh-via-rktio.patch"))
+       (snippet
+        (with-imported-modules '((guix build utils))
+          #~(begin
+              (use-modules (guix build utils))
+              ;; unbundle Chez submodules
+              (with-directory-excursion "racket/src/ChezScheme"
+                #$(origin-snippet (package-source chez-scheme)))
+              ;; unbundle libffi
+              (for-each
+               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-next-bootstrap-chez-bootfiles)
+       ,@(package-native-inputs racket-next-bootstrap-chez-bootfiles)))
+    (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? #f ;; not yet
+       #: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)))
+         (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"))))
+         (add-before 'configure 'initialize-config.rktd
+           (lambda* (#:key inputs #:allow-other-keys)
+             (mkdir-p "racket/etc")
+             (with-output-to-file "racket/etc/config.rktd"
+               (lambda ()
+                 (format #t
+                         "#hash((lib-search-dirs . ~s))\n"
+                         (cons #f
+                               (map (lambda (lib)
+                                      (string-append (assoc-ref inputs lib)
+                                                     "/lib"))
+                                    '("openssl"
+                                      "sqlite"))))))
+             #t))
+         (replace 'configure
+           (let ((inner (assq-ref %standard-phases 'configure)))
+             (lambda args
+               (chdir "racket/src")
+               (apply inner args))))
+         (add-after 'install 'remove-pkgs-directory
+           ;; otherwise, e.g., `raco pkg show` will try and fail to
+           ;; create a lock file
+           (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)))))
+    ;; https://download.racket-lang.org/license.html
+    ;; The LGPL components are only used by Racket BC.
+    (license (list asl2.0 expat))))
+
+(define-public racket-next-minimal-bc-3m
+  (hidden-package
+   (package/inherit racket-next-minimal
+     (name "racket-next-minimal-bc-3m")
+     (inputs
+      `(("libffi" ,libffi) ;; <- only for BC variants
+        ,@(filter (match-lambda
+                    ((label . _)
+                     (not (member label
+                                  '("zlib" "zlib:static"
+                                    "lz4" "lz4:static")))))
+                  (package-inputs racket-next-minimal))))
+     (native-inputs
+      `(("libtool" ,libtool)
+        ("racket" ,(if (%current-target-system)
+                       racket-next-minimal
+                       racket-next-minimal-bc-cgc))))
+     (arguments
+      (substitute-keyword-arguments (package-arguments racket-next-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 than the newer runtune system (Racket CS) supports a slightly different set of architectures than the current runtime system, Racket CS (based on ``Chez Scheme'').
+
+This packackage is the normal implementation of Racket BC with a precise garbage collector, 3M (``Moving Memory Manager'')."))))
+
+(define-public racket-next-minimal-bc-cgc
+  (package/inherit racket-next-minimal-bc-3m
+    (name "racket-next-minimal-bc-cgc")
+    (native-inputs
+     (filter (match-lambda
+               (("racket" . _)
+                #f)
+               (_
+                #t))
+             (package-native-inputs racket-next-minimal-bc-3m)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments racket-next-minimal-bc-3m)
+       ((#:configure-flags _ '())
+        `(list "--enable-cgcdefault"
+               ,cfg-flag:enable-lt
+               ,cfg-flag:sh-for-rktio))))
+    (synopsis "Old Racket implemetation used for bootstapping")
+    (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-next-bootstrap-chez-bootfiles
+  (hidden-package
+   (package/inherit racket-next-minimal
+     (name "racket-next-bootstrap-chez-bootfiles")
+     (inputs `())
+     (native-inputs
+      `(("racket" ,(if (%current-target-system)
+                       racket-next-minimal
+                       racket-next-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)))
+          (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 ``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 ``cs-bootstap'' 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 ``cs-bootstrap'' does not currently support building upstream Chez Scheme.")
+     (license (package-license chez-scheme)))))
+
+
+(define %pre-release-installers
+  "https://pre-release.racket-lang.org/installers/")
+
+(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"))
 
 (define-public racket-next
   (package
@@ -289,36 +564,10 @@ languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.")))
                           "README"
                           "src"))
               ;; unbundle package sources included elsewhere
-              (define (substitute/delete file pattern)
-                (substitute
-                 file
-                 (list (cons pattern
-                             (lambda (line matches)
-                               ;; must match exactly once
-                               (match matches
-                                 ((m)
-                                  (string-append (match:prefix m)
-                                                 (match:suffix m)))))))))
-              (define (unbundle-pkg pkg)
-                (define quoted-pkg (regexp-quote pkg))
-                (with-directory-excursion "share"
-                  (substitute/delete
-                   "links.rktd"
-                   (string-append
-                    "[(][^()]+[(]#\"pkgs\" #\""
-                    quoted-pkg
-                    "\"[)][)]"))
-                  (with-directory-excursion "pkgs"
-                    (substitute/delete
-                     "pkgs.rktd"
-                     (string-append
-                      "[(]\""
-                      quoted-pkg
-                      "\" \\. #s[(]"
-                      "(pkg-info|[(]sc-pkg-info pkg-info 3[)])"
-                      " [(][^()]+[)] [^()]+[)][)]"))
-                    (delete-file-recursively pkg))))
-              (unbundle-pkg "racket-lib"))))))
+              (with-directory-excursion "share/pkgs"
+                (for-each delete-file-recursively
+                          '#+%main-repo-main-distribution-pkgs))
+              #t)))))
     (inputs
      `(("cairo" ,cairo)
        ("fontconfig" ,fontconfig)
@@ -336,22 +585,32 @@ languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.")))
        ("libedit" ,libedit)))
     (native-inputs
      `(("racket" ,racket-next-minimal)
-       ("extend-layer" ,extend-layer)))
+       ("extend-layer" ,extend-layer)
+       ("main-repo" ,(package-source racket-next-minimal))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (add-before 'configure 'unpack-packages
-           (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
-             (let ((racket (assoc-ref (or native-inputs inputs) "racket"))
-                   (prefix (assoc-ref outputs "out")))
-               (mkdir-p (string-append prefix "/share/racket/pkgs"))
-               (copy-recursively
-                "share/links.rktd"
-                (string-append prefix "/share/racket/links.rktd"))
-               (copy-recursively
-                "share/pkgs"
-                (string-append prefix "/share/racket/pkgs"))
-               #t)))
+           (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"))
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 29 Jun 2021 21:58:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 29 17:58:13 2021
Received: from localhost ([127.0.0.1]:55848 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lyLkC-0003WG-Pq
	for submit <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:58:13 -0400
Received: from mail-qk1-f175.google.com ([209.85.222.175]:46695)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1lyLk9-0003Vm-9p
 for 49280 <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:58:10 -0400
Received: by mail-qk1-f175.google.com with SMTP id 19so270959qky.13
 for <49280 <at> debbugs.gnu.org>; Tue, 29 Jun 2021 14:58:09 -0700 (PDT)
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=IdMXqcY4irBQmjsXrAWEILFEReRTthOkRQS35Rw9i1g=;
 b=VaEdUjmqvesLB5+vqr1R+vnKabITECC0+ROWV6GHY1TXuKNarMAheSg82qoOFPPmVs
 XmSY7Pn5SH+yKhjxZbha/PG6ToZmwvRk0vrUOV74RQs4zkPTY/9+I9HIZcoAQ9WCenOl
 CBGx3HtpDpcmlX3dND8g5csSjnUMEEzf37/yyZDMv/hSzY+YrylAFFhShfxMMCCcEqFt
 67nhOUGD9WAnP02pYSGXMKGGvaKuGkexFL0KlZwPJsLwVUCbt+9qXOptT/uRmzqZXDyB
 azuoxGLUJVYsh6pI/8ccQzwH6jCEVJeKNT14eWCwl/eKnGOIk81+zvafZBOitOPAgcEQ
 QCDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=IdMXqcY4irBQmjsXrAWEILFEReRTthOkRQS35Rw9i1g=;
 b=GyQLUWgyylX7f34Vh8r82wVGKzeefqRDpcv0vY7hlehs5dsP4MLC51ON/1pVeyS2PA
 YkDpm/cfFaTB/aQGNu+GUqRutii4zoZExbFlYqtnp+tR9AI5pw1PSIpihYJTtl56UgHE
 LJpcvdreVzP72cyvPLPL1LZ30NcSEQj+sLX5zh7m8JPRCwtPhCcT6CoKDvk0aTUCUsWm
 wSDVmhvX19t0GQHr42s/pPHjmOx6U1JB/8kGSDoK/r8GEySnxahBqZsKPkM5CZxK8p7n
 XUL4gcEUF/LabaX/h8+lGhW7X92ZLEMU0HhVkmjh7dEO2prPpXEfkZHzLxL1ZdZmOeS4
 LgAg==
X-Gm-Message-State: AOAM532wJbk2d4sNH9pgpX/Xhn8ZN+NpXXLcLgCf2sM2expYElIZLqXe
 EKGGyBZaAi2Ekx4/ypdayHrTIqS6mIuGCDchxyg=
X-Google-Smtp-Source: ABdhPJzWRxiRLRQjz9w54FLsxKh8Q46V1Wmuqo0Lj9jAPV+zwStEijIeGgVsFeH1igujvufGHKghdg==
X-Received: by 2002:a05:620a:6d5:: with SMTP id
 21mr16847686qky.138.1625003883650; 
 Tue, 29 Jun 2021 14:58:03 -0700 (PDT)
Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id o21sm12850175qkp.51.2021.06.29.14.58.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 29 Jun 2021 14:58:03 -0700 (PDT)
From: Philip McGrath <philip@HIDDEN>
To: 49280 <at> debbugs.gnu.org
Subject: [PATCH 3/4] gnu: racket-next: Unbundle racket-next-minimal.
Date: Tue, 29 Jun 2021 17:57:41 -0400
Message-Id: <20210629215742.3112654-3-philip@HIDDEN>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20210629215742.3112654-1-philip@HIDDEN>
References: <20210629215255.3110238-1-philip@HIDDEN>
 <20210629215742.3112654-1-philip@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 49280
Cc: Philip McGrath <philip@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

This takes advantage of improvements since the Racket 8.1 release in support
for layered and tethered installation.

* gnu/packages/racket.scm (extend-layer): New private variable. This is a
script for configuring a new config-tethered layer chaining to an existing
Racket installation.
* gnu/packages/racket.scm (racket-next)[source](snippet): Unbundle
`racket-next-minimal`.
[inputs]: Stop inheriting from `racket`. Remove inputs that properly
beling to `racket-next-minimal`.
[native-inputs]: Add `racket-next-minimal` and `extend-layer`.
[arguments]: Stop inheriting from `racket`.
Add phase 'unpack-packages to move the sources and links file into place.
Replace 'configure phase using `extend-layer`.
Replace 'build phase using `raco setup`.
Delete 'install phase.
---
 gnu/packages/racket.scm | 202 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 201 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 363f19825b..cf0240be5c 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -272,4 +272,204 @@ languages such as Typed Racket, R5RS and R6RS Scheme, Algol 60, and Datalog.")))
         (base32
          "0ysvzgm0lx4b1p4k9balvcbvh2kapbfx91c9ls80ba062cd8y5qv"))
        (uri (string-append %pre-release-installers
-                           "racket-src.tgz"))))))
+                           "racket-src.tgz"))
+       (snippet
+        (with-imported-modules '((guix build utils)
+                                 (ice-9 match)
+                                 (ice-9 regex))
+          #~(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
+              (define (substitute/delete file pattern)
+                (substitute
+                 file
+                 (list (cons pattern
+                             (lambda (line matches)
+                               ;; must match exactly once
+                               (match matches
+                                 ((m)
+                                  (string-append (match:prefix m)
+                                                 (match:suffix m)))))))))
+              (define (unbundle-pkg pkg)
+                (define quoted-pkg (regexp-quote pkg))
+                (with-directory-excursion "share"
+                  (substitute/delete
+                   "links.rktd"
+                   (string-append
+                    "[(][^()]+[(]#\"pkgs\" #\""
+                    quoted-pkg
+                    "\"[)][)]"))
+                  (with-directory-excursion "pkgs"
+                    (substitute/delete
+                     "pkgs.rktd"
+                     (string-append
+                      "[(]\""
+                      quoted-pkg
+                      "\" \\. #s[(]"
+                      "(pkg-info|[(]sc-pkg-info pkg-info 3[)])"
+                      " [(][^()]+[)] [^()]+[)][)]"))
+                    (delete-file-recursively pkg))))
+              (unbundle-pkg "racket-lib"))))))
+    (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-next-minimal)
+       ("extend-layer" ,extend-layer)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'unpack-packages
+           (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
+             (let ((racket (assoc-ref (or native-inputs inputs) "racket"))
+                   (prefix (assoc-ref outputs "out")))
+               (mkdir-p (string-append prefix "/share/racket/pkgs"))
+               (copy-recursively
+                "share/links.rktd"
+                (string-append prefix "/share/racket/links.rktd"))
+               (copy-recursively
+                "share/pkgs"
+                (string-append prefix "/share/racket/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))
+         ;; we still don't have these:
+         (delete 'install))
+       #:tests? #f))))
+
+(define extend-layer
+  (scheme-file
+   "extend-layer.rkt"
+   `(module
+     extend-layer racket/base
+     (require racket/cmdline
+              racket/match
+              racket/file
+              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
+                          '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))))))))
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 29 Jun 2021 21:58:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 29 17:58:12 2021
Received: from localhost ([127.0.0.1]:55846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lyLkC-0003W7-Aw
	for submit <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:58:12 -0400
Received: from mail-qv1-f53.google.com ([209.85.219.53]:44933)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1lyLk4-0003VO-MQ
 for 49280 <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:58:05 -0400
Received: by mail-qv1-f53.google.com with SMTP id dj3so481qvb.11
 for <49280 <at> debbugs.gnu.org>; Tue, 29 Jun 2021 14:58:04 -0700 (PDT)
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=QY6Y7nfoQZZes0BD72N5Qc65u6NOoEB5vOh/5fMqWUg=;
 b=eIHMqy+Gsg9wB2Do6otvLAdy1IBy98ScnJnrTRONJn6tO/gtJ3fPHocJ0jYOXG14Wh
 90A7yHwlCsbCf7bQGV9Jf8I8/nT6GlWM12IRpXdh8mQkr7BKYzsbf1JJgHEvcm42gP24
 Cr/AQecKO9wnDBF9iHKTYToTW9kQipQVYmsiS0yrJTwguAC27sJwZw3ibpZzMowGZtii
 HqrySV91z4ZWXLtYvK7ObEYPRT4axnoEMKifRt8/XncalVGFTpWZoftu2xe4OXDGlWeo
 hEoc14J7+1NBNKTlyXHWbPFxICwaAv/sR4WuZq5xLWAoZc1OzZHC5Miva+Tx8CngzGz0
 DwDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=QY6Y7nfoQZZes0BD72N5Qc65u6NOoEB5vOh/5fMqWUg=;
 b=DWWkk9O/6i0NOnBrSKNlQSaSoM573SslN3tidvU7XAgHUr+EZpFH+jqAxu6Ex3LRgw
 upmac5TougknNoGutc1CLlvYcxnkxJLykfOMGMmTdRr9ASXZFBwnHc/x7aelVyNEjGfp
 G6jZTaJYDc9RZjYx4b9zvrvItWCboFYJwYSfIz5svsQ76HeUZHJYcWGh4ts6+LWGL/IP
 Q+kG9F39KekhZyliIl+yE6+vQ6L9tZBCiwrkCJwpy85VZfjsxULj99PgSE6dqSGni1SB
 Kk8Pk9GYsXpaHnB3mCUs9si6ZqoP8sPba2LbzXGvHj0bnM76tgXaYygTumNpio/gmt5u
 XMIw==
X-Gm-Message-State: AOAM530OA/yQ65uagYvIJGLY017Xqp8nSHh10+diT8zv1zIVaJY+ovdy
 UPDBthz536NhS8NbhnWrEqf3txhnFec0mrRYbM0=
X-Google-Smtp-Source: ABdhPJx0jL5pOd1CjF5WcH1jHm0bWm/OVKoXxfRP44iSEZ5DX3h5vWF2Q8660gwBxmcwbRnXlqyfUg==
X-Received: by 2002:a0c:fe01:: with SMTP id x1mr33399966qvr.46.1625003879069; 
 Tue, 29 Jun 2021 14:57:59 -0700 (PDT)
Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id b25sm628338qkk.111.2021.06.29.14.57.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 29 Jun 2021 14:57:58 -0700 (PDT)
From: Philip McGrath <philip@HIDDEN>
To: 49280 <at> debbugs.gnu.org
Subject: [PATCH 2/4] gnu: racket: Add racket-next and racket-next-minimal.
Date: Tue, 29 Jun 2021 17:57:40 -0400
Message-Id: <20210629215742.3112654-2-philip@HIDDEN>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20210629215742.3112654-1-philip@HIDDEN>
References: <20210629215255.3110238-1-philip@HIDDEN>
 <20210629215742.3112654-1-philip@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 49280
Cc: Philip McGrath <philip@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

* gnu/packages/racket.scm (racket-next-minimal,racket-next): New variables.
---
 gnu/packages/racket.scm | 62 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index d0cfed7292..363f19825b 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -23,6 +23,7 @@
   #:use-module ((guix licenses)
                 #:select (asl2.0 expat lgpl3+))
   #:use-module (guix packages)
+  #:use-module (guix base16)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
@@ -45,6 +46,36 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xorg))
 
+;; Commentary:
+;;
+;; Preliminary guidelines on naming things:
+;;   - `racket` is the main package. It corresponds to `racket-minimal`
+;;     with the Racket-level package "main-distribution" installed.
+;;   - `racket-minimal` is Racket runtime system and core libraries:
+;;     just enough to implement the package system and install the rest.
+;;     Upstream refers to this as "minimal Racket".
+;;   - `racket-pkg-` should probably be the prefix for Racket packages
+;;     available as Guix packages, once we're able to build those.
+;;     More specifically, it should correspond
+;;     to packages registered in the catalog at https://pkgs.rackat-lang.org.
+;;     This is a social convention to manage the namespace, not a technical
+;;     limitation: Racket can use other catalogs (e.g. for pre-built packages
+;;     or packages pinned to specific versions), unregistered package source
+;;     urls, or purely local packages. But we also need a convention to
+;;     manage the namespace, so we should use this one. In practice,
+;;     all generally useful libre Racket packages are registered there.
+;;     We probably will need a clever encoding scheme to deal with the fact
+;;     that Racket package names can contain [A-Za-z_-], i.e. including "_",
+;;     which is not allowed in Guix package names.
+;;   - `racket-next` is a development version of `racket`, following either
+;;     the upstrean Git HEAD or the release candidate, when one exists.
+;;   - `racket-next-` is the prefix for other development packages,
+;;     including `racket-next-minimal`. When we can build Racket packages
+;;     individually, we will need `racket-next-pkg-` for the packages
+;;     that make up `racket-next`.
+;;
+;; Code:
+
 
 (define %installer-mirrors
   ;; Source:
@@ -211,3 +242,34 @@ languages to complete language implementations.
 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.")))
+
+(define %pre-release-installers
+  "https://pre-release.racket-lang.org/installers/")
+
+(define-public racket-next-minimal
+  (package
+    (inherit racket-minimal)
+    (name "racket-next-minimal")
+    (version "8.1.900")
+    (source
+     (origin
+       (inherit (package-source racket-minimal))
+       (sha256
+        (base32
+         "0dm849wvlaxpfgz2qmgy2kwdslyi515rxn1m1yff38lagbn21vxq"))
+       (uri (string-append %pre-release-installers
+                           "racket-minimal-src.tgz"))))))
+
+(define-public racket-next
+  (package
+    (inherit racket)
+    (name "racket-next")
+    (version (package-version racket-next-minimal))
+    (source
+     (origin
+       (inherit (package-source racket))
+       (sha256
+        (base32
+         "0ysvzgm0lx4b1p4k9balvcbvh2kapbfx91c9ls80ba062cd8y5qv"))
+       (uri (string-append %pre-release-installers
+                           "racket-src.tgz"))))))
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at 49280 <at> debbugs.gnu.org:


Received: (at 49280) by debbugs.gnu.org; 29 Jun 2021 21:58:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 29 17:58:12 2021
Received: from localhost ([127.0.0.1]:55842 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lyLjy-0003VL-FL
	for submit <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:58:12 -0400
Received: from mail-qk1-f182.google.com ([209.85.222.182]:36385)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1lyLjx-0003V9-8n
 for 49280 <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:57:57 -0400
Received: by mail-qk1-f182.google.com with SMTP id l16so331690qkp.3
 for <49280 <at> debbugs.gnu.org>; Tue, 29 Jun 2021 14:57:57 -0700 (PDT)
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=scvuB0ls4IJeLELhueJ0PXnz9ECPNlyceDR9WnwEzYs=;
 b=LXap1xp0kR5WB+AeZaBBrJcLt0Y3aFCIAYa21iUkrQ+4OKxKSjkJOZDBwHSNtex6gk
 e3tzDNwloakss/S7zbZQ1w8yaZpvT/WFG7Vlc0SzqYTu6RcyTWTOTtpekC3E/5uAbfGS
 EB7cd7ecjJGNUhTRcdR13FVA4k2G2ENh3+3mGsLXL2n1oWmFdvbpce+tUsxMDFrINWTf
 VaYk8TsTIJczkvqfX82c/i3OHUisdaNoDinJDM+GnmI7BPzXOlP7YNBIT7rujRB1UOE6
 Gmtzle1ciQMN79OQPCM5nPzpo9ayMixYv+RFjDn20Ozm59TITCyF4Rf+6fxIXHeikRPL
 HGOQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=scvuB0ls4IJeLELhueJ0PXnz9ECPNlyceDR9WnwEzYs=;
 b=JPuCAgqoRHIxI26Ghflsky8anTOzxYykWwryx2aycfDiwPWG61czKHaccCq6j0gUbd
 os50ZPPqkZbvJRsU6Wk58XXRjvrjgKsDdYNpACMNZ0iXFaudncUwolf3NLTu74z/0LDg
 mXHfOvA9QccPYpWPsWdW2B3wYCJ0tB8V+OiSMFhKL/TqpLJFS+uUIVf+BQbapfEHHfe1
 EOCoRTimwQ9X6Jyv5/1fvHf250loIP9yLQ5eG+8HZD+9dUn/Lf+5Vib/xucss5cR+cwv
 k5W8Be9R9UiQeKD+ezxsowMbzzUaPz1TaW579G7hcy/mIp+B8aWfmodAXHTqmCzC5J6V
 gG2A==
X-Gm-Message-State: AOAM530RCoI6TJnnablQ5Vq9fSiFLWVHXcPbJlNziVEG0a5tBXE7atq1
 Rr/WTi73zaBUUUuo+DHGR6kzg9brmEPAsn8S35k=
X-Google-Smtp-Source: ABdhPJygLUt6OR77iPFVlnPNpPHx0mxxU9bTeDIlzIR6xgEdubBTaJ2oRZED9/f7znW+Sft6rhWH6g==
X-Received: by 2002:a37:65c3:: with SMTP id
 z186mr23544760qkb.481.1625003871677; 
 Tue, 29 Jun 2021 14:57:51 -0700 (PDT)
Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id y63sm12670913qke.16.2021.06.29.14.57.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 29 Jun 2021 14:57:51 -0700 (PDT)
From: Philip McGrath <philip@HIDDEN>
To: 49280 <at> debbugs.gnu.org
Subject: [PATCH 1/4] gnu: racket: Fix lib-search-dirs configuration.
Date: Tue, 29 Jun 2021 17:57:39 -0400
Message-Id: <20210629215742.3112654-1-philip@HIDDEN>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20210629215255.3110238-1-philip@HIDDEN>
References: <20210629215255.3110238-1-philip@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 49280
Cc: Philip McGrath <philip@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

When a config.rktd file doesn't contain an entry for `lib-search-dirs`,
the default is equivalent to `'(#f)`, not `'()`.

* gnu/packages/racket.scm (racket)[#:arguments]: Fix
patch-config.rktd-lib-search-dirs phase.
---
 gnu/packages/racket.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 2d606071fe..d0cfed7292 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -125,7 +125,7 @@
                                   'lib-search-dirs
                                   (lambda (dirs)
                                     (append dirs extra-lib-search-dirs))
-                                  null)
+                                  '(#f))
                                  #:exists 'truncate/replace
                                  file)))
                     "--"
-- 
2.30.2





Information forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Jun 2021 21:53:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 29 17:53:48 2021
Received: from localhost ([127.0.0.1]:55837 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lyLfv-0003PJ-Rv
	for submit <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:53:48 -0400
Received: from lists.gnu.org ([209.51.188.17]:44684)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1lyLfu-0003PC-PR
 for submit <at> debbugs.gnu.org; Tue, 29 Jun 2021 17:53:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:39026)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philip@HIDDEN>)
 id 1lyLfs-000712-SR
 for guix-patches@HIDDEN; Tue, 29 Jun 2021 17:53:46 -0400
Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]:35344)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <philip@HIDDEN>)
 id 1lyLfp-0003ek-DI
 for guix-patches@HIDDEN; Tue, 29 Jun 2021 17:53:43 -0400
Received: by mail-qt1-x829.google.com with SMTP id g12so17292654qtb.2
 for <guix-patches@HIDDEN>; Tue, 29 Jun 2021 14:53:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=philipmcgrath.com; s=google;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=H60ivWbnEmHs+cVs0uIqFcRwtiWxEOeSK57FBgETisU=;
 b=gIs/UrzLUFwb385cTKMRfZyi2+4bP7+sd1s9FslxNywGs/QuX694Kb4eSu9h1+yOzY
 3aBCzoU3j8nCTYJdhrsnCYjolgYWxQ+kX1DcfUVHMD2R878GXj3Q3zwltP/qF92gJr8P
 9p23FKyn6IJ7rXSelYHC2GtNUgnh02CH9mtEfnFH7lJCI1HVeDTCI93fxL7Ug0I0A08P
 l2AfpGdKa7xZZPpa5O0DMRWGt4STg2TbQJph+6WTYkKlHIsiK/qXBEtiENRDNZbCKk3r
 VYnxx4S2txznG4yV7vRTbFh/HWQnh+7YhKrPI63I+W72OM+ZZTjEPQNMX1HW3rH5hY/Q
 JGcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=H60ivWbnEmHs+cVs0uIqFcRwtiWxEOeSK57FBgETisU=;
 b=PlWZvPs7iFssoHUQs+P4riRnYQLMNWneqyaibzkj8Bm2GWev1CR4mgg3nG8SsVwFC9
 6PaJtXv/bU8nsCsYQxLuMhTVVRm7XhYV9k7B2MBzSdJt04swa13YEUM1my6nOqMALKzt
 2H9K5SbojEo9Rlr1kf2J89asoK6dI3jEv+B+RZtAooX/0hTGK0AJdnExD/uvxkZYyyWB
 fqSt5eI30V1AaOhDmsLWvWzwgAI8C/CMFKNY+ZDm2fy+RsL4URZTk0W2Yil6TKLQCkkV
 tofI2YS7V8Afu146BLTPST/cFRSWgymT0CF1rDD0tWZnLYk2BxLmD2Cn0cwZ8PUhPnH4
 F/9Q==
X-Gm-Message-State: AOAM530HvPoOW4JvvUCBFebt3u5/CdVC+eT7UEOcR+jiWqQppU2Lq/TD
 X/0F3uC4oTClM1BySt2Xp+1OxzarSdaS1Ka/r0A=
X-Google-Smtp-Source: ABdhPJwNv/oMZukTgKMWvk8QT7gihXVqKlXUTn0a7v/e6+VAyF0Ce+UViFeP1RJ5YE2T5NmpKlsUbA==
X-Received: by 2002:a05:622a:13d2:: with SMTP id
 p18mr4888262qtk.224.1625003619737; 
 Tue, 29 Jun 2021 14:53:39 -0700 (PDT)
Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242])
 by smtp.gmail.com with ESMTPSA id 202sm11157911qki.83.2021.06.29.14.53.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 29 Jun 2021 14:53:39 -0700 (PDT)
From: Philip McGrath <philip@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/4] gnu: racket: Add racket-next. Bootstrap from C.
Date: Tue, 29 Jun 2021 17:52:55 -0400
Message-Id: <20210629215255.3110238-1-philip@HIDDEN>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: neutral client-ip=2607:f8b0:4864:20::829;
 envelope-from=philip@HIDDEN; helo=mail-qt1-x829.google.com
X-Spam_score_int: -12
X-Spam_score: -1.3
X-Spam_bar: -
X-Spam_report: (-1.3 / 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,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
Cc: Philip McGrath <philip@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

This patch series packages adds `racket-next` and `racket-next-minimal`
packages for Racket 8.1.900 (the first release candidate for Racket 8.2,
scheduled for late July). Beyond the release, having a development
package will be useful for Guix users who contribute to Racket or help
test the latest features.

In particular, these patches make use of improvements since the 8.1
release in Racket's support for layered and tethered instalations
to make some improvements to Guix's Racket packaging.

We can now unbundle `racket-next-minimal` from `racket-next`
by installing the main distribution as a layer on top of minimal Racket,
rather than duplicating the core runtime system in both packages.

This improvement facilitates changing the source of `racket-next-minimal`
to use the upstream Git repository, further unbundling main-distribution
packages developed in that repository, and bootstrapping Racket from C.
(One remaining bootstrapping limitation is discussed in comments added
in the patch.) The same features seem like the most promising path toward
adding support for Racket packages to Guix more generally.

-Philip

Philip McGrath (4):
  gnu: racket: Fix lib-search-dirs configuration.
  gnu: racket: Add racket-next and racket-next-minimal.
  gnu: racket-next: Unbundle racket-next-minimal.
  gnu: racket-next-minimal: Bootstrap from C.

 gnu/local.mk                                  |   1 +
 .../racket-next-minimal-sh-via-rktio.patch    |  87 +++
 gnu/packages/racket.scm                       | 525 +++++++++++++++++-
 3 files changed, 611 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/racket-next-minimal-sh-via-rktio.patch

-- 
2.30.2





Acknowledgement sent to Philip McGrath <philip@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#49280; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 19 Jul 2021 07:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.