Bug 165115 - bsd.java.mk - Unable to build port where USE_ANT=yes is set
Summary: bsd.java.mk - Unable to build port where USE_ANT=yes is set
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Greg Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-13 21:20 UTC by Greg Larkin
Modified: 2012-04-13 05:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Larkin freebsd_committer freebsd_triage 2012-02-13 21:20:12 UTC
I attempted to install devel/statsvn, but bsd.java.mk complained about an environment error with JAVA_HOME.  I checked my local shell environment, and JAVA_HOME was not set.  I looked through bsd.java.mk, and it appears that JAVA_HOME is set when USE_ANT=yes is in effect, but a check-makevars target then abort the make process because that variable is set.

How-To-Repeat: cd /usr/ports/devel/statsvn && make install clean
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-02-13 21:20:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->glewis

bsd.java.mk is glewis territory (via the GNATS Auto Assign Tool)
Comment 2 Greg Lewis freebsd_committer freebsd_triage 2012-02-14 07:10:32 UTC
State Changed
From-To: open->feedback

I'm able to build statsvn and other USE_ANT ports without any problems. 
The check-makevars target has been in bsd.java.mk for a long time, so it 
seems unlikely that it's suddenly become a problem. 

Do you definitely get the error from the check-makevars target?  Are you sure 
there isn't a setting somewhere else that is being picked up as part of the 
build process?  Maybe add the value of JAVA_HOME to the error message so you 
can see what it is.
Comment 3 Greg Larkin freebsd_committer freebsd_triage 2012-02-14 16:11:46 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, I found the problem, and it was a local issue as you correctly
surmised.  I forgot that my bsd.port.mk has already incorporated the
patch found in
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/164423, and this
caused the JAVA_HOME variable to be propagated when it hadn't been before.

My main goal with ports/164423 is to pass the make environment to
sub-make processes during port configuration, so maybe the other
places I pass it should be omitted.  On the other hand, is there any
reason not to unset the environment variables that should not be set
in Stage 2 of bsd.java.mk instead of issuing an error?

Thank you,
Greg

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk86h8IACgkQ0sRouByUApCfAgCgm3FBUSbRaPvyhDP71nsdgi+t
jlcAn1FU7NftB3Nc4npVP9FlLsnlk0ii
=BmRE
-----END PGP SIGNATURE-----
Comment 4 Greg Lewis 2012-03-13 05:25:53 UTC
I tend to agree that we could just unset the troublesome variables.
How do you feel about the following patch?

Index: bsd.java.mk
===================================================================
RCS file: /var/fcvs/ports/Mk/bsd.java.mk,v
retrieving revision 1.92
diff -u -r1.92 bsd.java.mk
--- bsd.java.mk	9 Feb 2012 06:40:49 -0000	1.92
+++ bsd.java.mk	26 Feb 2012 01:21:12 -0000
@@ -224,8 +224,8 @@
 .		for variable in JAVA_HOME JAVA_PORT JAVA_PORT_VERSION JAVA_PORT_VENDOR JAVA_PORT_OS
 .			if defined(${variable})
 check-makevars::
-	@${ECHO_CMD} "${PKGNAME}: Environment error: \"${variable}\" should not be defined."
-	@${FALSE}
+	@${ECHO_CMD} "${PKGNAME}: Environment error: \"${variable}\" should not be defined -- clearing."
+.undef				${variable}
 .			endif
 .		endfor
 

I'm also cc'ing Herve (co-maintainer) to see if he has any objections.

-- 
Greg Lewis                          Email   : glewis@eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis@FreeBSD.org
Comment 5 Herve Quiroz freebsd_committer freebsd_triage 2012-03-13 07:28:10 UTC
On Mon, Mar 12, 2012 at 10:25:53PM -0700, Greg Lewis wrote:
> I tend to agree that we could just unset the troublesome variables.
> How do you feel about the following patch?

I agree, the port should not fail but rather just cope with the set
variables.

Just a quick note though:

> +	@${ECHO_CMD} "${PKGNAME}: Environment error: \"${variable}\" should not be defined -- clearing."

IMHO "error" is no longer a relevant term here. It's more of a warning
message. Other than that, no objection to the patch.

Herve
Comment 6 Greg Larkin freebsd_committer freebsd_triage 2012-03-13 19:36:52 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/13/12 3:28 AM, Herve Quiroz wrote:
> On Mon, Mar 12, 2012 at 10:25:53PM -0700, Greg Lewis wrote:
>> I tend to agree that we could just unset the troublesome
>> variables. How do you feel about the following patch?
> 
> I agree, the port should not fail but rather just cope with the
> set variables.
> 
> Just a quick note though:
> 
>> +	@${ECHO_CMD} "${PKGNAME}: Environment error: \"${variable}\"
>> should not be defined -- clearing."
> 
> IMHO "error" is no longer a relevant term here. It's more of a
> warning message. Other than that, no objection to the patch.
> 
> Herve

Thank you both for looking into that.  The patch looks good to me!

Cheers,
Greg
- -- 
Greg Larkin

http://www.FreeBSD.org/           - The Power To Serve
http://www.sourcehosting.net/     - Ready. Set. Code.
http://twitter.com/cpucycle/      - Follow you, follow me
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9fodQACgkQ0sRouByUApAh7wCeP/c50xe1pMznr83amRzPMQio
46QAnjUFW0IQDw31vOHkLeqlJqqrVUCp
=sdGp
-----END PGP SIGNATURE-----
Comment 7 dfilter service freebsd_committer freebsd_triage 2012-04-13 05:03:58 UTC
glewis      2012-04-13 04:03:42 UTC

  FreeBSD ports repository

  Modified files:
    Mk                   bsd.java.mk 
  Log:
  . Instead of bailing when we hit a possibly conflicting variable being
    defined just clear it and issue a warning that it was set.
  
  PR:             165115
  Approved by:    hq@ (co-maintainer)
  
  Revision  Changes    Path
  1.93      +3 -3      ports/Mk/bsd.java.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"
Comment 8 Greg Lewis freebsd_committer freebsd_triage 2012-04-13 05:04:32 UTC
State Changed
From-To: feedback->closed

Patch committed.  Thanks all!