Fork me on GitHub
imre18:03:44 that uses the keys :deps and :paths in one of its aliases as opposed to their (extra/replace) counterparts. I failed to find any documentation wrt the usage of these keys in an alias. Does anyone know where I could get more info on why someone would want to use them there as opposed to :extra-*?

Alex Miller (Clojure team)18:03:24

They are synonyms for :replace-deps and :replace-paths - notably they replace the project paths and deps rather than add to


@U08BJGV6E see for examples where you have :deps in aliases.


Thank you both, I see I was looking in the wrong place. However, I do have a question wrt synonyms @U064X3EF3 - I don't see the phrases replace or synonym at - so my question is, are these synonyms (as in all contexts) or only appear to behave like synonyms due how works?


What is the intended behavior of these keys when the alias in question is used not in a tool execution context but to start a repl together with other aliases, like clj -A:build:dev:test?

Alex Miller (Clojure team)19:03:03

They are synonyms in all alias contexts

Alex Miller (Clojure team)19:03:23

No difference in tool / non-tool

Alex Miller (Clojure team)19:03:37

Well I guess the big difference is that -T removes the project paths and deps regardless


Oh I see, thank you. So is my understanding correct that if I want to use an alias both as a tool with only the deps/paths specified in the alias: clojure -T:my-alias and as an additional alias (with the additonal paths/deps) for a repl: clojure -A:dev:test:my-alias then I should just continue using :extra-paths/deps? And a side question just so I understand properly: if deps/replace-deps and paths/extra-paths are synonyms in every context, then why do both exist? Is using one recommended over using the other in some contexts and why?


Historical reasons and, now, backward compatibility.


I'm afk right now (on vacation in England) but I thought deps/paths behaved in a context-sensitive manner. If have to double check the source 😁


I guess I should be able to throw something together next week to test my assumptions in case there isn't some official-like documentation that explains this. Enjoy your holiday!


I found the synonyms confusing myself. I prefer using the specific keys so it's very clear what the alias does

Alex Miller (Clojure team)14:03:54

in the context of running a tool with -T, the project :deps and :paths are removed, so it may feel more natural in that case to use :deps and :paths rather than :replace-deps and :replace-paths. But in the context of -X where :deps and :paths are not removed, it can be helpful to use :replace-deps and :replace-paths to make that clear. so, that's why both synonyms exist

🙏 1

Thank you Alex. Is my understanding correct that there in the -T:tool context one could also use :extra-* without any observable difference at runtime (due to the removal you mentioned)?


If the answer to that is yes, then would it be safe to assume that if an alias is to be used both as a -T tool and an extra alias for my repl, it would be better to stick with :extra-* if I don't want it to affect project deps/paths when in the repl?


Brilliant, thank you!


When I follow this guide (the uberjar case), after writing the suggested content in build.clj and deps.edn, I get this interaction:

$ clj -X:build clean
Namespace could not be loaded: build
What am I doing wrong?

Alex Miller (Clojure team)00:03:55

Should be -T not -X ?

🙌 1

Thank you 🙈