liquidz / antq

Point out your outdated dependencies.
Other
394 stars 22 forks source link

Incorrect resolution of relative :local/root paths #207

Closed danskarda closed 1 year ago

danskarda commented 1 year ago

Imagine you have the directory structure similar to Polylith:

  1. There is projects/development/deps.edn
{:deps {component/foobar   {:local/root "../../components/foobar"}}}
  1. and there is another deps.edn in components/foobar (relative too project root)

  2. you run antq from project root with parameters :directory ["projects/development"]

  3. then antq fails to find component/foobar directory.

I did some debugging and found a place most likely responsible for the issue:

https://github.com/liquidz/antq/blob/9715ef8e30a6fd9b4179bc0ade7f5d8c1619e69b/src/antq/dep/clojure.clj#L83

Function get-relative-path-by-current-working-directory returns projects/development/..components/foobar and not components/foobar as expected.

I suspect the reason is custom concatenation of paths as strings. When I use io/file for standard filename concatenation, (str (io/file dir relative-path)) works fine (under Linux, I do not know about platforms with \ separators).

liquidz commented 1 year ago

@danskarda Thank you for your reporting! I'll have a look tomorrow.

liquidz commented 1 year ago

@danskarda Thanks for your advice! I just released 2.2.1017. Could you try the latest version?

danskarda commented 1 year ago

Hi @liquidz, I tested 2.2.1017 and it works in my project as expected. Thanks!

liquidz commented 1 year ago

Thanks for your confirmation!