compile forces namespace reloading from AOT classfile


  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: Release 1.7
  • Fix Version/s: Release 1.8
  • Component/s: None
  • Labels:
  • Patch:
  • Approval:


The patch for CLJ-979 exposed an issue with how clojure.core/compile is implemented, which causes the bug reported here:

The cause of this regression is that clojure.core/compile doesn't take into account clojure.core/loaded-libs, causing

(binding [*compile-files* true] (require 'some.ns))
(compile 'some.ns)

to reload 'some-ns from the AOT class with the call to compile.

Since the AOT compiled namespace is not loaded by DynamicClassLoader but using the underlying, code that relies on deftypes will have references to the AOT versions hardcoded, breaking the class loading policy introduced with CLJ-979 of prefering the in-memory versions to the AOT ones.

The fix for this, as implemented in the attached patch, is to make compile loaded-libs-aware, so that it won't force any namespace re-loading when unnecessary.


Alex Miller made changes -
Field Original Value New Value
Fix Version/s Release 1.7 [ 10250 ]
Approval Vetted [ 10003 ]
Rich Hickey made changes -
Fix Version/s Release 1.8 [ 10254 ]
Fix Version/s Release 1.7 [ 10250 ]
Alex Miller made changes -
Status Open [ 1 ] Closed [ 6 ]
Resolution Duplicate [ 3 ]


Vote (1)
Watch (2)


  • Created: