transformations: tuned-package: Use target on cross-compile.

* guix/transformations.scm (tuned-package): Use either bag-target if
  available or bag-system to select the CPU architecture of the package
  that is going to be tuned.  This enables the tuning of cross-compiled
  packages.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Jean-Pierre De Jesus DIAZ 2023-07-26 17:37:29 +02:00 committed by Ludovic Courtès
parent 04f71edb73
commit 19b6173708
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -529,8 +529,9 @@ system that builds code for MICRO-ARCHITECTURE; otherwise raise an error."
;; leading to an obscure build error, check whether the compiler is known
;; to support MICRO-ARCHITECTURE. If not, bail out.
(let* ((lowered (apply lower args))
(architecture (match (string-tokenize (bag-system lowered)
%not-hyphen)
(target (or (bag-target lowered)
(bag-system lowered)))
(architecture (match (string-tokenize target %not-hyphen)
((arch _ ...) arch)))
(compiler (any (match-lambda
((label (? package? p) . _)