From obrien@NUXI.org  Wed May  4 15:27:07 2011
Return-Path: <obrien@NUXI.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 05F001065676
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 May 2011 15:27:07 +0000 (UTC)
	(envelope-from obrien@NUXI.org)
Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85])
	by mx1.freebsd.org (Postfix) with ESMTP id DEBF28FC22
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 May 2011 15:27:06 +0000 (UTC)
Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1])
	by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id p44FR67E056052
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 4 May 2011 08:27:06 -0700 (PDT)
	(envelope-from obrien@dragon.nuxi.org)
Received: (from obrien@localhost)
	by dragon.nuxi.org (8.14.4/8.14.4/Submit) id p44FR6WD056051;
	Wed, 4 May 2011 08:27:06 -0700 (PDT)
	(envelope-from obrien)
Message-Id: <201105041527.p44FR6WD056051@dragon.nuxi.org>
Date: Wed, 4 May 2011 08:27:06 -0700 (PDT)
From: "David O'Brien" <obrien@freebsd.org>
Reply-To: "David O'Brien" <obrien@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: WITHOUT_CDDL and NO_CTF ignored if WITH_CTF defined
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         156817
>Category:       misc
>Synopsis:       [build] [patch] WITHOUT_CDDL and NO_CTF ignored if WITH_CTF defined
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    fjoe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 04 15:30:09 UTC 2011
>Closed-Date:    Wed Dec 14 06:45:13 UTC 2011
>Last-Modified:  Wed Dec 14 06:45:13 UTC 2011
>Originator:     David O'Brien
>Release:        FreeBSD 9.0-CURRENT i386
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD dragon.NUXI.org 9.0-CURRENT FreeBSD 9.0-CURRENT #664 r221012M: Mon Apr 25 08:32:28 PDT 2011 root@dragon.NUXI.org:/sys/i386/compile/DRAGON i386
>Description:
	Starting with r206082 (I believe), the "-DNO_CTF" became ignored
	in the "stage 1.1: legacy release compatibility shims",
	"stage 1.2: bootstrap tools", "stage 2.3: build tools", and
	"stage 3: cross tools" parts of the build if
	WITH_CTF=yes is in '/etc/src.conf'.
	John Birrell's claim in r179233 is that these stages of the build
	do not require CTF conversion.

	Additionally, it appears that WITH_CTF now has higher precidence
	than WITHOUT_CDDL.  [WITH_CTF=yes in /etc/src.conf combined with
	'make -DWITHOUT_CDDL buildworld' or WITHOUT_CDDL=yes in /etc/make.conf]
	If so, I feel this is wrong as if someone has set WITHOUT_CDDL
	they have strong licensing needs (restrictions).  And so not
	running the CTF tools is of lesser importance than accidently
	falling into a legal problem.
>How-To-Repeat:
	Perform builds with the above settings and look at the output
>Fix:
	revisit r206082.

>Release-Note:
>Audit-Trail:

From: Alexander Leidinger <netchild@FreeBSD.org>
To: obrien@FreeBSD.org
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/156817: WITHOUT_CDDL and NO_CTF ignored if WITH_CTF
 defined
Date: Tue, 10 May 2011 16:00:05 +0200

 This message is in MIME format.
 
 --=_vexzd7bwxq8
 Content-Type: text/plain;
  charset=UTF-8;
  DelSp="Yes";
  format="flowed"
 Content-Disposition: inline
 Content-Transfer-Encoding: 7bit
 
 Quoting David O'Brien <obrien@FreeBSD.org> (from Wed, 4 May 2011  
 09:57:50 -0700):
 
 > 1. I believe (but not positive) you've given WITH_CTF higher
 >    precidence than WITHOUT_CDDL.
 >    If so, I feel this is wrong as if someone has set WITHOUT_CDDL
 >    they have strong licensing needs (restrictions).  And so not running
 >    the CTF tools is of lesser importance than [accidently?] falling into
 >    a legal problem.
 
 IMHO it is in the same boat as the result of a compilation with gcc  
 regarding the licensing issue (attention: IANAL), the ctf tools take  
 stuff from our (BSD licensensed) source and write this info in a  
 specific format into our binaries.
 
 Putting the licensing (or not) issue aside, I see another reason to  
 not allow WITH_CTF together with WITHOUT_CDDL: The ctf tools are used  
 during building the userland, so it looks to me like we should do the  
 same with the ctf tools as we do with the compiler, we should build  
 them before using them, this way we are sure we have them (in case a  
 world was compiled without them before), or we can issue a warning and  
 continue without the ctf stuff (smooth fallback).
 
 Do you have a way to test the attached patch? I lack the time to do it ATM.
 
 Instead of the warning and automatic fallback we could also isse an  
 error. Feel free to paint the bikeshed. If it works, feel also free to  
 commit it.
 
 > 2. In the "stage 1.1: legacy release compatibility shims",
 >    "stage 1.2: bootstrap tools", "stage 2.3: build tools", and
 >    "stage 3: cross tools" -DNO_CTF is put into the environment
 >    but ctfconvert is still run.
 
 This needs more investigation for a fix...
 
 Bye,
 Alexander.
 
 -- 
 http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
 http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137
 You can't go home again, unless you set $HOME.
 
 
 --=_vexzd7bwxq8
 Content-Type: text/x-patch;
  charset=UTF-8;
  name="cddl_ctf.diff"
 Content-Disposition: attachment;
  filename="cddl_ctf.diff"
 Content-Transfer-Encoding: 7bit
 
 Index: Makefile.inc1
 ===================================================================
 --- Makefile.inc1	(Revision 221420)
 +++ Makefile.inc1	(Arbeitskopie)
 @@ -1080,6 +1080,10 @@
  _rescue= rescue/rescue
  .endif
  
 +.if (${MK_CDDL} != "no") && defined(WITH_CTF)
 +_ctf_tools= cddl/usr.bin/ctfconvert cddl/usr.bin/ctfdump cddl/usr.bin/ctfmerge
 +.endif
 +
  build-tools:
  .for _tool in \
      bin/csh \
 @@ -1101,6 +1105,7 @@
  .endfor
  .for _tool in \
      gnu/usr.bin/cc/cc_tools \
 +    ${_ctf_tools} \
      ${_kerberos5_tools}
  	${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
  		cd ${.CURDIR}/${_tool}; \
 Index: share/mk/bsd.lib.mk
 ===================================================================
 --- share/mk/bsd.lib.mk	(Revision 221420)
 +++ share/mk/bsd.lib.mk	(Arbeitskopie)
 @@ -33,6 +33,12 @@
  NO_WERROR=
  .endif
  
 +# The CTF conversation depends upon tools within the CDDL code
 +.if defined (WITH_CTF) && defined(WITHOUT_CDDL)
 +.warning "WITH_CTF and WITHOUT_CDDL are set at the same time, removing WITH_CTF"
 +.undef WITH_CTF
 +.endif
 +
  # Enable CTF conversion on request.
  .if defined(WITH_CTF)
  .undef NO_CTF
 Index: share/mk/bsd.prog.mk
 ===================================================================
 --- share/mk/bsd.prog.mk	(Revision 221420)
 +++ share/mk/bsd.prog.mk	(Arbeitskopie)
 @@ -15,6 +15,12 @@
  NO_WERROR=
  .endif
  
 +# The CTF conversation depends upon tools within the CDDL code
 +.if defined (WITH_CTF) && defined(WITHOUT_CDDL)
 +.warning "WITH_CTF and WITHOUT_CDDL are set at the same time, removing WITH_CTF"
 +.undef WITH_CTF
 +.endif
 +
  # Enable CTF conversion on request.
  .if defined(WITH_CTF)
  .undef NO_CTF
 
 --=_vexzd7bwxq8--
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Sun Dec 4 00:14:35 UTC 2011 
State-Changed-Why:  
With the most recent checkins, is this PR still relevant? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156817 
Responsible-Changed-From-To: freebsd-bugs->fjoe 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Wed Dec 14 02:35:52 UTC 2011 
Responsible-Changed-Why:  
Max, 
I suspect this PR should be closed based on your recent comments. 
Can you take a look at this PR to see if there is any remaining 
value in it?  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156817 
State-Changed-From-To: feedback->closed 
State-Changed-By: fjoe 
State-Changed-When: Wed Dec 14 06:40:52 UTC 2011 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=156817 
State-Changed-From-To: closed->feedback 
State-Changed-By: fjoe 
State-Changed-When: Wed Dec 14 06:43:20 UTC 2011 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=156817 
State-Changed-From-To: feedback->closed 
State-Changed-By: fjoe 
State-Changed-When: Wed Dec 14 06:43:39 UTC 2011 
State-Changed-Why:  
In HEAD after r228158: 
- NO_CTF overrides WITH_CTF so that ctfconvert is always disabled during 
buildworld tools build stages 
- WITHOUT_CDDL takes precedence over WITH_CTF 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156817 
>Unformatted:
