From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 MGviJzHLWWNoKQEAbAwnHQ (envelope-from ) for ; Thu, 27 Oct 2022 02:05:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IBMFJzHLWWP+HAAAG6o9tA (envelope-from ) for ; Thu, 27 Oct 2022 02:05:05 +0200 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 296813BC9E for ; Thu, 27 Oct 2022 02:05:05 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onqMS-0002Gg-LX; Wed, 26 Oct 2022 20:03:04 -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 1onqMQ-0001zf-L3 for guix-patches@gnu.org; Wed, 26 Oct 2022 20:03:02 -0400 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 1onqMQ-00031a-DT for guix-patches@gnu.org; Wed, 26 Oct 2022 20:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1onqMP-0004Ro-Uj for guix-patches@gnu.org; Wed, 26 Oct 2022 20:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58576] [PATCH] system: image: Define correct docker image arch when cross building Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 27 Oct 2022 00:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58576 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: Thiago Jung Bauermann , 58576@debbugs.gnu.org Received: via spool by 58576-submit@debbugs.gnu.org id=B58576.166682897117080 (code B ref 58576); Thu, 27 Oct 2022 00:03:01 +0000 Received: (at 58576) by debbugs.gnu.org; 27 Oct 2022 00:02:51 +0000 Received: from localhost ([127.0.0.1]:55552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onqMF-0004RP-Cg for submit@debbugs.gnu.org; Wed, 26 Oct 2022 20:02:51 -0400 Received: from mx.kolabnow.com ([212.103.80.154]:49348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onqMC-0004RB-QS for 58576@debbugs.gnu.org; Wed, 26 Oct 2022 20:02:50 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 1746619EB; Thu, 27 Oct 2022 02:02:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:in-reply-to:date:date:subject:subject:from:from :references:received:received:received; s=dkim20160331; t= 1666828962; x=1668643363; bh=IpZbI58Qs1VPpEjFQJZm6INeclhhKaft+QF nbqn6jTY=; b=xUkaWuB4iSVn7KckK5G0zn3rtijScJel6XUH1c93Yb3jTWtn1aA qGS2QVRXpWESCXdW7YBJq8B8gpQAUvM50k+xxJcfW6Is0UfzfSEGGjP0hV/ZmvGH rkm61wvXuFxXmpmIUEFiFxZA0WYvpewuDgkGojf75ytZhi98upanO/dz2iT0xEZG u2iEkp0B4UC6LG2YjlX/6UoADz6GBwN+g9gysyecfm4bSDKU9Gny+AsCp5H0yWVU 1AN5phGYyx9a5+ERkGzbiH4p3POop4MyWKO3zJBLLn7SSv3nYY0AWOKW1vJE5lNz SvwotVxD04IM25ZaK2LrvpyHdc3FxwoBR/IpCvO2jardn2gIai+cX7GRX24qVyQ/ h1bQrmoScNZWem8FPGsjB06SSHrEb9Lk6PUCOQgCGVytV8J1RXh29uqDX2+e1tE/ MUrslyzA13OiUHA6wwPNPGz26nnPf5P0Wkt/QoP4yP6BpRjVERo3fKDHiuFE0Mrs 7h22QzJ0NlokDgfZ/bawcLAvLxQpRsH8ju9RbFMxWFg7pZl7O7RwmRO0W2pu7Qwb OyzNp4s9chVNIXwwdMJmkGdxX0GGS8yaJkmlDyuXQ4vJxJ3HX4WZrgnq/91IReLX FXQWgEB9AJS1ThedTJL5oflmCCQU+bPHj1CiE15uTC44PTHZYDsMoLPs= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NxiBQCwDGg-4; Thu, 27 Oct 2022 02:02:42 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by mx.kolabnow.com (Postfix) with ESMTPS id AF30414FA; Thu, 27 Oct 2022 02:02:41 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 54D3981F; Thu, 27 Oct 2022 02:02:41 +0200 (CEST) References: <20221017012843.29975-1-bauermann@kolabnow.com> <87pmeqnaus.fsf@gnu.org> Date: Wed, 26 Oct 2022 20:47:15 -0300 In-reply-to: <87pmeqnaus.fsf@gnu.org> Message-ID: <87tu3qgmlg.fsf@kolabnow.com> 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: List-Help: List-Subscribe: , 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 Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666829105; h=from:from:sender:sender:reply-to: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=IpZbI58Qs1VPpEjFQJZm6INeclhhKaft+QFnbqn6jTY=; b=cLn0VS0RxyjNe1wOUzVPpWuP2aqZ99aDTiFQVrmrrqBWJhvS2SgFw52HC+KfxyGiMQozL+ jfB0KlaSyXRcNBm7ks2y2usHrXuNoP+v00uE6nmWm38ntj8kdjOA1lBLafrktTd3V1eYs7 zOTsu/LA7dVG0eJ1bJJp5TyD4wV8C6ZHxTdOzApNpHfUhPLrwEbODhu9IqYn8ZPK3EQJql jRtgPRj6cey8sakgHTzv3u0xqFSxKTDg7QXWQzUo+t92lJT/KPi4g6GrzODH0kvaOP2Q3a KJnKdj3T00pKCufVgue2VPS+KZ3fBtcfbPPaTQSahxq03hFaMX+p6nWzfMmBkQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666829105; a=rsa-sha256; cv=none; b=LV3haoHnx5rPamktX6qfXMgOnEJz4j6XZYe5PcoKDsi5B6fEAlyoi0LKXQWWvczkjmAWeB 1pHHr/lJ/dSAxTK/l/WtTGZb2NpLydumIEIQHUbLxFgDvUvzoTgJfQRkJJey6qlOigNeGZ 6fwjL45GfhKBn0OX/ZsluD72xB6BeeY7TCS6CruQi4Pdnnz/k+Y6Vdk46OdQc+c4hS4uRn lLHJAi5y74oNyAed1pMMcI88Qb8E6b5B5OpiSjSUOVifVZaQO+tpteIAhGT1YVydiMxWdi WerEruuVwAZNRf33twQ/gu6Yg9WppC/8518OmTqhkVyrD4IfX9Z4wgxBWRKXkA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=xUkaWuB4; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -1.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=xUkaWuB4; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 296813BC9E X-Spam-Score: -1.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: gChouPti2ZyU Hello Mathieu, Thank you for reviewing my patch! Sorry for the delay, I've been traveling. Mathieu Othacehe writes: > Hello Thiago, > > Thanks for this patch! > >> + (image-target (or (%current-target-system) >> + (and=3D> (image-platform image) platform-tar= get) >> + (nix-system->gnu-triplet))) > > There's the following snippet in "system-image" that is trying to do the > right thing (and it is not easy) with the "target" value. > > ;; The image platform definition may provide the appropriate "system" > ;; architecture for the image. If we are already running on this syste= m, > ;; the image can be built natively. If we are running on a different > ;; system, then we need to cross-compile, using the "target" provided b= y the > ;; image definition. > (define system (and=3D> platform platform-system)) > (define target (cond > ;; No defined platform, let's use the user defined > ;; system/target parameters. > ((not platform) > (%current-target-system)) > ;; The current system is the same as the platform syste= m, no > ;; need to cross-compile. > ((and system > (string=3D? system (%current-system))) > #f) > ;; If there is a user defined target let's override the > ;; platform target. Otherwise, we can cross-compile to = the > ;; platform target. > (else > (or (%current-target-system) > (and=3D> platform platform-target))))) > > The rationale is that the user supplied %current-target-system is always > overriding the image platform field. Then, %current-target-system is set > to the "target" value defined above. > > It makes me think that you could use %current-target-system directly as > the "image-target" value. WDYT? I don't think =E2=80=9C%current-target-system=E2=80=9D can be used directly= as the =E2=80=9Cimage-target=E2=80=9D value because for native builds it will be #= f and my understanding is that =E2=80=9Cbuild-docker-image=E2=80=9D would throw an e= rror when receiving #f for the =E2=80=9C#:system=E2=80=9D argument. So I still need the or expression above, but I can drop the middle expression that calls =E2=80=9Cplatform-target=E2=80=9D because it's redund= ant with the snippet you posted above. Thank you for pointing it out. I'll send a v2 with the change. --=20 Thanks Thiago