Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jun 2008 00:16:51 +0200
From:      Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de>
To:        Greg Lewis <glewis@eyesbeyond.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Issues with portmaster
Message-ID:  <20080623221651.GA1188@localhost.my.domain>
In-Reply-To: <20080623195640.GA99127@misty.eyesbeyond.com>
References:  <20080622020728.GC13734@server.vk2pj.dyndns.org> <485DF018.5020703@FreeBSD.org> <485F4B7E.3040905@FreeBSD.org> <485F4EE1.9040603@FreeBSD.org> <485F5582.5040101@FreeBSD.org> <20080623084308.GA51236@wep4017.physik.uni-wuerzburg.de> <485F6585.2040307@FreeBSD.org> <20080623122637.GA51758@wep4017.physik.uni-wuerzburg.de> <485FF948.5080901@FreeBSD.org> <20080623195640.GA99127@misty.eyesbeyond.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Jun 23, 2008 at 12:56:40PM -0700, Greg Lewis wrote:
> On Mon, Jun 23, 2008 at 12:28:08PM -0700, Doug Barton wrote:
> > Alexey Shuvaev wrote:
> > >On Mon, Jun 23, 2008 at 10:57:41AM +0200, Alex Dupre wrote:
> > >>Alexey Shuvaev ha scritto:
> > >>>It seems I don't understand something here. Can someone explain why
> > >>>jdk ports need to set BUILD_DEPENDS on diablo-jdk15 unconditionally?
> > >>(nearly) every JDK port needs an already usable/installed JDK to  
> > >>bootstrap the compilation. This is the reason of the BUILD_DEPENDS on  
> > >>javac that you cannot remove. But the port providing the javac binary  
> > >                 ^^^^^^^^^^^^^
> > >>could not be the diablo-jdk.
> > >>
> > >Mmmm... why not???
> > >In a nutshell, from the user point of view the reason to set BUILD_DEPENDS 
> > >is
> > >to ensure that some port (java here) is installed prior to build.
> > >However, if the port checks against installed java in a more complicated 
> > >manner
> > >than BUILD_DEPENDS mechanism can provide, I see no reason to set
> > >BUILD_DEPENDS to something just for its own sake.
> > >And from the build cluster point of view, the port will be built in a clean
> > >environment, so port will not detect any installed java and will set
> > >BUILD_DEPENDS *conditionally* (.if !defiend(BOOTSTRAPJDKDIR)).
> > >
> > >I have a feeling that the way BUILD_DEPENDS is set now is overkill, and
> > >one can put it under .if !defined(BOOTSTRAPJDKDIR) without any functional
> > >change. Of course, the Right Way To Do This would be to set the whole
> > >correct BUILD_DEPENDS line based on detected java. Maybe this is even not
> > >so complicated. Or I miss something?
> > 
> > Thanks for the discussion on this. Since I don't use java I'm relying 
> > an the users here. Hopefully glewis can weigh in at some point.
> 
> Its probably not that complicated for the port to stop "cheating" on the
> way it sets up BUILD_DEPENDS.  At the moment it knows the potential
> bootstrap JDKs install paths, but it doesn't know where they live in
> ports, so it cheats and sets the requirement to the detected javac but
> then hardcodes the dependency as Diablo.  This works from a ports point
> of view in that the dependency isn't installed if the requirement is
> found, but it obviously confuses portsmaster.
> 
The translation table from install paths to ports is simple:
diablo-jdk1.5.0 -> java/diablo-jdk15
jdk1.5.0 -> java/jdk15
jdk1.6.0 -> java/jdk16
jdk1.4.2 -> java/jdk14
linux-sun-jdk1.5.0 -> java/linux-sun-jdk15
linux-sun-jdk1.6.0 -> java/linux-sun-jdk16
linux-sun-jdk1.4.2 -> java/linux-sun-jdk14

I have even thought about something like this:

# if no valid jdk found, set dependency
.if !defined(BOOTSTRAPJDKDIR)
BOOTSTRAPJDKDIR?=       ${LOCALBASE}/diablo-jdk1.5.0
BUILD_DEPENDS+= ${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/diablo-jdk15
.else
# Do some black (Makefile/shell) magic to construct the valid BUILD_DEPENDS
# line from the detected BOOTSTRAPJDKDIR and the table above
.endif

but then I remembered the typical situation where I am. Normally,
I bootstrap java/jdk15 with already installed (old) jdk1.5.0.
But in this case the logic above would set BUILD_DEPENDS to itself!
I don't think it is good...

> >From a partial reading of the email thread, it looks like the simplest
> thing to do is to just not set BUILD_DEPENDS if it finds an appropriately
> installed JDK.  That way it will only set it if it can't find a bootstrap
> JDK and it needs one installed.
> 
This is achieved with attached 3-line patch. I have roughly tested it
with "make -V BUILD_DEPENDS". It produces reasonable results on a system
with jdk1.5.0 (no dependency on diablo) and on a system without any
java at all (there is a dependency on diablo).It is trivial, but nevertheless,
any real battlefield testing (upgrading real systems,
tinderbox package building)? Review from someone experienced?

Alexey.

--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch

--- Makefile.orig	2008-06-23 10:33:59.000000000 +0200
+++ Makefile	2008-06-23 10:34:36.000000000 +0200
@@ -108,9 +108,8 @@
 # if no valid jdk found, set dependency
 .if !defined(BOOTSTRAPJDKDIR)
 BOOTSTRAPJDKDIR?=	${LOCALBASE}/diablo-jdk1.5.0
-.endif
-
 BUILD_DEPENDS+=	${BOOTSTRAPJDKDIR}/bin/javac:${PORTSDIR}/java/diablo-jdk15
+.endif
 
 .if defined(WITHOUT_WEB)
 MAKE_ENV+=	DONT_BUILD_DEPLOY="YES"

--82I3+IH0IqGh5yIs--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080623221651.GA1188>