From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 uIopB8GaAmI+0wAAgWs5BA (envelope-from ) for ; Tue, 08 Feb 2022 17:30:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EMCKBMGaAmKNugAA9RJhRA (envelope-from ) for ; Tue, 08 Feb 2022 17:30:57 +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 7100314EB4 for ; Tue, 8 Feb 2022 17:30:54 +0100 (CET) Received: from localhost ([::1]:52186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHTOG-0000U4-Fs for larch@yhetil.org; Tue, 08 Feb 2022 11:30:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHSIr-00063T-4F for guix-patches@gnu.org; Tue, 08 Feb 2022 10:21:17 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHSIi-0008Si-TY for guix-patches@gnu.org; Tue, 08 Feb 2022 10:21:09 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHSIi-0006tL-QW for guix-patches@gnu.org; Tue, 08 Feb 2022 10:21:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [RFC PATCH 7/9] gnu: chez-scheme: Explicitly package bootstrap bootfiles. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Feb 2022 15:21: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 Cc: Philip McGrath Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164433361826335 (code B ref 53878); Tue, 08 Feb 2022 15:21:04 +0000 Received: (at 53878) by debbugs.gnu.org; 8 Feb 2022 15:20:18 +0000 Received: from localhost ([127.0.0.1]:48343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHx-0006qh-Ux for submit@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:18 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:41529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHSHw-0006q3-20 for 53878@debbugs.gnu.org; Tue, 08 Feb 2022 10:20:16 -0500 Received: by mail-qt1-f172.google.com with SMTP id y8so14946873qtn.8 for <53878@debbugs.gnu.org>; Tue, 08 Feb 2022 07:20: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=6AE1/qxcrotEryrbburLPzrMBVE8hEJhgaS/TLE/JiI=; b=NdhTYKBDp5oCxCyHVcIpQsvyv3DoyanmIChfarYyaMcZEX6yXrbfyAbkxKoV8Btb5J FmtN6WJVI7HbBISWTIou1f5hv/uRZ3kgwTzCZeeTVBeHrVHg5Y6hcDHT8UtgUMVAZLvU 7j8AZXEgHP+BZfzlnh71clureduZs6uf39a/odBakHaTtI3pN/kpz2PfVvsDfDAWV32N +E2PrlfOporFzGnx9g+NcGPdIlh07qFqVvRI9Ql4de4EJfeDWhOqsEYu3D2m6op8qi3b ZLlSUQC82vi6LqafMDPok9NCFj76GWC7PsGGNPuQFUR+cb33DOE7ULLIhtiImShHxQLw j8ZQ== 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=6AE1/qxcrotEryrbburLPzrMBVE8hEJhgaS/TLE/JiI=; b=bI2BWgWDOoJLbM7Vr/bn/FqoQEPTHZa5tQKLVYNdLXM1o2sPrIrk2CtNlp8ENlIoks LOAnQQelsaTNLoUENWzKDLGFXKLb61sb945KrkA6xWF8M2BNBpX2zQd0QXBKl3hOPSqn ub+YqxOH1/ZGt7oSwFUUrjAFnUDD5kBH945mU1AJAKTUzqPC4zSnRnLBbu2T80ap2hon +tmTLeyKMMCIIFkGdrHcanjpThjYzOcsQbddIF/4cXH6Wk6jIf3O72hi84Y8iDNekZbi Ws3IHCeZWfneSkNCJr32fvX68E4L7oOL/gPRLe6MjRfWtTZBoO9CDw5j3JGwAzqNda3S N4PQ== X-Gm-Message-State: AOAM532UHdBg2LQgr+4ktoD8kV/dRLP+27Ikc3IzBRb9l/ZoSvK4geRB ipW+TUhqxGQlQ2+XRrFgyR0s/jZ3tNa/XLOOfw8= X-Google-Smtp-Source: ABdhPJwSExUTsZrcY0O0PbMuFOLneErr+RxL6fiKJRZIKRitY0C7d0dGFWDTctDzZ3mTpPDqvVzWMw== X-Received: by 2002:ac8:6bd6:: with SMTP id b22mr3347208qtt.366.1644333610549; Tue, 08 Feb 2022 07:20: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 g24sm7048455qkk.76.2022.02.08.07.20.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 07:20:10 -0800 (PST) From: Philip McGrath Date: Tue, 8 Feb 2022 10:18:55 -0500 Message-Id: <20220208151857.1900389-7-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208151857.1900389-1-philip@philipmcgrath.com> References: <20220208151316.1897345-1-philip@philipmcgrath.com> <20220208151857.1900389-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=1644337854; 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=6AE1/qxcrotEryrbburLPzrMBVE8hEJhgaS/TLE/JiI=; b=eM7oTaag2mP572D6SzXzSoRaZtki7AW9N3WPZ5k91g9xUB2ofKPik1u8iR9zEiDuCaW8r1 eIkBiz9RvwWx1ztojckNktPZoA5mCsQZam1JSeJFQBcCw0ElRIAmCmj1Bsh0nvufsxmNfI BsYL0HY3KEk9LVcpS5lE8gS7CnAQgrlPYnBg0+2TdzcZxqFjQS3xTBF93TmQlA+r6ReEh9 bwArtOgVcOo9PwCgo3qzP7Wtz80/4X3se5DiX9Pf/70uAErRWLGYILVwNeyov/BXb6ZG4b Lkbswzn6SyQjYxRX8nrldgMqgF9b4MGS6HvIP7h700Bsmxj6ILWRQA6yfJVdNw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644337854; a=rsa-sha256; cv=none; b=AUIj1locZJbWNpdiCIiuRel+c1LEjDz/YPvzqfVN9a9JqBkk7OWI6tiUs8Yr8lP6QSNEK+ cBVAYpER0o4vLPQXYy6+Ys7NO4wjojpGEKqM3kxLc0P+doRbwQK2GYmnVhbB716P/DbP2I 6qEAWZ5EJaZ9psEC1eRDjmmLJZY07QEzEBQNhBhlwYyNdw1dZgwZNdz9AGB+Kf6gYqMmPc 18iBiSakVo08P1/dTF7MQr2CzzLc1HelXuxKOD+c35I6q7JDsQQ6dbxKYHVMWcobAI5qMJ 9pdBQB3YrbnHb0tdZgauMilOxE2jJfwoizwFloAmkyYN6Ax7AVf/hmhgbTIPzw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=NdhTYKBD; 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.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=NdhTYKBD; 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: 7100314EB4 X-Spam-Score: -2.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: de4/VmoHkh0w 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]: Add new phase 'unpack-bootfiles'. [version, source, home-page]: Derive from 'chez-scheme-bootstrap-bootfiles'. --- gnu/packages/chez-and-racket-bootstrap.scm | 57 ++++++++++++++++++++-- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index 9125d34ab7..c6e4e07085 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -216,9 +216,9 @@ (define unpack-nanopass+stex ;; otherwise, it will try to download submodules (display "# to placate ../configure"))))) -(define-public chez-scheme +(define-public chez-scheme-bootstrap-bootfiles (package - (name "chez-scheme") + (name "chez-scheme-bootstrap-bootfiles") ;; The version should match `(scheme-version-number)`. ;; See s/cmacros.ss c. line 360. (version "9.5.6") @@ -230,8 +230,45 @@ (define-public chez-scheme (sha256 (base32 "07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky")) - (file-name (git-file-name name version)) + (file-name (git-file-name "chez-scheme" version)) (snippet unbundle-chez-submodules))) + (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 ((mach (nix-system->chez-machine system #:threads? #f))) + (or (equal? "arm32le" mach) + (and mach + (member (substring mach 0 2) '("i3" "a6")) + (or-map (cut string-suffix? <> mach) + '("le" "nt" "osx")))))) + %supported-systems)) + (home-page "https://cisco.github.io/ChezScheme/") + (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.") + (properties `((hidden? . #t))) + (license license:asl2.0))) + +(define-public chez-scheme + (package + (name "chez-scheme") + (version (package-version chez-scheme-bootstrap-bootfiles)) + (source (package-source chez-scheme-bootstrap-bootfiles)) (build-system gnu-build-system) (inputs (list @@ -242,7 +279,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") @@ -263,6 +302,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`. @@ -345,7 +392,7 @@ (define* (stex-make #:optional (suffix "")) (not (eq? 'no-support (chez-machine->upstream-restriction mach)))))) %supported-systems))) - (home-page "https://cisco.github.io/ChezScheme/") + (home-page (package-home-page chez-scheme-bootstrap-bootfiles)) (synopsis "R6RS Scheme compiler and run-time") (description "Chez Scheme is a compiler and run-time system for the language of the -- 2.32.0