lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Using ccache and MINIMAL_PATH


From: Vadim Zeitlin
Subject: [lmi] Using ccache and MINIMAL_PATH
Date: Wed, 27 Oct 2021 19:42:03 +0200

 Hello,

 I've pushed the change to the CI workflow file which adds the use of
ccache for it, as this has reduced the build times from ~20 minutes on
average to ~5 after commits not changing any sources (this time is spent on
installing the packages and running the tests) at the cost of an extra
minute in the worst case of not having any cache at all, and so it is
clearly worth it for the CI builds. Moreover, I've now started using ccache
for my own lmi builds too, as this looks like a simple way to speed them
up.

 If, by chance, you'd like to do it as well, please be aware that just
adding /usr/lib/ccache directory in front of the PATH, as recommended by
ccache documentation in Debian, is not enough with lmi and you need to
predefine MINIMAL_PATH including this directory instead. This is probably
not a surprise for you, of course, as you added the lines changing PATH in
set_toolchain.sh in the first place, but I'd like to remind you about it
just in case you forgot this, so that you don't waste your time trying to
understand why wasn't ccache used, as I did.


 To be honest, I find the idea of resetting (rather than prepending to) the
PATH to be rather questionable and the rationale of preventing the unbound
path growth unconvincing, as we could easily check for the presence of the
components being added in the PATH before doing. Granted, it's simplest to
do it in zsh, where just

        path=("$localbindir" "$locallibdir" $path)

would be enough, but it can be done relatively easily even with /bin/sh
with something like this (which assumes that PATH is not empty, but this
should be a pretty safe assumption to make and nothing really catastrophic
happens if it's not the case):

        PATH=":$PATH"
        PATH="$localbindir:$locallibdir"${PATH//:$localbindir:$locallibdir:/:}

 IMHO this might be worth doing to allow assignments to the PATH to work in
the expected way, but it's not very important, of course, and I'll probably
remember about the trick with setting MINIMAL_PATH instead for at least
some time, now that I've wasted so much of it on discovering it.

 Regards,
VZ

Attachment: pgpo47rr0F971.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]