Subject: Re: [bug#52283] [PATCH 02/10] transformations: Add '--tune'.

From: Ludovic Courtès <[email-masked]>
Date: Tue, 07 Dec 2021 09:04:56 +0100

Hi Thiago,

Thiago Jung Bauermann <[email-masked]> skribis:

> Em sábado, 4 de dezembro de 2021, às 17:49:16 -03, Ludovic Courtès 
> escreveu:
>> +Tuned packages are @emph{grafted} onto packages that depend on them
>> +(@pxref{Security Updates, grafts}).  Thus, using @option{--no-grafts}
>> +annihilates the effect of @option{--tune}.
>
> Perhaps this is because English isn’t my first language, but annihilation 
> seems like a violent and dramatic effect in a package transformation. :-)
>
> Perhaps reword as “cancels”, “invalidates” or "nullifies"?

Not a native speaker either but yes, “cancels” sounds better; I’ll
change that.

>> +(define (tuned-package p micro-architecture)
>> +  "Return package P tuned for MICRO-ARCHITECTURE."
>> +  (define compiler
>> +    (tuning-compiler micro-architecture))
>> +
>> +  (package
>> +    (inherit p)
>> +    (native-inputs
>> +     ;; Arrange so that COMPILER comes first in $PATH.
>> +     `(("tuning-compiler" ,compiler)
>> +       ,@(package-native-inputs p)))
>> +    (arguments
>> +     (substitute-keyword-arguments (package-arguments p)
>> +       ((#:tests? _ #f) #f)))
>
> Perhaps I’m reading this wrong, but it looks like tuned packages don’t run 
> their testsuites? If so, this is a surprising side-effect and thus it would 
> be nice to have it mentioned in the manual, possibly also in a comment 
> here. It would be nice to also mention the rationale for disabling the 
> tests (not sure whether only in a comment here or if in the manual as 
> well). I assume it’s for convenience, but I’m not sure.

I agree, a comment and maybe a sentence in the manual would be welcome.

The reason the test suite is skipped is because we cannot know for sure
whether the machine that hosts the daemon is able to run code for this
specific micro-architecture.

The test suite runs in the “baseline” package build anyway, so assuming
the compiler works fine, skipping the test suite on tuned builds is
okay.

Thanks for your feedback!

Ludo’.