tools.namespace

circular dependency when CLJS namespace requires CLJ for macros

Details

  • Type: Defect Defect
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

When a .cljs file defines a namespace with :require-macros of the same namespace name as a .clj file, tools.namespace reports a circular dependency error.

See https://github.com/clojure-emacs/refactor-nrepl/issues/127 for example

Activity

Hide
Stuart Sierra added a comment -

Possible short-term fix: just ignore the special case of a cljs namespace with :require-macros on itself.

Show
Stuart Sierra added a comment - Possible short-term fix: just ignore the special case of a cljs namespace with :require-macros on itself.
Hide
Stuart Sierra added a comment -

Or maybe :require-macros shouldn't be parsed at all, since it is crossing the boundary between .cljs and .clj

Show
Stuart Sierra added a comment - Or maybe :require-macros shouldn't be parsed at all, since it is crossing the boundary between .cljs and .clj
Hide
Stuart Sierra added a comment -

Short-term fix in commit 6b19f942

Show
Stuart Sierra added a comment - Short-term fix in commit 6b19f942
Hide
Stuart Sierra added a comment -

Included in 0.3.0-alpha2 release

Show
Stuart Sierra added a comment - Included in 0.3.0-alpha2 release
Hide
Stuart Sierra added a comment -

Reopening. Solution in -alpha2 is inadequate, see commit message at commit 149f4650

Show
Stuart Sierra added a comment - Reopening. Solution in -alpha2 is inadequate, see commit message at commit 149f4650
Hide
Stuart Sierra added a comment -

Fixed in commit 5d6957d by ignoring :require-macros when analyzing dependencies. I believe this is the correct solution for now: tools.namespace will treat Clojure and ClojureScript as separate worlds, and will not attempt to analyze dependency relationships which cross that boundary.

Show
Stuart Sierra added a comment - Fixed in commit 5d6957d by ignoring :require-macros when analyzing dependencies. I believe this is the correct solution for now: tools.namespace will treat Clojure and ClojureScript as separate worlds, and will not attempt to analyze dependency relationships which cross that boundary.

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: