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 ms5.migadu.com with LMTPS id MF/NFlQj+GM5CQEAbAwnHQ (envelope-from ) for ; Fri, 24 Feb 2023 03:39:16 +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 yIfQFlQj+GMrAQAA9RJhRA (envelope-from ) for ; Fri, 24 Feb 2023 03:39:16 +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 DEC75B363 for ; Fri, 24 Feb 2023 03:39:15 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=jDjzbM56; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677206356; a=rsa-sha256; cv=none; b=goS4ec07YO1Zyn1asRc+qhOwXUNOvBAmPwQxzIN03IzqLD4pID3b0UoK/rSrfaW/8VVQ7r /oskU4ASxrFcpm8rPYCB3UoqCprnRgChPJYOv78M91t+ypP/T8f0g9dTeQOdmTivHrv0m1 Qgxv5RaRZBpzSOS1koLacSni1yroh/M/R+kmOCPZ2yAiJx7UAte48Trfj/gBwpAGogs8M+ uol6T9obq8NJa+yOmfDaPSgut9eY34tmD5quIlRRPs4nWagdsQ4aWxgJ8tF24uzkx0tWlI 002nPDLMJxLoyksOJxy5sbsTVkV6BKVm6c3aNgNgWYmcIJwhPt165f4PE5++cA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=jDjzbM56; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677206356; 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=lf6vOz67lv/lBor+vQ36EzgOGj1KE0cROmj21XQxYZ8=; b=o955Ui092T70m8Bffkab9L3dxRREvmxw+bA8+D2MFc4hNiFRqOxn/qu/SViv2e/K7n9EOR p/x5ZOI/HQtkPM+3I+TKgGp0Xn7XTAlIovoer2UzFDo8GOhAmQRGhIKYdaPHJ/bp1SYtoU +rOCfRyiYia+yyor9rrJGm2BnWRpMJE4JBGLCuW1OOgNaR68cQVEf6XGHoaEXmPvR2WbxY vguDlpGnRJGEplTD1JOlbXZ6mgjE6hpbECpZ4fLYUGZ91gb7wJTHDTV7+obyWIvGkv62/N iFxe7CoAYEvsLBF4P/CtXLA5MOZh+vtI8Gx22l5bAjEv1gNXx616K6vN6m+A+w== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVNzJ-0007gv-Qr; Thu, 23 Feb 2023 21:39:09 -0500 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 1pVNzG-0007gW-UH for guix-patches@gnu.org; Thu, 23 Feb 2023 21:39:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVNzC-00055h-PH for guix-patches@gnu.org; Thu, 23 Feb 2023 21:39:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVNzC-0003bp-BO for guix-patches@gnu.org; Thu, 23 Feb 2023 21:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61255] (%guile-for-build) default in =?UTF-8?Q?=E2=80=98computed-file=E2=80=99?= Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 24 Feb 2023 02:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61255 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , Christopher Baines , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 61255@debbugs.gnu.org Received: via spool by 61255-submit@debbugs.gnu.org id=B61255.167720631313814 (code B ref 61255); Fri, 24 Feb 2023 02:39:02 +0000 Received: (at 61255) by debbugs.gnu.org; 24 Feb 2023 02:38:33 +0000 Received: from localhost ([127.0.0.1]:35680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVNyi-0003ai-LR for submit@debbugs.gnu.org; Thu, 23 Feb 2023 21:38:33 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:37504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVNyg-0003aQ-SF for 61255@debbugs.gnu.org; Thu, 23 Feb 2023 21:38:31 -0500 Received: by mail-qv1-f50.google.com with SMTP id y3so12702648qvn.4 for <61255@debbugs.gnu.org>; Thu, 23 Feb 2023 18:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=lf6vOz67lv/lBor+vQ36EzgOGj1KE0cROmj21XQxYZ8=; b=jDjzbM560tjljVzg9fjmJX/LO7+awQZaudxV3oDxfIE6xbP8O8lvuS/M/WzxwejGww dXxDbDFFSSpFllzoh6SAHR6tgZYVr4Qr5plgfQ/5GAAut02FD0t7c4VO7qmsuJxM9b3n bpDaQVxotfwtVGj7t/+PBAlNDKiDtmzYYIxOr7zGZX1pvGErP9MCgIe7HEyk4wZuRNzA yNW7nzBcrhBws48JLU7aB19imHqB+E0u88OejQ6T29XfXXMKyJ5BtmqsQU2O+1peQ/+y 9EKc8v4WAwQqgiVmjx+wo6aWtcclrhr/SyqRnLx+Ewlg/1ph6ygia9Uncz2zFSy/BwXd fz4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lf6vOz67lv/lBor+vQ36EzgOGj1KE0cROmj21XQxYZ8=; b=ABCc7D5PNkWBNLz9ccqLcpUcM0c4XtWKlLxOu+lFp2zcQ9Bt21BGmrEXUQfiaaN/He wC4erVPJk5NlZxheWyZf6L4rgPsvmlRsgaONDQPAhGN9xF3kIRX1i3JaX7k/37usUisH Gywv2TvhxYXOJpc2unx/h8ZccbmfexW5swOIfO9yhXleRZSAyPxR2cSSduljsINDQN0c wIZUj9VOQYsOBIaCylsZ+K7ayACD00ExxCdzzJQR7xm0ipl5cAcdlFr+i/bPbmGALnMm n7nNPeVYkb9cZTEKtQ6ACniEjNKWQQRrxPEq2gmPFM+Hb9J80WvZqQV4qh/W+wkuUqbM ZkDw== X-Gm-Message-State: AO0yUKWszpcpt4eMK/2IxKp29ECqOh5gfbG/13x8TXwzr0EPE2xVNpQx wp2LIetQ9j4Ge6o7+0nGJDt7uxqGDqjNrPDz X-Google-Smtp-Source: AK7set/bsp8YUjGhH/UIwgggM0gUXmO+bFSt5CSye9LSQQBbShgbSfrsLzTWWhh1V4ET/+uU8OCw2g== X-Received: by 2002:a05:6214:4118:b0:56b:7cb:bdcd with SMTP id kc24-20020a056214411800b0056b07cbbdcdmr24436103qvb.39.1677206304913; Thu, 23 Feb 2023 18:38:24 -0800 (PST) Received: from hurd (dsl-10-129-1.b2b2c.ca. [72.10.129.1]) by smtp.gmail.com with ESMTPSA id x191-20020a3763c8000000b007402fdda195sm8043592qkb.123.2023.02.23.18.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 18:38:24 -0800 (PST) From: Maxim Cournoyer References: <20230203221409.15886-2-maxim.cournoyer@gmail.com> <20230203221409.15886-3-maxim.cournoyer@gmail.com> <877cwyw7yc.fsf@gnu.org> <87h6w2p02y.fsf@gmail.com> <87a61ilpi6.fsf_-_@gnu.org> <87fsb5wso1.fsf@gmail.com> <877cw85qtq.fsf_-_@gnu.org> Date: Thu, 23 Feb 2023 21:38:22 -0500 In-Reply-To: <877cw85qtq.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 23 Feb 2023 16:44:49 +0100") Message-ID: <87leknhjoh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: X-Migadu-Queue-Id: DEC75B363 X-Spam-Score: -1.87 X-Migadu-Spam-Score: -1.87 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: iSqCSZSawHdt Hi Ludovic, Ludovic Court=C3=A8s writes: > Hello! > > Maxim Cournoyer skribis: > >> Hi Ludovic! >> >> Ludovic Court=C3=A8s writes: >> >>> Hi Maxim, >>> >>> Maxim Cournoyer skribis: >>> >>>> Ludovic Court=C3=A8s writes: >>>> >>>>> Hello! >>>>> >>>>> Maxim Cournoyer skribis: >>>>> >>>>>> * guix/gexp.scm (computed-file): Set the default value of the #:guil= e argument >>>>>> to that of the %guile-for-build parameter. >>>>> >>>>> [...] >>>>> >>>>>> (define* (computed-file name gexp >>>>>> - #:key guile (local-build? #t) (options '())) >>>>>> + #:key (guile (%guile-for-build)) >>>>>> + (local-build? #t) (options '())) >>>>> >>>>> I think that would lead =E2=80=98computed-file=E2=80=99 to pick (%gui= le-for-build) at >>>>> the wrong time (time of call instead of time of lowering). >>>>> >>>>> Commit ab25eb7caaf5571cc9f8d6397a1eae127d7e29d1 made it #f such that >>>>> =E2=80=98gexp->derivation=E2=80=99 gets to resolve it at the =E2=80= =9Cright=E2=80=9D time. >>>> >>>> I see! I think you are right. Would making the change in the >>>> associated gexp compiler do the right thing? Currently it ignores the >>>> %guile-for-build fluid as set in the tests/pack.scm test suite for >>>> example. Something like this: >>> >>> I don=E2=80=99t fully understand the context. My preference would go t= o doing >>> like the =E2=80=98computed-file=E2=80=99 tests in =E2=80=98tests/gexp.s= cm=E2=80=99, where we explicitly >>> pass #:guile %bootstrap-guile. >> >> With the refactoring done in patch 3/5 ("pack: Extract >> populate-profile-root from self-contained-tarball/builder."), a >> computed-file is used in the factorized building block >> 'populate-profile-root'. Without this patch, the tests making use of it >> would attempt to build Guile & friends in the test store. >> >>> That said, it seems like patch #5 in this series doesn=E2=80=99t actual= ly use >>> =E2=80=98computed-file=E2=80=99 in =E2=80=98tests/pack.scm=E2=80=99, do= es it? >> >> It does, indirectly. >> >> I hope that helps! > > I=E2=80=99m really not sure what the impact of > 68775338a510f84e63657ab09242d79e726fa457 is, nor whether it was the only > solution to the problem. > > One thing that probably happens is that (default-guile) is now never > used for , contrary to what was happening before. The > spirit is that (default-guile) would be used as the default for all the > declarative file-like objects; gexp compilers refer to (default-guile), > not (%guile-for-build). > > Importantly, (%guile-for-build) is a derivation, possibly built for > another system, whereas (default-guile) is a package, which allows > =E2=80=98lower-object=E2=80=99 to return the derivation for the right sys= tem type. I assumed the purpose of the %guile-for-build fluid was to override the value of the guile used in some conditions, such as during tests (e.g. the '(set-guile-for-build (default-guile))' calls inside the store monad in tests/pack.scm). It's honored for gexp->derivation, but isn't honored for computed-file, which is supposed to be its declarative counterpart. This problem was only exposed when factoring out 'populate-profile-root' as a computed-file object in 68380db4c40a2ee1156349a87254fd7b1f1a52d5 ("pack: Extract populate-profile-root from self-contained-tarball/builder.") > Overall, I think this change should be reverted but of course, we should > find a solution to the problem you hit in the first place. > > I hope this makes sense to you. See the problem it solves below. If we revert this now, we'd have to mark the 'self-contained-tarball' as an expected fail until we find a a better solution. The problem it solves is this: after reverting the change with: > modified guix/gexp.scm > @@ -601,7 +601,7 @@ (define-gexp-compiler (computed-file-compiler (file <= computed-file>) > ;; gexp. > (match file > (($ name gexp guile options) > - (mlet %store-monad ((guile (lower-object (or guile (%guile-for-buil= d) > + (mlet %store-monad ((guile (lower-object (or guile ;(%guile-for-bui= ld) > (default-guile)) > system #:target #f))) > (apply gexp->derivation name gexp #:guile-for-build guile Running the pack.scm tests: $ make check TESTS=3Dtests/pack.scm Fails with a timeout, because the %guile-for-build is not honored by a computed-file derivation, and it goes on building the non-bootstrap build-side guile, gcc, etc. in the test store (see: pack.log): --8<---------------cut here---------------start------------->8--- gcc-10.3.0/gcc/targhooks.h gcc-10.3.0/gcc/testsuite/ gcc-10.3.0/gcc/testsuite/.gitattributes gcc-10.3.0/gcc/testsuite/ChangeLog gcc-10.3.0/gcc/testsuite/ChangeLog-1993-2007 gcc-10.3.0/gcc/testsuite/ChangeLog-2008 gcc-10.3.0/gcc/testsuite/ChangeLog-2009 gcc-10.3.0/gcc/testsuite/ChangeLog-2010 gcc-10.3.0/gcc/testsuite/ChangeLog-2011 gcc-10.3.0/gcc/testsuite/ChangeLog-2012 gcc-10.3.0/gcc/testsuite/ChangeLog-2013 gcc-10.3.0/gcc/testsuite/ChangeLog-2014 gcc-10.3.0/gcc/testsuite/ChangeLog-2015 gcc-10.3.0/gcc/testsuite/ChangeLog-2016 gcc-10.3.0/gcc/testsuite/ChangeLog-2017 gcc-10.3.0/gcc/testsuite/ChangeLog-2018 building of `/home/maxim/src/guix/test-tmp/store/hp86j4850ajphhs1hyryis5nj9= 3pv66l-gcc-10.3.0.tar.xz.drv' timed out after 300 seconds @ build-failed /home/maxim/src/guix/test-tmp/store/hp86j4850ajphhs1hyryis5n= j93pv66l-gcc-10.3.0.tar.xz.drv - timeout killing process 4149 cannot build derivation `/home/maxim/src/guix/test-tmp/store/82yb9zwxdwhmac= z36pjrrzzmgjgakavy-gcc-10.3.0.drv': 1 dependencies couldn't be built @ build-started /home/maxim/src/guix/test-tmp/store/8dfjl4594zgb7wi3icw8s9z= 3rr3pck6x-gcc-4.9.4.tar.xz.drv - x86_64-linux /home/maxim/src/guix/test-tmp= /var/log/guix/drvs/8d//fjl4594zgb7wi3icw8s9z3rr3pck6x-gcc-4.9.4.tar.xz.drv.= gz 4611 cannot build derivation `/home/maxim/src/guix/test-tmp/store/hcv6vh1gx5fkw6= 2l3nravi1aqhi8cq60-gcc-cross-boot0-10.3.0.drv': 1 dependencies couldn't be = built killing process 4611 cannot build derivation `/home/maxim/src/guix/test-tmp/store/1ihb1yadv4dfbq= hfcgn1cyvsl8444yaw-guile-3.0.7.drv': 1 dependencies couldn't be built cannot build derivation `/home/maxim/src/guix/test-tmp/store/6g7fhyr1b84b5q= g8nwn46hkrg55i8c2q-profile-directory.drv': 1 dependencies couldn't be built cannot build derivation `/home/maxim/src/guix/test-tmp/store/apm8bjvzs1n707= lagw0spzr2m2nc0p4v-pack.tar.gz.drv': 1 dependencies couldn't be built cannot build derivation `/home/maxim/src/guix/test-tmp/store/syiq7lmx3v0pkr= jp5wqd5kfapqpxpki3-check-tarball.drv': 1 dependencies couldn't be built test-name: self-contained-tarball location: /home/maxim/src/guix/tests/pack.scm:80 source: + (test-assert + "self-contained-tarball" + (let ((guile (package-derivation %store %bootstrap-guile))) + (run-with-store + %store + (mlet* %store-monad + ((profile + -> + (profile + (content + (packages->manifest (list %bootstrap-guile))) + (hooks '()) + (locales? #f))) + (tarball + (self-contained-tarball + "pack" + profile + #:symlinks + '(("/bin/Guile" -> "bin/guile")) + #:compressor + %gzip-compressor + #:archiver + %tar-bootstrap)) + (check (gexp->derivation + "check-tarball" + (with-imported-modules + '((guix build utils)) + (gexp (begin + (use-modules + (guix build utils) + (srfi srfi-1)) + (define store + (string-append + "." + (%store-directory) + "/")) + (define (canonical? file) + (let ((st (lstat file))) + (or (not (string-prefix? store file)) + (eq? 'symlink (stat:type st)) + (and (=3D 1 (stat:mtime st)) + (zero? (logand + 146 + (stat:mode st)))))= )) + (define bin + (string-append + "." + (ungexp profile) + "/bin")) + (setenv + "PATH" + (string-append + (ungexp %tar-bootstrap) + "/bin")) + (system* "tar" "xvf" (ungexp tarball)) + (mkdir (ungexp output)) + (exit (and (file-exists? + (string-append bin "/guile"= )) + (file-exists? store) + (every canonical? + (find-files + "." + (const #t) + #:directories? + #t)) + (string=3D? + (string-append + (ungexp %bootstrap-guile) + "/bin") + (readlink bin)) + (string=3D? + (string-append + ".." + (ungexp profile) + "/bin/guile") + (readlink "bin/Guile"))))))= )))) + (built-derivations (list check))) + #:guile-for-build + guile))) actual-value: #f actual-error: + (%exception + #<&store-protocol-error message: "build of `/home/maxim/src/guix/test-t= mp/store/syiq7lmx3v0pkrjp5wqd5kfapqpxpki3-check-tarball.drv' failed" status= : 101>) result: FAIL --8<---------------cut here---------------end--------------->8--- --=20 Thanks, Maxim