[CLJ-113] GC Issue 109: RT.load's "don't load if already loaded" mechanism breaks ":reload-all" Created: 17/Jun/09 Updated: 09/Aug/11 |
|
| Status: | In Progress |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Approved Backlog |
| Type: | Defect | ||
| Reporter: | Anonymous | Assignee: | Stephen C. Gilardi |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
Reported by scgilardi, Apr 24, 2009 What (small set of) steps will reproduce the problem? "require" and "use" support a ":reload-all" flag that is intended to cause the specified libs to be reloaded along with all libs on which they directly or indirectly depend. This is implemented by temporarily binding a "loaded-libs" var to the empty set and then loading the specified libs. AOT compilation added another "already loaded" mechanism to clojure.lang.RT.load() which is currently not sensitive to a "reload- all" being in progress and breaks its operation in the following case: A, B, and C are libs A depends on B. (via :require in its ns form) B depends on C. (via :require in its ns form) B has been compiled (B.class is on classpath) At the repl I "require" A which loads A, B, and C (either from class files or clj files) I modify C.clj At the repl I "require" A with the :reload-all flag, intending to pick up the changes to C C is not reloaded because RT.load() skips loading B: B.class exists, is already loaded, and B.clj hasn't changed since it was compiled. What is the expected output? What do you see instead? I expect :reload-all to be effective. It isn't. What version are you using? svn 1354, 1.0.0RC1 Was this discussed on the group? If so, please provide a link to the discussion: http://groups.google.com/group/clojure/browse_frm/thread/9bbc290321fd895f/e6a967250021462a#e6a967250021462a Please provide any additional information below. I'll upload a patch soon that creates a "*reload-all*" var with a root binding of nil and code to bind it to true when the current thread has a :reload-all call pending. When *reload-all* is true, RT.load() will (re)load all libs from their ".clj" files even if they're already loaded. The fix for this may need to be coordinated with a fix for issue #3. |
| Comments |
| Comment by Assembla Importer [ 24/Aug/10 3:45 AM ] |
|
Converted from http://www.assembla.com/spaces/clojure/tickets/113 |
| Comment by Assembla Importer [ 24/Aug/10 3:45 AM ] |
|
richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124) |
| Comment by Assembla Importer [ 24/Aug/10 3:45 AM ] |
|
richhickey said: Updating tickets (#8, #42, #113, #2, #20, #94, #96, #104, #119, #124, #127, #149, #162) |
| Comment by Kevin Downey [ 08/Aug/11 7:40 PM ] |
|
seems like the code that is emitted in the static init for namespace classes could be emitted into a init_ns() static method and the static init could call init_ns(). then RT.load could call init_ns() to get the behavior of reloading an AOT compiled namespace. |
| Comment by Kevin Downey [ 09/Aug/11 8:31 PM ] |
|
looking at the compiler it looks like most of what I mentioned above is already implemented, just need RT to reflectively call load() on the namespace class in the right place |
[CLJ-42] GC Issue 38: When using AOT compilation, "load"ed files are not reloaded on (require :reload 'name.space) Created: 17/Jun/09 Updated: 24/Aug/10 |
|
| Status: | In Progress |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Approved Backlog |
| Type: | Defect | ||
| Reporter: | Anonymous | Assignee: | Stephen C. Gilardi |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
Reported by m...@kotka.de, Jan 07, 2009 What (small set of) steps will reproduce the problem? 1. Create a file src/foo.clj cat >src/foo.clj <<EOF (ns foo (:load "bar")) EOF 2. Create a file src/bar.clj cat >src/bar.clj <<EOF (clojure.core/in-ns 'foo) (def x 8) EOF 3. Start Clojure Repl: java -cp src:classes clojure.main -r 4. Compile the namespace. user=> (compile 'foo) foo 5. Require the namespace user=> (require :reload-all :verbose 'foo) (clojure.core/load "/foo") (clojure.core/load "/bar") What is the expected output? What do you see instead? 6. Re-Require the namespace user=> (require :reload-all :verbose 'foo) (clojure.core/load "/foo") Only the "master" file is loaded, but not the bar file. Expected would have been to also load the bar file. Changes to bar.clj are not reflected, and depending on the setting (eg. using multimethods in foo from a different namespace) code may be corrupted. What version are you using? SVN rev. 1195 |
| Comments |
| Comment by Assembla Importer [ 24/Aug/10 6:44 AM ] |
|
Converted from http://www.assembla.com/spaces/clojure/tickets/42 |
| Comment by Assembla Importer [ 24/Aug/10 6:44 AM ] |
|
richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124) |
| Comment by Assembla Importer [ 24/Aug/10 6:44 AM ] |
|
richhickey said: Updating tickets (#42, #71) |
| Comment by Assembla Importer [ 24/Aug/10 6:44 AM ] |
|
richhickey said: Updating tickets (#8, #42, #113, #2, #20, #94, #96, #104, #119, #124, #127, #149, #162) |