Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Declined
-
Affects Version/s: 1.10.238
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
There is an unreleased self-host regression where requiring a namespace while in that namespace triggers circular dependency detection.
As a concrete example, let's say you are in a REPL, and you require a namespace, go into that namespace (using in-ns), exercise it a little, and then change the code to fix something and then reload it. This now fails on master for self-hosted code.
A repro following this example is the following:
(require 'cljs.js) (def st (cljs.js/empty-state)) (cljs.js/eval st '(require (quote foo.core)) {:context :expr :eval cljs.js/js-eval :load (fn [_ cb] (cb {:lang :clj :source "(ns foo.core) (def x 1)"}))} prn) (cljs.js/eval st '(require (quote foo.core) :reload) {:context :expr :ns 'foo.core :eval cljs.js/js-eval :load (fn [_ cb] (cb {:lang :clj :source "(ns foo.core) (def x 2)"}))} prn)
This causes the following on master, but not with the 1.9.908 release:
{:error #error {:message "Circular dependency detected foo.core -> foo.core", :data {:tag :cljs/analysis-error}}}
(Strictly speaking, the above example is not minimal in that :reload is not required in order to reproduce it: It will happen if you simply attempt to require the namespace while "in" it.)
Git bisect result implicates
CLJS-2356:CLJS-2356: