From debbugs-submit-bounces@debbugs.gnu.org Sun May 10 16:39:10 2020 Received: (at submit) by debbugs.gnu.org; 10 May 2020 20:39:10 +0000 Received: from localhost ([127.0.0.1]:50543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXsj0-0000If-K6 for submit@debbugs.gnu.org; Sun, 10 May 2020 16:39:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:40298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXsiy-0000IG-6M for submit@debbugs.gnu.org; Sun, 10 May 2020 16:39:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXsix-0004vD-VL for bug-guix@gnu.org; Sun, 10 May 2020 16:38:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49509) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXsix-000841-Mq for bug-guix@gnu.org; Sun, 10 May 2020 16:38:59 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44234 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jXsix-00078A-99 for bug-guix@gnu.org; Sun, 10 May 2020 16:38:59 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org Subject: Profile hooks ignore system and target X-Debbugs-Cc: Jan Nieuwenhuizen , Mathieu Othacehe X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 =?utf-8?Q?Flor=C3=A9al?= an 228 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 10 May 2020 22:38:57 +0200 Message-ID: <87a72f8qzi.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Hello! As janneke found (and maybe Mathieu also), the profile hooks called by =E2=80=98profile-derivation=E2=80=99 for some reason end up using a differe= nt system and target, as can be seen in this example: --8<---------------cut here---------------start------------->8--- $ guix describe Generacio 141 May 10 2020 11:41:44 (nuna) guix 279569c repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 279569ca8251b9ae3f96e4486e4614e340d0fe4f $ guix pack --target=3Darm-linux-gnueabihf --no-grafts idutils -d /gnu/store/rjbs4a5l1vi3winbf71xz3d0hhmdwnjj-tarball-pack.tar.gz.drv $ guix gc -R /gnu/store/rjbs4a5l1vi3winbf71xz3d0hhmdwnjj-tarball-pack.tar.g= z.drv | grep idutils-4.6.drv /gnu/store/kfv7bwzapb3lfirdpyjh5zcrrpld90ni-idutils-4.6.drv /gnu/store/1y5rjcvs6giag414wg4ngz7cp4mxy76v-idutils-4.6.drv $ guix build idutils --no-grafts -d /gnu/store/kfv7bwzapb3lfirdpyjh5zcrrpld90ni-idutils-4.6.drv $ guix build idutils --no-grafts -d --target=3Darm-linux-gnueabihf /gnu/store/1y5rjcvs6giag414wg4ngz7cp4mxy76v-idutils-4.6.drv --8<---------------cut here---------------end--------------->8--- We should be seeing only the cross-compile derivation. Where does the native derivation come from? --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix graph --path -t derivation /gnu/store/rjbs4a5l1vi3win= bf71xz3d0hhmdwnjj-tarball-pack.tar.gz.drv /gnu/store/kfv7bwzapb3lfirdpyjh5z= crrpld90ni-idutils-4.6.drv /gnu/store/rjbs4a5l1vi3winbf71xz3d0hhmdwnjj-tarball-pack.tar.gz.drv /gnu/store/hxp1gqbmmq4hjwnb8m1amp15k0ax455m-profile.drv /gnu/store/3180cdca49sl6xhn9prx9xcwv20jlpdl-fonts-dir.drv /gnu/store/kfv7bwzapb3lfirdpyjh5zcrrpld90ni-idutils-4.6.drv --8<---------------cut here---------------end--------------->8--- Actually all the profile hooks refer to the native derivation. To be continued=E2=80=A6 Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon May 11 16:15:51 2020 Received: (at control) by debbugs.gnu.org; 11 May 2020 20:15:51 +0000 Received: from localhost ([127.0.0.1]:53411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYEq7-0008MW-17 for submit@debbugs.gnu.org; Mon, 11 May 2020 16:15:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYEq5-0008MJ-64 for control@debbugs.gnu.org; Mon, 11 May 2020 16:15:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46481) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYEpz-000492-V2 for control@debbugs.gnu.org; Mon, 11 May 2020 16:15:43 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39048 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYEpy-0001Qi-WE for control@debbugs.gnu.org; Mon, 11 May 2020 16:15:43 -0400 Date: Mon, 11 May 2020 22:15:41 +0200 Message-Id: <87tv0mfcsy.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #41182 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 41182 important quit From debbugs-submit-bounces@debbugs.gnu.org Mon May 11 17:13:15 2020 Received: (at 41182) by debbugs.gnu.org; 11 May 2020 21:13:15 +0000 Received: from localhost ([127.0.0.1]:53482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYFje-0003UW-To for submit@debbugs.gnu.org; Mon, 11 May 2020 17:13:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYFjd-0003UK-EL for 41182@debbugs.gnu.org; Mon, 11 May 2020 17:13:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54064) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYFjY-00065r-6H; Mon, 11 May 2020 17:13:08 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39330 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYFjS-0004yb-E8; Mon, 11 May 2020 17:13:06 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 41182@debbugs.gnu.org Subject: Re: bug#41182: Profile hooks ignore system and target References: <87a72f8qzi.fsf@inria.fr> Date: Mon, 11 May 2020 23:13:00 +0200 In-Reply-To: <87a72f8qzi.fsf@inria.fr> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22\?\= \=\?utf-8\?Q\?'s\?\= message of "Sun, 10 May 2020 22:38:57 +0200") Message-ID: <87k11idvkz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41182 Cc: Mathieu Othacehe , Jan Nieuwenhuizen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Ludovic Court=C3=A8s skribis: > Actually all the profile hooks refer to the native derivation. I=E2=80=99ve looked at it and this problem is surprisingly tricky to addres= s. I=E2=80=99ve tried to address it in an API-compatible way, which meant sett= ing the =E2=80=98%current-system=E2=80=99 and =E2=80=98%current-target-system= =E2=80=99 parameters around the hook calls, but that is ugly, hard to get right (dynamic binding and monadic code really don=E2=80=99t go together well :-/), and actually raises another issue (=E2=80=98mapm/accumulate-builds=E2=80=99 appears to ignore t= he initial dynamic bindings for these two parameters). Hacky patch attached to illustrate. So I=E2=80=99m very much tempted to instead require each hook to take =E2= =80=98system=E2=80=99 and =E2=80=98#:target=E2=80=99 arguments and pass them to =E2=80=98gexp->de= rivation=E2=80=99. It=E2=80=99ll break the API, in case someone out there has custom profile hooks (unlikely given that it=E2=80=99s not really documented), but I=E2=80=99d s= ay that=E2=80=99s OK. Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 59ef5d078b..4f90e9e41d 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3013,9 +3013,10 @@ memoized as a function of '%current-system'." '/memoized)))) #'(begin (define memoized - (mlambda (system) exp)) + (mlambda (system target) exp)) (define-syntax identifier - (identifier-syntax (memoized (%current-system)))))))))) + (identifier-syntax (memoized (%current-system) + (%current-target-system)))))))))) (define/system-dependent linux-libre-headers-boot0 ;; Note: this is wrapped in a thunk to nicely handle circular dependencies diff --git a/guix/profiles.scm b/guix/profiles.scm index 25ff146bdf..58d7e0e450 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1580,6 +1580,18 @@ This is one of the things to do for the result to be relocatable. When TARGET is true, it must be a GNU triplet, and the packages in MANIFEST are cross-built for TARGET." + (define (call-with-system+target system target thunk) + (mlet* %store-monad ((system0 (set-current-system system)) + (target0 (set-current-target (pk 'set-target target))) + (result (thunk))) + (mbegin %store-monad + (set-current-system system0) + (set-current-target target0) + (return result)))) + + (define-syntax-rule (with-system+target system target exp) + (call-with-system+target system target (lambda () exp))) + (mlet* %store-monad ((system (if system (return system) (current-system))) @@ -1592,9 +1604,12 @@ are cross-built for TARGET." #:target target))) (extras (if (null? (manifest-entries manifest)) (return '()) - (mapm/accumulate-builds (lambda (hook) - (hook manifest)) - hooks)))) + (with-system+target + system + target + (mapm/accumulate-builds (lambda (hook) + (hook manifest)) + hooks))))) (define inputs (append (filter-map (lambda (drv) (and (derivation? drv) @@ -1689,6 +1704,8 @@ are cross-built for TARGET." (match profile (($ name manifest hooks locales? allow-collisions? relative-symlinks?) + (pk 'prof-c system target (%current-target-system)) + ;; (display-backtrace (make-stack #t) (current-error-port) #f 80) (profile-derivation manifest #:name name #:hooks hooks diff --git a/guix/store.scm b/guix/store.scm index 6c7c07fd2d..92158bd658 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -1899,7 +1899,10 @@ coalesce them into a single call." (values (map/accumulate-builds store (lambda (obj) (run-with-store store - (mproc obj))) + (mproc obj) + ;; #:system (%current-system) + ;; #:target (%current-target-system) + )) lst) store))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 12 04:35:59 2020 Received: (at 41182) by debbugs.gnu.org; 12 May 2020 08:35:59 +0000 Received: from localhost ([127.0.0.1]:54101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYQON-0004TG-Fa for submit@debbugs.gnu.org; Tue, 12 May 2020 04:35:59 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:53145) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYQOM-0004T3-1s for 41182@debbugs.gnu.org; Tue, 12 May 2020 04:35:58 -0400 Received: by mail-wm1-f41.google.com with SMTP id m24so11162010wml.2 for <41182@debbugs.gnu.org>; Tue, 12 May 2020 01:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=l5sWVA0oGpxBbGwpzgQlc1sNHS+XLooJrDOTCHhS/2c=; b=d5vElUjx3NGxwo5qifGp2pNoYBX2gC7DnuTqK+TVdNRkqIHRtGVGWYI1dQJ7UnUH5H KLcHBogB5GVUE+uZ3PH8Ydaj16SFWpL6W0cUUNFGI7u44kgWTB26+o8BOzZJvJvUj0+E RNp+2H690BaQPdnu1FrMH/bvTnQuZvbTmQ4geeaeUQ+gMT+xkynN3E0OVQr0PZUt6RMI 7/HFTE+4nNQesXazG2TK7D8+tYaPlIxGChAdmBPXXZBcxNYWyKVMfzGdxqyCUIZQav1u BMjxwTlAf3kVJ1IuU8XkcdSAPmXkYqjvdAze55flyvLsbxNa1QRzPXt8FAUQWDtTF0Sq JoEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=l5sWVA0oGpxBbGwpzgQlc1sNHS+XLooJrDOTCHhS/2c=; b=qmOUsJJWhEZxP5N55nmH+3zBWUDiPP3FXD+WvR/EI7fLh908S1Hl22W+fqVEudj1sB MlMuqhcXAlCm+DJsMiwOVhzBThLPOtt64GJblaTjqDTOR68MUmxM0P///uXzWYlbvdx2 iwRQA8ejwGX6GLzObC/ame/Gt8Ztgm0ztPb5ravwmciY2DZC5aPf3A3gPHhpMXl8bUOb U6W2UlrSrg7QHTybbFZ4NZETwMqYvqjeoyYoRl57P/DENVjrDxlwEtzqKTx3xesK3AVv pJNgrRaOFnPR7eLwBhWN0UZyCoVFyNBOMbchyMbOUDQYY9Ee85Lt00MDmLi0+GZW0loD EHlA== X-Gm-Message-State: AGi0PubwmltOIifPJGLUdHkvyRCxoo8m5wnFVw0jzQL0uz6p8XxvqiXW UbNZFECuZZ1rBM+7ohS246M= X-Google-Smtp-Source: APiQypJPj+PvU/T6OlasqhvM1H4V2Nc2xDIZAXNCBmD2w8AnSwv9MuYcSagpCCMUe4/uOwwogQqCnw== X-Received: by 2002:a7b:c253:: with SMTP id b19mr15483175wmj.110.1589272551987; Tue, 12 May 2020 01:35:51 -0700 (PDT) Received: from meru ([2a01:cb18:832e:5f00:fd66:fbb0:b5a6:36b6]) by smtp.gmail.com with ESMTPSA id r11sm10357048wro.15.2020.05.12.01.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 01:35:51 -0700 (PDT) From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#41182: Profile hooks ignore system and target References: <87a72f8qzi.fsf@inria.fr> <87k11idvkz.fsf@gnu.org> Date: Tue, 12 May 2020 10:35:50 +0200 In-Reply-To: <87k11idvkz.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 11 May 2020 23:13:00 +0200") Message-ID: <87ftc5czyx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41182 Cc: 41182@debbugs.gnu.org, Jan Nieuwenhuizen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hey Ludo, > So I=E2=80=99m very much tempted to instead require each hook to take =E2= =80=98system=E2=80=99 > and =E2=80=98#:target=E2=80=99 arguments and pass them to =E2=80=98gexp->= derivation=E2=80=99. It=E2=80=99ll > break the API, in case someone out there has custom profile hooks > (unlikely given that it=E2=80=99s not really documented), but I=E2=80=99d= say that=E2=80=99s OK. > > Thoughts? What seems strange to me is that gexp->derivation has target set to 'current by default, so it should use the defined target. Now, that I look at it, it's using "%current-target-system". Would it make any difference to switch: --8<---------------cut here---------------start------------->8--- (target -> (if (eq? target 'current) (%current-target-system) target)) --8<---------------cut here---------------end--------------->8--- to --8<---------------cut here---------------start------------->8--- (target (if (eq? target 'current) (current-target-system) (return target))) --8<---------------cut here---------------end--------------->8--- like for lower-object, gexp->file and gexp->script? Regarding breaking the profile hooks API, it's fine by me. Thanks for investigating this, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Wed May 13 05:46:06 2020 Received: (at 41182) by debbugs.gnu.org; 13 May 2020 09:46:06 +0000 Received: from localhost ([127.0.0.1]:57404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYnxm-0005G4-8w for submit@debbugs.gnu.org; Wed, 13 May 2020 05:46:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYnxk-0005FJ-6C for 41182@debbugs.gnu.org; Wed, 13 May 2020 05:46:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33182) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYnxe-0001fm-6h; Wed, 13 May 2020 05:45:58 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=59144 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYnxd-0005oc-KG; Wed, 13 May 2020 05:45:58 -0400 From: Jan Nieuwenhuizen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#41182: Profile hooks ignore system and target Organization: AvatarAcademy.nl References: <87a72f8qzi.fsf@inria.fr> <87k11idvkz.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Wed, 13 May 2020 11:45:55 +0200 In-Reply-To: <87k11idvkz.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 11 May 2020 23:13:00 +0200") Message-ID: <875zd0malo.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41182 Cc: 41182@debbugs.gnu.org, Mathieu Othacehe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s writes: Hello! > Ludovic Court=C3=A8s skribis: > >> Actually all the profile hooks refer to the native derivation. > > I=E2=80=99ve looked at it and this problem is surprisingly tricky to addr= ess. Thank you so much for looking into this! > I=E2=80=99ve tried to address it in an API-compatible way, which meant se= tting > the =E2=80=98%current-system=E2=80=99 and =E2=80=98%current-target-system= =E2=80=99 parameters around the > hook calls, but that is ugly, hard to get right (dynamic binding and > monadic code really don=E2=80=99t go together well :-/), and actually rai= ses > another issue (=E2=80=98mapm/accumulate-builds=E2=80=99 appears to ignore= the initial > dynamic bindings for these two parameters). Hacky patch attached to > illustrate. > > So I=E2=80=99m very much tempted to instead require each hook to take =E2= =80=98system=E2=80=99 > and =E2=80=98#:target=E2=80=99 arguments and pass them to =E2=80=98gexp->= derivation=E2=80=99. It=E2=80=99ll > break the API, in case someone out there has custom profile hooks > (unlikely given that it=E2=80=99s not really documented), but I=E2=80=99d= say that=E2=80=99s OK. > > Thoughts? I'm all for breaking the API if that gets us further. How about doing that on the wip-hurd-vm branch, complete building the vm-image with services and when we have found this (and possible next steps) are useful fixes, commit to core-updates? It would be useful to get substitutes for such a change, though -- testing this took all night. Other than that I can offer my observations trying to build a kind of minimal Hurd system using fb120a69a8 services: hurd: Use activation-service, hurd-etc-service. both ./pre-inst-env guix system build --target=3Di586-pc-gnu gnu/system/exam= ples/bare-hurd.tmpl ./pre-inst-env guix system vm-image --target=3Di586-pc-gnu gnu/system/e= xamples/bare-hurd.tmpl still want to build a native Hurd (in my case for x86_64). So, I tried applying what your patch seems to be suggesting: --8<---------------cut here---------------start------------->8--- diff --git a/guix/store.scm b/guix/store.scm index 92158bd658..b27ad0fab3 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -1900,8 +1900,8 @@ coalesce them into a single call." (lambda (obj) (run-with-store store (mproc obj) - ;; #:system (%current-system) - ;; #:target (%current-target-system) + #:system (%current-system) + #:target (%current-target-system) )) lst) store))) --8<---------------cut here---------------end--------------->8--- and with that "system build" succeeds (after a while) but "system vm-image"= says guix system: error: gnu/packages/glib.scm:404:2: gobject-introspection@= 1.62.0: build system `meson' does not support cross builds This could be mostly harmless...still building a full (non-tiny/minimal) qemu or grub maybe? Greetings janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed May 13 06:38:10 2020 Received: (at 41182) by debbugs.gnu.org; 13 May 2020 10:38:10 +0000 Received: from localhost ([127.0.0.1]:57465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYomA-0000J8-9g for submit@debbugs.gnu.org; Wed, 13 May 2020 06:38:10 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:42980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYom6-0000IY-8o for 41182@debbugs.gnu.org; Wed, 13 May 2020 06:38:09 -0400 Received: by mail-wr1-f45.google.com with SMTP id s8so20257983wrt.9 for <41182@debbugs.gnu.org>; Wed, 13 May 2020 03:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=NdaYDrKvzCM62G+v1zp8/fS7Y8RoKWb+czgyKqr2AJs=; b=WR2XXr5eGPk2s3X3OSkw+QeVDEc+LBAIEc0jzoy50Y4l//yZEhD2kEr3fay6fdmAjP d1XSQcg15g+PdI1gk4p4L4RImPLBClA390YhgoK8fV1LxFdY2WuPHfvsc/+lS/SnmLvb JvVhxQ9xykH6c+NXK9Tw3QXXJQsW/gB3dph9YpSCZA6sSUp9xVlovUG75CRU7wIuyVqu A9qNzNlMyZphmi1SiD3pRCoaV6LbzMBNmmVGCNViD3FsO/dW77cvMghL7Y0TVEnrUsLJ xtEPqoZ666uW9X9bM7W8mRP+iKyBlF8KC+s+NqsPdc/1aENKWxdlYdCG599WHylfOogO Zetg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=NdaYDrKvzCM62G+v1zp8/fS7Y8RoKWb+czgyKqr2AJs=; b=KQigwMc8mnBvzLKci4nj5eKUwJ6TwdcECvFpwajHUmEGS5fBpgjtWEKg4L0+LHEZc3 /lLc7918rK26DNG/YLRUChxDA3+VOwNjZZBcR9UrrBlFDRae1Ajb+xnTCh4g4QKDJSoC dVuI2Z9DiQjgiwQGBGhRg9+99uuJPcHYKKBDuLn7MHy8RjyxEXVcSGCp1sByn/SCZPU5 xOE+1iD2OLbxSDiwsqLW9nOd22wPp27JzOkt+NssL7IhhersVYXUWcGbWMkN4IVit3md L4LeWleKBkiHaliBJ3Gse1rI67cN4wYoBF6/tDZ8QUbmSl1PgsMl6xUxhMJlWhtOuyYL eKew== X-Gm-Message-State: AGi0PuZV9ZuBNneWEOa/NSC9u54Cl3vsu3r8XizBP19JCHNCkG5XTsmV /npnZv+oxeoOKHPAC2QaqohCHr/q X-Google-Smtp-Source: APiQypKSuHS8uQ9qfJD+fXF5LN+7opnCm7pDQXcoCbrhfL/kuJVey5nttzPcZAs1VbD3h8VWLe8oww== X-Received: by 2002:adf:f3cc:: with SMTP id g12mr18572266wrp.427.1589366280089; Wed, 13 May 2020 03:38:00 -0700 (PDT) Received: from meru ([2a01:cb18:832e:5f00:7499:6e2e:99e3:10a4]) by smtp.gmail.com with ESMTPSA id 94sm12443151wrf.74.2020.05.13.03.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 03:37:59 -0700 (PDT) From: Mathieu Othacehe To: Jan Nieuwenhuizen Subject: Re: bug#41182: Profile hooks ignore system and target References: <87a72f8qzi.fsf@inria.fr> <87k11idvkz.fsf@gnu.org> <875zd0malo.fsf@gnu.org> Date: Wed, 13 May 2020 12:37:58 +0200 In-Reply-To: <875zd0malo.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Wed, 13 May 2020 11:45:55 +0200") Message-ID: <87tv0k86ih.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41182 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 41182@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Jan, > and with that "system build" succeeds (after a while) but "system vm-image" says > > guix system: error: gnu/packages/glib.scm:404:2: gobject-introspection@1.62.0: build system `meson' does not support cross builds > > This could be mostly harmless...still building a full (non-tiny/minimal) > qemu or grub maybe? I remember fixing a very similar issue with d4ddf22d54f9374715c651aaebda2315e9f89272. The issue was cross-building QEMU does not work, because it's dragging packages built with meson-build-system. Turns out we want to use a native build of QEMU here, so I replaced #$qemu by #+qemu. Now there must be a similar issue somewhere. I'm building your branch to see if I can figure it out. Thanks for sharing your progress! Mathieu From debbugs-submit-bounces@debbugs.gnu.org Thu May 14 08:24:20 2020 Received: (at 41182) by debbugs.gnu.org; 14 May 2020 12:24:20 +0000 Received: from localhost ([127.0.0.1]:60566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZCuM-0007c5-Sc for submit@debbugs.gnu.org; Thu, 14 May 2020 08:24:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZCuM-0007br-0N for 41182@debbugs.gnu.org; Thu, 14 May 2020 08:24:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59700) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZCuG-0003eG-P2; Thu, 14 May 2020 08:24:08 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=47370 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jZCuG-000129-5N; Thu, 14 May 2020 08:24:08 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 41182@debbugs.gnu.org Subject: Re: bug#41182: Profile hooks ignore system and target References: <87a72f8qzi.fsf@inria.fr> <87k11idvkz.fsf@gnu.org> Date: Thu, 14 May 2020 14:24:06 +0200 In-Reply-To: <87k11idvkz.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 11 May 2020 23:13:00 +0200") Message-ID: <87pnb6vh5l.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 41182 Cc: Mathieu Othacehe , Jan Nieuwenhuizen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) Hi, Ludovic Court=C3=A8s skribis: > I=E2=80=99ve tried to address it in an API-compatible way, which meant se= tting > the =E2=80=98%current-system=E2=80=99 and =E2=80=98%current-target-system= =E2=80=99 parameters around the > hook calls, but that is ugly, hard to get right (dynamic binding and > monadic code really don=E2=80=99t go together well :-/), and actually rai= ses > another issue (=E2=80=98mapm/accumulate-builds=E2=80=99 appears to ignore= the initial > dynamic bindings for these two parameters). Hacky patch attached to > illustrate. I was able to boil this second sub-problem down to a simple case: --8<---------------cut here---------------start------------->8--- $ cat /tmp/t.scm (use-modules (guix) (guix grafts) (gnu packages idutils)) (define target (getenv "REAL_TARGET")) (%graft? #f) (with-store s (parameterize ((%current-target-system (getenv "TARGET"))) (pk (if target (package-cross-derivation s idutils target) (package-derivation s idutils))))) $ REAL_TARGET=3Darm-linux-gnueabihf ./pre-inst-env guile /tmp/t.scm=20 ;;; (# /gnu/store/6kq4ick0jljrfjnhw0v2yghr8nalhrqi-idutils-4.6 7f0867c0de1= 0>) $ TARGET=3Darm-linux-gnueabihf REAL_TARGET=3Darm-linux-gnueabihf ./pre-inst= -env guile /tmp/t.scm=20 ;;; (# /gnu/store/v4rgm5yhyx5ir3622hhxcaz3a10flcyr-idutils-4.6 7f7a4b1010a= 0>) --8<---------------cut here---------------end--------------->8--- IOW, the initial value of =E2=80=98%current-target-system=E2=80=99 leads us= to pick ld-wrapper -> guile -> bdw-gc -> libatomic-ops in the second case, which is wrong and due to this conditional in libgc=E2=80=99s inputs: (propagated-inputs (if (%current-target-system) ;; The build system refuses to check for compiler intrinsics when ;; cross-compiling, and demands using libatomic-ops instead. `(("libatomic-ops" ,libatomic-ops)) '())) As it turns out, =E2=80=98guix pack=E2=80=99 and =E2=80=98guix system=E2=80= =99 are the only programs that set =E2=80=98%current-target-system=E2=80=99 at the top level, via =E2=80=98run-with-store=E2=80=99. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu May 14 11:23:36 2020 Received: (at 41182-done) by debbugs.gnu.org; 14 May 2020 15:23:36 +0000 Received: from localhost ([127.0.0.1]:34492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZFhw-0004zv-03 for submit@debbugs.gnu.org; Thu, 14 May 2020 11:23:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZFhv-0004zg-22 for 41182-done@debbugs.gnu.org; Thu, 14 May 2020 11:23:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35399) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZFhp-0001PN-Q4; Thu, 14 May 2020 11:23:29 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=34880 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jZFho-00044z-U2; Thu, 14 May 2020 11:23:29 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 41182-done@debbugs.gnu.org Subject: Re: bug#41182: Profile hooks ignore system and target References: <87a72f8qzi.fsf@inria.fr> <87k11idvkz.fsf@gnu.org> <87pnb6vh5l.fsf@gnu.org> Date: Thu, 14 May 2020 17:23:26 +0200 In-Reply-To: <87pnb6vh5l.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 14 May 2020 14:24:06 +0200") Message-ID: <871rnmv8up.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41182-done Cc: Mathieu Othacehe , Jan Nieuwenhuizen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alright, fixed! 80963744a2 store: 'mapm/accumulate-builds' preserves '%current-target-sys= tem'. f52fbf7094 packages: Ensure bags are insensitive to '%current-target-syst= em'. Ludo=E2=80=99. From unknown Sun Jun 22 04:11:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 12 Jun 2020 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator