From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0JcoH1DuG2JbfwEAgWs5BA (envelope-from ) for ; Sun, 27 Feb 2022 22:34:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6G3tG1DuG2JwFQAAauVa8A (envelope-from ) for ; Sun, 27 Feb 2022 22:34:08 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 03D69C38B for ; Sun, 27 Feb 2022 22:34:08 +0100 (CET) Received: from localhost ([::1]:33868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nORB8-0002bR-TT for larch@yhetil.org; Sun, 27 Feb 2022 16:34:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nORB4-0002Za-FC for guix-patches@gnu.org; Sun, 27 Feb 2022 16:34:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nORB4-00060U-6J for guix-patches@gnu.org; Sun, 27 Feb 2022 16:34:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nORB4-0008Mh-3h for guix-patches@gnu.org; Sun, 27 Feb 2022 16:34:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v7 20/24] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 21:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53878@debbugs.gnu.org, Liliana Marie Prikler , zimoun Cc: Philip McGrath , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164599759232070 (code B ref 53878); Sun, 27 Feb 2022 21:34:02 +0000 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 21:33:12 +0000 Received: from localhost ([127.0.0.1]:59397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORAG-0008LB-6I for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:33:12 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:37776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nORAD-0008Kv-Tp for 53878@debbugs.gnu.org; Sun, 27 Feb 2022 16:33:10 -0500 Received: by mail-qk1-f179.google.com with SMTP id v5so8991551qkj.4 for <53878@debbugs.gnu.org>; Sun, 27 Feb 2022 13:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=Gi3RCsA57SE2QTOEWXHkP40aLW9iJKSGW0mPeQSZGxsflgf034waEq4y7vi1u6k5vO fi28GEYmoMjkUp/QjlZl51rxLkVK3cQgZiAsL67pN9aajXbkyp+FvNfpvMwy+Ye/bh10 FjKD/qgJiTEjaMaHYejtA4e3beByPVU4iHZeTET/EC4Vtv0oml4Dz5su0Q8XTA83brfR 5/NIdOU0oae4LEEYFfc6zN+JNsMjKJo5NURojY7R48QKC9Jlnex3HU4QkCJoXcu4URF4 +Km663BDxqm/exCSAglgta817p3Qw9RxcyVQc6B+7BZZhKBv/5aCiCrf4wrTXal8jVuo sHEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=i4sU1uagCqPtr9b8dzWOBzawXXncbhKzFWV3wsO5YPsAsOaiw1w9cQUkkss1boDEVN ZD25iXQaxHEofoUtWBLfjVENr3JikbriZMmPGEyJpSkeixk9oFppYNJNJAxglYnVEq62 ZryzHzf5vPIJBiEIKZZuInoRLoFRpcW0ZXockHaXwFfIgc3/jr0vKFrOFfb+GadJ3swk w6qWIbNQ99vSK3AoX2tuqNcA25cePrwsTmyOba3BQSmap58x/VYzp8l84MyWxkNEDQxJ TTluAMFDbXIYoLqn75iK9VSjmVhHZOyKgyBCnvtdYScQbcu0HTAKrjBGSlGM96D4aIY3 IyoQ== X-Gm-Message-State: AOAM532AfhKpCkitcj1c+ncKHEd/omwvxIQJRUWy5fF+VjT4YvEWk5D2 YOHA44XvWduEnxon4z5vl/oeXyaekHCR4Z37teU= X-Google-Smtp-Source: ABdhPJyfCmR9nR+SI2rooYBw8lZm+Fnab0OmYvsg0LW7l3NFKsWlF6YaABq2QZk7RKmETWQIbaw90w== X-Received: by 2002:a37:5d2:0:b0:5e9:5876:7f0 with SMTP id 201-20020a3705d2000000b005e9587607f0mr9627180qkf.4.1645997584318; Sun, 27 Feb 2022 13:33:04 -0800 (PST) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id p22-20020a37a616000000b00547b8839339sm4179005qke.77.2022.02.27.13.32.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Feb 2022 13:33:04 -0800 (PST) From: Philip McGrath Date: Sun, 27 Feb 2022 16:29:16 -0500 Message-Id: <20220227212920.2009000-21-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227212920.2009000-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227212920.2009000-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645997648; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=hpfZYjveH8DQFDk6d17WMVWfWUAFgjOO7w15K7AIPrxRYj3kVLNXWTiMD/Hx4oHDmCEq+o 86RS8O8v7DLGBVne/vPS/W9ZlVFJGjSzjQCr8CxPtQ5HXkBxQKa6Q/croK9S3Qqb5DreHk YGU22HtCCFybVnuOLENsdSR8Np5WVKT87HoI7KSttSNsOg4AvDFWGggH2n9au6/YwUkNYV TTjqscSB7rQ9cd9/iztC0vDqhtE3yn+2F0Gfu4EXI/em2QT06jk6h8scZvxnlM3lEm2Rmi U6zKzOQ3zroWLBJK7Qp9lmQImFFeElHJ9oGlYf8USX4OCSG412gymnUHrrA7wQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645997648; a=rsa-sha256; cv=none; b=AhRx1jFbZa5xdy0E5w1c3sHcaEXHmQfg2AH2D2GZtQsBjd2Ig3iJi46+zYsRsXWKO80jHJ JU7lOCMFGdcTXQdUVdM/DIMGax3C9tZ8krnfn4Ug/Y+E4fewNthhx1pRq+QP4E/K4hBzeE VZ/vanVoCXSCQ7YlOQ9dkswNdm7R3RZBfY4fhHqNwZY0WtRQ5HIfsq/1ES1diW2lnL1CUM GM5ilq0lsatYSGTXZ5eEuPrEtsosD237Q05n/GjqKE8bG5MaxWDrLZaLuhjQ3VNu5jt2YJ b2g6VEjzd1uWn6CAQwNSsSWmmGS5/6Rrq4KAleZqTOOS+QkyeJKUHiIl2x6bCQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=Gi3RCsA5; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=Gi3RCsA5; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 03D69C38B X-Spam-Score: 2.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: wPt+4nMV8uVN This makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. (chez-scheme-for-racket-bootstrap-bootfiles): Inherit from 'chez-scheme-bootstrap-bootfiles'. [arguments]: Adapt accordingly. --- gnu/packages/chez.scm | 98 +++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 43d2c764f3..da267d3616 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -46,6 +46,7 @@ (define-module (gnu packages chez) #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:export (nix-system->chez-machine chez-machine->nonthreaded chez-machine->threaded @@ -211,7 +212,9 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) + (native-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -232,6 +235,14 @@ (define-public chez-scheme (add-after 'unpack 'unpack-nanopass+stex (lambda args #$unpack-nanopass+stex)) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (when (directory-exists? "boot") + (delete-file-recursively "boot")) + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot"))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -316,8 +327,46 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license asl2.0))) +(define-public chez-scheme-bootstrap-bootfiles + (package + (inherit chez-scheme) + (name "chez-scheme-bootstrap-bootfiles") + (inputs '()) + (native-inputs '()) + (outputs '("out")) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (supported-systems + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %supported-systems)) + (synopsis "Chez Scheme bootfiles (binary seed)") + (description + "Chez Scheme is a self-hosting compiler: building it requires +``bootfiles'' containing the Scheme-implemented portions compiled for the +current platform. (Chez can then cross-compile bootfiles for all other +supported platforms.) + +This package provides bootstrap bootfiles for upstream Chez Scheme. +Currently, it simply packages the binaries checked in to the upsream +repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to +work with upstream Chez Scheme so that we can bootstrap these files from +source."))) + (define-public chez-scheme-for-racket-bootstrap-bootfiles (package + (inherit chez-scheme-bootstrap-bootfiles) (name "chez-scheme-for-racket-bootstrap-bootfiles") (version "9.5.7.3") ;; The version should match `(scheme-fork-version-number)`. @@ -325,32 +374,30 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; It will always be different than the upstream version! ;; When updating, remember to also update %racket-version in racket.scm. (source #f) ; avoid problematic cycle with racket.scm - (inputs `()) (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) - (build-system copy-build-system) ;; TODO: cross compilation (arguments - (list - #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")) - #:phases - #~(let ((unpack (assoc-ref %standard-phases 'unpack))) - (modify-phases %standard-phases - (replace 'unpack - (lambda args - (unpack #:source #$(or (package-source this-package) - (package-source racket-vm-bc))))) - (add-after 'unpack 'chdir - (lambda args - (chdir "racket/src/ChezScheme"))) - (add-after 'chdir 'unpack-nanopass+stex - (lambda args - #$unpack-nanopass+stex)) - (add-before 'install 'build - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (invoke (search-input-file (or native-inputs inputs) - "/opt/racket-vm/bin/racket") - "rktboot/main.rkt"))))))) + (substitute-keyword-arguments + (package-arguments chez-scheme-bootstrap-bootfiles) + ((#:phases those-phases #~%standard-phases) + #~(let* ((those-phases #$those-phases) + (unpack (assoc-ref those-phases 'unpack))) + (modify-phases those-phases + (replace 'unpack + (lambda args + (unpack #:source #$(or (package-source this-package) + (package-source racket-vm-bc))))) + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))) + (add-after 'chdir 'unpack-nanopass+stex + (lambda args + #$unpack-nanopass+stex)) + (add-before 'install 'build + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (invoke (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "rktboot/main.rkt")))))))) (supported-systems (filter nix-system->chez-machine %supported-systems)) (home-page "https://github.com/racket/ChezScheme") @@ -372,8 +419,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles Note that the generated bootfiles are specific to Racket's fork of Chez Scheme, and @code{cs-bootstrap} does not currently support building upstream -Chez Scheme.") - (license (list asl2.0)))) +Chez Scheme."))) ;; ;; Chez's bootstrap dependencies: -- 2.32.0