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

0 votes
in tools.deps.alpha by
edited by

If an alias, or tool invocation using -Sdeps, discards a project's deps by using :replace-deps then there is a good chance that some or all of the project's namespaces become impossible to load due to their requirements now missing from the classpath.

If there are files in the project's default paths that are auto-loaded by clojure on startup, such as user.clj, the tool invocation might fail therefore. This can be mitigated by also specifying :replace-paths [], however this does not seem to be too well known (example 1, example 2, example 3).

I was wondering whether it is common for tools to replace a project's deps with their own but still use the project's paths? I believe in most cases the tool will be authored with no knowledge of the project it will be used in and should not expect to find anything useful to load from the project's own paths.

In order to make it easier to set up tool invocations, it would make sense to me to make :replace-deps imply :replace-paths [] unless otherwise specified, or something along these lines.

A repro case can be found at https://github.com/imrekoszo/depslink3_2#missing-replace-paths-repro-case

Migrated from https://ask.clojure.org/index.php/9857/could-option-that-variant-sdeps-avoid-having-specify-alias?show=9884#a9884

Edit: update opening paragraph to reference replace-deps as opposed to replace paths. I don't know why I wrote replace-paths there in the first place, this is about problems with replace-deps :)

1 Answer

0 votes
by

Maybe a good idea, let me think about it.

...