Hey Marek,
Yep, this is a patch for the repository. I haven't figured out how to
programmatically patch it yet either; the original idea was to use
time-machine, but it was causing some errors that I wasn't able to debug.
Perhaps it's time I give it another shot.

As for -Os, check out the GCC optimization flags example in this post:

https://blog.lispy.tech/parameterized-packages-the-second-update.html

You'll have to then specify this parameter for the packages you want to
install, like so:

guix install hello --with-parameter=gcc-oflag=-Os

Back when I was working on it, there were talks about setting up global
transforms for Guix, which is how this patch was supposed to be used
globally. I am not sure if this feature has been added to Guix yet, but
once it is you can then add this transform globally. I have added features
that will check if the build system and any other user defined condition
matches before applying parameterization. Otherwise, you'll have to add
this transform to the packages you need -Os with, which is not very
difficult, just a bit cumbersome...


Regards,

Sarthak.

On Wed, Aug 21, 2024, 13:05 Marek Paśnikowski <ma...@marekpasnikowski.pl>
wrote:

> Sarthak Shah <shahsarth...@gmail.com> writes:
>
> > Another thing that needs a bit of fixing is that this doesn't work on
> > fresh Guix repositories, you need to have built Guix once from a
> > repository before applying the patch.
>
> Hold on.  Is this a patch to the guix /repository/, not /package/?  That
> would explain the patch failure.  Now I need to go and learn how to
> programmaticaly patch a channel.
>
> Any pointers on how to globally set the "-Os" CFLAG?
>
>

Reply via email to