<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions in tools.namespace</title>
<link>https://ask.clojure.org/index.php/questions/contrib-libs/tools-namespace</link>
<description></description>
<item>
<title>tools.namespace remove-node does not remove outgoing dependencies from :dependents</title>
<link>https://ask.clojure.org/index.php/14345/namespace-remove-remove-outgoing-dependencies-dependents</link>
<description>&lt;h3&gt;Problem&lt;/h3&gt;
&lt;p&gt;I noticed that when a dependency, &lt;code&gt;example.one&lt;/code&gt;, was removed from another namespace, &lt;code&gt;example.two&lt;/code&gt;, &lt;code&gt;example.one&lt;/code&gt; still showed up under &lt;code&gt;[::track/deps :dependents 'example.two]&lt;/code&gt; in the tracker after an invocation of &lt;code&gt;repl/scan&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After digging into this for some time, I saw that the implementation of &lt;code&gt;remove-node&lt;/code&gt; in &lt;code&gt;MapDependencyGraph&lt;/code&gt; didn't make any changes to the &lt;code&gt;:dependents&lt;/code&gt; attribute.&lt;/p&gt;
&lt;p&gt;This seems like a mistake to me, as the &lt;code&gt;remove-node&lt;/code&gt; docstring reads:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Removes the node from the dependency graph without removing it as a&lt;br&gt;
dependency of other nodes. That is, removes all outgoing edges from&lt;br&gt;
node.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The implementation of &lt;code&gt;remove-node&lt;/code&gt; follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(remove-node [graph node]
  (MapDependencyGraph.
    (dissoc dependencies node)
    dependents))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This removes outgoing edges from &lt;code&gt;dependencies&lt;/code&gt;, but if &lt;code&gt;dependents&lt;/code&gt; is effectively an inverse of &lt;code&gt;dependencies&lt;/code&gt;, then I'd expect to see some sort of removal from &lt;code&gt;dependents&lt;/code&gt; as well. Instead, &lt;code&gt;dependents&lt;/code&gt; remains unmodified.&lt;/p&gt;
&lt;h3&gt;Proposed Fix&lt;/h3&gt;
&lt;p&gt;If this is indeed a bug, and not a misunderstanding on my part, I have a fix &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/brandoncorrea/tools.namespace/commit/8ee0608a1885826ac862382c282e718bb4aae850&quot;&gt;here&lt;/a&gt; along with &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/brandoncorrea/tools.namespace/blob/behavioral-tests/src/test/clojure/clojure/tools/namespace/repl_test.clj#L56-L80&quot;&gt;a couple tests&lt;/a&gt; on my &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/brandoncorrea/tools.namespace/tree/behavioral-tests&quot;&gt;behavioral-tests branch&lt;/a&gt; that removes &lt;code&gt;node&lt;/code&gt; from values in the &lt;code&gt;dependents&lt;/code&gt; map.&lt;/p&gt;
&lt;p&gt;Does this align with the expected behavior of &lt;code&gt;remove-node&lt;/code&gt;, or am I misunderstanding the intended behavior of this function?&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14345/namespace-remove-remove-outgoing-dependencies-dependents</guid>
<pubDate>Mon, 20 Jan 2025 02:32:44 +0000</pubDate>
</item>
<item>
<title>tools.namespace no longer returns declared metadata on namespace</title>
<link>https://ask.clojure.org/index.php/12965/tools-namespace-longer-returns-declared-metadata-namespace</link>
<description>&lt;h3&gt;Problem&lt;/h3&gt;
&lt;p&gt;v1.4.0 of &lt;code&gt;tools.namespace&lt;/code&gt; returns metadata from namespace declarations. Newer versions do not.&lt;/p&gt;
&lt;h3&gt;Reproduction&lt;/h3&gt;
&lt;p&gt;Given &lt;code&gt;./src/foo.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns ^{:doc &quot;foo&quot; :no-doc true} foo)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And &lt;code&gt;./test.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.tools.namespace.find :as f]
         '[clojure.java.io :as io])

(binding [*print-meta* true]
  (pr (f/find-ns-decls-in-dir (io/file &quot;src&quot;))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I use v1.4.0, I get the &lt;code&gt;foo&lt;/code&gt; ns &lt;code&gt;:doc&lt;/code&gt; and &lt;code&gt;:no-doc&lt;/code&gt; metadata:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.0&quot;}}}' -M test.clj
((ns ^{:doc &quot;foo&quot;, :no-doc true} foo))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But if I use v1.4.4, the ns metadata includes the new generated &lt;code&gt;:dir&lt;/code&gt; and &lt;code&gt;:file&lt;/code&gt; metadata from tools.namespace, but not the &lt;code&gt;:doc&lt;/code&gt; and &lt;code&gt;:no-doc&lt;/code&gt; metadata:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.4&quot;}}}' -M test.clj
((ns ^{:dir &quot;src&quot;, :file &quot;foo.clj&quot;} foo))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This has been true since v1.4.1 when the jar/dir and file metadata feature was introduced:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;❯ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.1&quot;}}}' -M test.clj
((ns ^{:dir &quot;src&quot;, :file &quot;foo.clj&quot;} foo))
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Additional Info&lt;/h3&gt;
&lt;p&gt;The same issue should exhibit for &lt;code&gt;find-ns-decls-in-jarfile&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Usage Scenario&lt;/h3&gt;
&lt;p&gt;Cljdoc uses tools.namespace to learn about namespaces before attempting to load them. It skips namespaces that have &lt;code&gt;:no-doc&lt;/code&gt; and/or &lt;code&gt;:skip-wiki&lt;/code&gt; metadata.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12965/tools-namespace-longer-returns-declared-metadata-namespace</guid>
<pubDate>Sat, 27 May 2023 20:35:10 +0000</pubDate>
</item>
<item>
<title>clojure.tools.namespace throws casting error when calling find-ns-decls-in-jarfile</title>
<link>https://ask.clojure.org/index.php/12732/clojure-tools-namespace-throws-casting-error-calling-jarfile</link>
<description>&lt;p&gt;If I call &lt;code&gt;find-ns-decls-in-jarfile jarfile&lt;/code&gt; (example below) with any jar I get the exception:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Error printing return value (ClassCastException) at clojure.tools.namespace.find/read-ns-decl-from-jarfile-entry (find.clj:158).&lt;br&gt;
class java.util.jar.JarFile cannot be cast to class java.io.File (java.util.jar.JarFile and java.io.File are in module java.base of loader 'bootstrap')&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I can reproduce this with this example:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
    (let [filename (format &quot;%s/.m2/repository/org/clojure/tools.namespace/1.4.2/tools.namespace-1.4.2.jar&quot; (System/getenv &quot;HOME&quot;))
      jarfile (JarFile. (io/file filename))]
  (clojure.tools.namespace.find/find-ns-decls-in-jarfile jarfile))
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;I think the issue is the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/find.clj#L159&quot;&gt;type hint on line 159&lt;/a&gt;. I think this should instead be &lt;code&gt;^java.util.jar.JarFile&lt;/code&gt;.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12732/clojure-tools-namespace-throws-casting-error-calling-jarfile</guid>
<pubDate>Tue, 07 Mar 2023 17:15:20 +0000</pubDate>
</item>
<item>
<title>How to restrict namespaces reloaded by tools.namespace to only dependencies of a root ns?</title>
<link>https://ask.clojure.org/index.php/12724/restrict-namespaces-reloaded-tools-namespace-dependencies</link>
<description>&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;At my organisation, we use Component and would like to start using the reloaded workflow to reload the code more easily.&lt;/p&gt;
&lt;p&gt;The problem we’re facing is that our dev classpath contains too much. In addition to the app proper (loaded by &lt;code&gt;(require 'our-org.repl)&lt;/code&gt;), there are tests and some one-off code: migrations and illustrative REPL sessions that we keep around as documentation.&lt;/p&gt;
&lt;p&gt;Some of these auxiliary namespaces have names that don’t match their location in the filesystem, so they are not loaded correctly by tools.namespace. We’d like to prevent them from being reloaded at all, even though they are present on the classpath.&lt;/p&gt;
&lt;p&gt;We could use &lt;code&gt;clojure.tools.namespace.repl/set-refresh-dirs&lt;/code&gt;, but I feel this is clunky (need to explicitly opt-in for directories) and not quite expressive enough. What we’d really want is to reload only the namespaces that are (possibly indirect) dependencies of &lt;code&gt;our-org.repl&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To this end, I’ve monkey-patched tools-namespace:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn relevant-deps [deps ns]
  (conj
   (ns.dependency/transitive-dependencies deps ns)
   ns))

(alter-var-root
 #'ns.repl/remove-disabled
 (fn [orig-impl]
   (fn [{:keys [::ns.track/deps] :as tracker}]
     (-&amp;gt; tracker
         (orig-impl)
         (update ::ns.track/unload (partial filter (loaded-libs)))
         (update ::ns.track/load
                 #(set/intersection (set %1) %2)
                 (relevant-deps deps 'our-org.repl))))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This works, but is obviously kludgy. Is there a better way to achieve the same goal? Perhaps the functionality of restricting dependencies could be added to tools.namespace?&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12724/restrict-namespaces-reloaded-tools-namespace-dependencies</guid>
<pubDate>Fri, 03 Mar 2023 20:17:19 +0000</pubDate>
</item>
<item>
<title>Should tools.namespace find still cope with namespace-less sources?</title>
<link>https://ask.clojure.org/index.php/12677/should-tools-namespace-find-still-cope-with-namespace-sources</link>
<description>&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;&lt;br&gt;
Tools.namespace find 1.4.1 does not handle sources that don't include a &lt;code&gt;ns&lt;/code&gt; declaration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reproduction&lt;/strong&gt;&lt;br&gt;
Given file &lt;code&gt;./src/foo.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;;; no ns declaration here
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And test script &lt;code&gt;./test.clj&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.tools.namespace.find :as f]
         '[clojure.java.io :as io])

(println &quot;found nses:&quot; (f/find-ns-decls-in-dir (io/file &quot;src&quot;)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can see that &lt;code&gt;tools.namespace 1.4.0&lt;/code&gt; returns an empty sequence for this scenario:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.0&quot;}}}' -M --report stderr test.clj
found nses: ()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But version 1.4.1 throws an exception for this same test:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.4.1&quot;}}}' -M --report stderr test.clj
{:clojure.main/message
 &quot;Execution error (NullPointerException) at clojure.tools.namespace.find/find-ns-decls-in-dir$fn (find.clj:93).\nCannot invoke \&quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\&quot; because \&quot;x\&quot; is null\n&quot;,
 :clojure.main/triage
 {:clojure.error/class java.lang.NullPointerException,
  :clojure.error/line 93,
  :clojure.error/cause
  &quot;Cannot invoke \&quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\&quot; because \&quot;x\&quot; is null&quot;,
  :clojure.error/symbol
  clojure.tools.namespace.find/find-ns-decls-in-dir$fn,
  :clojure.error/source &quot;find.clj&quot;,
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.Compiler$CompilerException,
    :message
    &quot;Syntax error macroexpanding at (/home/lee/proj/oss/-verify/tns-test/test.clj:4:1).&quot;,
    :data
    {:clojure.error/phase :execution,
     :clojure.error/line 4,
     :clojure.error/column 1,
     :clojure.error/source
     &quot;/home/lee/proj/oss/-verify/tns-test/test.clj&quot;},
    :at [clojure.lang.Compiler load &quot;Compiler.java&quot; 7665]}
   {:type java.lang.NullPointerException,
    :message
    &quot;Cannot invoke \&quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\&quot; because \&quot;x\&quot; is null&quot;,
    :at [clojure.core$with_meta__5485 invokeStatic &quot;core.clj&quot; 220]}],
  :trace
  [[clojure.core$with_meta__5485 invokeStatic &quot;core.clj&quot; 220]
   [clojure.core$with_meta__5485 invoke &quot;core.clj&quot; 219]
   [clojure.tools.namespace.find$find_ns_decls_in_dir$fn__1437
    invoke
    &quot;find.clj&quot;
    93]
   [clojure.core$keep$fn__8649 invoke &quot;core.clj&quot; 7409]
   [clojure.lang.LazySeq sval &quot;LazySeq.java&quot; 42]
   [clojure.lang.LazySeq seq &quot;LazySeq.java&quot; 51]
   [clojure.lang.RT seq &quot;RT.java&quot; 535]
   [clojure.core$seq__5467 invokeStatic &quot;core.clj&quot; 139]
   [clojure.core$print_sequential invokeStatic &quot;core_print.clj&quot; 53]
   [clojure.core$fn__7391 invokeStatic &quot;core_print.clj&quot; 174]
   [clojure.core$fn__7391 invoke &quot;core_print.clj&quot; 174]
   [clojure.lang.MultiFn invoke &quot;MultiFn.java&quot; 234]
   [clojure.core$pr_on invokeStatic &quot;core.clj&quot; 3675]
   [clojure.core$pr invokeStatic &quot;core.clj&quot; 3678]
   [clojure.core$pr invoke &quot;core.clj&quot; 3678]
   [clojure.lang.AFn applyToHelper &quot;AFn.java&quot; 154]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 132]
   [clojure.core$apply invokeStatic &quot;core.clj&quot; 667]
   [clojure.core$pr invokeStatic &quot;core.clj&quot; 3691]
   [clojure.core$pr doInvoke &quot;core.clj&quot; 3678]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 139]
   [clojure.core$apply invokeStatic &quot;core.clj&quot; 667]
   [clojure.core$prn invokeStatic &quot;core.clj&quot; 3715]
   [clojure.core$prn doInvoke &quot;core.clj&quot; 3715]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 137]
   [clojure.core$apply invokeStatic &quot;core.clj&quot; 667]
   [clojure.core$println invokeStatic &quot;core.clj&quot; 3734]
   [clojure.core$println doInvoke &quot;core.clj&quot; 3734]
   [clojure.lang.RestFn invoke &quot;RestFn.java&quot; 421]
   [user$eval1480 invokeStatic &quot;test.clj&quot; 4]
   [user$eval1480 invoke &quot;test.clj&quot; 4]
   [clojure.lang.Compiler eval &quot;Compiler.java&quot; 7194]
   [clojure.lang.Compiler load &quot;Compiler.java&quot; 7653]
   [clojure.lang.Compiler loadFile &quot;Compiler.java&quot; 7591]
   [clojure.main$load_script invokeStatic &quot;main.clj&quot; 475]
   [clojure.main$script_opt invokeStatic &quot;main.clj&quot; 535]
   [clojure.main$script_opt invoke &quot;main.clj&quot; 530]
   [clojure.main$main invokeStatic &quot;main.clj&quot; 664]
   [clojure.main$main doInvoke &quot;main.clj&quot; 616]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 137]
   [clojure.lang.Var applyTo &quot;Var.java&quot; 705]
   [clojure.main main &quot;main.java&quot; 40]],
  :cause
  &quot;Cannot invoke \&quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)\&quot; because \&quot;x\&quot; is null&quot;,
  :phase :execution}}

Execution error (NullPointerException) at clojure.tools.namespace.find/find-ns-decls-in-dir$fn (find.clj:93).
Cannot invoke &quot;clojure.lang.IObj.withMeta(clojure.lang.IPersistentMap)&quot; because &quot;x&quot; is null
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Usage Scenario&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cljdoc uses tools.namespace to find namespaces during API analysis.&lt;/p&gt;
&lt;p&gt;Various libs include all sorts of weirdnesses including namespace-less sources.&lt;/p&gt;
&lt;p&gt;Previous versions of tools.namespace handled this weirdness for us.&lt;/p&gt;
&lt;p&gt;We can certainly work around this if it is decided that tools.namespace should not handle namespace-less sources.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12677/should-tools-namespace-find-still-cope-with-namespace-sources</guid>
<pubDate>Tue, 21 Feb 2023 20:17:47 +0000</pubDate>
</item>
<item>
<title>Exposing namespaces that will be reloaded from c.t.n.repl</title>
<link>https://ask.clojure.org/index.php/12231/exposing-namespaces-that-will-be-reloaded-from-c-t-n-repl</link>
<description>&lt;p&gt;Hello! I've recently copied some logic out of clojure.tools.namespace.repl that determines the next set of namespaces that need refreshing: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/repl.clj#L91&quot;&gt;https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/repl.clj#L91&lt;/a&gt; This information is highly useful to external consumers who may need to manage some stateful resources prior to refreshing, depending on their state management solution.&lt;/p&gt;
&lt;p&gt;I opened a PR here, which was closed because I apparently can't read contribution guidelines: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.namespace/pull/13&quot;&gt;https://github.com/clojure/tools.namespace/pull/13&lt;/a&gt; This just pulls out functions that are invoked via &lt;code&gt;alter-var-root&lt;/code&gt; to a standalone function. (vemv also helpfully pointed out that I forgot to propagate an argument).&lt;/p&gt;
&lt;p&gt;Would this be a reasonable, small change to make to c.t.n.repl?&lt;/p&gt;
&lt;p&gt;Thank you :)&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12231/exposing-namespaces-that-will-be-reloaded-from-c-t-n-repl</guid>
<pubDate>Fri, 23 Sep 2022 22:42:10 +0000</pubDate>
</item>
<item>
<title>tools.namespace does not recognise ns deps implied by data_readers.cljc</title>
<link>https://ask.clojure.org/index.php/11845/tools-namespace-does-recognise-deps-implied-datareaders</link>
<description>&lt;p&gt;i found an interesting issue in our codebase around some tagged-literals seemingly violating the principle of least surprise&lt;/p&gt;
&lt;p&gt;we have been creating some pure-data descriptions of processes including some &lt;code&gt;defrecord&lt;/code&gt; objects from a custom tagged-literal reader declared in &lt;code&gt;data_readers.cljc&lt;/code&gt;, and having those &lt;code&gt;defrecord&lt;/code&gt; objects participate in a protocol. it's all been working just fine until i ran across this issue&lt;/p&gt;
&lt;p&gt;someone had put one of these tagged literals into a &lt;code&gt;def&lt;/code&gt; (which seemed like a reasonable thing to do at first blush):&lt;/p&gt;
&lt;p&gt;&lt;code&gt;(def foo #ctx/event-path [:blah])&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;which was ok... until &lt;code&gt;c.t.n.r/refresh&lt;/code&gt; was called, after which point everything broke&lt;/p&gt;
&lt;p&gt;it turned out that the &lt;code&gt;defrecord&lt;/code&gt; object &lt;code&gt;foo&lt;/code&gt; had a stale class (presumably because the namespace dependencies induced by the tagged-literal parsers declared in &lt;code&gt;data_readers.cljc&lt;/code&gt; are not recognised by &lt;code&gt;tools.namespace&lt;/code&gt;, and namespaces were therefore recompiled out of order), and so no longer participated in the protocol&lt;/p&gt;
&lt;p&gt;should &lt;code&gt;tools.namespace&lt;/code&gt; be able to recognise &lt;code&gt;data_readers.cljc&lt;/code&gt; induced dependencies ? or is that a step too far for it ?&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11845/tools-namespace-does-recognise-deps-implied-datareaders</guid>
<pubDate>Fri, 29 Apr 2022 14:52:37 +0000</pubDate>
</item>
<item>
<title>Could tools.namespace refresh get more sophisticated directory/file filtering?</title>
<link>https://ask.clojure.org/index.php/11434/could-namespace-refresh-sophisticated-directory-filtering</link>
<description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt;&lt;br&gt;
currently the only way of affecting which source files are loaded by &lt;code&gt;clojure.tools.namespace.repl/refresh&lt;/code&gt; is setting refresh dirs, which is an allowlist-based system. There is no way currently to &lt;em&gt;block&lt;/em&gt; specific directories/files/patterns from being loaded but allowing everything else. This presents an issue when there are clojure source files in source directories on the classpath, which are not meant to be loaded at all.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Long story:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We bumped into an interesting issue with &lt;code&gt;clojure.tools.namespace/refresh&lt;/code&gt; vs &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md&quot;&gt;clj-kondo hooks&lt;/a&gt; .&lt;/p&gt;
&lt;p&gt;A one-liner repro case is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Srepro -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version &quot;1.2.0&quot;} seancorfield/next.jdbc {:git/url &quot;https://github.com/seancorfield/next-jdbc/&quot; :git/sha &quot;24bf1dbaa441d62461f980e9f880df5013f295dd&quot;}}}' -M -e &quot;((requiring-resolve 'clojure.tools.namespace.repl/refresh-all))&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will fail with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:error-while-loading hooks.com.github.seancorfield.next-jdbc
Could not locate hooks/com/github/seancorfield/next_jdbc__init.class, hooks/com/github/seancorfield/next_jdbc.clj or hooks/com/github/seancorfield/next_jdbc.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For context, clj-kondo is a static analyzer/linter. In order to be able to analyze custom macros properly, it lets libraries distribute clj files (describing how these macros should be analyzed) as resources under a specific directory.&lt;/p&gt;
&lt;p&gt;The above example fails due to the combination of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;referring a lib by git coordinates, which means that it will appear as a directory on the classpath&lt;/li&gt;
&lt;li&gt;said lib exporting clj-kondo hooks&lt;/li&gt;
&lt;li&gt;clj-kondo hooks themselves being .clj files&lt;/li&gt;
&lt;li&gt;as these are for clj-kondo to use, they are not meant to be loaded in the app using the lib&lt;/li&gt;
&lt;li&gt;as a result these files normally having a namespace inside them that does not appear in code proper, for example: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/seancorfield/next-jdbc/blob/24bf1dbaa441d62461f980e9f880df5013f295dd/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj#L1&quot;&gt;https://github.com/seancorfield/next-jdbc/blob/24bf1dbaa441d62461f980e9f880df5013f295dd/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj#L1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;tools.namespace by default reloads all clj source files found in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.github.io/java.classpath/#clojure.java.classpath/classpath-directories&quot;&gt;classpath-directories&lt;/a&gt; (referring back to the first point)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As there is currently no way to tell tools.namespace to &lt;em&gt;not&lt;/em&gt; load certain files I had to come up with a somewhat hacky workaround, which tries to set the refresh dirs to classpath-directories minus problematic ones, but it would be much much nicer if there was a way to be able to set this with a blocklist or predicate.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt; in case anyone else bumps into it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn remove-clj-kondo-exports-from-tools-ns-refresh-dirs
  &quot;A potential issue from using this is that if the directory containing the clj-kondo.exports folder
  also directly contains to-be-reloaded clojure source files, those will no longer be reloaded.&quot;
  []
  (-&amp;gt;&amp;gt; (clojure.java.classpath/classpath-directories)
       (mapcat
        (fn [^File classpath-directory]
          (let [children   (.listFiles classpath-directory)
                directory? #(.isDirectory ^File %)
                clj-kondo-exports?
                           #(= &quot;clj-kondo.exports&quot; (.getName ^File %))
                has-clj-kondo-exports
                           (some (every-pred clj-kondo-exports? directory?) children)]
            (if has-clj-kondo-exports
              (-&amp;gt;&amp;gt; children
                   (filter directory?)
                   (remove clj-kondo-exports?))
              [classpath-directory]))))
       (apply clojure.tools.namespace.repl/set-refresh-dirs)))

;; call in user.clj
(remove-clj-kondo-exports-from-tools-ns-refresh-dirs)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11434/could-namespace-refresh-sophisticated-directory-filtering</guid>
<pubDate>Wed, 05 Jan 2022 18:03:20 +0000</pubDate>
</item>
<item>
<title>Resolution for bug TNS-6 in clojure.tools.namespace</title>
<link>https://ask.clojure.org/index.php/10655/resolution-for-bug-tns-6-in-clojure-tools-namespace</link>
<description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;So I believe I have a resolution for &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/TNS-6&quot;&gt;TNS-6&lt;/a&gt; in clojure.tools.namespace. I have a consistent repro and a resolution in the form of a one-line patch (see the patch for more detail). All the tests still pass, though I'm not sure they cover the changes. I have also tested the resolution in a number of local dependent repos, and it resolves the issue.&lt;/p&gt;
&lt;p&gt;However, I am not a Clojure contributor so I cannot comment or submitt the patch or comment on relevant Jira ticket.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;From b5a62f894e049a09d5fcf099ac7b4d6591fb4f18 Mon Sep 17 00:00:00 2001
From: zalky &amp;lt;zalan.k@gmail.com&amp;gt;
Date: Mon, 24 May 2021 13:08:30 -0400
Subject: [PATCH] Fix TNS-6: fully remove ns from deps graph

The clojure.tools.namespace.dependency/remove-node fn removes a
namespace's :dependencies set from the graph (outgoing edges), but
does not remove that namespace from the :dependents set of other
namespaces (ingoing edges). If a namespace is removed and one of its
dependencies is changed at the same time, as commonly occurs when
switching branches, then the removed namespace is still in the
:dependents of the changed namespace when it is reloaded. As all the
of the dependents of a changed namespace are also reloaded, this
throws a missing namespace error.

The resolution is to use clojure.tools.namespace.depedency/remove-all
to remove both outgoing (:dependencies) and ingoing (:dependents)
edges in the dependency graph.

However, care must be taken when choosing the point of change, because
clojure.tools.namespace.track/add relies on the partial removal
behaviour of clojure.tools.namespace.track/remove-deps. It uses
remove-deps to wipe the dependencies of a node, and cannot know how to
re-insert dependents if lost. Therefore the point of change should be
in clojure.tools.namespace.track/remove.
---
 src/main/clojure/clojure/tools/namespace/track.cljc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/clojure/clojure/tools/namespace/track.cljc b/src/main/clojure/clojure/tools/namespace/track.cljc
index 683c35d..ce666d5 100644
--- a/src/main/clojure/clojure/tools/namespace/track.cljc
+++ b/src/main/clojure/clojure/tools/namespace/track.cljc
@@ -96,7 +96,7 @@
          :or {load (), unload (), deps (dep/graph)}} tracker
         known (set (dep/nodes deps))
         removed-names (filter known names)
-        new-deps (remove-deps deps removed-names)
+        new-deps (reduce dep/remove-all deps removed-names)
         changed (affected-namespaces deps removed-names)]
     (assoc tracker
       ::deps new-deps
-- 
2.30.1 (Apple Git-130)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;[Patch updated after further testing]&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10655/resolution-for-bug-tns-6-in-clojure-tools-namespace</guid>
<pubDate>Mon, 24 May 2021 17:39:12 +0000</pubDate>
</item>
<item>
<title>Should tools.namespace.repl/refresh exclude code found in ~/.gitlibs?</title>
<link>https://ask.clojure.org/index.php/10381/should-tools-namespace-repl-refresh-exclude-found-gitlibs</link>
<description>&lt;p&gt;If you have a &lt;code&gt;deps.edn&lt;/code&gt; project with a git dep in it, in a project where you're also using &lt;code&gt;clojure.tools.namespace.repl/refresh&lt;/code&gt; then by default the &lt;code&gt;refresh&lt;/code&gt; call will load and refresh all the clojure namespaces in your git dep.&lt;/p&gt;
&lt;p&gt;I think it does this because prior to tools.deps; essentially all library dependencies were distributed as jars, so it would assume that any directories in the classpath contain your projects source code, and would benefit from reloading via refresh.&lt;/p&gt;
&lt;p&gt;This assumption changes in &lt;code&gt;tools.deps&lt;/code&gt; projects as deps can now be stored as files on the filesystem in the &lt;code&gt;~/.gitlibs&lt;/code&gt; directory.  These deps are essentially mistaken as project dependencies, and are all loaded and refreshed, even if your project does not actually &lt;code&gt;require&lt;/code&gt; them.  &lt;/p&gt;
&lt;p&gt;Given that &lt;code&gt;~/.gitlibs&lt;/code&gt; are versioned and intended to be immutable, arguably it doesn't make sense to automatically require and refresh them.&lt;/p&gt;
&lt;p&gt;It is quite easily avoided by including a call to explicitly set your projects refresh-dirs with something like: &lt;code&gt;(tnsrepl/set-refresh-dirs &quot;src&quot; &quot;test&quot;)&lt;/code&gt;, however I wonder if it would be better for tools.namespace to exclude anything under &lt;code&gt;~/.gitlibs&lt;/code&gt; by default, as tools.namespace's starting/default assumption no longer holds.&lt;/p&gt;
&lt;p&gt;NOTE this is also likely related &lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/10277/preventing-clojure-namespace-refresh-loading-namespaces&quot;&gt;to this issue&lt;/a&gt;.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10381/should-tools-namespace-repl-refresh-exclude-found-gitlibs</guid>
<pubDate>Fri, 26 Mar 2021 14:43:59 +0000</pubDate>
</item>
<item>
<title>Preventing `clojure.tools.namespace.repl/refresh` from loading namespaces that haven't been loaded before</title>
<link>https://ask.clojure.org/index.php/10277/preventing-clojure-namespace-refresh-loading-namespaces</link>
<description>&lt;p&gt;Two issues that I see in the current implementation of &lt;code&gt;clojure.tools.namespace.repl/refresh&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Upon the very first call, it reloads absolutely all Clojure files on the classpath. Its docstring hints at it, but it doesn't explain for why such a behavior is needed. At the very least, it makes the first &lt;code&gt;refresh&lt;/code&gt; call much slower than needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It will attempt to (re)load even the files that haven't been loaded before. A very real situation - I have some Clojure files on classpath that require dependencies that aren't available. That alone makes it impossible to use &lt;code&gt;refresh&lt;/code&gt;. Perhaps, it can be altered to avoid loading files that haven't been loaded before.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Currently, I'm using these workarounds:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(alter-var-root #'clojure.tools.namespace.repl/refresh-tracker
                assoc :clojure.tools.namespace.dir/time (System/currentTimeMillis))

(alter-var-root #'clojure.tools.namespace.repl/remove-disabled
                (fn [orig-remove-disabled]
                  (fn [tracker]
                    (let [filter-loaded #(filter find-ns %)]
                      (-&amp;gt; tracker
                          orig-remove-disabled
                          (update :clojure.tools.namespace.track/unload filter-loaded)
                          (update :clojure.tools.namespace.track/load filter-loaded))))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Of course, the workaround assumes that each files has a proper &lt;code&gt;ns&lt;/code&gt; form and doesn't  create other namespaces. But seems like this assumption is also made by &lt;code&gt;tools.namespace&lt;/code&gt;, namely by the usage of &lt;code&gt;clojure.tools.namespace.file/read-file-ns-decl&lt;/code&gt;.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10277/preventing-clojure-namespace-refresh-loading-namespaces</guid>
<pubDate>Tue, 02 Mar 2021 19:51:03 +0000</pubDate>
</item>
<item>
<title>Would be nice if tools.namespace.find functions return file info in ns-decl meta</title>
<link>https://ask.clojure.org/index.php/8826/would-nice-tools-namespace-find-functions-return-file-info</link>
<description>&lt;p&gt;Currently calling &lt;code&gt;tools.namespace.find/find-ns-decls&lt;/code&gt; returns a seq of ns-decl for a given dir or collection of paths but there is no way to know where did they came from (can also be coming from paths inside jar files).&lt;/p&gt;
&lt;p&gt;Looks pretty straight forward to add file info as meta of the ns-decl form. Something like &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jpmonettas/tools.namespace/commit/1431215324ba7f76f78342742ce3716ec8c5abb8&quot;&gt;https://github.com/jpmonettas/tools.namespace/commit/1431215324ba7f76f78342742ce3716ec8c5abb8&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What do you guys think?&lt;/p&gt;
&lt;p&gt;(Filed jira at &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/TNS-55&quot;&gt;https://clojure.atlassian.net/browse/TNS-55&lt;/a&gt;)&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8826/would-nice-tools-namespace-find-functions-return-file-info</guid>
<pubDate>Tue, 05 Nov 2019 13:35:01 +0000</pubDate>
</item>
<item>
<title>How does tools.namespace.track/add is supposed to work?</title>
<link>https://ask.clojure.org/index.php/8737/how-does-tools-namespace-track-add-is-supposed-to-work</link>
<description>&lt;p&gt;I'm trying to figure out if I can use tools.namespace.track for a project but I don't understand the :unload :load functionality.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.tools.namespace.track :as ns-track])

;; define a empty tracker and add some dependencies
(def tracker (-&amp;gt; (ns-track/tracker)
                 (ns-track/add '{alpha #{beta}
                                 beta  #{gamma delta}})))

;; now add a new dependency and check what we need to unload and load
(-&amp;gt; tracker
    (ns-track/add '{epsilon #{}})
    (select-keys [:clojure.tools.namespace.track/unload
                  :clojure.tools.namespace.track/load]))

#:clojure.tools.namespace.track{:unload (epsilon alpha beta),
                                :load (epsilon beta alpha)}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I don't understand why alpha and  beta are required to unload/load but maybe I'm missing something.&lt;/p&gt;
&lt;p&gt;I'm using the latest version.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8737/how-does-tools-namespace-track-add-is-supposed-to-work</guid>
<pubDate>Fri, 18 Oct 2019 21:22:25 +0000</pubDate>
</item>
<item>
<title>Is it usual to require all application namespaces via tools.namespace?</title>
<link>https://ask.clojure.org/index.php/8325/usual-require-all-application-namespaces-tools-namespace</link>
<description>&lt;p&gt;We have to require namespaces with side effects like multimethod or protocol implementation.&lt;br&gt;
So we have a lot of noisy require forms in one initial namespace. &lt;/p&gt;
&lt;p&gt;Is it better to use tools.namespace for require all app namespaces?&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8325/usual-require-all-application-namespaces-tools-namespace</guid>
<pubDate>Sun, 04 Aug 2019 16:39:19 +0000</pubDate>
</item>
<item>
<title>Java 11 and Tools Namespace</title>
<link>https://ask.clojure.org/index.php/8288/java-11-and-tools-namespace</link>
<description>&lt;p&gt;I've run into an issue where &lt;code&gt;refresh&lt;/code&gt; from &lt;code&gt;tools.namespace&lt;/code&gt; (v. &lt;code&gt;0.3.0&lt;/code&gt;) seems to work with Java 8 but not Java 11. I tried with both Clojure &lt;code&gt;1.10.0&lt;/code&gt; and &lt;code&gt;1.10.1&lt;/code&gt;. I was able to reproduce the problem on a clean virtual machine. In both cases, I was able to reload the namespaces on Java 8 but not Java 11.&lt;/p&gt;
&lt;p&gt;It's weird though -- in some of my other projects, I can reload namespaces on Java 11. I haven't been able to track down the difference. (I'm also new to &lt;code&gt;tools.deps&lt;/code&gt;, so it could be I'm doing something wrong there.)&lt;/p&gt;
&lt;p&gt;I put together a reproduction here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/thomascothran/namespace-repro&quot;&gt;https://github.com/thomascothran/namespace-repro&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I'm assuming it's likely an error on my end, but the only thing I've been able to narrow it down to is the Java version.&lt;/p&gt;
&lt;p&gt;Reference: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/TNS-54&quot;&gt;https://clojure.atlassian.net/browse/TNS-54&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8288/java-11-and-tools-namespace</guid>
<pubDate>Wed, 31 Jul 2019 14:50:56 +0000</pubDate>
</item>
<item>
<title>Breakage with tools.reader 1.3.0</title>
<link>https://ask.clojure.org/index.php/8045/breakage-with-tools-reader-1-3-0</link>
<description>I've noticed this problem after bumping the tools.reader dep in cider-nrepl to 1.3.0:&lt;br /&gt;
&lt;br /&gt;
Oct 15, 2018 5:50:23 PM clojure.tools.logging$eval579$fn__582 invoke&lt;br /&gt;
SEVERE: Unhandled REPL handler exception processing message {:op init-debugger, :print-level 10, :print-length 10, :session cc619163-753b-46b1-9334-cf6e9459aac4, :id 8}&lt;br /&gt;
java.lang.ClassNotFoundException: clojure.tools.reader.reader_types.SourceLoggingPushbackReader, compiling:(cider/inlined_deps/toolsreader/v1v3v0/clojure/tools/reader.clj:1:1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.Compiler.load(Compiler.java:7526)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RT.loadResourceScript(RT.java:379)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RT.loadResourceScript(RT.java:370)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RT.load(RT.java:460)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RT.load(RT.java:426)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load$fn__6548.invoke(core.clj:6046)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load.invokeStatic(core.clj:6045)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load.doInvoke(core.clj:6029)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RestFn.invoke(RestFn.java:408)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load_one.invokeStatic(core.clj:5848)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load_one.invoke(core.clj:5843)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load_lib.invokeStatic(core.clj:5887)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load_lib.doInvoke(core.clj:5868)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RestFn.applyTo(RestFn.java:142)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$apply.invokeStatic(core.clj:659)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load_libs.invokeStatic(core.clj:5925)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$load_libs.doInvoke(core.clj:5909)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RestFn.applyTo(RestFn.java:137)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$apply.invokeStatic(core.clj:659)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$require.invokeStatic(core.clj:5947)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.core$require.doInvoke(core.clj:5947)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RestFn.invoke(RestFn.java:421)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at cider.inlined_deps.toolsnamespace.v0v3v0_alpha4.clojure.tools.namespace.parse$eval2867$loading__6434__auto____2868.invoke(parse.cljc:9)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at cider.inlined_deps.toolsnamespace.v0v3v0_alpha4.clojure.tools.namespace.parse$eval2867.invokeStatic(parse.cljc:9)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at cider.inlined_deps.toolsnamespace.v0v3v0_alpha4.clojure.tools.namespace.parse$eval2867.invoke(parse.cljc:9)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;... skipping some lines ...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.lang.Thread.run(Thread.java:748)&lt;br /&gt;
Caused by: java.lang.ClassNotFoundException: clojure.tools.reader.reader_types.SourceLoggingPushbackReader&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.net.URLClassLoader.findClass(URLClassLoader.java:381)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.lang.ClassLoader.loadClass(ClassLoader.java:424)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.lang.ClassLoader.loadClass(ClassLoader.java:357)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.lang.Class.forName0(Native Method)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at java.lang.Class.forName(Class.java:348)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RT.classForName(RT.java:2204)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.RT.classForNameNonLoading(RT.java:2217)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at cider.inlined_deps.toolsreader.v1v3v0.clojure.tools.reader$eval3532$loading__6434__auto____3533.invoke(reader.clj:9)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at cider.inlined_deps.toolsreader.v1v3v0.clojure.tools.reader$eval3532.invokeStatic(reader.clj:9)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at cider.inlined_deps.toolsreader.v1v3v0.clojure.tools.reader$eval3532.invoke(reader.clj:9)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.Compiler.eval(Compiler.java:7062)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.Compiler.eval(Compiler.java:7051)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;at clojure.lang.Compiler.load(Compiler.java:7514)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;... &amp;nbsp;more&lt;br /&gt;
&lt;br /&gt;
After first going to the tools.reader tracker (&lt;a href=&quot;https://dev.clojure.org/jira/browse/TRDR-55&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://dev.clojure.org/jira/browse/TRDR-55&lt;/a&gt;) I was told this is a problem that has to be fixed in tools.namespace, so I'm filing this ticket here as well.</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8045/breakage-with-tools-reader-1-3-0</guid>
<pubDate>Tue, 16 Oct 2018 09:04:51 +0000</pubDate>
</item>
<item>
<title>Generating namespace forms</title>
<link>https://ask.clojure.org/index.php/8042/generating-namespace-forms</link>
<description>&lt;p&gt;Since tools.namespace supports extracting dependencies from a namespace form (&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/parse.cljc#L123&quot;&gt;https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/parse.cljc#L123&lt;/a&gt;), would it also be in scope for tools.namespace to support generating namespace forms?&lt;/p&gt;
&lt;p&gt;That is, could we add a function that, given a list of dependent namespaces, java classes, etc., generates a namespace form in a canonical style (e.g., &lt;a rel=&quot;nofollow&quot; href=&quot;https://stuartsierra.com/2016/clojure-how-to-ns.html&quot;&gt;https://stuartsierra.com/2016/clojure-how-to-ns.html&lt;/a&gt;)?&lt;/p&gt;
&lt;p&gt;My use case is linting/reformatting a few hundred namespace declarations across large enterprise project.&lt;br&gt;
I'd like to do this programmatically --- since I haven't found any tools so far, I thought I'd write my own, and would like to make it open source if possible.&lt;/p&gt;
&lt;p&gt;Thought I'd run it by y'all first in case it'd be in scope for tools.namespace and there were specific design considerations I should keep in mind before writing the code.&lt;br&gt;
(And no worries if this is out of scope because it's too bike-sheddy, etc.)&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8042/generating-namespace-forms</guid>
<pubDate>Mon, 01 Oct 2018 12:00:06 +0000</pubDate>
</item>
<item>
<title>Support namespaces as strings in require statements</title>
<link>https://ask.clojure.org/index.php/8044/support-namespaces-as-strings-in-require-statements</link>
<description>&lt;p&gt;Since July 2017, in clojurescript, one can require npm modules using the following syntax:&lt;br&gt;
(:require (link: &quot;honeybadger-js&quot; :as honeybadger))&lt;/p&gt;
&lt;p&gt;The npm module to required is passed as a string.&lt;/p&gt;
&lt;p&gt;See &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules&quot;&gt;https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules&lt;/a&gt; for the full details.&lt;/p&gt;
&lt;p&gt;Currently, tools.namespace consider this form as invalid.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8044/support-namespaces-as-strings-in-require-statements</guid>
<pubDate>Sat, 28 Jul 2018 19:41:23 +0000</pubDate>
</item>
<item>
<title>`require :reload` fails where `load-file` succeeds</title>
<link>https://ask.clojure.org/index.php/8049/require-reload-fails-where-load-file-succeeds</link>
<description>&lt;p&gt;Here are steps to reproduce at the REPL:&lt;br&gt;
- &lt;code&gt;(c.t.n.r/refresh)&lt;/code&gt; succeeds&lt;br&gt;
- Modify any file in the classpath&lt;br&gt;
- &lt;code&gt;(c.t.n.r/refresh)&lt;/code&gt; fails from not having found certain namespace(s) (not always the same one(s))&lt;/p&gt;
&lt;p&gt;This always happens with a particular project, but no (known) others of relatively similar complexity. AOT compilation/execution works with the project in question, as do &lt;code&gt;require&lt;/code&gt;s without using &lt;code&gt;(c.t.n.r/refresh)&lt;/code&gt;. For &lt;code&gt;(c.t.n.r/refresh)&lt;/code&gt;, &lt;code&gt;load-file&lt;/code&gt; works in place of &lt;code&gt;require :reload&lt;/code&gt; in &lt;code&gt;clojure.tools.namespace.reload/track-reload-one&lt;/code&gt;. It is not known what the root cause of this bug is beyond &lt;code&gt;require :reload&lt;/code&gt;, or why &lt;code&gt;load-file&lt;/code&gt; works instead, but it's a simple enough patch with no known downsides. For now I'm hot-swapping code every time at the REPL.&lt;/p&gt;
&lt;p&gt;A fork is available at &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/alexandergunnarson/tools.namespace&quot;&gt;https://github.com/alexandergunnarson/tools.namespace&lt;/a&gt; from which I can submit a patch if desired.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8049/require-reload-fails-where-load-file-succeeds</guid>
<pubDate>Thu, 17 May 2018 22:07:42 +0000</pubDate>
</item>
<item>
<title>Show full path for circular dependency exceptions</title>
<link>https://ask.clojure.org/index.php/8046/show-full-path-for-circular-dependency-exceptions</link>
<description>I use {{org.clojure/tools.namespace &amp;quot;0.3.0-alpha4&amp;quot;}} to detect circular dependencies among arbitrary objects. It works fine, but the error could be more informative for a certain case:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{:type clojure.lang.ExceptionInfo&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;:message &amp;quot;Circular dependency between x and y&amp;quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;:data {:reason :clojure.tools.namespace.dependency/circular-dependency, :node x, :dependency y}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;:at [clojure.core$ex_info invokeStatic &amp;quot;core.clj&amp;quot; 4617]}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{x}} and {{y}} are redacted data.&lt;br /&gt;
&lt;br /&gt;
The problem is that neither x or y depend on each other directly, but via an indirect path.&lt;br /&gt;
&lt;br /&gt;
It would be tremendously useful if the exception itself informed of the full faulty path, instead of just the beginning and end.&lt;br /&gt;
&lt;br /&gt;
Example of desired exception:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;:data {:reason :clojure.tools.namespace.dependency/circular-dependency, :node x, :dependency y, :path [x a b c y]}&lt;br /&gt;
&amp;nbsp;</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8046/show-full-path-for-circular-dependency-exceptions</guid>
<pubDate>Thu, 23 Nov 2017 21:50:10 +0000</pubDate>
</item>
<item>
<title>Ability to track files that are not namespaces</title>
<link>https://ask.clojure.org/index.php/8043/ability-to-track-files-that-are-not-namespaces</link>
<description>&lt;p&gt;Support tracking non-clojure files when performing a refresh. The idea here is to make the reloaded workflow work well for libraries like HugSQL (which may depend on non-clojure files in the project).&lt;/p&gt;
&lt;p&gt;See &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/layerware/hugsql/issues/72&quot;&gt;https://github.com/layerware/hugsql/issues/72&lt;/a&gt; for some additional context&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8043/ability-to-track-files-that-are-not-namespaces</guid>
<pubDate>Fri, 03 Nov 2017 07:23:48 +0000</pubDate>
</item>
<item>
<title>Add project.clj for easier development</title>
<link>https://ask.clojure.org/index.php/8040/add-project-clj-for-easier-development</link>
<description>&lt;p&gt;Tools.namespace doesn't currently have have a Leiningen configuration which would make it easy to start a repl and start developing tools.namespace.&lt;/p&gt;
&lt;p&gt;Attached patch adds simple project.clj file with deps and source-paths.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8040/add-project-clj-for-easier-development</guid>
<pubDate>Tue, 13 Sep 2016 22:27:43 +0000</pubDate>
</item>
<item>
<title>File in invalid path will mark namespace for reload</title>
<link>https://ask.clojure.org/index.php/8052/file-in-invalid-path-will-mark-namespace-for-reload</link>
<description>&lt;p&gt;Having a cljc file at path {{public/js/out/foo/bar.cljc}} with ns form {{(ns foo.bar)}} will result in namespace {{foo.bar}} being reloaded.&lt;/p&gt;
&lt;p&gt;This is problematic because ClojureScript compiler will copy all the input files to {{:output-dir}} for source-map use. Lately as more libraries have started using cljc, and this has started causing problems in cases where library is used on Clojure env. Cljs compilation will result in reload of the library code, which can redefine protocols etc. and break the Clojure env.&lt;/p&gt;
&lt;p&gt;I think it would make sense for tools.namespace to ignore changes where file path and namespace don't match.&lt;br&gt;
Another question and perhaps way to fix this, is to understand why dependency resolution doesn't work in this case: namespaces which depend on the protocols at a cljc file on output-dir aren't reloaded.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8052/file-in-invalid-path-will-mark-namespace-for-reload</guid>
<pubDate>Tue, 13 Sep 2016 21:15:40 +0000</pubDate>
</item>
<item>
<title>ns-decl? treats (ns) as valid</title>
<link>https://ask.clojure.org/index.php/8050/ns-decl-treats-ns-as-valid</link>
<description>&lt;p&gt;If you try to declare an empty namespace with &lt;code&gt;(ns)&lt;/code&gt;, you get an ArityException, but ns-decl? does not test for this.&lt;/p&gt;
&lt;p&gt;The attached patch simply tests whether it is at least two items long.&lt;/p&gt;
&lt;p&gt;I have previously signed the Clojure CA.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8050/ns-decl-treats-ns-as-valid</guid>
<pubDate>Mon, 28 Mar 2016 12:10:01 +0000</pubDate>
</item>
<item>
<title>scan-dirs / scan-all can return incorrect dependencies when both clj and cljc files define same namespace</title>
<link>https://ask.clojure.org/index.php/8047/return-incorrect-dependencies-cljc-files-define-namespace</link>
<description>&lt;p&gt;Originally filed as an issue for function scan-all, which at the time I was unaware was deprecated in 0.3.0 alphas.  I have tested against the newer scan-dirs as well, and it has the same problem.&lt;/p&gt;
&lt;p&gt;When there are both .clj and .cljc files defining the same namespace, tools.namespace scan-dirs and scan-all can use the dependencies from the .cljc file, ignoring those in the .clj file, whereas for Clojure/Java the opposite should be done.&lt;/p&gt;
&lt;p&gt;See sample project and its README here for steps to reproduce: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jafingerhut/tnstest&quot;&gt;https://github.com/jafingerhut/tnstest&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note that Clojure/Java's behavior is to prefer .clj file over a .cljc file defining the same namespace, even if the .clj file is in a directory that is later in the classpath than a .cljc file.  According to Alex Miller email on clojure-dev Google group, this behavior is by design.   Link: &lt;a rel=&quot;nofollow&quot; href=&quot;https://groups.google.com/d/msg/clojure-dev/d5Hb1E7zfHE/sPybIAxgCwAJ&quot;&gt;https://groups.google.com/d/msg/clojure-dev/d5Hb1E7zfHE/sPybIAxgCwAJ&lt;/a&gt;&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8047/return-incorrect-dependencies-cljc-files-define-namespace</guid>
<pubDate>Wed, 30 Dec 2015 22:13:22 +0000</pubDate>
</item>
<item>
<title>Single classpath argument for c.t.n.move</title>
<link>https://ask.clojure.org/index.php/8038/single-classpath-argument-for-c-t-n-move</link>
<description>&lt;p&gt;{{clojure.tools.namespace.move/move-ns}} requires that the caller provide both 1) the directory containing the file to be moved; and 2) the collection of directories containing all source files to be updated with the new name. This is redundant.&lt;/p&gt;
&lt;p&gt;Instead, we can search for the file in all source directories, move it within the same root directory, then update all files in all directories.&lt;/p&gt;
&lt;p&gt;In addition, with java.classpath in TNS-36, the set of directories to search can default to directories on the classpath. This will be much more convenient for REPL use.&lt;/p&gt;
&lt;p&gt;This change can be made without breaking older arities of {{move-ns}}.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8038/single-classpath-argument-for-c-t-n-move</guid>
<pubDate>Fri, 06 Nov 2015 21:01:33 +0000</pubDate>
</item>
<item>
<title>c.t.n.move: does not support to move .cljc files</title>
<link>https://ask.clojure.org/index.php/8051/c-t-n-move-does-not-support-to-move-cljc-files</link>
<description>&lt;p&gt;it seems that c.t.n.move did not get any reader conditionals love. I use this namespace to power (link: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/benedekfazekas/mranderson&quot;&gt;https://github.com/benedekfazekas/mranderson&lt;/a&gt; text: mranderson): a source inlining tool used by cider-nrepl and refactor-nrepl in order to avoid clashes with the code/projects their users work on. lately we started adding dependencies to refactor-nrepl (well, tools.namespace itself) which may use .cljc files. source inlining started failing for these source files.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8051/c-t-n-move-does-not-support-to-move-cljc-files</guid>
<pubDate>Sat, 05 Sep 2015 22:19:57 +0000</pubDate>
</item>
<item>
<title>Broken tracker after mis-named namespace</title>
<link>https://ask.clojure.org/index.php/8048/broken-tracker-after-mis-named-namespace</link>
<description>&lt;p&gt;A tools.namespace dependency tracker can get into an inconsistent state after attempting to load a file with a namespace declaration that does not match the file's name.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Steps to reproduce:&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;In a new Clojure project, create a file {{foo.clj}} on the classpath containing the namespace declaration {{(ns wrong-ns-declaration-for-foo)}}&lt;/p&gt;
&lt;p&gt;Then at the REPL:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
user=&amp;gt; (use 'clojure.tools.namespace.repl)&lt;br&gt;
nil&lt;br&gt;
user=&amp;gt; (refresh)&lt;br&gt;
:reloading (wrong-ns-declaration-for-foo)&lt;br&gt;
:error-while-loading wrong-ns-declaration-for-foo&lt;/p&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Edit the file {{foo.clj}} so that its namespace declaration is correct: {{(ns foo)}}&lt;/p&gt;
&lt;p&gt;But at the REPL, {{refresh}} still doesn't work:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
user=&amp;gt; (refresh)&lt;br&gt;
:reloading (foo wrong-ns-declaration-for-foo)&lt;br&gt;
:error-while-loading wrong-ns-declaration-for-foo&lt;/p&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Since tools.namespace 0.2.5, the workaround is to call {{clear}}:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;user=&amp;gt; (clear)
{}
user=&amp;gt; (refresh)
:reloading (foo)
:ok&lt;/code&gt;&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8048/broken-tracker-after-mis-named-namespace</guid>
<pubDate>Sun, 07 Sep 2014 17:23:39 +0000</pubDate>
</item>
<item>
<title>Stack overflow on refresh after circular dependency detected</title>
<link>https://ask.clojure.org/index.php/8039/stack-overflow-refresh-after-circular-dependency-detected</link>
<description>&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
user&amp;gt; (refresh)&lt;br&gt;
Exception Circular dependency between com.example.foo and com.example.bar  clojure.tools.namespace.dependency.MapDependencyGraph (dependency.clj:74)&lt;br&gt;
user&amp;gt; (refresh)&lt;br&gt;
StackOverflowError   clojure.lang.PersistentHashMap$BitmapIndexedNode.index (PersistentHashMap.java:576)&lt;br&gt;
user&amp;gt; (clojure.repl/pst)&lt;br&gt;
StackOverflowError &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clojure.lang.PersistentHashMap$BitmapIndexedNode.index (PersistentHashMap.java:576)
clojure.lang.PersistentHashMap$BitmapIndexedNode.find (PersistentHashMap.java:676)
clojure.lang.PersistentHashMap$ArrayNode.find (PersistentHashMap.java:396)
clojure.lang.PersistentHashMap.valAt (PersistentHashMap.java:152)
clojure.lang.PersistentHashMap.valAt (PersistentHashMap.java:156)
clojure.lang.RT.get (RT.java:645)
clojure.tools.namespace.dependency/transitive (dependency.clj:52)
clojure.tools.namespace.dependency/transitive/fn--7043 (dependency.clj:51)
clojure.core.protocols/fn--6022 (protocols.clj:79)
clojure.core.protocols/fn--5979/G--5974--5992 (protocols.clj:13)
clojure.core/reduce (core.clj:6177)
clojure.tools.namespace.dependency/transitive (dependency.clj:52)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;nil&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8039/stack-overflow-refresh-after-circular-dependency-detected</guid>
<pubDate>Wed, 17 Apr 2013 16:34:08 +0000</pubDate>
</item>
<item>
<title>Attempt to reload deleted file</title>
<link>https://ask.clojure.org/index.php/8041/attempt-to-reload-deleted-file</link>
<description>&lt;p&gt;I can't identify the exact circumstances, but I have seen events where a source code file has been deleted but clojure.tools.namespace.repl/refresh still tries to reload it. Because the file doesn't exist, there's an exception when you try to load it, so you're stuck.&lt;/p&gt;
</description>
<category>tools.namespace</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8041/attempt-to-reload-deleted-file</guid>
<pubDate>Fri, 14 Dec 2012 13:56:02 +0000</pubDate>
</item>
</channel>
</rss>