From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 8H60DktVjmN7AwAAbAwnHQ (envelope-from ) for ; Mon, 05 Dec 2022 21:32:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8EOpDktVjmOPGwAA9RJhRA (envelope-from ) for ; Mon, 05 Dec 2022 21:32:11 +0100 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 AED7DC4CD for ; Mon, 5 Dec 2022 21:32:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2I8B-0006zO-Sb; Mon, 05 Dec 2022 15:32:03 -0500 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 1p2I8A-0006z8-Kx for guix-patches@gnu.org; Mon, 05 Dec 2022 15:32:02 -0500 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 1p2I8A-00039K-7L for guix-patches@gnu.org; Mon, 05 Dec 2022 15:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2I8A-0001HC-2D for guix-patches@gnu.org; Mon, 05 Dec 2022 15:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59843] [PATCH] shell: Enable --target for guix shell (--development) Resent-From: Yarl Baudig Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 05 Dec 2022 20:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59843 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59843@debbugs.gnu.org Cc: Yarl Baudig X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16702722784894 (code B ref -1); Mon, 05 Dec 2022 20:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Dec 2022 20:31:18 +0000 Received: from localhost ([127.0.0.1]:38230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2I7R-0001Gs-NU for submit@debbugs.gnu.org; Mon, 05 Dec 2022 15:31:18 -0500 Received: from lists.gnu.org ([209.51.188.17]:41966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2I7P-0001Gm-SW for submit@debbugs.gnu.org; Mon, 05 Dec 2022 15:31:16 -0500 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 1p2I7P-0006rN-An for guix-patches@gnu.org; Mon, 05 Dec 2022 15:31:15 -0500 Received: from msg-4.mailo.com ([213.182.54.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2I7N-00030d-15 for guix-patches@gnu.org; Mon, 05 Dec 2022 15:31:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailoo.org; s=mailo; t=1670272268; bh=w+zXkn/ROg8ekXl8E+gZ9p0O0Q7+GHWUoxMZr14dZLU=; h=X-EA-Auth:From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding; b=bPcjL+JnohGM0NX9+v3fVjCiuqzf6vG5l9Is6BxO2SVspmt8OSrtcdUB+y1tNrZoT EaAdU9EidmGEEnZ1xWzHm4EVPSdegB9IORpExiz/G27+lBVPvY1N4egxDVzVG1BoUf Qu+hU0VqYoRS8LajMVXR/J7+VcMN8NCRPVQT7rZ4= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via ip-206.mailobj.net [213.182.55.206] Mon, 5 Dec 2022 21:31:08 +0100 (CET) X-EA-Auth: hxS2cCCSdcuhrCYgP/q1oabSK0pxHsJEg4YfbQ3N2LyyA1EmRJyI0W2Pai0L1hsh0Sz56B2xpRkKY304uZCfrtY6owrpQ9AeDDFQ6VMXY/k= From: Yarl Baudig Date: Mon, 5 Dec 2022 21:30:51 +0100 Message-Id: <20221205203051.22898-1-yarl-baudig@mailoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=213.182.54.15; envelope-from=yarl-baudig@mailoo.org; helo=msg-4.mailo.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-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=1670272331; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=mC+BMKj2mSgkCxBz6Msdp0f2x/EJeIfE3UXLmcqcCWA=; b=Ye/kOlFhqxpCdB8uCogIm24+dWUvmMNZ/H9VVFp9BCAGmpUdX/8OlODq/8ikaOZ7UItumv hdOQYAGwgp1adpKMDJhs86YP1Hi7zevtyhhYGTWnbMl2eP/lcBQc8/Y8Uy6qSGpb3+kB0O IionUGOhQNQad6rp06LdcFjUrhEUa+ZxQNHfx864gi5bVAJZTrCsNyESeGYCanfasbn8MI 83eIrLgVUkuVf5c4vFoO5vTYnZx9BJb5igfYaiSjbr/2NxAiFQ7DuOSdsuar4nHc5Yac4N Av11lpXt2F878N8xf7xL+yCH5rmb+7be5XTS6Xjajr5+tJj0pQpgYV2nHvkh7Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670272331; a=rsa-sha256; cv=none; b=kBF5t0GOq58S7ENmhwm1mxJ0GXX3mb87cB/DWgE9UZMbOy/czSdXO2E50N9TBD1UrmEBs2 z3SQXE79ClJ2ggfZORLjSNhk43IXOAJYvJXyqUS/gSmVMaM1PX0ODzgkpxtqGopKs/QcBm Gxqui/P4jbDxjXzms1990HsJPbObkUOYddNcSe9ZU2/QM5PWwoRptAKz0EiYFII1dlEjmj 9aGMRggsYxPzCD+LaMLj43TfRQYfUv41Xf4Vcc9Ne1Y4ki1meJebfnmFo6hrrINbNqzP89 hYtbsXr0p5UumSP2+vbThIxdMKyK7sDl88rVWsnFlHZLGyxvgjuhBjSAYYtlaQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailoo.org header.s=mailo header.b=bPcjL+Jn; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mailoo.org (policy=none); 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: 7.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailoo.org header.s=mailo header.b=bPcjL+Jn; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mailoo.org (policy=none); 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: AED7DC4CD X-Spam-Score: 7.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5cYWwRZD0oL5 This enable the use of --target for development inputs, that is: with `guix shell`, includes the dependencies for cross-building packages given with --development * guix/scripts/environment.scm: Enable --target. * guix/scripts/shell.scm: Enable --target. * doc/guix.texi: Document it. --- doc/guix.texi | 5 +++++ guix/scripts/environment.scm | 14 +++++++++++--- guix/scripts/shell.scm | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a79b777826..f1da3a4865 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6176,6 +6176,11 @@ environment. @itemx -s @var{system} Attempt to build for @var{system}---e.g., @code{i686-linux}. +@item --target=@var{target} +Attempt to build the environment dependencies (see @option{--development}) +for @var{target}--e.g., @code{aarch64-linux-gnu}. Useful to debug cross-build +failures (@pxref{Debugging Build Failures}). + @item --container @itemx -C @cindex container diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 64597f6e9f..b269be828e 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -127,7 +127,9 @@ (define (show-environment-options-help) (display (G_ " -v, --verbosity=LEVEL use the given verbosity LEVEL")) (display (G_ " - --bootstrap use bootstrap binaries to build the environment"))) + --bootstrap use bootstrap binaries to build the environment")) + (display (G_ " + --list-targets list available targets"))) (define (show-help) (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...] @@ -144,6 +146,10 @@ (define (show-help) --ad-hoc include all specified packages in the environment instead of only their inputs")) + (display (G_ " + --target=TRIPLET cross-build inputs for non-adhoc packages for + TRIPLET--e.g., \"aarch64-linux-gnu\"")) + (show-environment-options-help) (newline) (show-build-options-help) @@ -277,7 +283,8 @@ (define %options (append %transformation-options %standard-build-options - %standard-native-build-options))) + %standard-native-build-options + %standard-cross-build-options))) (define (pick-all alist key) "Return a list of values in ALIST associated with KEY." @@ -332,7 +339,8 @@ (define (packages->outputs packages mode) (('package 'package (? string? spec)) (manifest-entries (package->development-manifest - (transform (specification->package+output spec))))) + (transform (specification->package+output spec)) + #:target (assoc-ref opts 'target)))) (('expression mode str) ;; Add all the outputs of the package STR evaluates to. (packages->outputs (read/eval str) mode)) diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm index 2fc1dc942a..b2ae12cec2 100644 --- a/guix/scripts/shell.scm +++ b/guix/scripts/shell.scm @@ -62,6 +62,9 @@ (define (show-help) (display (G_ " -f, --file=FILE add to the environment the package FILE evaluates to")) + (display (G_ " + --target=TRIPLET cross-build development inputs packages for + TRIPLET--e.g., \"aarch64-linux-gnu\"")) (display (G_ " -q inhibit loading of 'guix.scm' and 'manifest.scm'")) (display (G_ " base-commit: c3713d53e0bdf1186e08880b9e0ae6dd85f55fc4 -- 2.38.1