unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Yarl Baudig <yarl-baudig@mailoo.org>
To: 59843@debbugs.gnu.org
Cc: Yarl Baudig <yarl-baudig@mailoo.org>
Subject: [bug#59843] [PATCH] shell: Enable --target for guix shell (--development)
Date: Mon,  5 Dec 2022 21:30:51 +0100	[thread overview]
Message-ID: <20221205203051.22898-1-yarl-baudig@mailoo.org> (raw)

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







             reply	other threads:[~2022-12-05 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 20:30 Yarl Baudig [this message]
2022-12-14 10:59 ` [bug#59843] [PATCH] shell: Enable --target for guix shell (--development) Ludovic Courtès
2022-12-14 16:26   ` yarl baudig
2022-12-14 20:57   ` yarl baudig
2022-12-21 13:42     ` bug#59843: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221205203051.22898-1-yarl-baudig@mailoo.org \
    --to=yarl-baudig@mailoo.org \
    --cc=59843@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).