From nobody@FreeBSD.org  Sat Feb 19 03:34:44 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EDBAA16A4D5
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 19 Feb 2005 03:34:44 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C990643D53
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 19 Feb 2005 03:34:44 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j1J3Yidq075493
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 19 Feb 2005 03:34:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j1J3YiZb075492;
	Sat, 19 Feb 2005 03:34:44 GMT
	(envelope-from nobody)
Message-Id: <200502190334.j1J3YiZb075492@www.freebsd.org>
Date: Sat, 19 Feb 2005 03:34:44 GMT
From: Bartosz Fabianowski <freebsd@chillt.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Fix for ports/77403 introduced circular dependency in ports tree
X-Send-Pr-Version: www-2.3

>Number:         77707
>Category:       ports
>Synopsis:       Fix for ports/77403 introduced circular dependency in ports tree
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 19 03:40:17 GMT 2005
>Closed-Date:    Mon Apr 11 18:45:55 GMT 2005
>Last-Modified:  Mon Apr 11 18:45:55 GMT 2005
>Originator:     Bartosz Fabianowski
>Release:        5.3-STABLE
>Organization:
>Environment:
FreeBSD takahe.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Mon Feb 14 17:57:24 CET 2005     root@takahe.local:/usr/obj/usr/src/sys/TAKAHE  i386
>Description:
The fix for ports/77403, commited on 13th February, introduced a possible circular dependency in the ports tree. The following line was added to the port's Makefile:

USE_GCC= 2.7+

The way this is handled by Mk/bsd.gcc.mk, the port now depends on the earliest version of GCC that is at least 2.7. On my machine, the installed versions of GCC are 3.4 (system) and 3.2 (from ports). Since the earliest version of GCC on this machine is 3.2, the GCC 3.2 port now depends on itself. This is a very bad thing (TM) and, for example, breaks the INDEX build.
>How-To-Repeat:
On a machine with the following two versions of GCC installed, run make index with an up-to-date ports tree:

* system GCC > 3.2 (OSVERSION >= 501103)
* GCC 3.2 installed from ports

The GCC 3.2 port will pick up itself as a build dependency.
>Fix:
USE_GCC= 2.7+ is completely useless as no version of GCC prior to 2.7 is available on FreeBSD anyway - neither in ports nor in the system. The obvious fix is therefore to remove this line from the port's Makefile.
>Release-Note:
>Audit-Trail:

From: Mark Linimon <linimon@lonesome.com>
To: Bartosz Fabianowski <freebsd@chillt.de>
Cc: freebsd-gnats-submit@FreeBSD.org,
	<freebsd-ports-bugs@FreeBSD.org>
Subject: Re: ports/77707: Fix for ports/77403 introduced circular dependency
 in ports tree
Date: Fri, 18 Feb 2005 21:53:59 -0600 (CST)

 On Sat, 19 Feb 2005, Bartosz Fabianowski wrote:
 
 > USE_GCC= 2.7+ is completely useless as no version of GCC prior to 2.7 is
 > available on FreeBSD anyway - neither in ports nor in the system. The
 > obvious fix is therefore to remove this line from the port's Makefile.
 
 Well AFAIR it's not; I think a recent change to bsd.port.mk requires
 USE_GCC to be set to some useful value, where previously the port
 internally used USE_GCC for its own purposes.  So we've overloaded
 the meaning of the variable.  At least this is what I recall.
 
 But you're correct in that the current situation is broken.  I don't
 know enough about the problem to suggest a correct fix.
 
 You might try rebuilding this port without that line in it to prove
 that it really will build that way.
 
 mcl
 

From: Bartosz Fabianowski <freebsd@chillt.de>
To: Mark Linimon <linimon@lonesome.com>
Cc: freebsd-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject: Re: ports/77707: Fix for ports/77403 introduced circular dependency
 in ports tree
Date: Sat, 19 Feb 2005 05:12:56 +0100

 > So we've overloaded the meaning of the variable.  At least this is
 > what I recall.
 
 I see. It doesn't seem to have been announced anywhere big time, so 
 missed that information. Sorry.
 
 While lang/gcc32 will build just fine without USE_GCC, the compiler used 
 in this case (cc) will complain a lot about GCC extensions being used. 
 So that's not a good idea. It seems to me that the following might be a 
 proper fix:
 
 bsd.gcc.mk should try to satisfy the USE_GCC with the system compiler 
 first and only if that does not match the version requested, it should 
 try port versions. This way, USE_GCC= 2.7+ would take on the same 
 meaning as the old USE_GCC= X in that it simply requests for system GCC 
 to be used. At the same time, things such as USE_GCC= 3.1 would continue 
 to work because if the system compiler isn't 3.1, bsd.gcc.mk would keep 
 looking for an acceptable GCC.
 
 - Bartosz

From: Bartosz Fabianowski <freebsd@chillt.de>
To: Mark Linimon <linimon@lonesome.com>
Cc: freebsd-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject: Re: ports/77707: Fix for ports/77403 introduced circular dependency
 in ports tree
Date: Sat, 19 Feb 2005 05:21:05 +0100

 I have to correct myself. The build of lang/gcc32 without USE_GCC set 
 just died. So that's not an option.

From: Sergey Matveychuk <sem@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, freebsd@chillt.de
Cc:  
Subject: Re: ports/77707: Fix for ports/77403 introduced circular dependency
 in ports tree
Date: Fri, 11 Mar 2005 21:03:16 +0300

 I can't reproduce it:
 # uname -a
 FreeBSD stable-5.sem-home.ciam.ru 5.3-RELEASE-p4 FreeBSD 5.3-RELEASE-p4 
 #13: Fri Jan 14 04:39:21 MSK 2005 
 root@stable-5.sem-home.ciam.ru:/usr/obj/usr/src/sys/CURRENT  i386
 # pkg_info|grep gcc
 gcc-3.2.3_3         GNU Compiler Collection 3.2.3
 # cd /usr/ports/lang/gcc32
 # make pretty-print-build-depends-list
 This port requires package(s) "gettext-0.14.1 gmake-3.80_2 
 libiconv-1.9.2_1" to build.
 
 -- 
 Sem.

From: Bartosz Fabianowski <freebsd@chillt.de>
To: Sergey Matveychuk <sem@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/77707: Fix for ports/77403 introduced circular dependency
 in ports tree
Date: Sat, 12 Mar 2005 21:00:39 +0100

 The same sequence of commands on my machine:
 
 # uname -a
 FreeBSD takahe.local 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #0: Thu Mar 10 03:09:38 CET 2005     root@takahe.local:/usr/obj/usr/src/sys/TAKAHE  i386
 # pkg_info|grep gcc
 gcc-3.2.3_3         GNU Compiler Collection 3.2.3
 # cd /usr/ports/lang/gcc32
 # make pretty-print-build-depends-list
 This port requires package(s) "gcc-3.2.3_3 gettext-0.14.1 gmake-3.80_2 libiconv-1.9.2_1" to build.
 
 Not quite sure what to make of this. While ports/Mk/bsd.gcc.mk is commented, I still cannot fully follow what it is doing. Looking at that file, it seems to me that it will always pick the lowest version of GCC that meets the port's demands. Seems to work differently on your machine though. Very confusing indeed.
State-Changed-From-To: open->closed 
State-Changed-By: vs 
State-Changed-When: Mon Apr 11 18:44:17 GMT 2005 
State-Changed-Why:  
Fixed by adamw on 2005-03-20. Thanks for your submission! 

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