We're updating the issue view to help you get more done. 

compile forces namespace reloading from AOT classfile

Description

The patch for exposed an issue with how clojure.core/compile is implemented, which causes the bug reported here: https://groups.google.com/d/msg/clojure-dev/jj87-4yVlWI/YKG4QazhPuAJ

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

1 2 (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 java.net.URLClassLoader, code that relies on deftypes will have references to the AOT versions hardcoded, breaking the class loading policy introduced with 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.

Environment

None

Status

Assignee

Unassigned

Reporter

Nicola Mometto

Labels

Approval

Vetted

Patch

Code

Fix versions

Affects versions

Release 1.7

Priority

Major