This one is a bit convoluted to describe. We are running a Freebsd unix
environment using Ant to control some building and testing. In the case
where we're having problems, Ant is running C++ tests by having the Ant
script call "make test" to run the tests. If we can resolve this issue,
then our build/test cycle will be fully automated on FreeBSD.
We are running: Ant 1.4.1 / JDK 1.3.1 / FreeBSD 4.5-RC
The build.xml target is:
<target name="test" description="Run all unit tests">
<exec executable="/usr/local/bin/bash" failonerror="true" dir="myDir">
<arg line="-c 'make test'" />
</exec>
</target>
The LD_LIBRARY_PATH is set in the environment to have the following
JNI-required stuff:
/usr/local/jdk1.3.1/jre/lib/i386:/usr/local/jdk1.3.1/jre/lib/i386/classi
c:/usr/local/jdk1.3.1/jre/lib/i386/native_threads:/usr/local/jdk1.3.1/jr
e/lib/i386
To be concise, this is the way things are called, and then I'll state
the issue we are having:
1. Invoking "ant test" on the command line
2. Ant calls "make test"
3. Make calls C++ unit test (CppUnit)
4. C++ code uses JNI to call JVM instance <-- LD_LIBRARY_PATH
needed
5. JVM instance executes Java bytecode
The breakdown occurs at step #4. For some reason, the LD_LIBRARY_PATH
is lost from the Ant environment (overwritten?) and Ant returns the
following error from the C++ unit test code:
[exec] t10MyTest.testThisThing
[exec] .Cannot open
"/usr/local/jdk1.3.1/jre/lib/i386//libhpi.so".Cannot open
"/usr/local/jdk1.3.1/jre/lib/i38
6//libhpi.so".Cannot open
"/usr/local/jdk1.3.1/jre/lib/i386//libhpi.so"...............Cannot open
"/usr/local/jdk1.
3.1/jre/lib/i386//libhpi.so"F
[exec] .Cannot open "/usr/local/jdk1.3.1/jre/lib/i386//libhpi.so"F
If the test is executed WITHOUT Ant by using MAKE directly, then the
error does NOT occur:
1. Invoking "make test" on the command line
2. Make calls C++ unit test (CppUnit)
3. C++ code uses JNI to call JVM instance
4. JVM instance executes Java bytecode
Something in the Ant environment seems to be overwriting the
LD_LIBRARY_PATH. I have tried putting the LD_LIBRARY_PATH settings into
every conceivable place I could conceive of :-). For example, I've set
it in the following places:
-- in the shell environment
-- as parameters in the Makefile
-- as parameters in the Ant shell script that executes Ant
-- as an <env> tag in the Ant build script itself
-- each of these singly and together and several other convoluted things
I've tried....
Any ideas? Thanks in advance!
Guerry
--
To unsubscribe, e-mail: <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
|