# Exclude architectures from buildworld



## puretone (Aug 14, 2018)

Full disclosure: I might be committing the dispicable crime of willful n00bery here.

My OCD gets triggered by an annoyance sailing past in the buildworld output.
Why does buildworld insist in compiling stuff for aarch/arm64/powerpc etc when the target is amd64 hardware?!
I come across the occasional build failure, which is nearly always due to some error pertaining to an architecture I do not want/have.
I can understand the need for some x86 or i386 stuff being compiled for amd64 usage, but what the heck do we need the alien architectures for?
Today's kerfuffle pertains to '../../sys/arm64/include/minidump.h
Is there a method in make.conf to skip building all that other nonsense? 
Would CPUTYPE in make.conf do the trick and skip building stuff for aarch/arm64/powerpc etc?


----------



## ShelLuser (Aug 14, 2018)

Can you share any logs which support this comment?  I have to admit that I hardly pay attention to the output of a world build, but I don't ever recall seeing something like this.

Leading up to:  How are you building the world in the first place? What did you set up in /etc/make.conf and /etc/src.conf (or related files)?


----------



## SirDice (Aug 14, 2018)

puretone said:


> Why does buildworld insist in compiling stuff for aarch/arm64/powerpc etc when the target is amd64 hardware?!


What makes you think it does?


----------



## xtaz (Aug 14, 2018)

What the OP is referring to is clang building in support for cross compiling of the other target architectures. In the latest 11.2-STABLE there are build knobs that you can change now. But these won't be in 11.2-RELEASE.

See this commit: https://svnweb.freebsd.org/base?view=revision&revision=335875


----------



## SirDice (Aug 14, 2018)

I have several systems running 11-STABLE but haven't noticed this. But I generally start a buildworld and then go to bed to let it build during the night.


----------



## xtaz (Aug 14, 2018)

Whilst I'm here you might want to look at adding kld_list="filemon" to /etc/rc.conf, and WITH_META_MODE=yes to /etc/src-env.conf followed by a `kldload filemon`. And don't use ccache if you already are. When you next run a buildworld/kernel this will take the same amount of time as it usually does. But subsequent runs will zip past really quickly as this will reliably only rebuild things which have actually changed.

For me using this I can quite often run through buildworld/kernel in 2 minutes. However the caveat is if anything at all touches clang then it causes a massive cascading effect throughout the system and it takes just as long as usual. But this doesn't happen *that* often.


----------



## SirDice (Aug 14, 2018)

xtaz said:


> For me using this I can quite often run through buildworld/kernel in 2 minutes. However the caveat is if anything at all touches clang then it causes a massive cascading effect throughout the system and it takes just as long as usual. But this doesn't happen *that* often.


A typical buildworld usually takes around 1,5 hours on my systems. So this would definitely improve things.


----------



## kpa (Aug 14, 2018)

Building Clang takes the major slice of that time, any improvement there is going to make a big difference on the whole process.


----------



## puretone (Aug 14, 2018)

ShelLuser said:


> Can you share any logs which support this comment?  I have to admit that I hardly pay attention to the output of a world build, but I don't ever recall seeing something like this.
> 
> Leading up to:  How are you building the world in the first place? What did you set up in /etc/make.conf and /etc/src.conf (or related files)?



I was silly enough to not think of saving a log, it was yet another spur-of-the-moment thing. I usually do not pay attention to the output all that much either, when it does though, it is almost always due to some foreign architecture issue.
/etc/make.conf contains:

```
CPUTYPE?=skylake-avx512
KERNCONF=totallyuniquesillykernelname
TARGET_ARCH=amd64
WRKDIRPREFIX=/var/tmp/ccache
CCACHE_DIR=/var/cache/ccache
WITH_CCACHE_BUILD=yes
```
Just to be clear, I do *NOT* like having CPUTYPE & TARGET_ARCH variables set for all the obvious reasons. I gave this a shot in a futile attempt to ignore building aarch/arm64/powerpc/sparc etc stuff.



SirDice said:


> What makes you think it does?



Because buildworld failed at ../../sys/arm64/include/minidump.h, which was just one of a number of arm64 files that failed to compile for whatever reason. Again, why would I need any arm64 files compiled on exclusively amd64 hardware. I don't do any cross compiling for other architectures/developing either.


Note: these buildworld failures occur with either a vanilla source/build instructions (i.e. no custom settings anywhere in make.conf nor src.conf) and when ccache is fully enabled.


----------



## puretone (Aug 14, 2018)

xtaz said:


> What the OP is referring to is clang building in support for cross compiling of the other target architectures. In the latest 11.2-STABLE there are build knobs that you can change now. But these won't be in 11.2-RELEASE.
> 
> See this commit: https://svnweb.freebsd.org/base?view=revision&revision=335875



Precisely.
Currently, I come across these issues on a 12-CURRENT installation. I have also had it happen for 11.2-RELEASE.
My thinking is there should be some way to completely ignore of bypass all the other architectures in some way. Or in other words only build the base source for amd64/i386/x86 architectures.
Simply removing the arm/arm64/sparc64/powerpc/ directories from /usr/src/sys/ will stop buildworld immediately...even with the intended targets set. All those files are just sitting there wasting space.


----------



## xtaz (Aug 15, 2018)

Well, what I said *is* the way to bypass them. Click on the link and read the commit note! But you need 11.2-STABLE, it won't work in 11.2-RELEASE.


----------

