   ([state path]
    (merge-resources-in-path state path {:reloadable true}))
   ([state path path-opts]
-   (let [file (io/file path)
-         resources (do-find-resources-in-path state path)]
-     (-> state
-         (cond->
-           (.isDirectory file)
-           (assoc-in [:source-paths (.getAbsolutePath file)]
-             (assoc path-opts
-               :file file
-               :abs-path (.getAbsolutePath file)
-               :path path)))
-         (merge-resources resources)))))
+   (let [file (.getCanonicalFile (io/file path))
+         abs-path (.getCanonicalPath file)]
+     ;; checkout deps with a lot of symlinks can cause duplicates on classpath
+     (if (contains? (:source-paths state) abs-path)
+       state
+       (let [resources (do-find-resources-in-path state abs-path)
+             state
+             (if (.isDirectory file)
+               (assoc-in state [:source-paths abs-path] (assoc path-opts
+                                                          :file file
+                                                          :path abs-path))
+               state)]
+         (merge-resources state resources))))))
 
 (defn find-resources
   "finds cljs resources in the given path"

  {:pre [(compiler-state? state)
         (seq path)]}
  (let [root (io/file path)
        root-path (.getAbsolutePath root)
        root-len (inc (count root-path))]
    (into [] (for [file (file-seq root)
                   :let [abs-path (.getAbsolutePath file)]
                   :when (and (is-cljs-resource? abs-path)
                              (not (.isHidden file)))
                   :let [name (-> abs-path

            [loom.alg :as la]
            [cognitect.transit :as transit]
            [shadow.cljs.util :as util]
            [clojure.pprint :refer (pprint)]
            ))

(defn ^com.google.javascript.jscomp.Compiler make-closure-compiler []
