tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
mpenet 2021-02-03T08:27:14.145600Z

wouldn't it be good to have more deps.edn sources to load from ? (to recap now it's root/user/project/config(cli))

mpenet 2021-02-03T08:27:24.145900Z

I am still thinking about the monorepo problem

mpenet 2021-02-03T08:28:23.147Z

it would be the missing piece to avoid having either to hijack the user level conf or do deps.edn generation, or pass something to the cli as string I think

mpenet 2021-02-03T08:29:17.147200Z

related: https://clojure.org/reference/deps_and_cli#_deps_edn_sources

mpenet 2021-02-03T08:29:55.147500Z

I suspect i am not the first one asking that question

mpenet 2021-02-03T08:31:25.147800Z

I guess https://clojure.atlassian.net/jira/software/c/projects/TDEPS/issues/TDEPS-174 would be that (kinda)

mpenet 2021-02-03T08:33:36.148700Z

basically an option (or env var) to specify a comma separated list of deps.edn files at project level could be it. But maybe there are better ideas out there

mpenet 2021-02-03T08:33:44.148900Z

./cc @alexmiller

borkdude 2021-02-03T09:07:09.149300Z

aka "the fourth file" https://clojurians.slack.com/archives/C6QH853H8/p1611959766114500

mpenet 2021-02-03T09:17:02.150100Z

🙂 indeed

mpenet 2021-02-03T09:25:35.150900Z

I would make it "N files" so that people don't ask for the "fifth file" right after it's patched 🙂

borkdude 2021-02-03T10:02:44.152100Z

yeah. in clj-kondo I support something like :config-paths ["foo" ...] so it will merge in foo/clj-kondo.edn and hooks, which in turn can include :config-paths relative to itself. You can set up an entire chain of configs. Basically a classpath of configs.

mpenet 2021-02-03T10:04:18.152500Z

yeah that's a good way to solve the issue for good

alexmiller 2021-02-03T13:24:49.154500Z

I’m not yet convinced that this is the answer. I also think it’s important to separate the problems of shared deps mgmt from shared tooling config

alexmiller 2021-02-03T13:25:25.155200Z

I do not think N configs is a good answer

alexmiller 2021-02-03T13:26:36.156200Z

And I think it’s pretty crummy to need to pass stuff explicitly

mpenet 2021-02-03T13:29:03.156500Z

do you already have ideas for potential alternatives?

mpenet 2021-02-03T13:29:21.156900Z

I mean, solutions to that problem

alexmiller 2021-02-03T13:29:25.157100Z

No

alexmiller 2021-02-03T13:32:18.157700Z

I haven’t really sat down to think about it yet

arohner 2021-02-03T14:37:12.158500Z

Is there an “official” way to run clj with a java that isn’t on the path?

2021-02-03T14:38:08.158600Z

JAVA_HOME="path to java home" clj …

👍 1
2021-02-03T14:39:32.158900Z

actually it should be JAVA_CMD="path to java executable" clj …

alexmiller 2021-02-03T15:00:47.159100Z

no, the latter won't work

alexmiller 2021-02-03T15:03:20.159300Z

but JAVA_HOME will

2021-02-03T15:06:33.159500Z

but only if java executable is not present in PATH, isn’t it?

alexmiller 2021-02-03T15:06:47.159700Z

yes

alexmiller 2021-02-03T15:07:05.159900Z

but that was the precondition in the original question

2021-02-03T15:07:57.160100Z

right, sorry, misread the original question

mbjarland 2021-02-03T16:46:18.165200Z

@alexmiller (or anybody else for that matter) a follow up question on my maven resolution question. It seems to me after reading up on this that maven poms can define extra repositories under the repositories element and that, if specified, the maven behavior is to use those repositories to resolve the dependencies for that pom instead of the one used to resolve the pom. Two questions really: a) I failed to find a definitive answer. This seems to be the maven behavior, but it does not seem to be well documented. Is there even a spec for this or is the implementation of maven the spec? b) does deps alpha use this mechanic of changing the resolution repository?

danielneal 2021-02-03T17:01:39.170900Z

Is there a repo with the clj command line tools in (the scripts rather than the clj lib)? I just started work at a new place, and broke the build by upgrading to the latest version. They had a hacked/patched version that worked with http proxies. I think they might have opened a ticket, but I'm not sure which repo it would be on.

mbjarland 2021-02-03T17:02:28.171300Z

As a side note, it's interesting how maven discussions about resolution strategy (such as this one: <https://issues.apache.org/jira/browse/MNG-3056>) do not distinguish between the resolution language aka poms and the structure and the implementation of maven itself. These days we have quite a number of different resolution engines (IDEs, gradle, tools, lein, sbt, ivy, etc) which need to use the resolution language and do not necessarily care about the implementation of maven. I.e. the above issue discussion only talk about command line switches etc when the issue really is that the resolution language has a feature that everybody needs to adhere to.

mpenet 2021-02-03T17:02:40.171500Z

Maybe something like juxt/aero #include tag could help compose a deps file from multiple sources otherwise. But that's static (no merging), even tho another tag could do that.

mpenet 2021-02-03T17:03:15.171700Z

But that feels a bit odd now that I wrote it down

danielneal 2021-02-03T17:07:32.172500Z

ah ok, and the linux install is in there too

danielneal 2021-02-03T17:09:32.172700Z

ah there's no where to add an issue 😞

danielneal 2021-02-03T17:09:36.172900Z

I guess http://ask.clojure.org?

2021-02-03T17:11:32.173200Z

that would be the first place I could think of

danielneal 2021-02-03T17:52:49.173400Z

thanks 🙂

alexmiller 2021-02-03T18:02:04.173700Z

there are lots of poorly considered impl magic in this area of maven (particularly around security)

alexmiller 2021-02-03T18:02:22.173900Z

clojure/tools.deps will use the repos from the top-level deps.edn, and only those

alexmiller 2021-02-03T18:02:47.174100Z

well, top level merge, which includes root/user/project deps.edn (central/clojars included in root)

alexmiller 2021-02-03T18:03:36.174300Z

note that the scripts there have various string replacements that happen before the final version so you can't just use those directly

alexmiller 2021-02-03T18:04:12.174500Z

https://github.com/clojure/homebrew-tools is a repository for brew of old versions, but you can find the urls for tar/gz for old versions in those if really needed

alexmiller 2021-02-03T18:12:03.174800Z

proxies are supported for mvn repos in the current version (but not for git deps), so maybe be more specific on what you need?

alexmiller 2021-02-03T18:13:00.175Z

re security - I've more and more come to believe that allowing transitive deps to add (or worse, replace) repos to find things seems evil

😱 1
danielneal 2021-02-03T18:16:35.175400Z

They'd patched it as described in one of the answers, so I've done the same for now.

mbjarland 2021-02-03T18:45:43.175900Z

Agreed, seems evil. Perhaps resolution should fail at that point with a message containing the new repo so the caller can either add it or not, but at least be informed

alexmiller 2021-02-03T18:46:05.176100Z

gotcha, def plan to fix that, but depends on larger direction with tools.gitlibs

mbjarland 2021-02-03T18:46:06.176300Z

Thanks for the reality check and info

alexmiller 2021-02-03T18:46:17.176500Z

(jgit vs shelling out to git)

mbjarland 2021-02-03T18:51:18.176700Z

Also, I'm generally somewhat surprised as to the level of disinterest in for example version conflicts and resolution logic given that everybody, their mother and the kitchen sink is built using these tools and run into these problems. Everybody is driving around in steam cars and are generally not interested enough to stop and wonder if there is a better way. I realize I'm preaching to the choir here, but still, surprising.

danielneal 2021-02-03T18:58:35.177100Z

makes sense

alexmiller 2021-02-03T20:15:00.177300Z

it's really shocking that it mostly works at all :)