Home Bug Reports

[PATCH] 3.5.0 Java unit tests on OS X can fail due to DYLD_LIBRARY_PATH

blairblair Member Blair ZajacOrganization: Sony Pictures ImageworksProject: VnP ✭✭
In MacPorts the java unit tests can fail because DYLD_LIBRARY_PATH is set to /opt/local/lib which can contain shared libraries that java uses:
$ cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_zeroc-ice35-java/zeroc-ice35-java/work/Ice-3.5.0/java/test/Slice/generation
$ DYLD_LIBRARY_PATH=/opt/local/lib:/opt/local/lib/db46 ./run.py 
starting client... ok
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
unexpected exit status: expected: 0, got -5
Traceback (most recent call last):
  File "./run.py", line 28, in <module>
    clientProc.waitTestSuccess()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_zeroc-ice35-java/zeroc-ice35-java/work/Ice-3.5.0/scripts/Expect.py", line 564, in waitTestSuccess
    test(self.exitstatus, exitstatus)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_zeroc-ice35-java/zeroc-ice35-java/work/Ice-3.5.0/scripts/Expect.py", line 549, in test
    assert False
AssertionError

By having TestUtil.py setting DYLD_FALLBACK_LIBRARY_PATH instead, it avoids this issue. Here's a patch we're using in MacPorts.

https://svn.macports.org/repository/macports/trunk/dports/java/zeroc-ice35-java/files/patch-ice.scripts.TestUtil.py.diff

Blair
Sign In or Register to comment.