Bug 181344

Summary: Buildworld fail at xinstall when upgrading from 9.1-STABLE
Product: Base System Reporter: Rudy <crapsh>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: bdrewery
Priority: Normal    
Version: 9.1-STABLE   
Hardware: Any   
OS: Any   

Description Rudy 2013-08-16 18:40:00 UTC
Running 'svnup stable' creates a system that cannot be built.
This bug has been around a while:
       http://lists.freebsd.org/pipermail/freebsd-current/2013-April/041410.html
       http://lists.freebsd.org/pipermail/freebsd-stable/2013-March/072981.html

A users expectation is that a minor upgrade should compile without manual
interventions.  Please fix this build issue, thank you!

Fix: 

Don't know how to fix.
How-To-Repeat: # cd /usr/src/usr.bin/xinstall
# rm xinstall.c
# svnup stable
# make
cc -O2 -pipe  -I/usr/src/usr.bin/xinstall/../../contrib/mtree -I/usr/src/usr.bin/xinstall/../../lib/libnetbsd -I/usr/src/usr.bin/xinstall/../../lib/libmd -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/usr.bin/xinstall/xinstall.c
cc1: warnings being treated as errors
/usr/src/usr.bin/xinstall/xinstall.c: In function 'main':
/usr/src/usr.bin/xinstall/xinstall.c:301: warning: implicit declaration of function 'gid_from_group'
/usr/src/usr.bin/xinstall/xinstall.c:301: warning: nested extern declaration of 'gid_from_group'
/usr/src/usr.bin/xinstall/xinstall.c:311: warning: implicit declaration of function 'uid_from_user'
/usr/src/usr.bin/xinstall/xinstall.c:311: warning: nested extern declaration of 'uid_from_user'
/usr/src/usr.bin/xinstall/xinstall.c: In function 'metadata_log':
/usr/src/usr.bin/xinstall/xinstall.c:1331: warning: implicit declaration of function 'strsvis'
/usr/src/usr.bin/xinstall/xinstall.c:1331: warning: nested extern declaration of 'strsvis'
*** [xinstall.o] Error code 1
Comment 1 rudy 2013-08-20 16:35:05 UTC
This bug still exists as of 8/20/2013.

Rudy



# cd /usr/src/
# svnup stable
# make clean && make -j 4 buildworld

...

cc -O2 -pipe  -I/usr/src/usr.bin/xinstall/../../contrib/mtree 
-I/usr/src/usr.bin/xinstall/../../lib/libnetbsd 
-I/usr/src/usr.bin/xinstall/../../lib/libmd -std=gnu99 -fstack-protector 
-Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter 
-Wcast-align -Wchar-subscripts -Winline -Wnested-externs 
-Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/usr.bin/xinstall/../../contrib/mtree/getid.c
gzip -cn /usr/src/usr.bin/xinstall/install.1 > install.1.gz
cc1: warnings being treated as errors
/usr/src/usr.bin/xinstall/xinstall.c: In function 'metadata_log':
/usr/src/usr.bin/xinstall/xinstall.c:1331: warning: implicit declaration 
of function 'strsvis'
/usr/src/usr.bin/xinstall/xinstall.c:1331: warning: nested extern 
declaration of 'strsvis'
*** [xinstall.o] Error code 1
1 error
*** [all] Error code 2
1 error
*** [usr.bin.all__D] Error code 2
2 errors
*** [everything] Error code 2
1 error
*** [buildworld] Error code 2
1 error

# cat /etc/make.conf
KERNCONF="INJERA"
# added by use.perl 2013-02-06 22:32:17
PERL_VERSION=5.14.2
# uname -a
FreeBSD lavash.monkeybrains.net 9.1-STABLE FreeBSD 9.1-STABLE #6: Sat 
Jan  5 00:00:01 PST 2013 
monkey@injera.monkeybrains.net:/usr/obj/usr/src/sys/INJERA  amd64
Comment 2 Rudy 2013-08-27 17:52:13 UTC
Workaround:
  [1] Build 9.2 on another server and sync to old system.
       rsync -av /usr/obj  old91system:/usr/
       rsync -av /usr/src old91system:/usr/
  [2] Then run install on old system.
       cd /usr/src && make installkernel && make installworld
  [3] Run your mergemaster, check your loader.conf, and reboot!

Cheers,
Rudy
Comment 3 Bryan Drewery freebsd_committer freebsd_triage 2016-08-10 17:49:09 UTC
It's not supported to build directly in usr.bin/xinstall in an upgrade scenario.  One must use buildworld to get the proper headers and symbols from the new source.

Also given this hasn't been reported again in 3 years I am considering it no longer valid.  The linked reports look like attempted workarounds until r248332 was added to bring in -l compatibility in the bootstrap.