From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 4KY+HLolGmIUCAAAgWs5BA (envelope-from ) for ; Sat, 26 Feb 2022 14:06:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WHKUGbolGmICogAA9RJhRA (envelope-from ) for ; Sat, 26 Feb 2022 14:06:02 +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 0A7113F76F for ; Sat, 26 Feb 2022 14:06:02 +0100 (CET) Received: from localhost ([::1]:53804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNwlt-0000wF-8z for larch@yhetil.org; Sat, 26 Feb 2022 08:06:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNwkz-0000Kb-Ab for guix-patches@gnu.org; Sat, 26 Feb 2022 08:05:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNwkz-0003ZC-0d for guix-patches@gnu.org; Sat, 26 Feb 2022 08:05:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNwky-0005cb-QD; Sat, 26 Feb 2022 08:05:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v5 18/22] 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: Sat, 26 Feb 2022 13:05:04 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxime Devos , Attila Lendvai , Malte Gerdes , raingloom , philip@philipmcgrath.com X-Debbugs-Original-Xcc: philip@philipmcgrath.com Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164588068421512 (code B ref 53878); Sat, 26 Feb 2022 13:05:04 +0000 Received: (at 53878) by debbugs.gnu.org; 26 Feb 2022 13:04:44 +0000 Received: from localhost ([127.0.0.1]:54501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkd-0005an-J2 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:44 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:34567) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwkC-0005ZB-K5 for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 08:04:17 -0500 Received: by mail-qt1-f170.google.com with SMTP id c4so4997738qtx.1 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 05:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oYUHSTg3r8HpZEFMQJCIvUqDi5n3JqyJ7y5RwAPsPqI=; b=a+k2tMM+p6Kdjkypy+MjPaNsSPO4+forCTEaKD4kBDg8t1g9gmHgTd6h7+jjBrzrYP LFlzj2rc4W4d91doPu58V+2iu9FsFUZPWsTvRtsjBDAAzGmJm3b2MAhJ65vCBsn2NLoF Utpqd0ac6pzeJvwqZlMdL2Udlw7AzvPmfs6966KtVTtuOIqn53CMXh2PTQeVKeJK5rlR rzJP5AYdYKEC1jfgjxUxVPwxKy+BQW+vwmfNZGvy9f0EvXiKBWon7NCzbTQojQS6Xylp 8rsFl5bxj06c3nMtLho/2GiEpBmvKawnBEhOnJCQyNnttX7gy9rCUf1tgqjNQqkVEYbu WWFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oYUHSTg3r8HpZEFMQJCIvUqDi5n3JqyJ7y5RwAPsPqI=; b=01JqLQMqs0kj9FV/wsvc8mPoRTO2AT5N5tALbR1Z7JZ87p1pEY1HRsM7lZL6p0fJc+ KJZiGuZAUGLoPI2n4IQt7b92uj7OJ+c/L4IQEH4aaOEitlrCwopRYbMnojUEraB06Pmj aL4v6W15tNzWF7eJxq53mXP7qIrEdO3s49fY3AWilgvNX18HXKwmtaJIqg4RxwlGIPhS tTIly0SB8gqoK1/0xJ5wfTmMk8SSgmV2O9vGvPwd5wGLt9zCYRR/EI/+CYFXuymzGsKK SPnjBDGcgOOi/gfFWEKKdpLx1SkTj6bZVMvNtI6xZ+zBZVXAFSrGH1J3tSWRiH5zlzTF Qyqw== X-Gm-Message-State: AOAM533n88pAIXPYakp/pT4+O+ne4IX7WuYM9U2wfevXUVIqPjKlzFHS nID7MziXnK2bDHlM6KW44iXpqbpucXQUWnviNLw= X-Google-Smtp-Source: ABdhPJytAHTFUiQO3jS/1dop+C6B5Kgoh9FNtWH5fuaEmZcVyHzvzPLOqPcTLa+UtKs0OazhvMvr5w== X-Received: by 2002:a05:622a:24c:b0:2d7:1d1b:c98d with SMTP id c12-20020a05622a024c00b002d71d1bc98dmr10421932qtx.592.1645880650986; Sat, 26 Feb 2022 05:04:10 -0800 (PST) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id p12-20020a05622a048c00b002de8f67b60dsm3415826qtx.58.2022.02.26.05.04.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 05:04:10 -0800 (PST) From: Philip McGrath Date: Sat, 26 Feb 2022 08:02:50 -0500 Message-Id: <20220226130254.1301333-19-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220226130254.1301333-1-philip@philipmcgrath.com> References: <20220220060610.178131-1-philip@philipmcgrath.com> <20220226130254.1301333-1-philip@philipmcgrath.com> MIME-Version: 1.0 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=1645880762; 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=oYUHSTg3r8HpZEFMQJCIvUqDi5n3JqyJ7y5RwAPsPqI=; b=NJlFxNxFmYgnOsnqzyuy40GTAT6Vdy3iqAXMzbCmHJpb7lmbo77i1rspbkHfNlJjlY+64D 2gPjr5LitkyvUKrmQPh0uAXlWpQAYqXakmvbiAQDIL43Mjx0QXaJL5cYlZr18JEJok0pwL ALRdYSSvnbRp4KEL+KX0togRyY0iSHkoIY/9cUUlDAsiRtTbC1fH3OFWWMKbELaFpqvjcs BOU/Hj/HI+C2iW+U7S6eerooX6SPnJbnYxCa3DqbvAzZ58DSakql7YIA/ciDomlPVQetNV DxUtY71lOTimInOYl7W36gzB0qfidUJ2Se9u1czOE/YXfjCu/uxLKYZwku2Ppg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645880762; a=rsa-sha256; cv=none; b=pkOPYz/pAegut02t2l76oGCHwUdSheG1XxtKGGfICe4WvoCgCfMsDFFqBYCOmrKIuSrb6D b61n506YWW+vqOEqRGWj08hX+VUqAS67bWiRl7lc+liLUxsmPDLXr/Pvar9moaWRfRhaUK dbLu1oT2A0d1GB79MfNNpWB5h17vM1wYPsDMabZDREzZ+0zgFd1NSN5La+l63dNTyIV/gX 0Mretd4Qw7YmAWCq5ePjr3liYi4pf9evETi2/xdeC9PVAlJjI6WuniG7UoMWAgUfn+bMv1 QC4OsheKXr4jN79bVma85s58FjhwD4C73kF9Cu94+DRoxm2LCO+KWN7PeAhgrw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=a+k2tMM+; 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.88 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=a+k2tMM+; 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: 0A7113F76F X-Spam-Score: 2.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: PbCC8rb8nqA7 This makes the structure of the upstream Chez Scheme package the same as for the Racket variant, it sets things up for (one day, hopefully) actually being able to bootstrap the upstream Chez Scheme bootfiles, and it may be useful for cross-compilation and adding support for architectures without pre-built bootfiles from upstream. * gnu/packages/chez.scm (chez-scheme-bootstrap-bootfiles): New variable. (chez-scheme)[native-inputs]: Add it. [arguments]<#:phases>: Add 'unpack-bootfiles'. (chez-scheme-for-racket-bootstrap-bootfiles): Inherit from 'chez-scheme-bootstrap-bootfiles'. [arguments]: Adapt accordingly. --- gnu/packages/chez.scm | 98 +++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index ba555e6830..4818e59837 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -46,6 +46,7 @@ (define-module (gnu packages chez) #:use-module (gnu packages xorg) #:use-module (ice-9 match) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:export (nix-system->chez-machine chez-machine->nonthreaded chez-machine->threaded @@ -211,7 +212,9 @@ (define-public chez-scheme ;; for X11 clipboard support in expeditor: ;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232 libx11)) - (native-inputs (list chez-nanopass-bootstrap stex-bootstrap)) + (native-inputs (list chez-scheme-bootstrap-bootfiles + chez-nanopass-bootstrap + stex-bootstrap)) (native-search-paths (list (search-path-specification (variable "CHEZSCHEMELIBDIRS") @@ -232,6 +235,14 @@ (define-public chez-scheme (add-after 'unpack 'unpack-nanopass+stex (lambda args #$unpack-nanopass+stex)) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (when (directory-exists? "boot") + (delete-file-recursively "boot")) + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot"))) ;; NOTE: the custom Chez 'configure' script doesn't allow ;; unrecognized flags, such as those automatically added ;; by `gnu-build-system`. @@ -316,8 +327,46 @@ (define* (stex-make #:optional (suffix "")) and 32-bit PowerPC architectures.") (license asl2.0))) +(define-public chez-scheme-bootstrap-bootfiles + (package + (inherit chez-scheme) + (name "chez-scheme-bootstrap-bootfiles") + (inputs '()) + (native-inputs '()) + (outputs '("out")) + (build-system copy-build-system) + ;; TODO: cross compilation + (arguments + (list #:install-plan + #~`(("boot/" "lib/chez-scheme-bootfiles")))) + (supported-systems + ;; Upstream only distributes pre-built bootfiles for + ;; arm32le and t?(i3|a6)(le|nt|osx) + (filter (lambda (system) + (let ((machine (and=> (nix-system->chez-machine system) + chez-machine->nonthreaded))) + (or (equal? "arm32le" machine) + (and machine + (member (substring machine 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> machine) + '("le" "nt" "osx")))))) + %supported-systems)) + (synopsis "Chez Scheme bootfiles (binary seed)") + (description + "Chez Scheme is a self-hosting compiler: building it requires +``bootfiles'' containing the Scheme-implemented portions compiled for the +current platform. (Chez can then cross-compile bootfiles for all other +supported platforms.) + +This package provides bootstrap bootfiles for upstream Chez Scheme. +Currently, it simply packages the binaries checked in to the upsream +repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to +work with upstream Chez Scheme so that we can bootstrap these files from +source."))) + (define-public chez-scheme-for-racket-bootstrap-bootfiles (package + (inherit chez-scheme-bootstrap-bootfiles) (name "chez-scheme-for-racket-bootstrap-bootfiles") (version "9.5.7.3") ;; The version should match `(scheme-fork-version-number)`. @@ -325,32 +374,30 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles ;; It will always be different than the upstream version! ;; When updating, remember to also update %racket-version in racket.scm. (source #f) ; avoid problematic cycle with racket.scm - (inputs `()) (native-inputs (list chez-nanopass-bootstrap racket-vm-bc)) - (build-system copy-build-system) ;; TODO: cross compilation (arguments - (list - #:install-plan - #~`(("boot/" "lib/chez-scheme-bootfiles")) - #:phases - #~(let ((unpack (assoc-ref %standard-phases 'unpack))) - (modify-phases %standard-phases - (replace 'unpack - (lambda args - (unpack #:source #$(or (package-source this-package) - (package-source racket-vm-bc))))) - (add-after 'unpack 'chdir - (lambda args - (chdir "racket/src/ChezScheme"))) - (add-after 'chdir 'unpack-nanopass+stex - (lambda args - #$unpack-nanopass+stex)) - (add-before 'install 'build - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (invoke (search-input-file (or native-inputs inputs) - "/opt/racket-vm/bin/racket") - "rktboot/main.rkt"))))))) + (substitute-keyword-arguments + (package-arguments chez-scheme-bootstrap-bootfiles) + ((#:phases those-phases #~%standard-phases) + #~(let* ((those-phases #$those-phases) + (unpack (assoc-ref those-phases 'unpack))) + (modify-phases those-phases + (replace 'unpack + (lambda args + (unpack #:source #$(or (package-source this-package) + (package-source racket-vm-bc))))) + (add-after 'unpack 'chdir + (lambda args + (chdir "racket/src/ChezScheme"))) + (add-after 'chdir 'unpack-nanopass+stex + (lambda args + #$unpack-nanopass+stex)) + (add-before 'install 'build + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (invoke (search-input-file (or native-inputs inputs) + "/opt/racket-vm/bin/racket") + "rktboot/main.rkt")))))))) (supported-systems (filter nix-system->chez-machine %supported-systems)) (home-page "https://github.com/racket/ChezScheme") @@ -372,8 +419,7 @@ (define-public chez-scheme-for-racket-bootstrap-bootfiles Note that the generated bootfiles are specific to Racket's fork of Chez Scheme, and @code{cs-bootstrap} does not currently support building upstream -Chez Scheme.") - (license (list asl2.0)))) +Chez Scheme."))) ;; ;; Chez's bootstrap dependencies: -- 2.32.0