diff mbox series

[bug#64874] guix: tuned-package: Use target on cross-compile.

Message ID 20230726153729.4147922-1-jean@foundationdevices.com
State New
Headers show
Series [bug#64874] guix: tuned-package: Use target on cross-compile. | expand

Commit Message

Jean-Pierre De Jesus DIAZ July 26, 2023, 3:37 p.m. UTC
* 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: Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com>
---
 guix/transformations.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


base-commit: cf9904bcc8dd03e73675475bb4d8746dc434e415

Comments

Simon Tournier Aug. 16, 2023, 4:51 p.m. UTC | #1
Hi,

Thanks for the patch.


On Wed, 26 Jul 2023 at 17:37, Jean-Pierre De Jesus DIAZ via Guix-patches via <guix-patches@gnu.org> wrote:
> * 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: Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com>
> ---
>  guix/transformations.scm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/guix/transformations.scm b/guix/transformations.scm
> index 92d9c89c0e..76d0208bf1 100644
> --- a/guix/transformations.scm
> +++ b/guix/transformations.scm
> @@ -510,8 +510,9 @@ (define (lower* . args)
>      ;; 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)

Ludo, WDYT?

Cheers,
simon
Ludovic Courtès Aug. 16, 2023, 9:54 p.m. UTC | #2
Hi,

Simon Tournier <zimon.toutoune@gmail.com> skribis:

> On Wed, 26 Jul 2023 at 17:37, Jean-Pierre De Jesus DIAZ via Guix-patches via <guix-patches@gnu.org> wrote:
>> * 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: Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com>
>> ---
>>  guix/transformations.scm | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/guix/transformations.scm b/guix/transformations.scm
>> index 92d9c89c0e..76d0208bf1 100644
>> --- a/guix/transformations.scm
>> +++ b/guix/transformations.scm
>> @@ -510,8 +510,9 @@ (define (lower* . args)
>>      ;; 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)
>
> Ludo, WDYT?

LGTM, thanks for the heads-up!

Ludo’.
Ludovic Courtès Sept. 17, 2023, 1:08 p.m. UTC | #3
Hi,

Ludovic Courtès <ludo@gnu.org> skribis:

> Simon Tournier <zimon.toutoune@gmail.com> skribis:

[...]

>> Ludo, WDYT?
>
> LGTM, thanks for the heads-up!

I went ahead and applied it.

Ludo’.
diff mbox series

Patch

diff --git a/guix/transformations.scm b/guix/transformations.scm
index 92d9c89c0e..76d0208bf1 100644
--- a/guix/transformations.scm
+++ b/guix/transformations.scm
@@ -510,8 +510,9 @@  (define (lower* . args)
     ;; 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) . _)