From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 0GZuLe+2Mma3hQEAe85BDQ:P1 (envelope-from ) for ; Wed, 01 May 2024 23:41:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 0GZuLe+2Mma3hQEAe85BDQ (envelope-from ) for ; Wed, 01 May 2024 23:41:03 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=dTixssOH; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714599663; a=rsa-sha256; cv=none; b=sIWN36tIUIlEiFxkdRgVMc71cj8LKUiFesJGgtg57c9GHdDAp964wrwZRIwxJ3159RBhtJ dWhQcbO3qvzk+eEbGjQFH1wcS4s92wBeOeqoDArKzENPoUkBpaICDVDhGRudw8bHVwoNEB r9HkmWxEoFkrATtPeVemyR9DgVGb7xm4vmS2lmd5Y2YYFyuhGc4fVUtCCUKmS36fsOBwQa CXd5Hu2WCnN3GJ67dIIb+l+umyuA/BoPkCTmfY/cefojGX2EXVME7fqAc1zdOHzCkBDGQ/ aq5KaBZKrC+hhhab2sJn2MZn3YoqtMhiz7oi+bfeJvdSRwoOuvZOLXAXeLL2+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=dTixssOH; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714599663; 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: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=PKTJuTUWxkH1yaMMlZ+oMbsulqQ7RHSARVY7zE5+BHQ=; b=axy08SLstpyBe0xzTk2QIjGlvUMYHoEU2QO4k1aCnBGZidVIG9J3V2dw8Lf0WrdKkcut98 kDrNy0jxZnSC5xW48cPSzBriwxcT19NcZol8Q+Jos5CIKIOOIkZjxT6Wr9sLpVFYnsBrND QSFq47+4k8CcE1S75qnqUhXGHlS/wtxrX1gFDolqGjX7e82veDT6RFGyniB6tiJNlu3izF NtuyGGSwboGSBbc/d4fXVhsrVRmQvSPsJPCjBcyXFz0Z8E3EAsdfQt0PWd3EcTU86b/m0N Z6oBSSFj9NomlZ5sN/P9XU6VDFYFi9O5zMmcJDTRgYDUDWXCun2z6IrK0aRlmA== 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 53A021B3D6 for ; Wed, 1 May 2024 23:41:03 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2Hgw-0008Gp-DS; Wed, 01 May 2024 17:40:42 -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 1s2Hgv-0008GR-7L for bug-guix@gnu.org; Wed, 01 May 2024 17:40:41 -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 1s2Hgu-0001gq-Uv for bug-guix@gnu.org; Wed, 01 May 2024 17:40:40 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s2HhG-0001Ec-4k for bug-guix@gnu.org; Wed, 01 May 2024 17:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#66866: Grafting breaks cross-compilation Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 01 May 2024 21:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66866 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: dan Cc: David Elsing , dev@jpoiret.xyz, Philip McGrath , Mathieu Othacehe , efraim@flashner.co.il, 66866@debbugs.gnu.org, 70492@debbugs.gnu.org, janneke@gnu.org Received: via spool by 66866-submit@debbugs.gnu.org id=B66866.17145996084696 (code B ref 66866); Wed, 01 May 2024 21:41:02 +0000 Received: (at 66866) by debbugs.gnu.org; 1 May 2024 21:40:08 +0000 Received: from localhost ([127.0.0.1]:39599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2HgO-0001Db-1C for submit@debbugs.gnu.org; Wed, 01 May 2024 17:40:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2HgK-0001D2-UZ; Wed, 01 May 2024 17:40:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2Hfs-0001IY-Ky; Wed, 01 May 2024 17:39:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=PKTJuTUWxkH1yaMMlZ+oMbsulqQ7RHSARVY7zE5+BHQ=; b=dTixssOHGGxuezOc38/1 Dz8N/Jgb5ZzwZ9DpXtVZmQcAFnV9pAXMEelzxCV4ZrJjCtcKJAhD8zYG9uL7sKGJ+/DepQ9/FfrD1 ++8A9YwZkdIXMxHGf0f8mQ8e7iYDueSP8hpt3olrUOQeRNC52VDibw293AkktLsdhurwWVVPx7ENe 757FT6oLkq6jWMV+7SmboAg7LbXZ2gNeXs44GKHnE5vehOKJAaaPAitKcKI3DkvxOvjhveWNixyNU yzUyD2MXMUixhd4zErDy+wqCRm0dgWuibiFCuv0Gokp1LkvGcpmqmB/CF+LTmfnwClgJRKZ/CcV2t l+VEUa0kpPLBmw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <87frwn308k.fsf@dan.games> (dan's message of "Tue, 19 Mar 2024 01:30:31 +0800") References: <87ttnh5b4g.fsf@gnu.org> <86h6ien6bg.fsf@posteo.net> <87frwn308k.fsf@dan.games> Date: Wed, 01 May 2024 23:39:32 +0200 Message-ID: <8734r143fv.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 53A021B3D6 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.09 X-Spam-Score: -7.09 X-TUID: dudtMU8U0piu --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, dan skribis: > I spent some time digging into the rabbit hole. After changing=20 > the lower function of the copy-build-system to look more like the=20 > lower function of the gnu-build-system, I'm able to cross compile=20 > alsa-lib without the --no-grafts flag. The changes I made are=20 > like: > > diff --git a/guix/build-system/copy.scm=20 > b/guix/build-system/copy.scm > index d58931b33c..74304b4bfb 100644 > --- a/guix/build-system/copy.scm > +++ b/guix/build-system/copy.scm > @@ -66,13 +66,13 @@ (define* (lower name > (bag > (name name) > (system system) > - (host-inputs `(,@(if source > + (build-inputs `(,@(if source > `(("source" ,source)) > '()) > - ,@inputs > + ,@native-inputs > ;; Keep the standard inputs of=20 > 'gnu-build-system'. > ,@(standard-packages))) > - (build-inputs native-inputs) > + (host-inputs inputs) > (outputs outputs) > (build copy-build) > (arguments (strip-keyword-arguments private-keywords=20 > arguments)))) > > Can we put everything inside build-inputs? From my understanding,=20 > copy-build-system shouldn't care about cross-compilation at all. Intuitively, if =E2=80=98copy-build-system=E2=80=99 is about copying architecture-independent files, then it should do the same thing whether or not we are cross-compiling. However, users can and do add phases whose result is architecture-dependent. Small sample: =E2=80=A2 =E2=80=98desec-certbot-hook=E2=80=99 captures a reference to cu= rl, so it would get the wrong one when cross-compiling if we assumed build-inputs =3D host-inputs. =E2=80=A2 =E2=80=98chez-scheme-for-racket-bootstrap-bootfiles=E2=80=99 bu= ilds stuff when cross-compiling. Philip, could you explain the intent and what you expect here? So it would seem we can=E2=80=99t just assume everything is a native input = like https://issues.guix.gnu.org/70492 does. Now, as David and you found out, the use of inputs in build-system/copy.scm:lower is bogus. It seems that it can be fixed by following the intended definition of build/host inputs, as David suggested: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/build-system/copy.scm b/guix/build-system/copy.scm index d58931b33c2..cf0214320bf 100644 --- a/guix/build-system/copy.scm +++ b/guix/build-system/copy.scm @@ -66,13 +66,13 @@ (define* (lower name (bag (name name) (system system) - (host-inputs `(,@(if source + (build-inputs `(,@(if source `(("source" ,source)) '()) - ,@inputs - ;; Keep the standard inputs of 'gnu-build-system'. - ,@(standard-packages))) - (build-inputs native-inputs) + ,@native-inputs + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (host-inputs inputs) (outputs outputs) (build copy-build) (arguments (strip-keyword-arguments private-keywords arguments)))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable But wait! That=E2=80=99s all theoretical because the bag always has (target= #f) and =E2=80=98copy-build=E2=80=99 bundles build and host inputs together, as= if doing a native build. So it seems like https://issues.guix.gnu.org/70492 (putting everything in =E2=80=98build-inputs=E2=80=99) is OK, after all. But still, there seem to be some expectation that =E2=80=98copy-build-syste= m=E2=80=99 can support cross-compilation for real, so maybe we should add a =E2=80=98copy-cross-build=E2=80=99 procedure in addition to the patch above. Thoughts? Ludo=E2=80=99. --=-=-=--