public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-java] Patch for LIBRARY_PATH support in gjl
@ 2007-05-14  7:08 Alistair John Bush
  2007-05-14  8:33 ` Vlastimil Babka
  2007-05-14  9:43 ` Petteri Räty
  0 siblings, 2 replies; 8+ messages in thread
From: Alistair John Bush @ 2007-05-14  7:08 UTC (permalink / raw
  To: Gentoo Java

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here is a patch to allow users to configure a packages LIBRARY_PATH via

gjl_user_env="${HOME}/.gentoo/java-config-2/launcher.d/${gjl_package}"
gjl_system_env="/etc/java-config-2/launcher.d/${gjl_package}"

What do ppl think?  Ive keep it the same as package.env, any complaints
with this?

Index: gjl
===================================================================
- --- gjl (revision 4648)
+++ gjl (working copy)
@@ -113,6 +113,11 @@
         args += ' -classpath %s' % (classpath)

     if library:
+       envlp = os.getenv('LIBRARY_PATH')
+
+       if envlp:
+           library = ':'.join((envlp, library))
+
         args += ' -Djava.library.path="%s"' % (library)

     if args:


- --
Alistair John Bush
Developer Gentoo Java

OpenPGP key 0x4900CFB7
www.gentoo.org
www.gentoo.org/proj/en/java
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGSArdRJGZcUkAz7cRArf3AJ915C3mSbmOjhMHp+wIX4A5yg/wDACfQqUy
0pJXs5/33uuc+zj0LleHyC8=
=ulQ9
-----END PGP SIGNATURE-----
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-java] Patch for LIBRARY_PATH support in gjl
  2007-05-14  7:08 [gentoo-java] Patch for LIBRARY_PATH support in gjl Alistair John Bush
@ 2007-05-14  8:33 ` Vlastimil Babka
  2007-05-14  9:43 ` Petteri Räty
  1 sibling, 0 replies; 8+ messages in thread
From: Vlastimil Babka @ 2007-05-14  8:33 UTC (permalink / raw
  To: Gentoo Java

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alistair John Bush wrote:
> Here is a patch to allow users to configure a packages LIBRARY_PATH via

Wasn't that LD_LIBRARY_PATH?
- --
Vlastimil Babka (Caster)
Gentoo/Java
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGSB6+tbrAj05h3oQRAuK2AJ9uObs5qX6MYHnL+1aPE+GD8FcxcgCfaL7H
q373SBNO4CW9nDA9WG0SF3A=
=b8Da
-----END PGP SIGNATURE-----
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-java] Patch for LIBRARY_PATH support in gjl
  2007-05-14  7:08 [gentoo-java] Patch for LIBRARY_PATH support in gjl Alistair John Bush
  2007-05-14  8:33 ` Vlastimil Babka
@ 2007-05-14  9:43 ` Petteri Räty
  2007-05-14 10:06   ` Vlastimil Babka
  1 sibling, 1 reply; 8+ messages in thread
From: Petteri Räty @ 2007-05-14  9:43 UTC (permalink / raw
  To: Alistair John Bush; +Cc: Gentoo Java

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]



Alistair John Bush kirjoitti:
> Here is a patch to allow users to configure a packages LIBRARY_PATH via
> 

I think it should be either JAVA_LIBRARY_PATH or  LD_LIBRARY_PATH.

Regards,
Petteri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-java] Patch for LIBRARY_PATH support in gjl
  2007-05-14  9:43 ` Petteri Räty
@ 2007-05-14 10:06   ` Vlastimil Babka
  2007-05-14 10:27     ` Petteri Räty
  2007-05-14 10:48     ` Fabian Groffen
  0 siblings, 2 replies; 8+ messages in thread
From: Vlastimil Babka @ 2007-05-14 10:06 UTC (permalink / raw
  To: Gentoo Java

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Petteri Räty wrote:
> 
> Alistair John Bush kirjoitti:
>> Here is a patch to allow users to configure a packages LIBRARY_PATH via
>>
> 
> I think it should be either JAVA_LIBRARY_PATH or  LD_LIBRARY_PATH.

Using a simple test:
public class pathtest {
    public static void main(String[] args) throws Exception {
        System.out.println("library path: " +
System.getProperty("java.library.path"));
    }
}

Only LD_LIBRARY_PATH was affecting the output, and setting a
- -Djava.library.path has overriden it. Including the defaults of JDK!
That's probably another problem, maybe it should also add LDPATH from
the VM's env file?
And related to https://bugs.gentoo.org/show_bug.cgi?id=125563 add some
sane defaults like /lib:/usr/lib ...

> The reason I have LIBRARY_PATH is that is what is stored in package.env.

That doesn't matter, package.env is our artifact, not everything there
is usually used in the real env :)

> And this way they will have to explicitly add additional library paths
> to a package.

If someone sets LD_LIBRARY_PATH then he expects it to be used
everywhere, why force another var for java.

> What do you think?

I'm for LD_LIBRARY_PATH. Or as compromise, append both LD_ and JAVA_
variables. That way one can set additional paths for java without
affecting everything else.

- --
Vlastimil Babka (Caster)
Gentoo/Java
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGSDSltbrAj05h3oQRAur0AJ9aQfyi0b2ElKQMjIkhYxpIml8iYwCfUJED
PU0m/QkhqrU3gIQNoJUkY0U=
=JH+j
-----END PGP SIGNATURE-----
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-java] Patch for LIBRARY_PATH support in gjl
  2007-05-14 10:06   ` Vlastimil Babka
@ 2007-05-14 10:27     ` Petteri Räty
  2007-05-14 10:48     ` Fabian Groffen
  1 sibling, 0 replies; 8+ messages in thread
From: Petteri Räty @ 2007-05-14 10:27 UTC (permalink / raw
  To: Vlastimil Babka; +Cc: Gentoo Java

[-- Attachment #1: Type: text/plain, Size: 915 bytes --]

Vlastimil Babka kirjoitti:
> 
> Only LD_LIBRARY_PATH was affecting the output, and setting a
> -Djava.library.path has overriden it. Including the defaults of JDK!
> That's probably another problem, maybe it should also add LDPATH from
> the VM's env file?
> And related to https://bugs.gentoo.org/show_bug.cgi?id=125563 add some
> sane defaults like /lib:/usr/lib ...
> 

Or we just append to LD_LIBRARY_PATH in gjl:

betelgeuse@pena ~/test/java $ LD_LIBRARY_PATH="/testing/testing/" java
-Djava.library.path=foobar pathtest
library path: foobar
betelgeuse@pena ~/test/java $ LD_LIBRARY_PATH="/testing/testing/" java
pathtest
library path:
/opt/sun-jdk-1.6.0/jre/lib/i386/server:/opt/sun-jdk-1.6.0/jre/lib/i386:/opt/sun-jdk-1.6.0/jre/../lib/i386:/testing/testing/:/usr/java/packages/lib/i386:/lib:/usr/lib

Anyone know that this is fox?
/usr/java/packages/lib/i386

Regards,
Petteri




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-java] Patch for LIBRARY_PATH support in gjl
  2007-05-14 10:06   ` Vlastimil Babka
  2007-05-14 10:27     ` Petteri Räty
@ 2007-05-14 10:48     ` Fabian Groffen
  2007-05-15  7:02       ` Alistair John Bush
  1 sibling, 1 reply; 8+ messages in thread
From: Fabian Groffen @ 2007-05-14 10:48 UTC (permalink / raw
  To: Gentoo Java

On 14-05-2007 12:06:30 +0200, Vlastimil Babka wrote:
> > What do you think?
> 
> I'm for LD_LIBRARY_PATH. Or as compromise, append both LD_ and JAVA_
> variables. That way one can set additional paths for java without
> affecting everything else.

The only problem I see here is that LD_LIBRARY_PATH is something that
may be called DYLD_LIBRARY_PATH or SHLIBS_PATH on different platforms.
Additionally, it should be unset in normal use, as it is considered
harmful.  JAVA_LIBRARY_PATH feels better for this reason, and can be
safely injected in the environment, if neccesary.

Just my 2 cents.


-- 
Fabian Groffen
Gentoo on a different level
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-java] Patch for LIBRARY_PATH support in gjl
  2007-05-14 10:48     ` Fabian Groffen
@ 2007-05-15  7:02       ` Alistair John Bush
  2007-05-15 10:04         ` Petteri Räty
  0 siblings, 1 reply; 8+ messages in thread
From: Alistair John Bush @ 2007-05-15  7:02 UTC (permalink / raw
  To: Fabian Groffen, Gentoo Java

Fabian Groffen wrote:
> 
> The only problem I see here is that LD_LIBRARY_PATH is something that
> may be called DYLD_LIBRARY_PATH or SHLIBS_PATH on different platforms.
> Additionally, it should be unset in normal use, as it is considered
> harmful.  JAVA_LIBRARY_PATH feels better for this reason, and can be
> safely injected in the environment, if neccesary.
> 
> Just my 2 cents.
> 

I have to agree with grobian.

so here is the result of an example command

$ JAVA_LIBRARY_PATH="test" gjl -a -p jython
gjl_args=" -classpath
/usr/share/jython/lib/jython.jar:/usr/share/libreadline-java/lib/libreadline-java.jar:/usr/share/junit/lib/junit.jar:/usr/share/javacc/lib/javacc.jar
-Djava.library.path="/lib:/usr/lib:test:/usr/lib64/libreadline-java"


and the patch

$ svn diff gjl
Index: gjl
===================================================================
--- gjl (revision 4648)
+++ gjl (working copy)
@@ -113,6 +113,11 @@
         args += ' -classpath %s' % (classpath)

     if library:
+       envlp = os.getenv('JAVA_LIBRARY_PATH')
+
+       if envlp:
+           library = ':'.join(('/lib:/usr/lib', envlp, library))
+
         args += ' -Djava.library.path="%s"' % (library)

     if args:


As you can see,  I have prefixed '/lib:/usr/lib' to java.library.path

I will commit this to trunk latter tonight.  Is there any other
development occuring in trunk atm? How about unreleased functionality?

-- 
Alistair John Bush
Developer Gentoo Java

OpenPGP key 0x4900CFB7
www.gentoo.org
www.gentoo.org/proj/en/java
-- 
gentoo-java@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-java] Patch for LIBRARY_PATH support in gjl
  2007-05-15  7:02       ` Alistair John Bush
@ 2007-05-15 10:04         ` Petteri Räty
  0 siblings, 0 replies; 8+ messages in thread
From: Petteri Räty @ 2007-05-15 10:04 UTC (permalink / raw
  To: Alistair John Bush; +Cc: Gentoo Java

[-- Attachment #1: Type: text/plain, Size: 971 bytes --]

Alistair John Bush kirjoitti:
> 
> 
> and the patch
> 
> $ svn diff gjl
> Index: gjl
> ===================================================================
> --- gjl (revision 4648)
> +++ gjl (working copy)
> @@ -113,6 +113,11 @@
>          args += ' -classpath %s' % (classpath)
> 
>      if library:
> +       envlp = os.getenv('JAVA_LIBRARY_PATH')
> +
> +       if envlp:
> +           library = ':'.join(('/lib:/usr/lib', envlp, library))
> +
>          args += ' -Djava.library.path="%s"' % (library)
> 
>      if args:
> 
> 
> As you can see,  I have prefixed '/lib:/usr/lib' to java.library.path
> 
> I will commit this to trunk latter tonight.  Is there any other
> development occuring in trunk atm? How about unreleased functionality?
> 

Trunk was just released as 2.0.32 so there shouldn't be anything
unreleased. You didn't my idea of appending to LD_LIBRARY_PATH in order
to not overwrite the default?

Regards,
Petteri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-05-15 10:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-14  7:08 [gentoo-java] Patch for LIBRARY_PATH support in gjl Alistair John Bush
2007-05-14  8:33 ` Vlastimil Babka
2007-05-14  9:43 ` Petteri Räty
2007-05-14 10:06   ` Vlastimil Babka
2007-05-14 10:27     ` Petteri Räty
2007-05-14 10:48     ` Fabian Groffen
2007-05-15  7:02       ` Alistair John Bush
2007-05-15 10:04         ` Petteri Räty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox