From edwin@mavetju.org  Mon Sep 24 10:14:38 2007
Return-Path: <edwin@mavetju.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0716816A417
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Sep 2007 10:14:38 +0000 (UTC)
	(envelope-from edwin@mavetju.org)
Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78])
	by mx1.freebsd.org (Postfix) with ESMTP id A8F2513C469
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Sep 2007 10:14:37 +0000 (UTC)
	(envelope-from edwin@mavetju.org)
Received: by mail5out.barnet.com.au (Postfix, from userid 1001)
	id DDA472219CF2; Mon, 24 Sep 2007 20:14:35 +1000 (EST)
Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mail5.barnet.com.au (Postfix) with ESMTP id A05EF21B108C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Sep 2007 20:14:35 +1000 (EST)
Received: from k7.mavetju (k7.mavetju.org [10.251.1.18])
	by mail5auth.barnet.com.au (Postfix) with ESMTP id 4BDBE2218E32
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Sep 2007 20:14:35 +1000 (EST)
Received: by k7.mavetju (Postfix, from userid 1001)
	id 843FB64; Mon, 24 Sep 2007 20:14:37 +1000 (EST)
Message-Id: <20070924101437.843FB64@k7.mavetju>
Date: Mon, 24 Sep 2007 20:14:37 +1000 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] bsd.port.mk - fail if dependency failed
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         116601
>Category:       ports
>Synopsis:       [patch] bsd.port.mk - fail if dependency failed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 24 10:20:01 GMT 2007
>Closed-Date:    Tue Feb 05 03:39:41 UTC 2013
>Last-Modified:  Tue Feb 05 03:39:41 UTC 2013
>Originator:     Edwin Groothuis
>Release:        FreeBSD 6.2-RELEASE-p4 i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 6.2-RELEASE-p4 FreeBSD 6.2-RELEASE-p4 #0: Thu Apr 26 17:55:55 UTC 2007 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/SMP i386


>Description:

Right now the ports framework skips over failed dependencies if
they don't install the right file:

===>   dynagen-devel-0.10.1 depends on executable: dynamips-devel - not found
===>    Verifying install for dynamips-devel in /usr/ports/emulators/dynamips-devel
===>   Returning to build of dynagen-devel-0.10.1
===>   dynagen-devel-0.10.1 depends on file: /usr/local/bin/python2.5 - found

It should have stopped at stopped there, and not continued.

LIB_DEPENDS does do this properly.


This only happens in polluted build-environments where work/.build_done
of a dependency exists and therefor skips the installation. Both
of them shouldn't happen :-)

>How-To-Repeat:
>Fix:

--- bsd.port.mk.orig	Mon Sep 24 09:10:01 2007
+++ bsd.port.mk	Mon Sep 24 10:08:40 2007
@@ -4812,6 +4812,7 @@
 					fi; \
 				fi; \
 			else \
+				fileneeded="$$prog"; \
 				${ECHO_MSG} "===>   ${PKGNAME} depends on file: $$prog - not found"; \
 				notfound=1; \
 			fi; \
@@ -4830,6 +4831,7 @@
 						notfound=0; \
 					fi; \
 				else \
+					pkgneeded="$$prog"; \
 					${ECHO_MSG} "===>   ${PKGNAME} depends on package: $$prog - not found"; \
 					notfound=1; \
 				fi; \
@@ -4852,6 +4854,7 @@
 					notfound=0; \
 				fi; \
 			else \
+				execneeded="$$prog"; \
 				${ECHO_MSG} "===>   ${PKGNAME} depends on executable: $$prog - not found"; \
 				notfound=1; \
 			fi; \
@@ -4862,6 +4865,22 @@
 				${ECHO_MSG} "     => No directory for $$prog.  Skipping.."; \
 			else \
 				${_INSTALL_DEPENDS} \
+				if [ ! -z "$$fileneeded" ]; then \
+					if [ ! -e "$$prog" ]; then \
+						${ECHO_MSG} "Error: file \"$$prog\" does not exist"; \
+						${FALSE}; \
+					fi; \
+				elif [ ! -z "$$pkgneeded" ]; then \
+					if ! ${PKG_INFO} "$$prog" > /dev/null 2>&1 ; then \
+						${ECHO_MSG} "Error: package \"$$prog\" does not exist"; \
+						${FALSE}; \
+					fi; \
+				elif [ ! -z "$$execneeded" ]; then \
+					if ! ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
+						${ECHO_MSG} "Error: executable \"$$prog\" does not exist"; \
+						${FALSE}; \
+					fi; \
+				fi; \
 			fi; \
 		fi; \
 	done
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Sep 24 10:20:10 UTC 2007 
Responsible-Changed-Why:  
bsd.port.mk is portmgr territory 

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

From: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@freebsd.org>
Cc:  
Subject: ports/116601 - [patch] bsd.port.mk - fail if dependency failed
Date: Mon, 26 Nov 2007 15:12:40 +1100

 Any further questions with regarding to this patch? Or an estimate
 on when it will be tested and implemented?
 
 -- 
 Edwin Groothuis      |            Personal website: http://www.mavetju.org
 edwin@mavetju.org    |              Weblog: http://www.mavetju.org/weblog/

From: Mark Linimon <linimon@FreeBSD.org>
To: Edwin Groothuis <edwin@mavetju.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/116601 - [patch] bsd.port.mk - fail if dependency failed
Date: Mon, 26 Nov 2007 10:41:40 -0600

 On Sunday 25 November 2007, Edwin Groothuis wrote:
 > Any estimate on when it will be tested and implemented?
 
 1Q 2008.  Currently we are waiting for the ABIs to be stabilized
 for 6.3 and 7.0 before we can start the final package builds.
State-Changed-From-To: open->analyzed 
State-Changed-By: pav 
State-Changed-When: Thu Apr 10 22:46:03 UTC 2008 
State-Changed-Why:  
Being tested in an exprun 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116601 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: pav 
State-Changed-When: Fri Apr 11 09:00:26 UTC 2008 
State-Changed-Why:  
This breaks the /nonexistant dependencies, like 

EXTRACT_DEPENDS=        ${NONEXISTENT}:${PORTSDIR}/${RUBY_PORT}:patch 

See http://pointyhat.freebsd.org/errorlogs/i386-errorlogs/a.7-exp.2008041107/ruby-mode.el-1.8.6.111,1.log 

===>  Extracting for ruby-mode.el-1.8.6.111,1 
===>   ruby-mode.el-1.8.6.111,1 depends on file: /nonexistent - not found 
===>    Verifying patch for /nonexistent in /usr/ports/lang/ruby18 
[...] 
===>   Returning to build of ruby-mode.el-1.8.6.111,1 
Error: file "/nonexistent" does not exist 
*** Error code 1 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116601 
State-Changed-From-To: feedback->open 
State-Changed-By: edwin 
State-Changed-When: Mon Jul 28 05:17:22 UTC 2008 
State-Changed-Why:  
New patches provided. 

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

From: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@freebsd.org>
Cc:  
Subject: Re: ports/116601: [patch] bsd.port.mk - fail if dependency failed
Date: Mon, 28 Jul 2008 15:20:05 +1000

 --M9NhX3UHpAaciwkO
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Attached are new patches, which check explicitely if the file missing
 is called ${NONEXISTENT}. Any ports which use something else should
 be fixed. I volunteer.
 
 -- 
 Edwin Groothuis      |            Personal website: http://www.mavetju.org
 edwin@mavetju.org    |              Weblog: http://www.mavetju.org/weblog/
 
 --M9NhX3UHpAaciwkO
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=a
 
 --- bsd.port.mk.orig	2008-07-24 22:29:32.000000000 +0000
 +++ bsd.port.mk	2008-07-28 05:11:03.000000000 +0000
 @@ -4817,6 +4817,7 @@
  					fi; \
  				fi; \
  			else \
 +				fileneeded="$$prog"; \
  				${ECHO_MSG} "===>   ${PKGNAME} depends on file: $$prog - not found"; \
  				notfound=1; \
  			fi; \
 @@ -4835,6 +4836,7 @@
  						notfound=0; \
  					fi; \
  				else \
 +					pkgneeded="$$prog"; \
  					${ECHO_MSG} "===>   ${PKGNAME} depends on package: $$prog - not found"; \
  					notfound=1; \
  				fi; \
 @@ -4857,6 +4859,7 @@
  					notfound=0; \
  				fi; \
  			else \
 +				execneeded="$$prog"; \
  				${ECHO_MSG} "===>   ${PKGNAME} depends on executable: $$prog - not found"; \
  				notfound=1; \
  			fi; \
 @@ -4867,6 +4870,24 @@
  				${ECHO_MSG} "     => No directory for $$prog.  Skipping.."; \
  			else \
  				${_INSTALL_DEPENDS} \
 +				if [ "$$fileneeded" != "${NONEXISTENT}" ]; then \
 +					if [ ! -z "$$fileneeded" ]; then \
 +						if [ ! -e "$$prog" ]; then \
 +							${ECHO_MSG} "Error: file \"$$prog\" does not exist"; \
 +							${FALSE}; \
 +						fi; \
 +					elif [ ! -z "$$pkgneeded" ]; then \
 +						if ! ${PKG_INFO} "$$prog" > /dev/null 2>&1 ; then \
 +							${ECHO_MSG} "Error: package \"$$prog\" does not exist"; \
 +							${FALSE}; \
 +						fi; \
 +					elif [ ! -z "$$execneeded" ]; then \
 +						if ! ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
 +							${ECHO_MSG} "Error: executable \"$$prog\" does not exist"; \
 +							${FALSE}; \
 +						fi; \
 +					fi; \
 +				fi; \
  			fi; \
  		fi; \
  	done
 
 --M9NhX3UHpAaciwkO--
State-Changed-From-To: open->feedback 
State-Changed-By: pav 
State-Changed-When: Wed Jul 30 19:37:22 UTC 2008 
State-Changed-Why:  
Following ports failed to build with your patch: 

math/p5-Math-Pari 
mail/enigmail-seamonkey 
mail/enigmail-thunderbird 
textproc/xqilla 

Error logs were forwarded to you in private mail. 

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

From: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@freebsd.org>
Cc:  
Subject: Re: ports/116601: [patch] bsd.port.mk - fail if dependency failed
Date: Thu, 31 Jul 2008 11:25:33 +1000

 On Wed, Jul 30, 2008 at 07:41:36PM +0000, pav@FreeBSD.org wrote:
 > Synopsis: [patch] bsd.port.mk - fail if dependency failed
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: pav
 > State-Changed-When: Wed Jul 30 19:37:22 UTC 2008
 > State-Changed-Why: 
 > Following ports failed to build with your patch:
 > 
 > math/p5-Math-Pari
 > mail/enigmail-seamonkey
 > mail/enigmail-thunderbird
 > textproc/xqilla
 > 
 > Error logs were forwarded to you in private mail.
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=116601
 
 Thanks for this report. I fixed the first and the last, I have
 send-pr'd the one for the second and third (which are the same port
 at the end) - ports/126110 - [patch] mail/enigmail-thunderbird -
 remove non-existing path in EXTRACT_DEPENDS
 
 -- 
 Edwin Groothuis      |            Personal website: http://www.mavetju.org
 edwin@mavetju.org    |              Weblog: http://www.mavetju.org/weblog/
State-Changed-From-To: feedback->open 
State-Changed-By: pav 
State-Changed-When: Thu Jul 31 08:00:13 UTC 2008 
State-Changed-Why:  
Failing ports were fixed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116601 
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Sun Jan 11 11:04:47 UTC 2009 
State-Changed-Why:  
Committed, thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/116601: commit references a PR
Date: Sun, 11 Jan 2009 11:04:21 +0000 (UTC)

 pav         2009-01-11 11:04:05 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Mk                   bsd.port.mk 
   Log:
   - Remove conditional checks and support for FreeBSD versions prior 6.0-RELEASE
   
   Submitted by:   pav
   
   - Fix COPYTREE_* macros not to change permissions and ownership on files, that
     were already present in the target path
   
   Submitted by:   beech
   
   - Add a showconfig-recursive target, which has been in documentation for years
     but never implemented
   
   PR:             ports/87642, ports/126770
   Submitted by:   Andy Kosela <andy.kosela@gmail.com>
   
   - Fix ignorelist-verbose target (in preparation for duds.verbose)
   
   PR:             ports/127286 (part of)
   Submitted by:   linimon
   
   - Fix OPTIONS dialog to show up for every previously unconfigured port in the
     dependency chain
   
   PR:             ports/127554
   Submitted by:   ale
   
   - Fail, if recursing into a dependency failed to satisfy the dependency object
     (only for :install targets)
   
   PR:             ports/116601
   Submitted by:   edwin
   
   Revision  Changes    Path
   1.606     +46 -26    ports/Mk/bsd.port.mk
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: closed->feedback 
State-Changed-By: pav 
State-Changed-When: Sun Jan 11 22:17:24 UTC 2009 
State-Changed-Why:  
Reopen - it breaks the Ports for tcsh users, because they need to manually 
rehash before system sees newly installed executables in path. 

The patch will be backout out soon. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116601 
State-Changed-From-To: feedback->suspended 
State-Changed-By: pav 
State-Changed-When: Sat Dec 19 16:58:32 UTC 2009 
State-Changed-Why:  
No updated patch received -> suspend. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116601 
State-Changed-From-To: suspended->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Feb 5 03:39:40 UTC 2013 
State-Changed-Why:  
Feedback timeout 

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