From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UBHtFWlO8GC8MQAAgWs5BA (envelope-from ) for ; Thu, 15 Jul 2021 17:04:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id IH2tD2lO8GDqeAAA1q6Kng (envelope-from ) for ; Thu, 15 Jul 2021 15:04:09 +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 AB43710AD4 for ; Thu, 15 Jul 2021 17:04:08 +0200 (CEST) Received: from localhost ([::1]:46690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m42uF-0006wL-ME for larch@yhetil.org; Thu, 15 Jul 2021 11:04:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m42uA-0006wB-7r for guix-patches@gnu.org; Thu, 15 Jul 2021 11:04:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37864) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m42u9-00037s-Mt for guix-patches@gnu.org; Thu, 15 Jul 2021 11:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m42u9-00029E-Kj for guix-patches@gnu.org; Thu, 15 Jul 2021 11:04:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49565] [PATCH] gnu: glibc-headers-mesboot: Use %build-inputs in setenv phase Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 Jul 2021 15:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49565 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49565@debbugs.gnu.org, Maxime Devos Received: via spool by 49565-submit@debbugs.gnu.org id=B49565.16263614338242 (code B ref 49565); Thu, 15 Jul 2021 15:04:01 +0000 Received: (at 49565) by debbugs.gnu.org; 15 Jul 2021 15:03:53 +0000 Received: from localhost ([127.0.0.1]:49410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m42u1-00028s-8b for submit@debbugs.gnu.org; Thu, 15 Jul 2021 11:03:53 -0400 Received: from mx.kolabnow.com ([95.128.36.40]:43238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m42tz-00028e-3z for 49565@debbugs.gnu.org; Thu, 15 Jul 2021 11:03:52 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id CFF2A40D65; Thu, 15 Jul 2021 17:03:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1626361424; x=1628175825; bh=VifWItV/AekpBDCRy18HUcFrnlO9eYBgqfJ I/D4noyY=; b=4ShIo6Bt3CcoMOt00FIaFMnSMc48GqahO9XbekmYHzdt2pevPzL fFtQYMW6fno9QAWwoZ97v5FS+9mtH6x7UqHhqpXFuWM+rYPU0A2cYysGRCBbdkjP 5tui4j4oTxu3C0mYQU4yyu2pvAx3F6S+a7LJShV09SMWKXqa1QuOwAveXFmAkzMB /yu+LEIPAsRL9uAx+nb9kXIRWgboqnHFvXsmeGyhpC9wsm+h35fMyjQ1Z49CnGxh LfAJmeXsXFQ8aor6GIvra+5/mgMkm/royhE06TqbbYuzIhKFb+omGRBoy1c6nUxg q7Lwb6K7TN7X6BRRykAkElm5+wysdpxwXpTOVOEJytCQmKTK23HSlE3toqBrBxPS y7B8v9R9HNsZAQCcX6R0TJ1ij/DkdiParPsJCmFGhgfl5lZmgvX8hweexqfj0f0g t6WTvzo5ObDi3X6mdUuKz/sIfkRfhzu5IoU/t3t2EUoTuUKsRBliEpBg7AnU8ab/ KOnsNWq0amk+kaSBoirew5Yv/VO/Kgu7AHCEievrzet0l9pS54066bhidpdagqqn QwAuqOnWDfpzAFysnNid4JAKhWYb5lPwa+gTiGWwBMTUFXXybPeRhdqiRVuCoFve Bkg0kzzDkWzyrof2X6qxjCIpE6+EocaC4gjUVvhJisVils/uPaRM045A= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xjaMnr46kfhg; Thu, 15 Jul 2021 17:03:44 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id E8898407D0; Thu, 15 Jul 2021 17:03:43 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 9F4AA2E49; Thu, 15 Jul 2021 17:03:42 +0200 (CEST) Date: Thu, 15 Jul 2021 12:03:36 -0300 Message-ID: <4491449.dtmGtMj3lj@popigai> In-Reply-To: <0eac02a304064759c0bbe37f91ece93ebd6f0994.camel@telenet.be> References: <20210715004613.763843-1-bauermann@kolabnow.com> <0eac02a304064759c0bbe37f91ece93ebd6f0994.camel@telenet.be> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626361449; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=VifWItV/AekpBDCRy18HUcFrnlO9eYBgqfJI/D4noyY=; b=cV3ZGbQvfZWy9lqwS54JozueTKF+Qh+2nm+BIKRJvW1JbS6BmNBUA5u2/2hoEOc4oF7dYV XAtqxLLSMfZoClAWquRpO/eDiO9acycsutubOLWJYEMxzXu/IJPa7S25Mvpj9zEy6InwGu RykuvFbMQaS7+q7PMa5NO/KfV94hddrOmO7JPkdbus2+ScZnhjbdM43DUXvz/SZoTBIPaA vGsqiQydWgbPfrIPeeKbhSk8dwjGoXBtzLaQbkOOyCnbDNWHrYiPVrvM4MU0OL8sFo17kR MvMStInFGEIVlGah6oyfdP9Iw0A7aGR0vI+zhkjnv6WeWIlzO+lh0TevrQk/KA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626361449; a=rsa-sha256; cv=none; b=qMdJ5sGRygzM0dRhqlB1RQjbvySJTVjVldJx0YAJrZVINYIF6LnG3BddRXYfIO22RhCiRO LCf+moIbcyv0jyctvGq+W8YO8DhGdaUhBoccVKqb85VPQb7tsXl5Z7xPT6eoiuKVWLIdVy VVXyo1LMqIgeoS1AfwEsVTaNzM3TD1Ib6f6L45IHFRXew4hYyjszTne1oQlAFh20lYUhg5 dijnQEQNq7ecewMBY1P39KzqjqlRNJy8vFyHMUiUhdydAKpjgjKqjbyMkppEg3xA0q5Pch r85tHPYcFJwkQtBvwgqJTWcoiPFnysGjB3iHC9NzpX2NqDGyGlPMevXBuzgiqA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=4ShIo6Bt; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=4ShIo6Bt; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: AB43710AD4 X-Spam-Score: -2.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: ErkTWPrzdx8P Hello Maxime, Thanks for your help. Em quinta-feira, 15 de julho de 2021, =C3=A0s 09:58:54 -03, Maxime Devos=20 escreveu: > Thiago Jung Bauermann via Guix-patches via schreef op wo 14-07-2021 om=20 21:46 [-0300]: > > When cross-building from x86-64-linux to powerpc64le-linux, > > (assoc-ref inputs "libc") returns #f so get it from %build-inputs > > instead. > >=20 > > For consistency, do the same for the other inputs as well. > >=20 > > * gnu/packages/commencement.scm (glibc-headers-mesboot)[arguments]: Get > > packages from =E2=80=98%build-inputs=E2=80=99 rather than =E2=80=98inpu= ts=E2=80=99. > > --- > >=20 > > gnu/packages/commencement.scm | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > >=20 > > When running > >=20 > > ``` > > $ ./pre-inst-env guix build \ > >=20 > > --target=3Dpowerpc64le-linux-gnu.gcc \ > > gcc-toolchain@11 > >=20 > > ``` >=20 > To be clear: are you trying to cross-compile GCC > (that will be run on powerpc64le and produce binaries > for powerpc64le) or are you trying to build a cross-compiler > (that will be run on x86_64 and produce binaries for powerpc64le)? >=20 > This command does the former. That=E2=80=99s a great question. I hadn=E2=80=99t noticed this subtlety. Wh= at I=E2=80=99m actually=20 trying to do is reproduce this CI failure on core-updates: https://ci.guix.gnu.org/build/667452/details Looking at the log file, I see this: ``` make[2]: Entering directory '/tmp/guix-build-gcc-11.1.0.drv-0/build/gcc' configure: creating cache ./config.cache checking build system type... x86_64-unknown-linux-gnu checking host system type... powerpc64le-unknown-linux-gnu checking target system type... powerpc64le-unknown-linux-gnu ``` So by luck I=E2=80=99m doing what I needed to do, which is cross-compile a = GCC for=20 a powerpc64le host and powerpc64le target. > > on current core-updates branch (commit 8456581375cf), I get the >=20 > > following error during the build of glibc-mesboot-2.16: > Why is 'glibc-mesboot-2.16' being cross-compiled here? > Mesboot currently only supported i686-linux and x86_64-linux and > not powerpc64le-linux (at least the version currently in Guix). I don=E2=80=99t know why my system tried to build it. Perhaps because of th= e bogus=20 target string. When I used the correct one I had to use the `guix build -e= =20 (@@ =E2=80=A6)` trick to force the build again. I=E2=80=99ll try again to b= e sure, but if=20 that is the case then this patch can be dropped. > > I deduced that this is because `(assoc-ref inputs "libc")` is returning > > #f. And indeed, changing the code to look in %build-inputs instead > > fixes the issue. I also noticed that most other places which look for > > a "libc" package do so in %build-inputs rather than in inputs. > >=20 > > Just changing the line for "libc" is enough to fix the build but for > > consistency, also change the other variables as well. >=20 > Normally, looking up inputs in 'inputs' is the right thing, > but 'libc' is special. Looking at 'standard-cross-packages', > it seems like when cross-compiling, "libc" is renamed to "cross-libc", > for no apparent reason. Maybe it can be renamed back to "libc"? >=20 > That could simplify some code, e.g. in qtbase-5: >=20 > (let ((glibc (assoc-ref inputs ,(if (%current-target-system) > "cross-libc" "libc")))) >=20 > would become: >=20 > (let ((glibc (assoc-ref inputs "cross-libc"))) >=20 > If I search with git grep '"cross-libc" "libc", I find 5 such examples. Sorry, I don=E2=80=99t know about that but I can poke around to see if I ca= n find=20 something out. > Are you sure your usage of (assoc-ref %build-inputs "libc") is correct > here? I=E2=80=99m not, to be honest. I=E2=80=99m still familiarizing myself with = gexps. > As "libc" currently doesn't exist in 'inputs', that means "libc" > is searched for in 'native-inputs', which is probably not what you want, > given that you are cross-compiling? Are you saying that =E2=80=98%build-inputs=E2=80=99 is the union of =E2=80= =98inputs=E2=80=99 and =E2=80=98native- inputs=E2=80=99? For my own education, do you know where that happens? The manual and the doc string for =E2=80=98build-expression->derivation=E2= =80=99 only=20 mention that it comes from =E2=80=98inputs=E2=80=99. I can send a patch to = correct them. =2D-=20 Thanks, Thiago