From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id d8aUOVo6vV5rVAAA0tVLHw (envelope-from ) for ; Thu, 14 May 2020 12:32:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wAaSM1o6vV5gaQAAbx9fmQ (envelope-from ) for ; Thu, 14 May 2020 12:32:26 +0000 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 2FD84940B0F for ; Thu, 14 May 2020 12:32:24 +0000 (UTC) Received: from localhost ([::1]:52262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZD2G-000606-QH for larch@yhetil.org; Thu, 14 May 2020 08:32:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZCv9-0004bF-9i for bug-guix@gnu.org; Thu, 14 May 2020 08:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZCv8-0003kV-TQ for bug-guix@gnu.org; Thu, 14 May 2020 08:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZCv8-0007di-Ly for bug-guix@gnu.org; Thu, 14 May 2020 08:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41182: Profile hooks ignore system and target Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 14 May 2020 12:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41182 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 41182@debbugs.gnu.org Received: via spool by 41182-submit@debbugs.gnu.org id=B41182.158945906029279 (code B ref 41182); Thu, 14 May 2020 12:25:02 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.8 (--) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Othacehe Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 X-Spam-Score: 0.49 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Scan-Result: default: False [0.49 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.53878416876054]; MX_INVALID(1.00)[cached]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.05), country: US(-0.00), ip: 209.51.188.17(-0.54)]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[ludo@gnu.org,bug-guix-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[gnu.org:email]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[gnu.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[209.51.188.17:from]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_COUNT_SEVEN(0.00)[9]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: DifyC0BK0TX2 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.