clj.native-image icon indicating copy to clipboard operation
clj.native-image copied to clipboard

Extra compilation?

Open sogaiu opened this issue 4 years ago • 0 comments

Don't know if it's really a problem, but it appears one can end up with redundant compilations invoking build.

main-ns in build is typically a string IIUC. namespaces appears to have symbols in it and may end up including the namespace that main-ns refers to.

Thus, (cons main-ns namespaces) can end up with a string version of main-ns as well as a symbol version:

    (let [deps-map (merged-deps)
          namespaces (mapcat (comp find-namespaces-in-dir io/file) (:paths deps-map))]
      (prep-compile-path)
      (doseq [ns (distinct (cons main-ns namespaces))]
        (println "Compiling" ns)
        (compile (symbol ns)))

I have seen "Compiling script" appear twice -- once for the string "script" and once for the symbol script.

I guess one could do (cons (symbol main-ns) namespaces) since there is a wrapping distinct. Not sure if namespaces will always contain a symbol version of main-ns.

sogaiu avatar Dec 04 '19 22:12 sogaiu