Fork me on GitHub
#mount
<
2017-02-16
>
onetom04:02:52

@arnout i was starting the system using this boot task:

(deftask refresh
  "Reload all changed namespaces on the classpath.
  Throws an exception in the case of failure."
  []
  (with-pass-thru _
    #_(apply tns/set-refresh-dirs (get-env :directories))
    (->> ["src"]
         (map abs-path)
         (apply tns/set-refresh-dirs))
    (with-bindings {#'*ns* *ns*
                    #'*e   *e}
      (mount/stop)
      (let [result (tns/refresh :after 'mount/start)]
        (when (instance? Throwable result)
          (throw result))))))

onetom04:02:39

but i haven't been able to reproduce the issue since, so i suspect it's an error related to how the code evolves. as states are being added and removed, occasionally throwing exceptions during reloading...

onetom04:02:08

but i might throw this whole auto reload approach away and just use cursive's "Sync files in REPL ⇧⌘M"....

onetom05:02:26

actually, i can't do that conveniently because if i move a symbol definition from a namespace to another, that causes exceptions, like this:

java.lang.IllegalStateException: gen already refers to: #'test-helpers/gen in namespace: app.users-test
clojure.lang.Compiler$CompilerException: java.lang.IllegalStateException: gen already refers to: #'test-helpers/gen in namespace: app.users-test, compiling:(app/users_test.clj:1:1)
im wondering then what is the use of that "sync files" in cursive then if it just does a (require .... :reload); which is not very convenient. it seems i cant avoid clojure.tools.namespace.repl/refresh 😕