# 'make buildworld' failure in 12.2-RELEASE



## olafz (Nov 10, 2020)

I am just trying to build from sources, but it fails. No src.conf(), my make.conf() is:


```
OPTIONS_UNSET= NIS
OPTIONS_UNSET+= X11
OPTIONS_UNSET+= DOCS
OPTIONS_UNSET+= DEBUG
OPTIONS_UNSET+= WAYLAND
#
DEFAULT_VERSIONS+=ssl=libressl
```

The error message:


```
--------------------------------------------------------------
>>> stage 3: cross tools
--------------------------------------------------------------
cd /usr/src; INSTALL="sh /usr/src/tools/install.sh"  TOOLS_PREFIX=/usr/obj/usr/src/amd64.amd64/tmp  PATH=/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/sbin:/bin:/usr/sbin:/usr/bin  WORLDTMP=/usr/obj/usr/src/amd64.amd64/tmp  MAKEFLAGS="-m /usr/src/tools/build/mk  -m /usr/src/share/mk" make  -f Makefile.inc1  DESTDIR=  OBJTOP='/usr/obj/usr/src/amd64.amd64/tmp/obj-tools'  OBJROOT='${OBJTOP}/'  MAKEOBJDIRPREFIX=  BOOTSTRAPPING=1202000  BWPHASE=cross-tools  SSP_CFLAGS=  MK_HTML=no NO_LINT=yes MK_MAN=no  -DNO_PIC MK_PROFILE=no -DNO_SHARED  -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no  MK_CLANG_EXTRAS=no MK_CLANG_FULL=no  MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no  MK_INCLUDES=yes MK_LLVM_TARGET_ALL=no  TARGET=amd64 TARGET_ARCH=amd64  MK_GDB=no MK_TESTS=no cross-tools
===> lib/clang (obj,all,install)
===> lib/clang/libllvm (all)
[Creating objdir /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/clang/libllvm...]
make[4]: "/usr/src/lib/clang/libllvm/Makefile" line 18: Please enable at least one of: MK_LLVM_TARGET_AARCH64, MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_BPF, MK_LLVM_TARGET_MIPS,  MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_RISCV, MK_LLVM_TARGET_SPARC,  or MK_LLVM_TARGET_X86
*** Error code 1
```


----------



## SirDice (Nov 10, 2020)

What does `svnlite info /usr/src` show? Assuming you used SVN to update the sources.


----------



## olafz (Nov 10, 2020)

SirDice said:


> What does `svnlite info /usr/src` show? Assuming you used SVN to update the sources.


No, I fetched src.txz from here and unpacked the archive.


----------



## SirDice (Nov 10, 2020)

I would suggest trying to get the source from SVN. These files should be ok but it's difficult to verify. What is your current version? Also 12.2-RELEASE?

`rm -rf /usr/src/*`
`svnlite co https://svn.freebsd.org/base/releng/12.2 /usr/src`

Then do a `make clean` for good measure, to clean up any leftovers from previous builds.


----------



## oz42 (Nov 10, 2020)

Yes, it is 2.2-RELEASE. I upgraded "binary", upgrading from source has failed.
`root@betsy:~ # svnlite co https://svn.freebsd.org/base/releng/12.2 /usr/src
svnlite: Command not found.`


----------



## SirDice (Nov 11, 2020)

You really took almost everything out previously, didn't you? Can you still use pkg(8)? `pkg install subversion`. Then use `svn` instead of `svnlite`.

If all else fails you may have to resort to unpacking base.txz and simply overwrite everything. That archive should contain everything from the base. That would at least restore all the tools that you need.


----------



## oz42 (Nov 11, 2020)

I have restored my test box to 12.1 and did exactly that: untar base.txz from 12.1-RELEASE. It even has survived this somehow. I am still afraid to to that on my production box (2nd DNS and backup MX box).

The reason for all this is a years old bug that is still not fixed:

Lets say you put one line into src.conf(). This is just an example, YMMV. I have tons of these lines defined.

```
WITHOUT_KERBEROS=YES
```

You go all the way:
`make buildworld
make installkernel
reboot
cd /usr/src; make installworld; reboot
mergemaster -Ui; cd /usr/src; yes | make delete-old; yes | make delete-old-libs; reboot`

This new system is performing great. Days later you decide: I'd like to have that Kerberos stuff back again. So you delete that line in src.conf(). Or you just delete that file. And proceed as usual:
`make buildworld`
Bam! Build failure. Because a) /usr/src depends on header files in /usr/include that no longer exist (and perhaps even libraries in /usr/lib, I am not sure). All stuff in /usr/src contains the whole OS, so it should depend only on files in /usr/src. For me, that's clearly a bug.

So I decided to do a "binary" upgrade to 12.2-RELEASE. Next bug stepping in: instead of installing just everything as I ordered freebsd-update() to do, this tool thought: oh, no Kerberos libs on the disk, so I won't install them.

This is an example, but finally there is no other way than reinstalling. I did that already, one time I even reinstalled Linux because of a problem with a port, but that's another story.

I had reported several bug reports about build failures, e.g. PR 243727 or PR 242217. But to me it feels as if noone is listening.

I still like the idea of building FreeBSD tailored for small VM boxes for $13/y with little RAM and CPU resources. But although the handbook says that it is perfectly fine, it leads to a security risk sooner or later. Just because you sometimes cannot upgrade to a newer release.


----------

