From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yL6mGCWwTGOuCwAAbAwnHQ (envelope-from ) for ; Mon, 17 Oct 2022 03:30:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aFTqFyWwTGPxEgEAG6o9tA (envelope-from ) for ; Mon, 17 Oct 2022 03:30:13 +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 F292435B37 for ; Mon, 17 Oct 2022 03:30:12 +0200 (CEST) Received: from localhost ([::1]:56448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okExH-0005MD-Rt for larch@yhetil.org; Sun, 16 Oct 2022 21:30:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okEx8-0005Lu-JF for guix-patches@gnu.org; Sun, 16 Oct 2022 21:30:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47533) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okEx8-0000fu-Ap for guix-patches@gnu.org; Sun, 16 Oct 2022 21:30:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1okEx8-0004za-5F for guix-patches@gnu.org; Sun, 16 Oct 2022 21:30:02 -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: Mon, 17 Oct 2022 01:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58576 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58576@debbugs.gnu.org Cc: Thiago Jung Bauermann X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166597015219082 (code B ref -1); Mon, 17 Oct 2022 01:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Oct 2022 01:29:12 +0000 Received: from localhost ([127.0.0.1]:46611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okEwJ-0004xh-SM for submit@debbugs.gnu.org; Sun, 16 Oct 2022 21:29:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:47230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okEwH-0004xa-PI for submit@debbugs.gnu.org; Sun, 16 Oct 2022 21:29:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okEwD-0004kA-0p for guix-patches@gnu.org; Sun, 16 Oct 2022 21:29:06 -0400 Received: from mx.kolabnow.com ([212.103.80.155]:53664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okEw9-0000ZN-V3 for guix-patches@gnu.org; Sun, 16 Oct 2022 21:29:03 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id E7A70B13A; Mon, 17 Oct 2022 03:28:59 +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:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1665970139; x=1667784540; bh=DRuz0sx+C6jH1OHEuX9jvZZIBVCA7I+S54Ry9KNWb/Q=; b=fd1FZmWlnvan EMPQ2qcymC2L7HwxqTBtRzeVZzpFop0kSp3R7nof+YFHJQsZFGTvcRH/guNwjiDf vJDrsC+2TZrFhAC8oH72iMLRZiq5+yTV+BEs5OiuahXH4AgP/ZgJH4/Rqood2PDQ 4U9L9BapfBkTrCZ8f+kj3RXzpPXs58hFiw6/LLDjUeJ0PK4yWLo/Sh3Cbbf5CsZi x9wCfuhP1ffJ9Iu+GbUqiZvyAWiCWmi0fRPLCIdMe2BuGuTi+dJh/oMzwnQM3xzM fr0Fbx260KjKDeBf4dIHKbfnMHt+58sVq6BOwFN+6lO7ywFBiyRC85sLKJ7WN+9C NqulE34ePfDl7UPp4aEw3zOG3YxwXrHj0U9egzlVQCsSXstEbUVAHwO/8JbF6LKd OSzo/za9tWXUaeUQ2dnC13yVHr1u8h/uaq05NNKph0T0JTDJfKMViEv/WSxIbRiH jOsyIJMx2IfwYj/lyOE1tY47p9ez0Zeyg0Ctb3BQOWksDRWoR9drz6ebGsPTUv03 36aJCzuS6oER01H1S16E+1j4jqL+ROzacZ9og955iJO4zwLveigtS+ktHQtYyG/O +Ae/NEE2EieV/joyh+cXMNRY18zpDz3zW7yR5duAQ/cUOp4Sn3y0sv/vVONZS9Eu T3S77zZSLM5KmkBR7wXoz9LgfU7OZSc= 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 eOYeDU7qBxeM; Mon, 17 Oct 2022 03:28:59 +0200 (CEST) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by mx.kolabnow.com (Postfix) with ESMTPS id 81998B137; Mon, 17 Oct 2022 03:28:58 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 40AD42367; Mon, 17 Oct 2022 03:28:58 +0200 (CEST) Date: Sun, 16 Oct 2022 22:28:43 -0300 Message-Id: <20221017012843.29975-1-bauermann@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=212.103.80.155; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665970213; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=DRuz0sx+C6jH1OHEuX9jvZZIBVCA7I+S54Ry9KNWb/Q=; b=JSVH8tnRFM5lo2XvlejYXp3dC+dOaB8NBZ2mk7qNaoHWaVVmNz8jlzpgAPfvV567f5prVT TYId7b2GIQfWGR1xro7sLqMlKkoYZguHpPiDE3Wjv1+Nv4mNM3CzIkVn8zSVfwjtt04GiG Vk4LJvsGUOciUKlAHjRJnjt/FdH5p95GzzXIITKRdSbNEguWeiuKmbqmo5A1+3PHGsAJJg WqSi8tGxt8xaTyAeeXHIWywgPHAKH5iXX1m2BoN8RC9S304aIJQ/IoHFRI6RP31n1+A7fz 3JnAXUjQwBcJKiIUpIa8nbtmpn7QGrd6BRTGSB6/SuQYvgzAjs+/CHR18EuYwA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665970213; a=rsa-sha256; cv=none; b=obn86NxvnBuyTLXNscHceLe8NWHQ2smDWgp5/HRfiBn1kqdpJ21kUQrbeMQCTrbhASLDJJ DtzNvsVTm+BXtozKUsIfAzr9uzgf1+UkaXVA30htYv+96fNRB1vHYilVjL2H7V5EmJNaSF YejQNvJmzTsgDWx5G3inj90iVq+NIJwrftQte0n4Bosr4R5mCfeozB8vGp+3tpAOkj1Lmw yvVqdRj5Ceu/lhl21cCioNZyt4047E3WxiU40fCUiKP+WwEA8qya6AVAlFxVGiRORLv7QV jdEfEn6OSNazJoZANYErUXlBLXIMrGDQVE8TRKcu+/R7LcvGahweq7hI125gqA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=fd1FZmWl; 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: -6.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=fd1FZmWl; 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: F292435B37 X-Spam-Score: -6.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: On7QZyK9pYsU From: Thiago Jung Bauermann Cross-building a docker image with: $ guix system image --image-type=docker --target=aarch64-linux-gnu os.scm results in an image where the architecture declared in its config.json is the host architecture rather than the target one. The binaries are correctly cross-compiled, so the image can be loaded and used despite the warning message shown by docker: $ docker load -i vcal7bvsqcijchifhqdvprpd1niqh8sk-docker-image.tar.gz Loaded image: guix:latest $ docker create guix:latest WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 40f06aa869ed690489c4a3824a7f7721bd4bf453b85f25ac7199266939fe2fba $ echo $? 0 This is fixed by passing the correct triplet to the build-docker-image function. * gnu/system/image.scm (system-docker-image) Add ‘image-target’ variable. [builder]: Pass ‘#:system’ argument to ‘build-docker-image’. --- gnu/system/image.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 5fc0d55d9a14..c6d7d13f6daf 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -652,6 +652,9 @@ (define shared-network? shared-network?) (list boot-program))) (substitutable? (image-substitutable? image)) + (image-target (or (%current-target-system) + (and=> (image-platform image) platform-target) + (nix-system->gnu-triplet))) (register-closures? (has-guix-service-type? os)) (schema (and register-closures? (local-file (search-path %load-path @@ -705,6 +708,7 @@ (define builder #:entry-point '(#$boot-program #$os) #:compressor '(#+(file-append gzip "/bin/gzip") "-9n") #:creation-time (make-time time-utc 0 1) + #:system #$image-target #:transformations `((,image-root -> "")))))))) (computed-file name builder