From patchwork Sun Feb 20 06:06:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 37373 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BCEF527BBEB; Sun, 20 Feb 2022 06:08:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1866127BBE9 for ; Sun, 20 Feb 2022 06:08:50 +0000 (GMT) Received: from localhost ([::1]:60728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLfOr-000782-7p for patchwork@mira.cbaines.net; Sun, 20 Feb 2022 01:08:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLfND-0005J0-9L for guix-patches@gnu.org; Sun, 20 Feb 2022 01:07:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37064) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLfNB-00040C-KS for guix-patches@gnu.org; Sun, 20 Feb 2022 01:07:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nLfNB-0005OL-DT; Sun, 20 Feb 2022 01:07:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v4 08/15] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Sun, 20 Feb 2022 06:07:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53878@debbugs.gnu.org, Liliana Marie Prikler , Ludovic =?utf-8?q?Co?= =?utf-8?q?urt=C3=A8s?= Cc: Attila Lendvai , Malte Gerdes , raingloom , zimoun , Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164533721520612 (code B ref 53878); Sun, 20 Feb 2022 06:07:05 +0000 Received: (at 53878) by debbugs.gnu.org; 20 Feb 2022 06:06:55 +0000 Received: from localhost ([127.0.0.1]:59174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfN0-0005MH-Rh for submit@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:55 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:45838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLfMy-0005Lk-JA for 53878@debbugs.gnu.org; Sun, 20 Feb 2022 01:06:53 -0500 Received: by mail-qv1-f43.google.com with SMTP id c14so23824691qvl.12 for <53878@debbugs.gnu.org>; Sat, 19 Feb 2022 22:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KNOUjMT3+W/jjCU6TuR4VoZo9rnrj3vaZE3pLMma7YQ=; b=etqNf27d1sqDj7+jQgEQZIR3yTsYg+lI6VmCAxGz7wxwIUuR/Oz84MIWQ1zGkGnNNe U+yHkH0QkjDV+IWHqA64VHls1TDNIoKxOTW+caQ7tgLegTFoAug1ZN3f79l+bw7SfuzA i61UKCrpqPFBW5mZgb0zGK+qEmr2FGwLdJGA9Wc69/uhUVexxDexOWGy3IVrj/rZ4E+P YWgukGoxQa6WoZZsxRIRrqgHqxkG7HeR+KKq4vYr5wGay3Hk4rOYGZDVw+io719N5hnL 5Ij6Sv5OIrrh5kaUSKMZQsldhUwYpb7VSOCWcJeeDBJZVgrexsjPnmqAIPi82BFVBRKt iw8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KNOUjMT3+W/jjCU6TuR4VoZo9rnrj3vaZE3pLMma7YQ=; b=nt/VvhFnQUJWoFHnFMiVh885xha4oZP/7zefHzoEixs9vS4cLsT5XhR1irxqSh9zVT JT5wmNiAHCq0MeY+QgvdfWrnyKe+1J7qhhK8rjrB9eJ2Oh2ivi2TOT9rx+DGdwoUtOSM 3bz7Kv9TiI+1IdXwfAUc2VmJkcizFV+uCkHlJnp1f04DeAN0pqNzYhznMOj4iqfcCSWo Xnwj+wQfgDyygSmqjGxnhJAt0jXkpug6IROxFN28B+Dg55D4w8JWi5DeL+eoPeC9MHEL 7iWENm76+8JoQQpR8GyfOtw8v0xfRiYxfXuXFpvs606s6clB31+4cWJKgHaoEQ/ZR2C1 NcyA== X-Gm-Message-State: AOAM530VUUg05dEq6A+H1+8LM4IvRCn7xAyxLnmE7SaFUAXjIpd54dhP LynPRAsw1fNz9EEZiEOSceWnCcBII+Kq/q1G1kY= X-Google-Smtp-Source: ABdhPJyQa0Y5hpoR+FKCebANgXRfOf/bVPYEOzoUfR/NTRkmDNY6+qSpXqgLAS/DuVqRaubpbI24Cw== X-Received: by 2002:ac8:4e94:0:b0:2dd:dbdc:1366 with SMTP id 20-20020ac84e94000000b002dddbdc1366mr4277663qtp.111.1645337207003; Sat, 19 Feb 2022 22:06:47 -0800 (PST) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id s65sm8325312qkh.126.2022.02.19.22.06.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Feb 2022 22:06:46 -0800 (PST) From: Philip McGrath Date: Sun, 20 Feb 2022 01:06:03 -0500 Message-Id: <20220220060610.178131-9-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220220060610.178131-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220220060610.178131-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This might seem a bit silly in isolation, but it makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez-and-racket-bootstrap.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. --- gnu/packages/chez-and-racket-bootstrap.scm | 51 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index d66955d50d..366815634d 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -187,7 +187,7 @@ (define-public chez-scheme (sha256 (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) + (file-name (git-file-name "chez-scheme" version)) (snippet #~(begin (use-modules (guix build utils)) (for-each (lambda (dir) @@ -207,7 +207,9 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) + (native-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -237,6 +239,14 @@ (define-public chez-scheme (lambda () ;; otherwise, it will try to download submodules (display "# to placate ../configure"))))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (when (directory-exists? "boot") + (delete-file-recursively "boot")) + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot"))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -321,6 +331,43 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license license:asl2.0))) +(define-public chez-scheme-bootstrap-bootfiles + (package + (inherit chez-scheme) + (name "chez-scheme-bootstrap-bootfiles") + (inputs '()) + (native-inputs '()) + (outputs '("out")) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (supported-systems + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %supported-systems)) + (synopsis "Chez Scheme bootfiles (binary seed)") + (description + "Chez Scheme is a self-hosting compiler: building it requires +``bootfiles'' containing the Scheme-implemented portions compiled for the +current platform. (Chez can then cross-compile bootfiles for all other +supported platforms.) + +This package provides bootstrap bootfiles for upstream Chez Scheme. +Currently, it simply packages the binaries checked in to the upsream +repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to +work with upstream Chez Scheme so that we can bootstrap these files from +source."))) + ;; ;; Chez's bootstrap dependencies: ;;