From patchwork Wed Feb 23 18:55:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 37437 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 E055027BBEA; Wed, 23 Feb 2022 19:32:18 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED 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 5B62627BBE9 for ; Wed, 23 Feb 2022 19:32:18 +0000 (GMT) Received: from localhost ([::1]:32960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMxN3-000853-IN for patchwork@mira.cbaines.net; Wed, 23 Feb 2022 14:32:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMxIx-0005sZ-0l for guix-patches@gnu.org; Wed, 23 Feb 2022 14:28:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52677) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMxIw-0005xP-Nf for guix-patches@gnu.org; Wed, 23 Feb 2022 14:28:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nMxIw-0007pO-HK for guix-patches@gnu.org; Wed, 23 Feb 2022 14:28:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53878] [PATCH v3 09/15] gnu: Add racket-vm-cgc. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Feb 2022 19:28: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: Liliana Marie Prikler , Philip McGrath , 53878@debbugs.gnu.org, Ludovic =?utf-8?q?Court=C3=A8s?= Cc: Attila Lendvai , Maxime Devos , Malte Gerdes , raingloom , zimoun Received: via spool by 53878-submit@debbugs.gnu.org id=B53878.164564443230016 (code B ref 53878); Wed, 23 Feb 2022 19:28:02 +0000 Received: (at 53878) by debbugs.gnu.org; 23 Feb 2022 19:27:12 +0000 Received: from localhost ([127.0.0.1]:46572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMxI8-0007o3-3x for submit@debbugs.gnu.org; Wed, 23 Feb 2022 14:27:12 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:39675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMwnL-0006xX-So for 53878@debbugs.gnu.org; Wed, 23 Feb 2022 13:55:24 -0500 Received: by mail-qv1-f52.google.com with SMTP id a1so10078581qvl.6 for <53878@debbugs.gnu.org>; Wed, 23 Feb 2022 10:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=12c2JJJXeto50BbY2zuvCtk0Q6FQDOkttxIaRRkaXUE=; b=jrH+edyNX4TKETL+RTifa4uaHzx+q+Fp7ETyHQB5FCilxx4HSuS6xFEMlSSLm8JwSa av9BjFamEKJ098QBVg19g0BV39CQln9W54I/BavWQ3GAtfG8pxlQJr9+DaDQCLg0SVXP QYJ6lZJH/crh6uDZDAHMS8Csxdpxsipu0JJrdsML/i1uGo9HGoQl4SxosTQXLG894buL 9TyL4htefuHjnmcvEMSgyh1sfATzQchYAYoSckD3SpgRqSluAyhzrEtEiXDAfZICNBlp RTSfwkCrP+PcT6SU/WVBwG+f93lsEUZG5DFg28NNq3+l2UF1QCgq88ufLdE4Yi0NRF1u RZoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=12c2JJJXeto50BbY2zuvCtk0Q6FQDOkttxIaRRkaXUE=; b=MGurJSGaYhNedITSWBUweeXUC+0MWViaHUgRPxWjxWs0cEJ5Uv9wVJWKqzA9qJfV08 8iWa0SsPfExhHjLTb+gIoNuNZKAgG2h6mXaw1FHIvVooHyBLiIlje8245D0ZzfMNmG31 v0U1tg0Y3ZxqxgmqeS48TkDSOiC4MYo9/ldFaQHnXXfLNuzhVXWmJXHjZHGBBf6j6tT4 KEBNYZSkXIO9csMnHli2wCWlO5hPN/XZ2DEwrqLSYax1ZExR9jDtvpxFEu0/gvxQxY1Z sQnBmP5eqV/SVo2hqV014e5Ngf5mxzFPpjpGJoqcjYYW6PJ8xbrG8VRmloPOfv1L01Ki tMlA== X-Gm-Message-State: AOAM532Oh0ABU5iRfcs0r7UF/DnEQ0ydigzV76H4t8SojdeMGa9Kg+vw B6gsoXOTadwyJoGHZOYHypA= X-Google-Smtp-Source: ABdhPJxZ7QK0BoO2MWE+kCbOjQQ50nF2kDKSyXJE4OJMLVIBmt2PkakAhXNFRw4myKjRP66tQ+u8Dw== X-Received: by 2002:ad4:450d:0:b0:432:6b36:acb2 with SMTP id k13-20020ad4450d000000b004326b36acb2mr641233qvu.130.1645642518200; Wed, 23 Feb 2022 10:55:18 -0800 (PST) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id e3sm269483qto.25.2022.02.23.10.55.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Feb 2022 10:55:17 -0800 (PST) Message-ID: Date: Wed, 23 Feb 2022 13:55:16 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US References: <20220208151316.1897345-1-philip@philipmcgrath.com> <1853902.IiyMIqa0Cy@bastet> <5037281.s90xYg8xyF@bastet> From: Philip McGrath In-Reply-To: X-Mailman-Approved-At: Wed, 23 Feb 2022 14:27:10 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Wed, 23 Feb 2022 14:31:38 -0500 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 Hi, On 2/20/22 13:13, Liliana Marie Prikler wrote: >> Given Ludo’'s explanation, I think the difference (or at least an >> important difference) is that those functions are defined in `(guix >> ...)` modules, as opposed to `(gnu packages ...)` modules. >> >> But I wish I knew with any degree of certainty *why* this would be >> true, if indeed it is. >> >> Maybe Maxime knows? > Both Ludo and Maxime already explained this, but to be extra clear, > it's the thunking. > > (define foo ) > (define bar ) <- problem > > (define (foo) ) > (define bar ) <- no problem. > > Since inputs are thunked, you can define chez in chez.scm and racket in > racket.scm and use them as input to each other without breaking the > compiler (you will break the package builder though). If you want > something more meaningful, you can define racket-minimal in racket.scm > and use it in chez.scm as input to a package, then use that package as > input to racket. This does not work for (source ) and (inherit ) > however, because those forms are not thunked. You would have to thunk > them until you reach a save haven (like a package's inputs), where you > can call the thunk to produce a value. To try to be concrete, I made the patch below as a mock-up of part of your earlier suggestion (IIUC): On 2/20/22 04:03, Liliana Marie Prikler wrote: > Inside chez-and-racket-bootstrap, define (make-) functions for > the following: > - chez-bootstrap-bootfiles, chez-for-racket-bootstrap-bootfiles: > Taking version and origin. > - racket-vm-cgc: Taking version and origin. > - racket-vm-bc: Taking racket-vm-cgc. > - racket-vm-cs: Taking racket-vm-bc. > ... > > Inside racket, define %racket-version, %racket-origin, racket-minimal > and racket. It'd also be good if you made local definitions > (define racket-vm-cgc (make-racket-vm-cgc %racket-version %racket- > origin)) > (define racket-vm-bc (make-racket-vm-bc racket-vm-cgc)) > ... > in this file. This applies on top of v4, or I've put it at if that's easier for anyone: --8<---------------cut here---------------start------------->8--- From 982fe7cfb4d33103ee611acc310e3225ccf35852 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Wed, 23 Feb 2022 11:13:43 -0500 Subject: [PATCH] example of import problems --- gnu/packages/chez-and-racket-bootstrap.scm | 4 ++++ gnu/packages/racket.scm | 3 +++ 2 files changed, 7 insertions(+) ORIGIN into a new file-like object. In the resulting file-like object, the package source diff --git a/gnu/packages/chez-and-racket-bootstrap.scm b/gnu/packages/chez-and-racket-bootstrap.scm index b779099fb3..ea10f7fe92 100644 --- a/gnu/packages/chez-and-racket-bootstrap.scm +++ b/gnu/packages/chez-and-racket-bootstrap.scm @@ -47,6 +47,7 @@ (define-module (gnu packages chez-and-racket-bootstrap) #:use-module ((guix licenses) #:prefix license:) #:export (chez-scheme-for-system + make-racket-vm-cgc racket-vm-for-system)) ;; Commentary: @@ -199,6 +200,9 @@ (define-module (gnu packages chez-and-racket-bootstrap) ;; ;; Code: +(define (make-racket-vm-cgc a b) + 42) + (define* (chez-scheme-for-system #:optional (system (or (%current-target-system) (%current-system)))) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index c2854f84e8..08e437a722 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -58,6 +58,9 @@ (define %racket-version "8.4") ; MUST match "chez-and-racket-bootstrap.scm" (define %racket-commit (string-append "v" %racket-version)) +(define fake-racket-vm-cgc + (make-racket-vm-cgc 1 2)) + (define (extract-package-source origin spec) "Extract the source for a Racket package specified by SPEC from