tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
mkvlr 2020-12-26T07:52:58.098600Z

https://github.com/RickMoynihan/lein-tools-deps/pull/93 sounds like it doesnt

dharrigan 2020-12-26T17:22:06.101300Z

I'm using clojure -Sdeps "${DEPS}" -X:uberjar and I've noticed that -Sdeps is not honoured anymore (I previously was using -M:uberjar). The var ${DEPS} contains a custom mvn/repos.... configuration to set a local company proxy to be the source for central and clojars. Am I missing something to now use -Sdeps?

seancorfield 2020-12-26T17:43:14.102700Z

The default behavior is as-if -Srepro per the docs for 2.0.

seancorfield 2020-12-26T17:45:24.104900Z

You can specify :repro false if you need the user deps included. But the command line deps are not part of the project basis.

seancorfield 2020-12-26T17:46:43.106700Z

You need to put that in an alias and then tell depstar about it via :aliases '[...]'

dharrigan 2020-12-26T17:46:50.107Z

hmmm

dharrigan 2020-12-26T17:46:56.107200Z

that's wont work for custom overrides

dharrigan 2020-12-26T17:47:14.107600Z

for example, when building in a pipeline, the repo is different than building locally

dharrigan 2020-12-26T17:47:49.108500Z

so, previously, in the pipeline (on gitlab), I was able to override the default ones that come with clj (maven and clojars)

dharrigan 2020-12-26T17:48:04.109200Z

without having to touch the deps.edn in the project, which can be different for usecases

seancorfield 2020-12-26T17:48:47.110300Z

Open an issue to add some sort of :deps argument

dharrigan 2020-12-26T17:49:07.110700Z

to depstar?

seancorfield 2020-12-26T17:49:13.110900Z

Yes

dharrigan 2020-12-26T17:49:20.111200Z

I'm not sure this is a depstar issue

dharrigan 2020-12-26T17:50:01.112600Z

This is more on how deps are resolved, and permitting the user to override (or merge in a deps file) from the commandline, like -Sdeps did before

seancorfield 2020-12-26T17:50:17.113100Z

The -Sdeps CLI argument only applies to the runtime basis, not the computed project basis

seancorfield 2020-12-26T17:51:32.114600Z

This applies to all tools that explicitly compute the project basis

dharrigan 2020-12-26T17:52:19.115500Z

Okay, so the "global" mvn/repos key - that can't be replaced with the :aliases '[...]' functionality in depstar?

dharrigan 2020-12-26T17:52:34.115800Z

an alias can't override the global mvn/repos key?

dharrigan 2020-12-26T17:56:11.118100Z

I think the project basis and runtime basis should both allow for the key for mvn/repos to be overridden to suit this - to replace where deps are found (esp when running in a container - for building)

seancorfield 2020-12-26T17:58:08.120200Z

The project basis is computed from the system, user, and project deps.edn files. The -Sdeps argument is only for the CLI script itself and that information is "gone" by the time the tool runs. depstar by default omits the user deps.edn (i.e., as-if -Srepro) but you can override that with depstar's :repro false argument so that it includes user deps.edn in the project basis computation.

seancorfield 2020-12-26T17:59:25.121700Z

So to override the :mvn/repos key, it either needs to be in the user deps.edn file (`:repro false`) or the project deps.edn file.

dharrigan 2020-12-26T17:59:40.122200Z

So, if I do :repro false and include a mvn/repos in my project deps.edn, it should work

seancorfield 2020-12-26T18:00:04.122700Z

Or every tool needs a way to provide additional deps from the command-line like the CLI script allows.

seancorfield 2020-12-26T18:00:52.123700Z

This is why depstar (and several other tools) has an :aliases argument: the aliases used by the tool to compute the project basis are not the same as the aliases used by the CLI to compute the runtime basis needed to start the tool.

seancorfield 2020-12-26T18:01:50.124900Z

Hence my suggestion to create an issue against depstar to add some new command-line argument to allow additional deps.edn-style context to be provided for the computation of the project basis.

seancorfield 2020-12-26T18:02:26.125900Z

(this is also why I created the post on http://ask.clojure.org about a higher-level API for tools to use t.d.a for exactly this sort of computation)

dharrigan 2020-12-26T18:02:42.126300Z

would you support a procurers argument?

seancorfield 2020-12-26T18:03:18.126800Z

I don't think that mechanism is open for extension in t.d.a right now?

dharrigan 2020-12-26T18:03:39.127300Z

I'm not sure I fully grok this yet - but have to disppear for a bit - kid needs bed time!

dharrigan 2020-12-26T18:03:42.127500Z

🙂

alexmiller 2020-12-26T18:45:17.128200Z

procurers are open for extension if you're using the library - they're just multimethods

👍 1
seancorfield 2020-12-26T21:32:48.130300Z

@alexmiller hard to use with :replace-deps unless you add it as part of the same tool deps, I guess?