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

Self-host: Unable to reload namespace while in it

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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 (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:

1 {: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.)

Environment

None

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

Approval

None

Patch

None

Affects versions

1.10.238

Priority

Minor