jar dependencies

Shannon -jj Behrens jj at nttmcl.com
Wed Mar 26 20:32:52 PST 2003


On Wed, Mar 26, 2003 at 07:17:02PM +0200, Sheldon Hearn wrote:
> On (2003/03/26 08:50), Shannon -jj Behrens wrote:
> 
> > Everything Java should be installed in /usr/java.  Each Java port
> > should simply be wholly copied to /usr/java/$port_name.
> 
> This idea has promise.  If you'd looked at the "Status Quo" option in my
> original post, you'll see I proposed a light modification to the status quo,
> involving the use of a Java-specific PREFIX, defaulting to /usr/local/java.
> 
> So we're basically in agreement there.

Yes, I did notice that.  We do agree.

> > Then, for each dependency jar found in /usr/java/$port_name
> > (via find), the following logic would take place: if that jar
> > is already present in /usr/java/lib, hardlink to that file in
> > /usr/java/lib.  Otherwise, move that jar to /usr/java/lib and then
> > hardlink to that file.  When removing a Java port, simply delete
> > the /usr/java/$port_name directory.  Optionally, clean up the
> > /usr/java/lib directory by deleting any files who have a refcount of 1
> > (i.e. jar files that are used by any Java port).
> 
> Your hardlink trick is also close to what I did for a demonstration box
> I set up recently for our developers, except that I used symlinks, which
> can cross filesystems.  I didn't suggest this, because I felt it was too
> radical to gain support.
> 
> Although you lose the refcount trick with symlinks, you should be
> including the symlinks in the package list anyway.

I'm hoping that you understand that the refcount trick is there so that there
is no need to make ports for every dependency.  It was my way of having things
just work semi-automatically.

> > I realize that this is quite a break from the standard way FreeBSD
> > does things.  In fact, I'd be surprised if anyone took me seriously.
> > However, I would like to point out that since Java is practically an
> > OS unto itself, it's not totally unreasonable that it must be treated
> > in a special manner.
> 
> Exactly.  A square peg doesn't fit into a round hole of identical
> surface area.
> 
> I think, however, that this is more an issue of whether there's enough
> community support to justify the additional work for committers.
> What you're suggesting with links is a LOT of work.  Even what I

It's true that it requires some work to get started.  Someone, perhaps 
myself, would have to write the script to manage the /usr/java/lib directory.
However, once the script is written, porting things would be trivial.  I.e.,
each port would basically have to do:

	copy package to /usr/java/$package_name
	use ant or whatever else the package normally uses to build
	run script to copy jar files to /usr/java/lib
	perhaps install a binary to /usr/local/bin?
	automatically generate the package list

> was suggesting (stripping down the installation of JARs to just
> those specific to each package and then beefing up the ports tree's
> dependencies) is a lot of work.

I agree.  Although this is the arguably RIGHT THING to do, I don't think
there's enough manpower to make it happen.  Furthermore, it would make Java in
FreeBSD different than Java in other OS's which seems to violate the reason for
using Java.

> Looking at the state of the ports tree for Java stuff, the following
> possible causes come to mind:
> 
> 1) JDK-1.4.1 support took a long time to materialize on FreeBSD.  During
>    the wait, the community shrank as folks went for Linux.

To be fair, I don't think Linux has an answer to this particular question
either.  I've always done things very manually in Linux.

> 2) The community doesn't bother with the ports tree for Java stuff, because
>    it's too easy to just unpack a distfile into /usr/local.
> 
> 3) The community doesn't submit ports because the packaging issue we're
>    discussing right now makes it difficult to come up with ports that
>    you can feel proud of.

This is why I think it's essential to make creating the ports trivial.  
Unpacking stuff to /usr/local is trivial, but it's wasteful.  My idea is 
really just an optimization for disk space, and nothing more.

> Personally, I'd like to do as much as I can in the ports tree to make
> 5.1-RELEASE a serious Java platform contender.  I want to do this so
> that the release goes out with all the cool stuff on the CDROMs / DVDs
> as packages.

Surely, that would be desireable.  Personally, I'm doing this because I want
FreeBSD to be a serious Jython platform contender :)

Best Regards,
-jj


More information about the freebsd-java mailing list