i run stable/13 from git with world rebuilds, when it feels necessary and WITH_META_MODE=yes. each make buildworld appears rebuilding whole toolchain stack, even if no any changes to toolchain made in src. This has not been observed on 12.2. Alternatively, i tried, building world with CROSS_TOOLCHAIN=llvm-@version, and WITHOUT_TOOLCHAIN=yes, next rebuild, if tried, takes only minutes, which is a desired behavior.
there were no cleaning of /usr/obj, so that it stays with *.meta files from previous build
Created attachment 226949 [details] src.conf used for buildworld
I'll note that if #define __FreeBSD_version in src/tree/sys/sys/param.h has changed, rebuilds are expected behavior. So I'm assuming that has not changed. Are you saying that the following wort of sequence rebuilds the toolchain 3 times? # cd /usr/src/ # env WITH_META_MODE=yes make buildworld # env WITH_META_MODE=yes make buildworld # env WITH_META_MODE=yes make buildworld Note that lack of any other activity between buildworld's. I do not expect the above would rebuild the toolchain 3 times. By constrast it is expected that the below sort of sequence will rebuild (or relink) more than the the above would overall: # cd /usr/src/ # env WITH_META_MODE=yes make buildworld # env WITH_META_MODE=yes make installworld # env WITH_META_MODE=yes make buildworld # env WITH_META_MODE=yes make installworld # env WITH_META_MODE=yes make buildworld This is because the installworld activity will update file dates on files that WITH_META_MODE checks as an example of a dependency. WITH_META_MODE has some examples of dependency recording that could be avoided with appropriate safety. An example would be avoiding checking in the rm command having been updated, even when rm was used in the command sequence for regenerating a file. You may need to be more explicit about your sequence of steps that leads to the rebuilds that you object to.
my case would be results that are from two consecutive buildworld such as in your example 1 scenario. i did not try 3 times in a row. i will retest this more thoroughly. indeed, after installworld step, buildworld takes slightly more time which is expected, from your explanation, but i had no full llvm/clang rebuild on version 12.2. i will report back asap.
(In reply to Oleh Vinichenko from comment #4) Note that if the old/prior /usr/src vs. new /usr/src did have a change to #define __FreeBSD_version that the rebuild is expected each time --until after the update is installed so that it then matches the update /usr/src content. You did not comment on if there was a change to __FreeBSD_version involved or not. The test of: # cd /usr/src/ # env WITH_META_MODE=yes make buildworld # env WITH_META_MODE=yes make buildworld # env WITH_META_MODE=yes make buildworld should be for the installed __FreeBSD_version already matching the value in /usr/src/tree/sys/sys/param.h . (I've made a presumption of the default /usr/src place. You might be using some other path.)
(In reply to Mark Millard from comment #5) Actually, my wording has in general made a presumption about prior activity that need not be the case. A sequence that avoids the presumption is: # cd /usr/src/ # env WITH_META_MODE=yes make buildworld # env WITH_META_MODE=yes make installworld # env WITH_META_MODE=yes make buildworld ## no more rebuilds below? # env WITH_META_MODE=yes make buildworld # env WITH_META_MODE=yes make buildworld The installworld establishes the updated compiler version is in place, so also matching /usr/src for the version number and such. The first buildworld after that may have the usual issues with some rebuilding based on changes to dependencies from the installworld activity. After that the version should match /usr/src and the dependencies should no longer cause rebuild/relink activity.
ok, so correct report from me had to be, that toolchain is rebuilt completely after installworld, while i understand why it could be the case, it seems excessive, when no changes in /usr/src happened (i.e, no git pull, etc ...). If such behavior is by design, then this report can be closed as expected, no problems with that. with building world from scratch: >>> World built in 5134 seconds, ncpu: 8, make -j8 with building world, just right after first one finished: >>> World built in 64 seconds, ncpu: 8, make -j8 # good :) after installing world (notice, that nothing done in /usr/src at all): >>> World built in 3238 seconds, ncpu: 8, make -j8 most of time is llvm rebuild
This was discussed on the current mailing list: https://lists.freebsd.org/pipermail/freebsd-current/2021-January/078488.html I guess we need a separate build server/jail/VM which isn't updated frequently.
I guess this can be closed as not really a problem ( for my concerns ), mentioned mailing list providing good explantion, thank you