From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +OKjOnfkGmKQVwEAgWs5BA (envelope-from ) for ; Sun, 27 Feb 2022 03:39:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YN1cM3fkGmKVPwEAG6o9tA (envelope-from ) for ; Sun, 27 Feb 2022 03:39:51 +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 4A8FD358EB for ; Sun, 27 Feb 2022 03:39:51 +0100 (CET) Received: from localhost ([::1]:41522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nO9TS-0008NI-HQ for larch@yhetil.org; Sat, 26 Feb 2022 21:39:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nO9Sm-00072z-W1 for guix-patches@gnu.org; Sat, 26 Feb 2022 21:39:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nO9Sm-0006WB-MD for guix-patches@gnu.org; Sat, 26 Feb 2022 21:39:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nO9Sm-0004KA-J1 for guix-patches@gnu.org; Sat, 26 Feb 2022 21:39:08 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v6 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 02:39:08 +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.164592954316532 (code B ref 53878); Sun, 27 Feb 2022 02:39:08 +0000 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:39:03 +0000 Received: from localhost ([127.0.0.1]:56590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Sg-0004IJ-Nt for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:39:03 -0500 Received: from mail-qv1-f48.google.com ([209.85.219.48]:43935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9SU-0004HF-3w for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:38:50 -0500 Received: by mail-qv1-f48.google.com with SMTP id c14so4983571qvk.10 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=IvyWGC3/WAamEPbYFZAPqXe3iN8twafURrbbabbFe3RoPHkbMaEvQUpR+maPNsESCL UvUXKl4HPYG4yn3dSMrawFRgml/9ofTlAkuQW6TQ3y7kf95x6H3pz8mpl0CSKPeuz2as /+QkhxjTL5fIRWGM9j5b/peA2f7DyUFVnvXqvdr70qV6S29e+kLRU+mZym0as/su/ObT Zm8aMKKm8KJZlVcmdxCJ5Pix0RRwoUY3yNfpCBtKLhmhFOdRgOkFzNH5Bzy6vHJ8Rdlp H3s34iVJKgfUp1dhNxDE/SDOjpgKxgRR5EaWPD3U0twy5YmZ0jbghtX9W8DRlfYjoGzs aGCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cGi1cMspcQpp49NFenSBqvw+gLuS2M0D9p9ZQpdHAlY=; b=MMsweiI4LbZ+qmvp5+moSJ2aDkjDn2RF1U9i7vEqZVyGOX6Y/Q1FTfo0IM1GrPueUK SqR0nprZuw+Bo0FI64/Zik+PXf04F71veamdnplMp3X5F1kSM4Ke4EQ/i738z4vo4F+I UHCbA/0S1xcYWx13im/1TNM9xfTnO0PekARzosMC5pFQEHEIjOffjrOw3qmpCVSm2k6G mlMvbHg4PA0Esy1cGmNqjX4HDAcnEiDSENlz5ugWd4PhT/LizUh+Gs5ZAcbdlcQ2PQnx lokdiaFeBfOYYi2tpByNQ5G2h4y3ehyX01xrTkLJIQtlBNCPmOt+4AXJwPCea0j/irMx eipQ== X-Gm-Message-State: AOAM53110i/+nYnYeGQgXsdmvHJfu4rBFOsyMzXH/wJ7rZeujJeqIBpG +2la1WFBJaivqmzPsAQWCDOxJODGxkB3uMrRaq0= X-Google-Smtp-Source: ABdhPJw0nSr/iO642IP31ic3vIRLqIGe+JyPVh4FTtK/c3yb9++5htnvfTjBvXjADYdLOZN5NT5gcA== X-Received: by 2002:a05:6214:21ee:b0:433:baf:21a3 with SMTP id p14-20020a05621421ee00b004330baf21a3mr342992qvj.4.1645929524535; Sat, 26 Feb 2022 18:38:44 -0800 (PST) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id f19-20020a379c13000000b006490363756fsm3269672qke.21.2022.02.26.18.38.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:38:44 -0800 (PST) From: Philip McGrath Date: Sat, 26 Feb 2022 21:34:46 -0500 Message-Id: <20220227023450.1877215-21-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220227023450.1877215-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220227023450.1877215-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-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=1645929591; 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=PWvv54cAKwh04Gym0SSQe6IGrkxymOeLNsnXSKOLA4JNl/Elox9GJGOnCelS3nVQ2v7CAn 3bAuaW+LDjNNmXkdCrktwPzLY0xiaU5O0KpNV7QzlfgHwubaOO83b1YByJy4rJSWt88WLE r+UAAOKUcU0OK6ECapgVkjEI8G6fz16Na2d2bule63Hm5s4fvEzc5Lnq6BxuU36vkvd8no CNs9uiIUEf9aw/rdOUCCysQ0P+oxhIaMMPLP1jQgGD++XX8o9RL5A254QjtBLcne9stBFD NfxeKLw24n/ePvJoNnQZlV9oaitl/R0qYgoAdjWIxA3J6kUNzWNJqA/Nh3nEcA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645929591; a=rsa-sha256; cv=none; b=cMsilulFBDrSyNSGehz7d3NJUpufLIO9HNrFAgbBMI/6VvRC/DIQ9WVttj58FvHUory3I8 9uir2n4s1RyRUKLeTi1YZI7a/W0uXSgb2t8pL9CvejZi/ruFSfq1m3/xsx1AWfddPLwpiI 0hy1fM7cGoc6zRrTz0oFh6vRzcAWNMQFGuLe/BrORxydhue873JWo5Qrf3G/r71ghbE5aP OneRjuNXaROVxozmUL+ZovRNwQioQi9Zow/TMYn/wFKpbxMZaR5YsyBJKdxtTzrxf5jTB8 DkLG1on5E+t1rlYzAmwR6pQwDP1dlOy4WNkNTCwJ91rqDERgRxMYn5if9RCmjw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b="IvyWGC3/"; 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: 3.89 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b="IvyWGC3/"; 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: 4A8FD358EB X-Spam-Score: 3.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: TBqVWMLNVG6N 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