Clojure

clojure.lang.RT should provide a loadLibrary static method

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.3
  • Fix Version/s: Release 1.4
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code
  • Approval:
    Ok

Description

Right now, loading native libraries in Clojure doesn't work as expected because those libraries are loaded into the classloader of the invoking class (that is, Clojure's own classloader).

This problem has been discussed on the mailing list and a patch has been welcomed by Rich -

https://groups.google.com/group/clojure/browse_thread/thread/aa72e43091ec3228?pli=1
https://groups.google.com/forum/#!topic/clojure-dev/awe7-yeieIM
https://groups.google.com/forum/?hl=en#!topic/clojure-dev/OFQhDKHTyrw

To fix this, I am attaching a trivial patch that implements loadLibrary in RT.

Activity

Hide
Chouser added a comment -

Tests would be nice, though I can see how getting such a test to work without 3rd party deps might be difficult.

My naive attempts to reproduce the problem failed. For example, this works fine for me:
(System/loadLibrary "hprof")

Nevertheless, the patch applies cleanly and appears to be what Rich asked for, so I'm setting this to "screened".

Show
Chouser added a comment - Tests would be nice, though I can see how getting such a test to work without 3rd party deps might be difficult. My naive attempts to reproduce the problem failed. For example, this works fine for me: (System/loadLibrary "hprof") Nevertheless, the patch applies cleanly and appears to be what Rich asked for, so I'm setting this to "screened".

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: