[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#68266] [PATCH 7/7] packages: rust: Memoize make-rust-sysroot result
From: |
Ludovic Courtès |
Subject: |
[bug#68266] [PATCH 7/7] packages: rust: Memoize make-rust-sysroot results. |
Date: |
Mon, 15 Jan 2024 17:54:22 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hello,
Christopher Baines <mail@cbaines.net> skribis:
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Christopher Baines <mail@cbaines.net> skribis:
[...]
>>> (define*-public (make-rust-sysroot target)
>>> - (let ((base-rust rust))
>>> + (make-rust-sysroot/implementation target rust))
>>> +
>>> +(define make-rust-sysroot/implementation
>>> + (mlambda (target base-rust)
>>> (package
>>> (inherit base-rust)
>>> (name (string-append "rust-sysroot-for-" target))
>>
>> We should avoid using ‘mlambda’ (without ‘q’) with packages as it leads
>> to deep object comparisons. That’s why for packages we typically
>> always have one-argument (mlambdaq (package) …).
>>
>> But since ‘base-rust’ wasn’t a parameter before, let’s keep it simple
>> (‘diff --ignore-space-change’):
>
> ...
>
>> WDYT?
>
> Yeah, that does look good. I pushed my earlier version of this patch
> this morning though.
>
> I did have a look at trying to adapt the changes to fit in (guix
> build-system cargo) instead, as I noticed that seemed to be a pattern
> elsewhere, but I think there's something weird going on with the use of
> make-rust-sysroot there since default-rust-sysroot takes an argument,
What matters is that ‘make-rust-sysroot’ takes a single argument,
‘target’, so we can safely write:
(define make-rust-sysroot
(mlambda (target)
…))
I think it’s important to not bring a deep <package> comparison because
this kind of cost is then hard to pinpoint.
Perhaps you can adjust ‘make-rust-sysroot’ along these lines?
Thanks,
Ludo’.
- [bug#68266] [PATCH 0/7] Memoize packages associated with cross building., Christopher Baines, 2024/01/05
- [bug#68266] [PATCH 1/7] gnu: Memozise make-ld-wrapper results., Christopher Baines, 2024/01/05
- [bug#68266] [PATCH 2/7] gnu: Memozise cross-binutils results., Christopher Baines, 2024/01/05
- [bug#68266] [PATCH 3/7] gnu: Memozise cross-gcc results., Christopher Baines, 2024/01/05
- [bug#68266] [PATCH 5/7] gnu: Memozise cross-mig results., Christopher Baines, 2024/01/05
- [bug#68266] [PATCH 4/7] gnu: Memozise cross-kernel-headers results., Christopher Baines, 2024/01/05
- [bug#68266] [PATCH 7/7] packages: rust: Memoize make-rust-sysroot results., Christopher Baines, 2024/01/05
- [bug#68266] [PATCH 6/7] gnu: Memozise cross-libc results., Christopher Baines, 2024/01/05
- [bug#68266] [PATCH 1/7] gnu: Memozise make-ld-wrapper results., Ludovic Courtès, 2024/01/08
[bug#68266] [PATCH v2] guix: store: Add report-object-cache-duplication., Christopher Baines, 2024/01/10