Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Oct 2012 13:38:00 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        Greg Lewis <glewis@eyesbeyond.com>
Cc:        java@freebsd.org, Erwin Lansing <erwin@freebsd.org>
Subject:   Re: [ports-i386@FreeBSD.org: openjdk6-jre-b26_1 pkg-plist errors on i386 9]
Message-ID:  <508ACA78.30802@FreeBSD.org>
In-Reply-To: <20121026043704.GA90964@misty.eyesbeyond.com>
References:  <20121025105934.GN4474@droso.net> <5089B928.2090504@FreeBSD.org> <5089D4B7.9050603@FreeBSD.org> <20121026043704.GA90964@misty.eyesbeyond.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2012-10-26 00:37:05 -0400, Greg Lewis wrote:
> G'day Jung-uk,
> 
> On Thu, Oct 25, 2012 at 08:09:27PM -0400, Jung-uk Kim wrote:
>> On 2012-10-25 18:11:52 -0400, Jung-uk Kim wrote:
>>> On 2012-10-25 06:59:34 -0400, Erwin Lansing wrote:
>>> 
>>>> FYI; can you please investigate and/or report to the
>>>> developers? If you are already aware of this problem but do
>>>> not yet have a fix, please mark the port BROKEN in the
>>>> appropriate case, so that users do not unexpectedly encounter
>>>> it.
>>> 
>>>> See http://pointyhat.freebsd.org for the full log.
>>> 
>>> Actually, this is (arguably) a bug for javavmwrapper.  Its 
>>> installation script searches for JDK/JREs under ${PREFIX} and 
>>> registers them all without an exception.  That means you
>>> cannot have a package containing ${PREFIX}/*j{dk|re}*/bin/java
>>> without explicitly registering javavmwrapper as dependency.  I
>>> think we should get rid of this "feature" or de-installation
>>> script must remove /usr/local/etc/javavms.
> 
> I don't regard this as a bug at all.  When javavmwrapper is being 
> reinstalled it must figure out what all of the available JVMs are 
> and register them.  Maintaining lists of all of them is fragile,
> so instead it liberally looks for all the possible VMs that might
> be available and registers them to itself.

Guessing what to re-register is equally fragile, IMHO.

>>> I'll add javavmwrapper as a dependency for bootstrap-openjdk
>>> for now.
> 
> This isn't the right answer.  Unless I'm mistaken bootstrap-openjdk
> isn't a fully functional JDK and should never be registered with
> javavmwrapper.

Yeah, I hate it.  I am going to back it out in the next update.
However, javavmwrapper must be fixed first.

>> Actually it triggered another bug, i.e., stale symlinks. :-(
>> 
>> https://redports.org/~jkim@FreeBSD.org/20121025222400-65315-93464/bootstrap-openjdk-r306294_1.log
>>
>>
>> 
Now we really have to fix the root cause.  Here is my suggestion:
>> 
>> http://people.freebsd.org/~jkim/javavmwrapper.diff
> 
> To me, that's a bandaid rather than a fix.  Here are my two
> suggestions:

I beg to differ.  All symlinks for javavm and javavms must be
destroyed because they serve no purpose after deinstalltion.

> 1. Don't actually make bootstrap-openjdk a port.  There is no
> reason for it to be on the system once its done its job of
> bootstrapping the build, so why not just make it a distfile for the
> ports that will use it to bootstrap?  They can unpack it in $WRKDIR
> and set the bootstrap path accordingly.

That's exactly what I did initially, ALT_BOOTDIR = ${WRKDIR}/bootstrap:

http://redports.org/~jkim/20120906230927-07665-60416/openjdk6-b25_2.log

I abandoned the idea because:

1) hard to maintain the distfiles
2) there is no easy way to reproduce the distfiles
3) all ports that build with the distfiles must be sync'ed manually
etc.

Currently the openjdk6 is the only consumer but it may grow in the
future, e.g., openjdk7, cacao, jamvm, classpath, etc...

> 2. Make a change to javavmwrapper's pkg-install script to ignore
> bootstrap JDKs.  That way it never registers it (which is the right
> thing to do) and there is no clean up to do.
> 
> Something like this should do it:
> 
> Index: files/pkg-install.in 
> ===================================================================
>
> 
- --- files/pkg-install.in	(revision 306295)
> +++ files/pkg-install.in	(working copy) @@ -21,7 +21,7 @@ fi
> 
> # Ensure all JDKs and JREs are installed -for jvm in
> "${LOCALBASE}"/*jdk* "${LOCALBASE}"/*jre*; do +for jvm in `ls
> "${LOCALBASE}"/*jdk* "${LOCALBASE}"/*jre* | grep -v bootstrap`; do 
> if [ -x "${jvm}/bin/java" ]; then "${PKG_PREFIX}"/bin/registervm
> "${jvm}/bin/java" > /dev/null 2>&1 fi
> 
> I should likely do something clever with IFS there in case
> ${LOCALBASE} has a space in it.

I think this or something similar must be done, too.  However, I think
"ls ... | grep -v ..." may be too fragile.  I'll update my patch and
let you know.

Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCKyngACgkQmlay1b9qnVOIeQCcDCDSq8I+RlaTruoedGJXdXAU
3c0An3LrTMlpkJ0A5wBUqtStx67bZsZW
=mq9z
-----END PGP SIGNATURE-----



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