TrueNAS code downloaded from https://github.com/truenas/os does not build

Nagendra

Cadet
Joined
Mar 25, 2021
Messages
3
TrueNAS code downloaded from https://github.com/truenas/os reports the errors on TrueNAS-12.0-U2.1:
1) fatal error: sys/cdefs.h: No such file or directory
2) /bin/sh: config: not found

1) fatal error: sys/cdefs.h: No such file or directory
truenas# make CC=/usr/local/bin/gcc LD=/usr/local/bin/ld buildworld
--------------------------------------------------------------
>>> World build started on Mon May 3 00:28:04 PDT 2021
--------------------------------------------------------------

--------------------------------------------------------------
>>> Rebuilding the temporary build tree
--------------------------------------------------------------
[...]
/root/NEW-TRUENAS-SRC/os/tools/build/../../contrib/libc-pwcache/pwcache.c:72:10: fatal error: sys/cdefs.h: No such file or directory
72 | #include <sys/cdefs.h>
| ^~~~~~~~~~~~~
compilation terminated.
*** Error code 1

Stop.
make[3]: stopped in /root/NEW-TRUENAS-SRC/os/tools/build
*** Error code 1

Stop.
make[2]: stopped in /root/NEW-TRUENAS-SRC/os
*** Error code 1
*** Error code 1
truenas# ls
.arcconfig COPYRIGHT Makefile.inc1 share
.arclint crypto Makefile.libcompat stand
.cirrus.yml etc Makefile.sys.inc sys
.clang-format gnu ObsoleteFiles.inc targets
.git include README tests
.gitattributes kerberos5 README.md tools
.github lib release UPDATING
.gitignore libexec RELNOTES usr.bin
bin LOCKS rescue usr.sbin
cddl MAINTAINERS sbin
contrib Makefile secure
truenas# cat /etc/version
TrueNAS-12.0-U2.1 (ff1fe0fc68)
truenas#


2) /bin/sh: config: not found
truenas# make CC=/usr/local/bin/gcc LD=/usr/local/bin/ld buildkernel

--------------------------------------------------------------
>>> Kernel build for GENERIC started on Mon May 3 00:31:17 PDT 2021
--------------------------------------------------------------
===> GENERIC
mkdir -p /usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/sys

--------------------------------------------------------------
>>> stage 1: configuring the kernel
--------------------------------------------------------------
cd /root/NEW-TRUENAS-SRC/os/sys/amd64/conf; PATH=/usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/tmp/bin:/usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/tmp/usr/sbin:/usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/tmp/usr/bin:/usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/tmp/legacy/bin:/usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin config -d /usr/obj/root/NEW-TRUENAS-SRC/os/amd64.amd64/sys/GENERIC -I '/root/NEW-TRUENAS-SRC/os/sys/amd64/conf' -I '/root/NEW-TRUENAS-SRC/os/sys/amd64/conf' '/root/NEW-TRUENAS-SRC/os/sys/amd64/conf/GENERIC'
/bin/sh: config: not found
*** Error code 127
*** Error code 1
truenas#
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,471
You can't build TrueNAS CORE on top of TrueNAS CORE, since we strip out all the dev environment tools. You'll need to do it on a FreeBSD 12-STABLE or later system.
 
Top