From patchwork Sun Feb 27 02:34:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 37492 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 B458827BBEA; Sun, 27 Feb 2022 02:38:22 +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,FROM_FMBLA_NEWDOM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS 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 E918D27BBE9 for ; Sun, 27 Feb 2022 02:38:21 +0000 (GMT) Received: from localhost ([::1]:38422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nO9S1-0006BU-3x for patchwork@mira.cbaines.net; Sat, 26 Feb 2022 21:38:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nO9Rj-0006AO-9a for guix-patches@gnu.org; Sat, 26 Feb 2022 21:38:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nO9Rj-0006Kv-1B for guix-patches@gnu.org; Sat, 26 Feb 2022 21:38:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nO9Ri-0004E7-T9 for guix-patches@gnu.org; Sat, 26 Feb 2022 21:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v6 06/24] gnu: racket-minimal: Change inheritance to follow bootstrapping. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 02:38: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=A8?= =?utf-8?q?s?= , Maxime Devos , raingloom , Liliana Marie Prikler , Attila Lendvai , Malte Gerdes Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164592945216157 (code B ref 53878); Sun, 27 Feb 2022 02:38:02 +0000 Received: (at 53878) by debbugs.gnu.org; 27 Feb 2022 02:37:32 +0000 Received: from localhost ([127.0.0.1]:56542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9R9-0004CQ-L7 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:32 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:33681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9R7-0004CD-2T for 53878@debbugs.gnu.org; Sat, 26 Feb 2022 21:37:26 -0500 Received: by mail-qt1-f171.google.com with SMTP id bt3so6088687qtb.0 for <53878@debbugs.gnu.org>; Sat, 26 Feb 2022 18:37:25 -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=csYxz1KLSKiWhLrQOqhP0OIL5gVjxXKbeWBLNdaC9Rg=; b=OhNvuqmvJMii+fwQAq6EBmkU/fLNPhc/V796bGt8Vjc6wpWvnbuOZ/3z0HBdbIGeUs iPbnxSOJXFzdLDnobKYssJSNB0PeeudiAlSz8nvLreOoKwD3D30085W83idVtAdLYJob ifrhlaDsfkRISgyO1oMyKo7LjtcA8pIfMVpb4mIE4Iv0pkhb6RFJed7UxunL4CpX508B Mad0TdZ0P1YZT5RyuoWBwEMWzCLlAW0gscaNb1R+9Ezk0b14nb+tjgKDCJzfipDXWkYb akpUskV8sFPaVO1mBw4qkI5fiGf86daZTMenF6qp+NtZO0m3GAA/mOhQUv/VSB/SLQv5 q0UA== 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=csYxz1KLSKiWhLrQOqhP0OIL5gVjxXKbeWBLNdaC9Rg=; b=pnR6BPCTOr5FQncfDz4EyuHeb50KM4XqEE6ryX5By4+QnmMd2Jb2FhfskvWDKLlK+G qIlWuF/6ihfB4j9tiwVCoADba250m4+yg7B+O4WwyfCoLMc2UsxiRd4h+H+bzIRsBTmY wnhoNcOVGM5ymAcJqOI2WjpRiN73Os9GRnq9XtIZdj9AhJFYNKhwhOJhIhNARcm3U7AS Vd+rJlKoYWH5Xi9pm9pk1y/jMzqYq+fyAvmIbFN493jdr8zBtObgsBOjHpO9ITZZ9AK7 bde9FCYDf8RD5sMFMZDnS9fKsKP42DcjilJcDHp6/EJJ7y9qf9KZWOvr6GvfGkoQtOx4 AoOA== X-Gm-Message-State: AOAM533GfkG8DykPBKrnNvPBwvMPdZAJI+v2gwFg60LnAwyjNujX4wct rEATdL/A1KfortSlOYyOGPcSrjLmIaYyju8iN44= X-Google-Smtp-Source: ABdhPJwz3SunO7W2AsW7OhmSpZDzGxjGoD2h3dpLCvcjn+r+bfdVCT9NeD/r/cD/RMcVStqeLZxhhw== X-Received: by 2002:a05:622a:8d:b0:2dd:d979:bc46 with SMTP id o13-20020a05622a008d00b002ddd979bc46mr12374086qtw.342.1645929439440; Sat, 26 Feb 2022 18:37:19 -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 o21-20020ac85a55000000b002d7847160c0sm4140270qta.82.2022.02.26.18.37.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:37:19 -0800 (PST) From: Philip McGrath Date: Sat, 26 Feb 2022 21:34:32 -0500 Message-Id: <20220227023450.1877215-7-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 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 Having the package inheritance chain go in the same direction as the bootstrapping chain, rather than the opposite, is less confusing. In some cases, it can also help to avoid unnecessary rebuilds. * gnu/packages/racket.scm (racket-minimal-bc-cgc): Change to be the root of the package inheritance chain. [version, source, inputs, native-inputs, build-system, arguments, home-page, license]: Inline formerly inherited values. (racket-minimal-bc-3m): Inherit from 'racket-minimal-bc-cgc' rather than 'racket-minimal'. [inputs, native-inputs, arguments, license]: Adjust accordingly. (racket-minimal): Inherit from 'racket-minimal-bc-3m'. [inputs, native-inputs, arguments, license]: Adjust accordingly. [properties]: Override effect of 'hidden-package'. --- gnu/packages/racket.scm | 130 +++++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 63 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index b828bbbd3d..00f4fef49f 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Pierre Neidhardt -;;; Copyright © 2021 Philip McGrath +;;; Copyright © 2021, 2022 Philip McGrath ;;; Copyright © 2021 jgart ;;; ;;; This file is part of GNU Guix. @@ -172,9 +172,9 @@ (define (make-unpack-nanopass+stex) (display "# to placate ../configure"))))) -(define-public racket-minimal +(define-public racket-minimal-bc-cgc (package - (name "racket-minimal") + (name "racket-minimal-bc-cgc") (version %racket-version) (source %racket-origin) (inputs @@ -184,19 +184,14 @@ (define-public racket-minimal sqlite bash-minimal ;; <- for `system` ncurses ;; <- for #%terminal - ;; only for CS - zlib - lz4)) - (native-inputs - (list chez-scheme-for-racket-bootstrap-bootfiles - racket-minimal-bc-3m)) + ;; only for BC variants: + libffi)) + (native-inputs (list libtool)) ;; <- only for BC variants (build-system gnu-build-system) (arguments (list #:configure-flags - #~(cons* "--enable-csonly" - "--enable-libz" - "--enable-lz4" + #~(cons* "--enable-cgcdefault" #$(racket-vm-common-configure-flags)) ;; Tests are in packages like racket-test-core and ;; main-distribution-test that aren't part of the main @@ -210,17 +205,6 @@ (define-public racket-minimal (guix build utils)) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'unpack-nanopass+stex - (lambda args - (with-directory-excursion "racket/src/ChezScheme" - #$(make-unpack-nanopass+stex)))) - (add-after 'unpack-nanopass+stex 'unpack-bootfiles - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (with-directory-excursion "racket/src/ChezScheme" - (copy-recursively - (search-input-directory (or native-inputs inputs) - "lib/chez-scheme-bootfiles") - "boot")))) (add-before 'configure 'initialize-config.rktd (lambda* (#:key inputs #:allow-other-keys) (define (write-racket-hash alist) @@ -265,43 +249,37 @@ (define maybe-release-catalog ;; rmdir because we want an error if it isn't empty (rmdir (string-append #$output "/share/racket/pkgs"))))))) (home-page "https://racket-lang.org") - (synopsis "Racket without bundled packages such as DrRacket") - (description - "Racket is a general-purpose programming language in the Scheme family, -with a large set of libraries and a compiler based on Chez Scheme. Racket is -also a platform for language-oriented programming, from small domain-specific -languages to complete language implementations. + (synopsis "Old Racket implementation used for bootstrapping") + (description "This variant of the Racket BC (``before Chez'' or +``bytecode'') implementation is not recommended for general use. It uses +CGC (a ``Conservative Garbage Collector''), which was succeeded as default in +PLT Scheme version 370 (which translates to 3.7 in the current versioning +scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the +Racket CS implementation. -The ``minimal Racket'' distribution includes just enough of Racket for you to -use @command{raco pkg} to install more. Bundled packages, such as the -DrRacket IDE, are not included.") +Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may +also be used for embedding applications without the annotations needed in C +code to use the 3M garbage collector.") ;; https://download.racket-lang.org/license.html ;; The LGPL components are only used by Racket BC. - (license (list license:asl2.0 license:expat)))) + (license (list license:lgpl3+ license:asl2.0 license:expat)) + ;; Eventually, it may make sense for some vm packages to not be hidden, + ;; but this one is especially likely to remain hidden. + (properties `((hidden? . #t))))) (define-public racket-minimal-bc-3m (hidden-package (package - (inherit racket-minimal) + (inherit racket-minimal-bc-cgc) (name "racket-minimal-bc-3m") - (inputs - (modify-inputs (package-inputs racket-minimal) - (prepend libffi) ;; <- only for BC variants - (delete "zlib" "lz4"))) (native-inputs - (list libtool - (if (%current-target-system) - racket-minimal - racket-minimal-bc-cgc))) + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (prepend racket-minimal-bc-cgc))) (arguments - (substitute-keyword-arguments (package-arguments racket-minimal) + (substitute-keyword-arguments (package-arguments racket-minimal-bc-cgc) ((#:configure-flags _ '()) #~(cons "--enable-bconly" - #$(racket-vm-common-configure-flags))) - ((#:phases cs-phases) - #~(modify-phases #$cs-phases - (delete 'unpack-nanopass+stex) - (delete 'unpack-bootfiles))))) + #$(racket-vm-common-configure-flags))))) (synopsis "Minimal Racket with the BC [3M] runtime system") (description "The Racket BC (``before Chez'' or ``bytecode'') implementation was the default before Racket 8.0. It uses a compiler written @@ -316,27 +294,53 @@ (define-public racket-minimal-bc-3m ;; The LGPL components are only used by Racket BC. (license (list license:lgpl3+ license:asl2.0 license:expat))))) -(define-public racket-minimal-bc-cgc +(define-public racket-minimal (package (inherit racket-minimal-bc-3m) - (name "racket-minimal-bc-cgc") - (native-inputs (list libtool)) + (name "racket-minimal") + (inputs + (modify-inputs (package-inputs racket-minimal-bc-cgc) + (prepend zlib lz4) + (delete "libffi"))) + (native-inputs + (modify-inputs (package-native-inputs racket-minimal-bc-cgc) + (delete "libtool") + (prepend chez-scheme-for-racket-bootstrap-bootfiles + racket-minimal-bc-3m))) (arguments (substitute-keyword-arguments (package-arguments racket-minimal-bc-3m) + ((#:phases bc-phases) + #~(modify-phases #$bc-phases + (add-after 'unpack 'unpack-nanopass+stex + (lambda args + (with-directory-excursion "racket/src/ChezScheme" + #$(make-unpack-nanopass+stex)))) + (add-after 'unpack-nanopass+stex 'unpack-bootfiles + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "racket/src/ChezScheme" + (copy-recursively + (search-input-directory (or native-inputs inputs) + "lib/chez-scheme-bootfiles") + "boot")))))) ((#:configure-flags _ '()) - #~(cons "--enable-cgcdefault" - #$(racket-vm-common-configure-flags))))) - (synopsis "Old Racket implementation used for bootstrapping") - (description "This variant of the Racket BC (``before Chez'' or -``bytecode'') implementation is not recommended for general use. It uses -CGC (a ``Conservative Garbage Collector''), which was succeeded as default in -PLT Scheme version 370 (which translates to 3.7 in the current versioning -scheme) by the 3M variant, which in turn was succeeded in version 8.0 by the -Racket CS implementation. + #~(cons* "--enable-csonly" + "--enable-libz" + "--enable-lz4" + #$(racket-vm-common-configure-flags))))) + (synopsis "Racket without bundled packages such as DrRacket") + (description + "Racket is a general-purpose programming language in the Scheme family, +with a large set of libraries and a compiler based on Chez Scheme. Racket is +also a platform for language-oriented programming, from small domain-specific +languages to complete language implementations. -Racket BC [CGC] is primarily used for bootstrapping Racket BC [3M]. It may -also be used for embedding applications without the annotations needed in C -code to use the 3M garbage collector."))) +The ``minimal Racket'' distribution includes just enough of Racket for you to +use @command{raco pkg} to install more. Bundled packages, such as the +DrRacket IDE, are not included.") + (properties `()) + ;; https://download.racket-lang.org/license.html + ;; The LGPL components are only used by Racket BC. + (license (list license:asl2.0 license:expat)))) (define-public chez-scheme-for-racket-bootstrap-bootfiles (package