Skip to content

Commit e3de281

Browse files
author
Jeff Valk
committed
Make dynamic classpath modification robust to compiler loader binding
When the current classloader has no modifiable ancestor, do not rely on the compiler's classloader var binding, as it may be unbound in some circumstances. Instead, create a new dynamic classloader with the clojure runtime's ancestry.
1 parent 95030a3 commit e3de281

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/orchard/java/classpath.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
[^URL url]
7373
(let [loader (or (modifiable-classloader)
7474
(set-classloader!
75-
(modifiable-classloader @Compiler/LOADER)))]
75+
(modifiable-classloader (clojure.lang.DynamicClassLoader.
76+
(clojure.lang.RT/baseLoader)))))]
7677
(when (dp/add-classpath-url loader url)
7778
url)))
7879

0 commit comments

Comments
 (0)