Can't "build world" within a Bhyve VM

The main host is FreeBSD 13, I created a VM to run FreeBSD and have Poudriere on it, for this, I am using vm-bhyve, here is the config of the VM:

Code:
loader="bhyveload"
cpu=8
memory=32G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0"
disk0_dev="sparse-zvol"
uuid="e4937ac8-0a24-11ee-b769-a85e451113f8"
network0_mac="58:9c:fc:02:b7:a1"

I created the VM using FreeBSD-13.2-RELEASE-amd64-disc1.iso, which currently is up and running:

Code:
FreeBSD test 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64

I updated the sources and wanted to build workd an kernel, for this I am using this script:


Code:
#!/bin/sh
FREEBSD_VERSION=13
NUMBER_OF_CORES=`sysctl -n hw.ncpu`
ZPOOL="zroot"
START=$(date +%s)

if [ `sysctl -n kern.securelevel` -gt 0 ]; then
    sysrc kern_securelevel_enable="NO"
    echo "need to reboot with securelevel 0"
    exit
fi

write() {
    echo -e '\e[0;32m'
    echo \#----------------------------------------------------------------------------
    echo \# $1
    echo -e \#----------------------------------------------------------------------------'\e[0m'
}


cd /usr/src

write "Checking out and updating sources FreeBSD: ${FREEBSD_VERSION}"
git pull

# Exit immediately if a command exits with a non-zero exit status
set -e

write "building world"
make -j${NUMBER_OF_CORES} buildworld

write "building kernel"
make -j${NUMBER_OF_CORES} kernel

zfs set exec=on ${ZPOOL}/tmp

write "installing world"
make installworld

write "making distribution"
cp -R /etc /etc.old && cd /usr/src && make distribution DESTDIR=/

write "backup /etc"
(cd /etc.old && cp group passwd master.passwd /etc && pwd_mkdb /etc/master.passwd)
cp /etc.old/ssh/sshd_config /etc/ssh/

write "deleting old"
make -DBATCH_DELETE_OLD_FILES delete-old

END=$(date +%s)
DIFF=$(echo "$END - $START" | bc)
ELAPSED=$(printf '%02dh:%02dm:%02ds\n' $(($DIFF/3600)) $(($DIFF%3600/60)) $(($DIFF%60)))

write "Done in: $ELAPSED, rebot and then \"yes | make delete-old-libs\""

But it keeps failing giving errors like:
Code:
--- xz_make ---
(cd /usr/src/rescue/rescue/../../usr.bin/xz &&  make MK_PIE=no NO_SHARED=yes -DRESCUE CRUNCH_CFLAGS=-DRESCUE CRUNCH_CFLAGS+=-I/usr/obj/usr/src/amd64.amd64/lib/libifconfig CRUNCH_CFLAGS+=-I/usr/obj/usr/src/amd64.amd64/lib/libiscsiutil MK_AUTO_OBJ=yes DIRPRFX=rescue/rescue/xz/ depend && make MK_PIE=no NO_SHARED=yes -DRESCUE CRUNCH_CFLAGS=-DRESCUE CRUNCH_CFLAGS+=-I/usr/obj/usr/src/amd64.amd64/lib/libifconfig CRUNCH_CFLAGS+=-I/usr/obj/usr/src/amd64.amd64/lib/libiscsiutil MK_AUTO_OBJ=yes DIRPRFX=rescue/rescue/xz/ args.o coder.o file_io.o hardware.o list.o main.o message.o mytime.o options.o signals.o suffix.o util.o tuklib_open_stdxxx.o tuklib_progname.o tuklib_exit.o tuklib_cpucores.o tuklib_mbstr_width.o tuklib_mbstr_fw.o)
--- .depend ---
echo xz.full: /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libc.a /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/liblzma.a /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libmd.a /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libpthread.a >> .depend
--- args.o ---
cc -target x86_64-unknown-freebsd13.2 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin  -O2 -pipe -fno-common   -DHAVE_CONFIG_H  -I/usr/src/lib/liblzma  -I/usr/src/contrib/xz/src/common -DRESCUE -I/usr/obj/usr/src/amd64.amd64/lib/libifconfig -I/usr/obj/usr/src/amd64.amd64/lib/libiscsiutil -MD  -MF.depend.args.o -MTargs.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -Wno-error=array-parameter -Wno-error=deprecated-non-prototype -Wno-error=unused-but-set-parameter -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member  -Qunused-arguments    -c /usr/src/contrib/xz/src/xz/args.c -o args.o
--- all_subdir_kerberos5 ---
/usr/src/crypto/heimdal/kadmin/util.c:138:5: error: call to undeclared function 'get_response'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        if(get_response("Attributes", buf, resp, sizeof(resp)) != 0)
           ^
/usr/src/crypto/heimdal/kadmin/util.c:138:5: note: did you mean 'get_rmsponse'?
/usr/src/crypto/heimdal/kadmin/util.c:43:1: note: 'get_rmsponse' declared here
get_rmsponse(const char *prompt, const char *def, char *buf, size_t len);
^
/usr/src/crypto/heimdal/kadmin/util.c:268:5: error: call to undeclared function 'get_response'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        if(get_response(prompt, buf, resp, sizeof(resp)) != 0)
           ^
/usr/src/crypto/heimdal/kadmin/util.c:354:5: error: call to undeclared function 'get_response'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        if(get_response(prompt, buf, resp, sizeof(resp)) != 0)
           ^
/usr/src/crypto/heimdal/kadmin/util.c:580:1: error: static declaration of 'get_response' follows non-static declaration
get_response(const char *prompt, const char *def, char *buf, size_t len)
^
/usr/src/crypto/heimdal/kadmin/util.c:138:5: note: previous implicit declaration is here
        if(get_response("Attributes", buf, resp, sizeof(resp)) != 0)
           ^
4 errors generated.
*** [util.o] Error code 1

make[5]: stopped in /usr/src/kerberos5/usr.bin/kadmin
--- all_subdir_sbin ---

make[2]: stopped in /usr/src
--- all_subdir_kerberos5 ---

make[2]: stopped in /usr/src
--- all_subdir_rescue ---

make[3]: stopped in /usr/src/rescue
--- all_subdir_lib ---

make[2]: stopped in /usr/src
--- all_subdir_rescue ---

make[2]: stopped in /usr/src

make[1]: stopped in /usr/src

make: stopped in /usr/src

In the VM I don't have anything in /etc/make.conf or /etc/src.conf

Any ideas of what could be wrong? just in case running the same script in the main host works, but for an unknown reason, I can't make it work within Bhyve.
 
First check that it builds at all *without* using the script and make sure there are no local modifcations/missing files in /usr/src (git pull will not here, git status should).
 
either running it by hand fails, the script has you can notice just runs
Code:
make -j${NUMBER_OF_CORES} buildworld
I have tried also only
Code:
make buildworld
and fails,

This is how I doit:
Code:
# git pull
# git status
On branch stable/13
Your branch is up to date with 'origin/stable/13'.

nothing to commit, working tree clean
# git log --oneline -5
cb1883b03223 (HEAD -> stable/13, origin/stable/13) linux(4): Fix linker warning about undefined vdso symbols
74614fa93a62 linux(4): Fix MSG_CTRUNC handling in recvmsg()
1b1cf17660de linux(4): Add a comment explaining udata freeing on error
b67a012e7ca3 linux(4): Refactor recvmsg
d238be002e42 linux(4): Skip unsupported anxiliary message
#
# make -j4 buildworld
--- buildworld ---
make[1]: "/usr/src/Makefile.inc1" line 340: SYSTEM_COMPILER: libclang will be built for bootstrapping a cross-compiler.
make[1]: "/usr/src/Makefile.inc1" line 345: SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker.
--- buildworld_prologue ---
--------------------------------------------------------------
>>> World build started on Wed Aug 23 16:39:54 UTC 2023
--------------------------------------------------------------
--- _worldtmp ---
--------------------------------------------------------------
>>> Rebuilding the temporary build tree
--------------------------------------------------------------
rm -rf /usr/obj/usr/src/amd64.amd64/tmp
....


--- rescue ---
cc -target x86_64-unknown-freebsd13.2 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -fno-common    -std=gnu99 -Wno-format-zero-length -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wstrict-prototypes -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -Wno-error=array-parameter -Wno-error=deprecated-non-prototype -Wno-error=unused-but-set-parameter  -Qunused-arguments     -Wl,--allow-multiple-definition -Wl,-zrelro -static   -static -o rescue rescue.o cat.lo chflags.lo chio.lo chmod.lo cp.lo date.lo dd.lo df.lo echo.lo ed.lo expr.lo getfacl.lo hostname.lo kenv.lo kill.lo ln.lo ls.lo mkdir.lo mv.lo pkill.lo ps.lo pwd.lo realpath.lo rm.lo rmdir.lo setfacl.lo sh.lo sleep.lo stty.lo sync.lo test.lo csh.lo camcontrol.lo clri.lo devfs.lo dmesg.lo dump.lo dumpfs.lo dumpon.lo fsck.lo fsck_ffs.lo fsck_msdosfs.lo fsdb.lo fsirand.lo gbde.lo geom.lo ifconfig.lo init.lo kldconfig.lo kldload.lo kldstat.lo kldunload.lo ldconfig.lo md5.lo mdconfig.lo mdmfs.lo mknod.lo mount.lo mount_cd9660.lo mount_msdosfs.lo mount_nfs.lo mount_nullfs.lo mount_udf.lo mount_unionfs.lo newfs.lo newfs_msdos.lo nos-tun.lo ping.lo reboot.lo restore.lo rcorder.lo route.lo savecore.lo shutdown.lo spppcontrol.lo swapon.lo sysctl.lo tunefs.lo umount.lo ccdconfig.lo rtsol.lo ipf.lo routed.lo rtquery.lo bectl.lo zfs.lo zpool.lo bsdlabel.lo fdisk.lo dhclient.lo head.lo mt.lo sed.lo tail.lo tee.lo gzip.lo bzip2.lo less.lo xz.lo zstd.lo fetch.lo tar.lo nc.lo vi.lo id.lo iscsictl.lo zdb.lo chroot.lo chown.lo iscsid.lo /usr/obj/usr/src/amd64.amd64/rescue/rescue/../librescue/exec.o /usr/obj/usr/src/amd64.amd64/rescue/rescue/../librescue/getusershell.o /usr/obj/usr/src/amd64.amd64/rescue/rescue/../librescue/login_class.o /usr/obj/usr/src/amd64.amd64/rescue/rescue/../librescue/popen.o /usr/obj/usr/src/amd64.amd64/rescue/rescue/../librescue/rcmdsh.o /usr/obj/usr/src/amd64.amd64/rescue/rescue/../librescue/sysctl.o /usr/obj/usr/src/amd64.amd64/rescue/rescue/../librescue/system.o -lcrypt -ledit -ljail -lkvm -lelf -ltermcapw -lutil -lxo -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem -lbe -lzfsbootenv -lzutil -ltpool -lspl -licp_rescue -lgeom -lbsdxml -lkiconv -lmt -lsbuf -lufs -lz -lbz2 -lprivatezstd -lfetch -larchive -lssl -lcrypto -lmd /usr/obj/usr/src/amd64.amd64/lib/libifconfig/libifconfig.a -lm /usr/obj/usr/src/amd64.amd64/lib/libiscsiutil/libiscsiutil.a
--- all_subdir_kerberos5 ---
/usr/src/crypto/heimdal/kadmin/util.c:138:5: error: call to undeclared function 'get_response'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        if(get_response("Attributes", buf, resp, sizeof(resp)) != 0)
           ^
/usr/src/crypto/heimdal/kadmin/util.c:138:5: note: did you mean 'get_rmsponse'?
/usr/src/crypto/heimdal/kadmin/util.c:43:1: note: 'get_rmsponse' declared here
get_rmsponse(const char *prompt, const char *def, char *buf, size_t len);
^
/usr/src/crypto/heimdal/kadmin/util.c:268:5: error: call to undeclared function 'get_response'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        if(get_response(prompt, buf, resp, sizeof(resp)) != 0)
           ^
/usr/src/crypto/heimdal/kadmin/util.c:354:5: error: call to undeclared function 'get_response'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        if(get_response(prompt, buf, resp, sizeof(resp)) != 0)
           ^
/usr/src/crypto/heimdal/kadmin/util.c:580:1: error: static declaration of 'get_response' follows non-static declaration
get_response(const char *prompt, const char *def, char *buf, size_t len)
^
/usr/src/crypto/heimdal/kadmin/util.c:138:5: note: previous implicit declaration is here
        if(get_response("Attributes", buf, resp, sizeof(resp)) != 0)
           ^
4 errors generated.
--- all_subdir_secure ---

make[2]: stopped in /usr/src
--- all_subdir_kerberos5 ---

make[2]: stopped in /usr/src
--- all_subdir_lib ---

make[2]: stopped in /usr/src
--- all_subdir_rescue ---
__cxa_thread_call_dtors: dtr 0xc3bbb0 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xc3bbb0 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xc3bbb0 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xc3c190 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xc3c4c0 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xbcc540 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xc3c190 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xc3c4c0 from unloaded dso, skipping
__cxa_thread_call_dtors: dtr 0xbcc540 from unloaded dso, skipping
*** [rescue] Error code 6

make[4]: stopped in /usr/src/rescue/rescue
1 error

make[4]: stopped in /usr/src/rescue/rescue

make[3]: stopped in /usr/src/rescue

make[2]: stopped in /usr/src

make[1]: stopped in /usr/src

make: stopped in /usr/src
 
I created /etc/src.conf with:
Code:
WITHOUT_KERBEROS=

And it works, compiles, but what I don't understand is why in the main host works and not within the Bhyve VM.

Any ideas?
 
Back
Top