Solved Updating from source - when to build world

jbo@

Developer
When updating from the stable/13 branch, how do I know when I need to (re)build world in addition to just the kernel?

Is the idea that as long as I don't update my local repository I can only re-build the kernel when I want to change the kernel configuration but every time I update my local repository I need to build world as well?
Or are there situations where I can update my local repository and only re-build the kernel? If so, how do I know when I need to rebuild world as well?
 
When updating from the stable/13 branch, how do I know when I need to (re)build world in addition to just the kernel?
Assume you always have to do that.

Building world can be sped up quite a bit if you set WITH_META_MODE, so it doesn't rebuild everything every time.
 
Been a long time since I've updated from source, but it was always (going by memory, not my notes):
update source tree
make buildworld
make buildkernel
make installkernel
mergemaster
reboot
make installworld
mergemaster

buildworld first gets all the compiler bits in place that may be needed by buildkernel.

ETA:
If you are only changing the kernel config, in theory you shouldn't need to rebuild world as long as you aren't changing KABI bits.
Off of my list above, once you have rebooted and installworld, you have kernel and world in sync.
If you just change kernel config (adding/removing drivers) you should be able to make buildkernel && make installkernel
 
Building world can be sped up quite a bit if you set WITH_META_MODE, so it doesn't rebuild everything every time.
So using WITH_META_MODE indeed comes with a substantial decrease in build times - thank you Sir!

I have two more questions regarding building from source:
  1. Just to be sure that I get this right: Building world (i.e. running make buildworld does not need the KERNCONF parameter, right? World is agnostic to the kernel config (as it's just not the kernel) - does that sound about right?
  2. Is running make buildkernel and then make installkernel more safe or does it have other advantages over just doing make kernel? Are there cases where things can go wrong i.e. if the build fails but for some reason installation happens anyway?
 
Just to be sure that I get this right: Building world (i.e. running make buildworld does not need the KERNCONF parameter, right? World is agnostic to the kernel config (as it's just not the kernel) - does that sound about right?
Correct.

Is running make buildkernel and then make installkernel more safe or does it have other advantages over just doing make kernel? Are there cases where things can go wrong i.e. if the build fails but for some reason installation happens anyway?
I've honestly never used make kernel, I've always split them up in a buildkernel and installkernel stages. But I tend to build everything over night (just let the machine churn away when I'm asleep).
 
You can also shave off some time by disabling and optimizing some parts....

/etc/make.conf (change CPUTYPE accordingly to match your machine)
Code:
cat /etc/make.conf
CPUTYPE?=haswell
WITHOUT_DEBUG=YES
MK_PROFILE=no

/etc/src.conf
Code:
WITHOUT_DEBUG_FILES=1
WITHOUT_LIB32=1
WITHOUT_KERNEL_SYMBOLS=yes
WITHOUT_TESTS=yes
WITHOUT_PROFILE=yes
WITH_MALLOC_PRODUCTION=yes
WITHOUT_LLVM_ASSERTIONS=yes
 
When in doubt always look over the Makefile. It lists all the required steps, shows all other available build targets and is usually a good source of information.
 
When updating from the stable/13 branch, how do I know when I need to (re)build world in addition to just the kernel?

Is the idea that as long as I don't update my local repository I can only re-build the kernel when I want to change the kernel configuration but every time I update my local repository I need to build world as well?
Or are there situations where I can update my local repository and only re-build the kernel? If so, how do I know when I need to rebuild world as well?
Thank you everyone for the information in this thread. I was asking myself exactly the same question. Do I have to build the world
all the time or not. Now I know. Also thanks for the tips to cut build times down.

One more question I have. How frequently you guys update the stable kernel. Once a week or a month or even longer? What is a
good advice on it?
Thanks
 
How frequently you guys update the stable kernel. Once a week or a month or even longer?
Depends on what I'm doing. Sometimes once a week, sometimes once a month. I do try to update it regularly. My package repositories are almost constantly getting updated.
 
Back
Top