Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.deps.alpha by
retagged by

If :paths contain a project-local symlink that points to a directory outside the project, TDA prints a warning like:

WARNING: Use of :paths external to the project has been deprecated, please remove: resources

In general, it's a good idea to warn about external dependencies, and if the :paths were, say, ["../untracked-src" "/tmp/misc"] I'd be glad to see the warning.

But in this case, my build is caching intermediate results on /tmp (mounted as tmpfs for speed among other things) and referring to them via project-local symlink which I didn't expect TDA to differentiate from a local dir.

Say deps.edn is

{:paths ["resources"]}

and resources is a symlink

resources -> /tmp/resources.FlkJvG

then it'd be nice not to see this warning.

It seems the :paths validator chases symlinks as it canonicalizes paths before checking whether they're external. Perhaps it can be relaxed to normalize paths without chasing symlinks e.g.:

(in-ns 'clojure.tools.deps.alpha.util.dir)

(defn normalize
  "Make normalized File in terms of the current directory context without following symlinks.
  f may be either absolute or relative."
  ^File [^File f]
  (-> (if (.isAbsolute f)
          f
        (jio/file *the-dir* f))
      .toPath
      .normalize
      .toFile))

;; and modify `sub-path?' to use `normalize' instead of `canonicalize'.

1 Answer

0 votes
by
...