From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KJNRIMqLFmLLMAEAgWs5BA (envelope-from ) for ; Wed, 23 Feb 2022 20:32:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AHoOHcqLFmL6zAAAauVa8A (envelope-from ) for ; Wed, 23 Feb 2022 20:32:26 +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 E6B1029106 for ; Wed, 23 Feb 2022 20:32:21 +0100 (CET) Received: from localhost ([::1]:32960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMxN6-000853-Pr for larch@yhetil.org; Wed, 23 Feb 2022 14:32:20 -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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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+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=1645644742; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=12c2JJJXeto50BbY2zuvCtk0Q6FQDOkttxIaRRkaXUE=; b=vAytuNEsVNbo6I40Fj8VF43pJZsoug7iXNzsRenu+gyXvzbTohKss6gXHmrb6INUj953nd sx1//8F2p0fnafLGYxdnMOuHwAeGXampz+V89N8en8coD2rmvuY729S8Bwnmm1O3n81qxJ z+85ZDOLZXLlKyjSF6BQP/WTi8thUoQoVsJClLTwkKT2Lo+vMOOoIxR7agoIJvn3ReAvhR g5t7Mscrvg9B9vMNF14Ygia9bpha+ThWl8P0AcRu/BtoJ2O/2miGUKHwu+l77PgaETYrow UMHcd23Xkwch5ImYuC09WJMEdoQZ9d+w7elJekbbBZc8xUIHrlezGMFfrzJQDA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645644742; a=rsa-sha256; cv=none; b=EIyWmMcXawxUQ/Dhma6YNkdCZRT5rYA1+hSL7bffWYae+Zl8bfUEvJaJ5qFHc8MC/g9J1L LNaN4WtmaS5NH2KqUecSNNp/mamZRftXrBnkHKAJfWXYl/DlJGnGrLjt97g9JPMN2mPH8J W/PayodS6/Tpd2BfyzAMmjWeQYc/OIq5gLn3J8zpvoIBTAtYRcWgEOHplnYilGN/WNWzZT IKXyAA+sJOIO4Gnq2Fp4Q1FQxTJcyPIr0SNhHo6F7zSq6lRbmgnOPbrhaKszqIZQa5LTD0 k89U7Gaiw2LvR1qL7kbi+5UZErZ9mdhYc+9KZLH0XhpQcR7Fsx1FGJKN41MwfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=jrH+edyN; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: -1.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=jrH+edyN; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: E6B1029106 X-Spam-Score: -1.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9xEBrDq+wk6p 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(+) 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 ORIGIN into a new file-like object. In the resulting file-like object, the package source -- 2.32.0 --8<---------------cut here---------------end--------------->8--- With this patch, trying to run `make` fails with the same kind of error we've seen before: ``` ice-9/eval.scm:293:34: error: make-racket-vm-cgc: unbound variable hint: Did you forget `(use-modules (gnu packages chez-and-racket-bootstrap))'? ``` Overall, I certainly agree that duplicating the definition of `%racket-version` is not ideal. I'd be glad for you or anyone to improve the situation, and I'll try to get my head around Maxime's email about the underlying semantics. But I am confident that v4 of this series is at least not broken, if perhaps not maximally beautiful. Especially given that I, for one, have tried things that initially seemed correct only to discover subtle problems later, I think it would be better for any refinements to come in follow-on patches later. -Philip