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 @@ (define (lower* . args)
;; leading to an obscure build error, check whether the compiler is known ;; leading to an obscure build error, check whether the compiler is known
;; to support MICRO-ARCHITECTURE. If not, bail out. ;; to support MICRO-ARCHITECTURE. If not, bail out.
(let* ((lowered (apply lower args)) (let* ((lowered (apply lower args))
(architecture (match (string-tokenize (bag-system lowered) (target (or (bag-target lowered)
%not-hyphen) (bag-system lowered)))
(architecture (match (string-tokenize target %not-hyphen)
((arch _ ...) arch))) ((arch _ ...) arch)))
(compiler (any (match-lambda (compiler (any (match-lambda
((label (? package? p) . _) ((label (? package? p) . _)