Solved Buildworld fail (9 stable i386)

Hi everyone

I encounter buildworld issue, please help me debug if you can :)

I updated my source tree at 4/24 15:00(GMT) RELDATE=900505 by cvsup (# make update in /usr/src) on a pentium 3 machine and [cmd=]rm -rf /usr/obj/usr && make clean && make cleandir && make cleandir && make buildworld[/cmd] But got an error:
Code:
....
sh /usr/src/tools/install.sh -C -o root -g wheel -m 444  /usr/src/gnu/usr.bin/cc/include/../../../../contrib/gcc/config
/i386/emmintrin.h /usr/src/gnu/usr.bin/cc/include/../../../../contrib/gcc/config/i386/mmintrin.h /usr/src/gnu/usr.bin
/cc/include/../../../../contrib/gcc/config/i386/pmmintrin.h /usr/src/gnu/usr.bin/cc/include/../../../../contrib
/gcc/config/i386/tmmintrin.h /usr/src/gnu/usr.bin/cc/include/../../../../contrib/gcc/config/i386/xmmintrin.h mm_malloc.h
 /usr/obj/usr/src/tmp/usr/include/gcc/4.2
....
===> gnu/usr.bin/texinfo/install-info (installincludes)
===> gnu/usr.bin/texinfo/texindex (installincludes)
===> gnu/usr.bin/texinfo/doc (installincludes)
===> include (includes)
cd /usr/src/include; make buildincludes; make installincludes
creating osreldate.h from newvers.sh
/usr/local/bin/svnversion
*** Error code 1

Stop in /usr/src/include.
*** Error code 1

Stop in /usr/src/include.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
#

My make.conf:
Code:
CPUTYPE=pentium3m
CFLAGS= -O2 -pipe -msse
COPTFLAGS= -O -pipe

NO_ATM= true    # do not build ATM related programs and libraries
NO_BLUETOOTH=   true    # do not build Bluetooth related stuff
NO_CVS= true    # do not build CVS
NO_DICT=        true    # do not build the Webster dictionary files
NO_FORTRAN=     true    # do not build g77 and related libraries
NO_GAMES=       true    # do not build games (games/ subdir)
NO_GPIB=        true    # do not build GPIB support
NO_I4B= true    # do not build isdn4bsd package
NO_IPFILTER=    true    # do not build IP Filter package
NO_NETCAT=      true    # do not build netcat
NO_NIS=         # do not build NIS support and related programs.
NO_NLS_CATALOGS=        # do not build NLS catalog support for csh(1)
NO_OPENSSH=     true    # do not build OpenSSH
NO_RCMDS=       true    # do not build or install BSD r* commands (rsh, etc).
NO_SHAREDOCS=           # do not build the 4.4BSD legacy docs
NO_BIND=        true    # Do not build any part of BIND

SUP_UPDATE=     yes
SUP=            /usr/bin/csup
SUPFLAGS=       -g -L 2
SUPHOST=        ftp.freebsd.org 
SUPFILE=        /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE=   /usr/share/examples/cvsup/ports-supfile
DOCSUPFILE=     /usr/share/examples/cvsup/doc-supfile

WITHOUT_X11=yes
X11BASE=${LOCALBASE}

OPTIMIZED_CFLAGS=yes            # ports only?
WITH_OPTIMIZED_CFLAGS=yes       # ports only?

CC=clang
CXX=clang++
CPP=clang-cpp
# Don't forget this when using Jails!
NO_FSCHG=

WITH_CLANG=yes
WITH_CLANG_EXTRAS=yes
WITH_CLANG_IS_CC=yes

# added by use.perl 2012-03-07 16:12:16
PERL_VERSION=5.14.2

Here
  1. I tried to rename /usr/local/bin/svnversion to /usr/local/bin/svnversionXX. The "/usr/local/bin/svnversion" message disappears, but the error is the same.
  2. Now compiled by clang, even removed clang relation in make.conf (back to gcc), error the same.
  3. I tried [cmd=]#sh -x ./sys/conf/newvers.sh[/cmd] and got below result:
    Code:
    + LC_ALL=C
    + export LC_ALL
    + [ ! -r version ]
    + touch version
    + cat version
    + pwd
    + hostname
    + date
    + v=6 u=epopen d=/usr/src h=epopen.com t='Wed Apr 25 10:05:18 CST 2012'
    + make -V KERN_IDENT
    + i=''
    + [ -x /bin/svnversion ]
    + [ -x /usr/bin/svnversion ]
    + [ -x /usr/local/bin/svnversion ]
    + svnversion=/usr/local/bin/svnversion
    + break
    + [ -d ./sys/conf/../../.git ]
    + [ -n /usr/local/bin/svnversion ]
    + echo /usr/local/bin/svnversion
    /usr/local/bin/svnversion
    + cd ./sys/conf/..
    + /usr/local/bin/svnversion
    + svn='Unversioned directory'
    + unset svn
    + [ -n '' ]
    + cat
    + echo 7
    Here, my code sync by cvsup, but system tried "svnversion" and reply "Unversioned directory"
    svnversion exists or not all same error (previous rename test)
How can I apply more debug method and message?
Please help me.:)

Thanks a lot.
Neko
 
Remove the CFLAGS and COPTFLAGS lines. Those are even more questionable with clang. Get it to compile first, then add "optimizations" one at a time to see which breaks it.

All the cleans are not necessary.
Is ftp.freebsd.org really a cvs mirror also?
 
Not related to the buildworld issue but X11BASE=${LOCALBASE} can be removed too. It's not needed anymore.
 
wblock@ said:
Remove the CFLAGS and COPTFLAGS lines. Those are even more questionable with clang. Get it to compile first, then add "optimizations" one at a time to see which breaks it.

All the cleans are not necessary.
Is ftp.freebsd.org really a cvs mirror also?
Thanks quick reply :)
  • About CFLAGS and COPTFLAGS, before 9.0 (6.0~8.2) existed, of course built using gcc and worked fine. I tried using gcc to build 9.0, same error. But I will try your suggestion and build again.
  • Get the whole source code at ftp.freebsd.org? Will try it also. My source tree is synchronized by make update (cvsup), same as ftp.freebsd.org, I think.
Thanks a lot.
 
SirDice said:
Not related to the buildworld issue but X11BASE=${LOCALBASE} can be removed too. It's not needed anymore.
Thaks your reply quickly.
X11BASE existed before 9.0 (6.0~8.2) also.
I will try your suggest also.
Thanks you a lot.
 
epopen said:
X11BASE existed before 9.0 (6.0~8.2) also.
It was used during the transition from /usr/X11R6/bin/ to /usr/local/bin/. This transistion ended ages ago so it's safe to remove now.
 
Also, most of your NO_* entries should be in /etc/src.conf (as WITH_*/WITHOUT_* entries) and not /etc/make.conf. See src.conf(5) for the details.

You may want to remove /etc/make.conf completely (or just rename it) and see if you can complete a buildworld. Then add in one line at a time until you find the one that fails. It will take a while to do that, but it will tell you exactly where the issue is.
 
SirDice said:
It was used during the transition from /usr/X11R6/bin/ to /usr/local/bin/. This transistion ended ages ago so it's safe to remove now.
Thanks, I removed it :e
Thank you a lot.
 
wblock@ said:
Remove the CFLAGS and COPTFLAGS lines. Those are even more questionable with clang. Get it to compile first, then add "optimizations" one at a time to see which breaks it.

All the cleans are not necessary.
Is ftp.freebsd.org really a cvs mirror also?
Hi
result report...
1. Remove CFLAGS and COPTFLAGS try buildworld
Same error....
2. About ftp.freebsd.org
Restore CFLAGS and COPTFLAGS
Got ftp.freebsd.org/pub/FreeBSD/releases/i386/9.0-RELEASE/base,kernel,src.txz
decompress & make buildkernel
Round 1: clang segment fault ...
Round 2: building.

Thanks you a lot.:)
 
You have it set up to use csup to fetch source. Use that. Actually, phoenix makes a very good suggestion in starting with an empty make.conf. I would leave the Perl line and remove everything else. Make sure you haven't changed to something weird, like gcc 4.7. Just for fun, run tzsetup(8) before trying it again.
 
phoenix said:
Also, most of your NO_* entries should be in /etc/src.conf (as WITH_*/WITHOUT_* entries) and not /etc/make.conf. See src.conf(5) for the details.

You may want to remove /etc/make.conf completely (or just rename it) and see if you can complete a buildworld. Then add in one line at a time until you find the one that fails. It will take a while to do that, but it will tell you exactly where the issue is.
Thanks you a lot.
I will do it.

But have two question...
1.after
Code:
man src.conf
I found WITH_CLANG
But if I didn't set WITH_CLANG in make.conf (previous test)
Build world by "gcc":p (default gcc)
Is it mistake?

2.I checked http://wiki.freebsd.org/BuildingFreeBSDWithClang
Page said "If you want to use clang for everything, even ports, set WITH_CLANG in /etc/make.conf"
I want compile ports with clang.

So WITH_CLANG set in /etc/make.conf and /etc/src.conf is best solution?

Thanks you a lot:e
 
feralape said:
Quick question, why use NO_XXX instead of WITHOUT_XXX

src.conf says to use WITHOUT_XXX, what's the difference?
src.conf(5)

Simple explanation. Using those NO_* variables in /etc/make.conf was the old, and now depricated, way. src.conf(5) replaced it.
 
epopen said:
I want compile ports by clang

So WITH_CLANG set in /etc/make.conf and /etc/src.conf is best solution?

Don't try that yet, it's still experimental and doesn't work for some ports. Get the basics working first.
 
Hi everyone.
Test result:
I update /usr/src source code yesterday.
And follow wblock's suggest, take simple /etc/make.conf like:
Code:
CPUTYPE=pentium3m 
WITHOUT_X11=yes
CC=clang
CXX=clang++
CPP=clang-cpp
NO_FSCHG=
WITH_CLANG=yes
WITH_CLANG_EXTRAS=yes
WITH_CLANG_IS_CC=yes
But same error. :(
I will remove /etc/make.conf and try again.

The error message simple too, I don't know root cause.
Have debug method for it?

Thanks a lot.
 
wblock@ said:
1. Don't try clang yet.
2. Did you run tzsetup(8) as root yet?
3. I don't see an actual error in post #1.
4. svnversion is part of devel/subversion. There may be a problem with that port. For now, easiest to just deinstall it.

Thanks a lot.

I had been rebuild again...
I remove /etc/make.conf and /etc/src.conf.
And your suggestion:
  1. Don't try clang yet.
    OK (No /etc/make.conf)
  2. Did you run tzsetup(8) as root yet?
    Yes, I live in Taiwan so
    • "Select local or UTC (Greenwich Mean Time) clock" choose "No"
    • "Time Zone Selector" choose "Asia"->"Taiwan"
    • "Does the abbreviation `CST' look reasonable?" choose "Yes"
  3. I don't see an actual error in post #1.
    I don't know why no error message.
  4. svnversion is part of devel/subversion. There may be a problem with that port. For now, easiest to just deinstall it.
    Yes, I remove subversion by # pkg_deinstall subversion
Before enter # script command,
clean source code by
# rm -rf /usr/obj/usr && make clean && make cleandir && make cleandir
Later, enter # script command and logger # /usr/src/make buildworld
Final, same build fail.....

About build fail log by # script
Please visit my server http://gallery.epopen.com/main.php?g2_view=core.DownloadItem&g2_itemId=26360 and download log file.
Please reference it

Thanks a lot.
 
In the future, pastebin.com or similar sites make it easier for people to read log files.

Code:
===> gnu/usr.bin/texinfo/doc (installincludes)
===> include (includes)
cd /usr/src/include; make buildincludes; make installincludes
creating osreldate.h from newvers.sh
*** Error code 1

Stop in /usr/src/include.
*** Error code 1

This still makes me think a time/date problem. Check that the time and date are set correctly.
Are you trying this in single-user mode?
# adjkerntz -i
might help.
 
wblock@ said:
In the future, pastebin.com or similar sites make it easier for people to read log files.

Code:
===> gnu/usr.bin/texinfo/doc (installincludes)
===> include (includes)
cd /usr/src/include; make buildincludes; make installincludes
creating osreldate.h from newvers.sh
*** Error code 1

Stop in /usr/src/include.
*** Error code 1

This still makes me think a time/date problem. Check that the time and date are set correctly.
Are you trying this in single-user mode?
# adjkerntz -i
might help.
Thank you a lot!
I had been testing your suggestioms.
  1. No /etc/make.conf and /etc/make.conf and # /usr/src/rm -rf /usr/obj/usr && make clean && make cleandir && make cleandir
  2. Reboot machine into single-user mode.
  3. # adjkerntz -i
  4. # cd /usr/src/ && make buildworld
  5. Got the same error:(
Later:
My laptop (FreeBSD 9.0-stable amd64) buildworld and buildkernel work fine (fresh install via 9.0 DVD, not upgrade!). So I got the source code from ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.0-RELEASE/src.txz and updated the source via # make update and no /etc/make.conf and /etc/make.conf and # make buildworld
Got the same error.

In my machine, current FreeBSD version is i386-stable, upgrade from 8.2 via source code. Means buildworld (9.0 source code) works fine in an 8.2 environment. But buildworld fails in a 9.0 environment.

So my machine has a problem now, I think. But I don't know how to identify and debug it, buildworld result doesn't show any useful message. May I reinstall machine or other?

Thanks a lot.
 
epopen said:
Later...
My laptop (FreeBSD 9.0-stable amd64) buildworld and buildkernel work fine.
(Fresh install via 9.0 DVD, not upgrade!)

9.0 installed from the DVD is -RELEASE, not -STABLE. You did a buildworld and buildkernel successfully?

So I got source code from ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.0-RELEASE/src.txz
And update source via # make update.

csup(1) will fetch the entire source. If there are extra files in /usr/src, they will not be removed, and could cause problems.

# rm -rf /usr/obj
# rm -rf /usr/src
# csup 9stable-supfile
# cd /usr/src
# make buildkernel

If that doesn't work, I don't know what else to suggest, other than maybe the system time is set to UTC.
 
wblock@ said:
9.0 installed from the DVD is -RELEASE, not -STABLE. You did a buildworld and buildkernel successfully?
Sorry, I miss one thing..
After laptop fresh install FreeBSD 9.0-RELEASE from DVD
# /usr/src/make update
In /etc/make.conf, had
Code:
SUP=/usr/bin/csup
SUPFLAGS=-g -L 2
SUPHOST=cvsup.tw.FreeBSD.org
SUPFILE=/usr/share/examples/cvsup/stable-supfile
So after buildworld and buildkernel and install, became to STABLE.
And result:
Code:
FreeBSD 9.0-STABLE #0: Wed May  2 12:22:18 CST 2012
:p

wblock@ said:
csup(1) will fetch the entire source. If there are extra files in /usr/src, they will not be removed, and could cause problems.

# rm -rf /usr/obj
# rm -rf /usr/src
# csup 9stable-supfile
# cd /usr/src
# make buildkernel

Yes, I tried
# rm -rf /usr/obj
# rm -rf /usr/src
# csup /usr/share/examples/cvsup/stable-supfile
Here, because no /etc/make.conf and /etc/make.conf
So I modified /usr/share/examples/cvsup/stable-supfile,
Code:
*default host=cvsup.tw.FreeBSD.org
# cd /usr/src
# make buildkernel
Result: got same error/fail.

wblock@ said:
If that doesn't work, I don't know what else to suggest, other than maybe the system time is set to UTC.
Yes, today I plan to try
# adjkerntz -i
in single-user mode again.
If it can't work try reinstall fresh 9.0 i386 from DVD maybe :p

Update: Test result.
Still build error fail..

Thanks you a lot!
 
Hi everyone,

The issue fixed.
Reason: I had installed git, and managed system configure by git, so /.git exist. But src/sys/conf/newvers.sh, if git exist.
Code:
SYSDIR=$(dirname $0)/..
Result: variable SYSDIR=/bin/.. ($0=/bin/sh)
And
Code:
git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git"
Result: variable git_cmd=/usr/local/bin/git --git-dir=/bin/../../.git
And
Code:
git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null`
Result: variable git=a64d741 (My system configure least commit ID)
Least.. all of variable combined and execute under...
Code:
svn=`$git_cmd svn find-rev $git 2>/dev/null`
# make buildworldError assert here!!
I tried to execute it like
[CMD="/usr/src/include #"]/usr/local/bin/git --git-dir=/bin/../../.git svn find-rev a64d741[/CMD]
got
Code:
git: 'svn' is not a git command. See 'git --help'.

Did you mean one of these?
        fsck
        show
Solution: Rename /usr/local/bin/git to other name.
Prevent newvers.sh error.
Now, make buildworld finished and successful.

If git exists, newvers.sh causes an error by other one same, I checked google, and saw some work-around. Is it a bug?

Thanks everyone a lot!

Note: How can I mark thread [Solved]?
 
I ran into the same issue when I had a .git directory in the / directory. Try the patch in my PR:

http://www.freebsd.org/cgi/query-pr.cgi?pr=174422

The problem is that the newvers.sh script is broken. It somehow works for SVN but the GIT revision detection breaks because the newvers.sh is sourced instead of executed, resulting in $0 being set to /bin/sh instead of the path to newvers.sh and the GIT revision detection ends up finding the ./git directory instead of the intended /usr/src/.git.
 
Back
Top