Bug 28002

Summary: SHARED=symlinks is broken
Product: Base System Reporter: reel <reel>
Component: binAssignee: ru <ru>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-STABLE   
Hardware: Any   
OS: Any   

Description reel 2001-06-10 04:50:01 UTC
When doing a "make world", it seems that it has a problem with
sys/netinet/ip_compat.h
I get the message:
===> sbin/ipf
make: don't know how to make /usr/src/sbin/ipf/../../sys/netinet/ip_compat.h. St
op
*** Error code 2
1 error
[four Error code 2]
I cvsup'd today twice and I make world twice (it occured twice).

Fix: 

not at the moment.
How-To-Repeat: CVSup from cvsup2.freebsd.org for 4.3-STABLE (releng4) and then,
usual things for make world:
cd /usr/src
make world
Then, it breaks. :|
Comment 1 peter 2001-06-10 06:44:47 UTC
reel@sympatico.ca wrote:

> >Description:
> When doing a "make world", it seems that it has a problem with
> sys/netinet/ip_compat.h
> I get the message:
> ===> sbin/ipf
> make: don't know how to make /usr/src/sbin/ipf/../../sys/netinet/ip_compat.h.

This is because of either:
1) You are using 'make -DNOCLEAN world' (dont do this) and you have a stale
   .depend file
or
2) Something is stale in your obj directory.  rm -rf /usr/obj/*

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5
Comment 2 Bruce Evans 2001-06-10 08:24:39 UTC
On Sat, 9 Jun 2001, Peter Wemm wrote:

>  reel@sympatico.ca wrote:
>  
>  > >Description:
>  > When doing a "make world", it seems that it has a problem with
>  > sys/netinet/ip_compat.h
>  > I get the message:
>  > ===> sbin/ipf
>  > make: don't know how to make /usr/src/sbin/ipf/../../sys/netinet/ip_compat.h.
>  
>  This is because of either:
>  1) You are using 'make -DNOCLEAN world' (dont do this) and you have a stale
>     .depend file
>  or
>  2) Something is stale in your obj directory.  rm -rf /usr/obj/*

This is actually because the SHARED=symlinks case was broken by moving
ipfilter, despite this case being the usual case for makeworld.  From
src/Makefile.inc1:

	@echo "--------------------------------------------------------------"
	@echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
	@echo "--------------------------------------------------------------"
	cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
				^^^^^^^^^^^^^^^^^^^^^^^^
	@echo
	@echo "--------------------------------------------------------------"
	@echo ">>> stage 4: building libraries"
	@echo "--------------------------------------------------------------"
	cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
	@echo
	@echo "--------------------------------------------------------------"
	@echo ">>> stage 4: make dependencies"
	@echo "--------------------------------------------------------------"
	cd ${.CURDIR}; ${WMAKE} par-depend
	@echo
	@echo "--------------------------------------------------------------"
	@echo ">>> stage 4: building everything.."
	@echo "--------------------------------------------------------------"
	cd ${.CURDIR}; ${WMAKE} all

Bruce
Comment 3 greid freebsd_committer freebsd_triage 2001-06-10 11:09:21 UTC
State Changed
From-To: open->closed
Comment 4 Bruce Evans 2001-06-10 11:58:06 UTC
[Cc corrected]

On Sun, 10 Jun 2001, Peter Wemm wrote:

> Bruce Evans wrote:
> > On Sat, 9 Jun 2001, Peter Wemm wrote:
> > 
> > >  reel@sympatico.ca wrote:
> > >  
> > >  > >Description:
> > >  > When doing a "make world", it seems that it has a problem with
> > >  > sys/netinet/ip_compat.h
> > >  > I get the message:
> > >  > ===> sbin/ipf
> > >  > make: don't know how to make /usr/src/sbin/ipf/../../sys/netinet/ip_comp
>     at.h.
> > >  
> > >  This is because of either:
> > >  1) You are using 'make -DNOCLEAN world' (dont do this) and you have a stal
>     e
> > >     .depend file
> > >  or
> > >  2) Something is stale in your obj directory.  rm -rf /usr/obj/*
> > 
> > This is actually because the SHARED=symlinks case was broken by moving
> > ipfilter, despite this case being the usual case for makeworld.  From
> > src/Makefile.inc1:
> > 
> > 	@echo "--------------------------------------------------------------"
> > 	@echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
> > 	@echo "--------------------------------------------------------------"
> > 	cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
> 
> SHARED=symlinks may be broken, but it isn't causing world to die.  I have
> two recent -stable (as little as 10 minutes ago) builds that I can show you
> if you dont believe me.

That is another bug :-).  You must have garbage in /usr/include/netinet
from a previous installworld.  Buildworld picks up this garbage because
-nostdinc was removed from CFLAGS in rev.1.105 of src/Makefile.inc1.

> The actual error message comes from stale .depend data. That is the only
> way that make ever gets told about the existance of
> "/usr/src/sbin/ipf/../../sys/netinet/ip_compat.h"

Yes.  I haven't actually run makeworld to test this and jumped to some
conclusions.

> See the CFLAGS in -stable:
> CFLAGS+=-DIPL_NAME=\"/dev/ipl\" -I- -I${.CURDIR}/../../sys/netinet \
>  -I${.CURDIR}/../../contrib/ipfilter
> 
> These should be changed to ../../sys/contrib/ipfilter/netinet for -stable.
> 
> However, this is not breaking the build.  It may not be correct, but it
> is not causing an abort.  Stale .depend data is causing the make failures.
> 
> It is also broken on -current for different reasons.  Sometimes it uses the
> ones from sys/netinet via the installed includes, and other times it uses
> the ones in ../../contrib/ipfilter  (when doing #include "ip_compat.h" etc).

It seems to only find "ip_compat.h" there.  This is enough to build ipf.
ipmon apparently uses <netinet/foo.h> so it doesn't build unless the
ipfilter headers are in a subdir named netinet somewhere (and a default
or -I path to the directory above).

> Somebody got carried away in removing -I../../sys in -current and broke
> things even more by removing -I../../sys/netinet at the same time.

Bruce
Comment 5 peter 2001-06-10 23:11:53 UTC
Bruce Evans wrote:
> [Cc corrected]
> 
> On Sun, 10 Jun 2001, Peter Wemm wrote:
> 
> > Bruce Evans wrote:
> > > On Sat, 9 Jun 2001, Peter Wemm wrote:
> > > 
> > > >  reel@sympatico.ca wrote:
> > > >  
> > > >  > >Description:
> > > >  > When doing a "make world", it seems that it has a problem with
> > > >  > sys/netinet/ip_compat.h
> > > >  > I get the message:
> > > >  > ===> sbin/ipf
> > > >  > make: don't know how to make /usr/src/sbin/ipf/../../sys/netinet/ip_
    comp
> >     at.h.
> > > >  
> > > >  This is because of either:
> > > >  1) You are using 'make -DNOCLEAN world' (dont do this) and you have a 
    stal
> >     e
> > > >     .depend file
> > > >  or
> > > >  2) Something is stale in your obj directory.  rm -rf /usr/obj/*
> > > 
> > > This is actually because the SHARED=symlinks case was broken by moving
> > > ipfilter, despite this case being the usual case for makeworld.  From
> > > src/Makefile.inc1:
> > > 
> > > 	@echo "--------------------------------------------------------------"
> > > 	@echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
> > > 	@echo "--------------------------------------------------------------"
> > > 	cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
> > 
> > SHARED=symlinks may be broken, but it isn't causing world to die.  I have
> > two recent -stable (as little as 10 minutes ago) builds that I can show you
> > if you dont believe me.
> 
> That is another bug :-).  You must have garbage in /usr/include/netinet
> from a previous installworld.  Buildworld picks up this garbage because
> -nostdinc was removed from CFLAGS in rev.1.105 of src/Makefile.inc1.

Actually, I did two build/installworlds, in this order.  I was concerned
about junk in /usr/include as a result of switching this box from
-current to -stable.
0) rm -rf /usr/obj/*
1) make buildworld
2) make installworld
3) mv /usr/include /usr/include.old; also clean up old files in / and /usr
4) make installworld
5) rm -rf /usr/obj/*
6) make world

The problem is that ipf.c etc has this crud:
#include "ip_compat.h"
#include "ip_fil.h"
#include "ip_nat.h"
#include "ip_state.h"
#include "ipf.h"
#include "ipl.h"
-nostdinc has no bearing on that at all.  We *needed* the -I../../sys/netinet
so that everything was supposed to use the same include files, but in
-current ru@freebsd.org removed it without replacing the functionality.

> > See the CFLAGS in -stable:
> > CFLAGS+=-DIPL_NAME=\"/dev/ipl\" -I- -I${.CURDIR}/../../sys/netinet \
> >  -I${.CURDIR}/../../contrib/ipfilter
> > 
> > These should be changed to ../../sys/contrib/ipfilter/netinet for -stable.
> > 
> > However, this is not breaking the build.  It may not be correct, but it
> > is not causing an abort.  Stale .depend data is causing the make failures.
> > 
> > It is also broken on -current for different reasons.  Sometimes it uses the
> > ones from sys/netinet via the installed includes, and other times it uses
> > the ones in ../../contrib/ipfilter  (when doing #include "ip_compat.h" etc)
    .
> 
> It seems to only find "ip_compat.h" there.  This is enough to build ipf.
> ipmon apparently uses <netinet/foo.h> so it doesn't build unless the
> ipfilter headers are in a subdir named netinet somewhere (and a default
> or -I path to the directory above).

Personally, with disk space being as cheap as it is, I feel we should
deorbit SYMLINKS=shared.  After all, some people even build their entire
worlds static.  This would greatly reduce the complexity of building an
include tree and reduce the margin for error.

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5
Comment 6 Bruce Evans 2001-06-11 00:56:24 UTC
On Sun, 10 Jun 2001, Peter Wemm wrote:

>  > > SHARED=symlinks may be broken, but it isn't causing world to die.  I have
>  > > two recent -stable (as little as 10 minutes ago) builds that I can show you
>  > > if you dont believe me.
>  > 
>  > That is another bug :-).  You must have garbage in /usr/include/netinet
>  > from a previous installworld.  Buildworld picks up this garbage because
>  > -nostdinc was removed from CFLAGS in rev.1.105 of src/Makefile.inc1.
>  
>  Actually, I did two build/installworlds, in this order.  I was concerned
>  about junk in /usr/include as a result of switching this box from
>  -current to -stable.
>  0) rm -rf /usr/obj/*
>  1) make buildworld

This can work because you have an old (but sufficiently current to work)
set of ipfilter headers in /usr/include/netinet ...

>  2) make installworld

and this installs a current set of ipfilter headers in /usr/include/netinet
(but this set will be "old" again for the next build, because the sources
may have changed).

>  3) mv /usr/include /usr/include.old; also clean up old files in / and /usr

This gets rid of all the headers ...

>  4) make installworld

... and this installs all headers again, including a current set of ipfilter
headers.

>  5) rm -rf /usr/obj/*
>  6) make world

This works because you have an old (but sufficiently current to work)
set of ipfilter headers in /usr/include/netinet ...

Here the headers are certainly sufficiently current to work, because
you just installed them, but this is not true in general.  People
upgrading from RELENG_4 have the RELENG_4 headers and might fail in
step (1).

>  The problem is that ipf.c etc has this crud:
>  #include "ip_compat.h"
>  #include "ip_fil.h"
>  #include "ip_nat.h"
>  #include "ip_state.h"
>  #include "ipf.h"
>  #include "ipl.h"
>  -nostdinc has no bearing on that at all.  We *needed* the -I../../sys/netinet
>  so that everything was supposed to use the same include files, but in
>  -current ru@freebsd.org removed it without replacing the functionality.

I see.  ipmon seems to be the only exception.  ipmon/Makefile only used
-I../../sys, and ipmon.c only uses:

#include "netinet/ip_compat.h"
#include "netinet/ip_fil.h"
#include "netinet/ip_proxy.h"
#include "netinet/ip_nat.h"
#include "netinet/ip_state.h"

>  Personally, with disk space being as cheap as it is, I feel we should
>  deorbit SYMLINKS=shared.  After all, some people even build their entire
>  worlds static.  This would greatly reduce the complexity of building an
>  include tree and reduce the margin for error.

You mean SHARED=symlinks.  This is more for avoiding having a separate
copy of the headers than to save space.  Copies of things are sources
of bitrot.

Bruce
Comment 7 ru freebsd_committer freebsd_triage 2001-06-11 10:01:42 UTC
State Changed
From-To: closed->open

SHARED=symlink case is currently broken.
Comment 8 ru freebsd_committer freebsd_triage 2001-10-11 15:44:25 UTC
Responsible Changed
From-To: freebsd-bugs->ru

I plan to work this out. 
Somehow...
Comment 9 ru freebsd_committer freebsd_triage 2002-07-22 15:29:25 UTC
State Changed
From-To: open->closed

This feature is now back available in 4.6-STABLE and 5.0-CURRENT.