From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id AAlCFH1i12SFWgAASxT56A (envelope-from ) for ; Sat, 12 Aug 2023 12:44:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SLcjFH1i12TxKQAA9RJhRA (envelope-from ) for ; Sat, 12 Aug 2023 12:44:13 +0200 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 DA30962EDA for ; Sat, 12 Aug 2023 12:44:12 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=PWnv0rFu; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691837053; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=Ho/r12nq9ncuod0bx1snWlWTLrdH2xWdAuouuSfixzc=; b=W4Et0fmj245ttypBIDaJVq3eE8ly6bl7svBE2uanaGH7/nxs0Yh/w2ttP5TB66Jc02JIXm Z8ZU2zydsAZ7rNyUaHKiPOWgBmWktvICNbIJ7gqWroRWD+pZXEvwD1fcdtaCCYvuXxpgqJ aa2rRoNX4lIrwJV4notHgRxvN7zgVBFBA07vndsMqLn5g5o7aZD5ImNp5rPPhKG2TFpSwQ TfY7jn2JWB8ABlbe5QZYOx9yG/183rzhTtukUT368StZpCCUpiZPawSc9ffFDf3xcHROE9 EHgejApzHYJqyCtiAwfD7PitoZejPIDB47Yiq4UJs+ko6qETQJ/hRB8wASyWag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691837053; a=rsa-sha256; cv=none; b=HaHWRQzv3IdDnqAUGN8X1LIxsF9s5V01h0eCZPs6O2S8nXKPxyvL/fntsU+3oO2DQCgKi9 3eGOTbhIa239eZYCvwdyF1fNB0JqOKSJLFyIFBgpo5UpNp6zwXjttp6ZIqNL776tqp1hiN 7ywYUl0yjFuymolP2dk3hOrS0ghAqxSHR2FyJhVeeU2txOVSS1GJVjFOYjrI6aIyB5PwwM qe+VxfXo5stNkGa940EgcrMlWjqhZk5fgPKMnpMk9IvWroSgzyeS5YzoYRxETbeJDPoutO rugwb7rwT9jzgu4I0dM8p4qenn1KKjzH/8SDHAryz2pG2rOFAfwyC5PJUk0sAw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=PWnv0rFu; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUm6F-00010A-IS; Sat, 12 Aug 2023 06:44:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qUm6E-000102-KL for bug-guix@gnu.org; Sat, 12 Aug 2023 06:44:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qUm6E-0005hx-CI for bug-guix@gnu.org; Sat, 12 Aug 2023 06:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUm6E-0005VU-8Y for bug-guix@gnu.org; Sat, 12 Aug 2023 06:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65225: [PATCH] environment: Build the profile for the requested system. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 12 Aug 2023 10:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65225 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Tobias Geerinckx-Rice , 65225@debbugs.gnu.org Cc: Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Ricardo Wurmus Received: via spool by 65225-submit@debbugs.gnu.org id=B65225.169183698620963 (code B ref 65225); Sat, 12 Aug 2023 10:44:02 +0000 Received: (at 65225) by debbugs.gnu.org; 12 Aug 2023 10:43:06 +0000 Received: from localhost ([127.0.0.1]:48800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUm5J-0005S3-Jo for submit@debbugs.gnu.org; Sat, 12 Aug 2023 06:43:05 -0400 Received: from jpoiret.xyz ([206.189.101.64]:44662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUm5H-0005Rp-NP for 65225@debbugs.gnu.org; Sat, 12 Aug 2023 06:43:04 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 537FF18540D; Sat, 12 Aug 2023 10:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1691836982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ho/r12nq9ncuod0bx1snWlWTLrdH2xWdAuouuSfixzc=; b=PWnv0rFuq6A+zIegCJgt7eVJM0ld4KG7DPNCeu28xgivG8hgZnpNIXmxfFHazL88H/VoGt C1NXq2diCYLQyyv5OyOmlr5Ns+vXtc/uIwTF6a5NempO6hxWzypTEmMZ4jZ4j3/D7bBrZp F7Kwae3JR1c6ER/eV3617Sz0TF+eJ/hfRuwJxoAngAC5h+Ej8j7nsQa/wQAX5Pa98d78KL ZfUZ9ubIEpJ7huPF3F86+MCFW0medsPQIUrOiomIY7k61zoRXLbvhbDF9VXJtUFBpm6R5F Eag1eAyuZ5w3RDOedUqXlTkJ1u+x50rsbMLVks04TykBZVoKR+ByoaAD1PPMgw== In-Reply-To: <871qg8o8hi.fsf@jpoiret.xyz> References: <2f29e4cbc33a82509a5980bc5ddd5f8ae53cf113.1691280000.git.me@tobias.gr> <871qg8o8hi.fsf@jpoiret.xyz> Date: Sat, 12 Aug 2023 12:42:59 +0200 Message-ID: <87wmy0mtho.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Josselin Poiret From: Josselin Poiret via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: DA30962EDA X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -7.29 X-Spam-Score: -7.29 X-TUID: r7pCVfj0oWvF --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi everyone, Actually, let me add a big erratum, since it appears I misread the intention of gexp->derivation (and realized 2 minutes after writing the previous email). Josselin Poiret writes: > --8<---------------cut here---------------start------------->8--- > (mlet* %store-monad ( ;; The following binding forces '%current-system' a= nd > ;; '%current-target-system' to be looked up at >>=3D > ;; time. > (graft? (set-grafting graft?)) > > (system -> (or system (%current-system))) > (target -> (if (eq? target 'current) > (%current-target-system) > target)) > ...) > ...) > --8<---------------cut here---------------end--------------->8--- > > Well, the issue here is that such an mlet starts by translating the > graft? binding into a >>=3D call, which ends up putting the rest of the > translation into a function call that will *not* be called until the > monadic value is run. That means that the system and target bindings > afterwards are *not* looked up at call time but at monadic run time! This is actually what the comment above hints at, I misunderstood its meaning. It seems that this piece of code used to be (before 2015) =2D-8<---------------cut here---------------start------------->8--- (mlet* %store-monad ( ;; The following binding forces '%current-system' and ;; '%current-target-system' to be looked up at >>=3D ;; time. (unused (return #f) (system -> (or system (%current-system))) (target -> (if (eq? target 'current) (%current-target-system) target)) ...) ...) =2D-8<---------------cut here---------------end--------------->8--- probably at a time when (current-system) didn't exist. In turn, this means that gexp->derivation intentionally delays getting the current system to monadic run time. Thus, we probably need to pass an optional #:system argument to the hooks that they can forward to gexp->derivation to fix this =E2=80=9Cproperly=E2=80=9D > IMO, this is way too complicated to keep in mind at all times, and there > are bugs lurking under the surface absolutely everywhere, waiting for a > corner case to be uncovered. My comment still stands. Best, =2D-=20 Josselin Poiret --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHEBAEBCgAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmTXYjMQHGRldkBqcG9p cmV0Lnh5egAKCRBQXkC5Fhcaiuz8C/9iCU982dfYRv5YczivMoXAQDttDJBvja2G 2zK1+wJbRHGcLfwQhPvFuhiIQTIrjkTqzNcOVY6R5E7ik3FDzQgrs+ZwHIKaYLGk O24VFGJ+Il8ctLDERYOuOzbBTn0tp5VuH3N8XwXU8rbS5Vdq8wZRXCtQD4AAzQaK 7YaeLq8yDNxHUyzO4I23eEWE6w/2Z5Cj1Nz7vxzw9RmFsyB8y+b1vdKgBGoVAugc eu4PypbkFZMXXWoFYQYCzN9amC1xIitsfY0r7Ps18U36NOxqvQyp4ukTOxOxR6UY Zfmz7j29ikrUvxQmqVC415+iZUjXI6yr8vDTG8SioMiV15ZaLOQZpMsqWJGyvOgH BEGS0LdNaoVOJPp9IKYg+0zCultKHkaHM4ET5b5DYOdwEtJw9sAbDSTyINxNMr1U xjIcv9R778554Cc543jgzMj29V6MjPakwdgOr7V3H6xPmsKt5OgOWjUcSRjyw2tI pAtvMNC7WZb2pu1hg2TrNuceYQKpNd4= =s75T -----END PGP SIGNATURE----- --=-=-=--