                (util/is-relative? override))
           (let [override-file
                 (-> (io/file package-dir override)
-                    (.getCanonicalFile))]
+                    (absolute-file))]
 
             (when-not (.exists override-file)
               (throw (ex-info "override to file that doesn't exist"

        (-> (if (and (= :release mode) (seq file-min))
              (io/file file-min)
              (io/file file))
            (.getCanonicalFile))]
    (when-not (.exists file)
      (throw (ex-info "file override for require doesn't exist" {:file file :require require :config cfg})))


(defn service? [x]
  (and (map? x) (::service x)))

(defn absolute-file
  ".getCanonicalFile resolves links but we just want to replace . and .."
  ^File [^File x]
  (-> x
      (.toPath)
      (.toAbsolutePath)
      (.normalize)
      (.toFile)))

(defn read-package-json
  "this caches the contents package.json files since we may access them quite often when resolving deps"
  [{:keys [index-ref] :as state} ^File file]
