tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
borkdude 2020-09-04T14:51:12.138400Z

I'm thinking about a feature for clj-kondo where library authors can publish config specific to their library and clj-kondo can detect this somehow. So their artifacts should have some predictable and unique location for this config. Has something like this been done for other tools, so I could look at some prior work?

alexmiller 2020-09-04T14:53:56.139100Z

I've been thinking about exactly this lately for clj, but have not settled on an answer

alexmiller 2020-09-04T14:54:16.139400Z

one answer in the new clj world is to put it in :aliases of course

alexmiller 2020-09-04T14:54:43.140Z

in general, we're trying to avoid "magic name" though

borkdude 2020-09-04T14:54:44.140100Z

yup but deps.edn itself isn't often part of a published artifact right

alexmiller 2020-09-04T14:55:08.140500Z

right - have been thinking about some way to allow tools to be self-describing

borkdude 2020-09-04T15:11:47.141600Z

I guess it doesn't have to be unique. If every library would publish their exported config under /clj-kondo, I guess you could just do .getResources. But maybe that doesn't work for dirs.

user=> (enumeration-seq (.getResources (.getContextClassLoader (Thread/currentThread)) "README.md"))
(#object[java.net.URL 0x50acf55d "jar:file:/Users/borkdude/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20170809-b9c14c6b/google-closure-library-third-party-0.0-20170809-b9c14c6b.jar!/README.md"] #object[java.net.URL 0x3cae7b8b "jar:file:/Users/borkdude/.m2/repository/org/clojure/google-closure-library/0.0-20170809-b9c14c6b/google-closure-library-0.0-20170809-b9c14c6b.jar!/README.md"])

borkdude 2020-09-04T15:13:25.142Z

I guess it does work:

user=> (enumeration-seq (.getResources (.getContextClassLoader (Thread/currentThread)) "clojure"))
(#object[java.net.URL 0x27a7ef08 "jar:file:/Users/borkdude/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar!/clojure"] #object[java.net.URL 0x280e8a1a "jar:file:/Users/borkdude/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar!/clojure"] #object[java.net.URL 0x11e33bac "jar:file:/Users/borkdude/.m2/repository/org/clojure/core.async/0.6.532/core.async-0.6.532.jar!/clojure"] ...)

borkdude 2020-09-04T15:41:11.142700Z

There is still nothing like $HOME or ~ in tools.deps, am I right?

ghadi 2020-09-04T15:41:28.142900Z

correct

borkdude 2020-09-04T15:42:27.143700Z

ok

borkdude 2020-09-04T15:46:06.144700Z

The reason I'm asking is, I'm considering sort of this for clj-kondo's config resources:

:config-paths ["../base/clj-kondo", "~/dev/clj-kondo", "~/.m2/repository/rum/rum/0.12.3/rum-0.12.3.jar!/clj-kondo"]
and maybe clojure could help create that path somehow using deps.edn. Still a bit fuzzy on this.

borkdude 2020-09-04T15:49:59.145600Z

I think the users would invoke clojure -Spath for their project and clj-kondo would then scan this classpath for clj-kondo top level dirs, spitting them out to some file which it uses for future reference

borkdude 2020-09-04T15:50:22.146100Z

but then they'd still would add their $HOME based paths manually, which is probably fine

alexmiller 2020-09-04T15:56:58.146600Z

not going to interpret ~

alexmiller 2020-09-04T15:58:23.147500Z

I think you should still consider alias data more, since it has existing sources and merging

alexmiller 2020-09-04T15:58:37.147700Z

and that data could point to files

borkdude 2020-09-04T16:00:23.149Z

Oh, the :config-paths will be part of .clj-kondo/config.edn, not of deps.edn. I was just thinking how clojure (or other tools) could help, since some of the config could come from libraries

dominicm 2020-09-04T16:57:02.151Z

Do ns-aliases work like :alias/foo?

alexmiller 2020-09-04T16:57:38.151600Z

no, they are aliases like namespace aliases

alexmiller 2020-09-04T16:58:06.152200Z

it's a map of alias to namespace, and you can use the alias in place of the namespace in your function name

dominicm 2020-09-04T16:58:43.153200Z

Ohh, it's not for keys in the arguments. It's for the function name.

dominicm 2020-09-04T16:58:53.153700Z

I see now "symbol" in the reference, my mistake 🙂

alexmiller 2020-09-04T16:59:17.154200Z

right. in your deps.edn {:aliases {:mine {:ns-aliases {foo my.other.thing}}}} and then clj -X:mine foo/bar to invoke my.other.thing/bar

alexmiller 2020-09-04T16:59:34.154400Z

and may be used for other things in the future

dominicm 2020-09-04T17:02:06.155900Z

Curiosity getting the better of me, why aren't aliases referenced like #ref or [:alias :mine] or something that would distinguish it as a value for reference? That would allow for :exec-args to reference aliases, or the CLI.

alexmiller 2020-09-04T17:04:41.156700Z

sorry, not sure I'm getting the use case

alexmiller 2020-09-04T17:05:04.157600Z

:exec-args can reference aliases, but it's up to your program to do that resolution (via the injected basis)

alexmiller 2020-09-04T17:06:03.159200Z

I have thought about some kind of automatic resolution and using a tagged literal for that might be a good idea, but not ready to commit to that yet

seancorfield 2020-09-04T17:06:13.159500Z

@alexmiller I'm really surprised at the removal of -R and -O since those have been around since day one, as well as the removal of several -S options. I can imagine that breaking some people's scripts (it definitely breaks a couple of ours at work). And the impending removal of the ability of -A to run :main-opts is also going to break a bunch of our workflows at work.

➕ 3
alexmiller 2020-09-04T17:07:37.160600Z

interested in that feedback if others share it

alexmiller 2020-09-04T17:08:03.161500Z

some of those could be made to work again for some period of time if widely desired

seancorfield 2020-09-04T17:08:37.162400Z

We have a helper script that you pass a list of aliases into and it runs clojure -A:those:aliases in multiple directories -- now that script needs to know whether/when to use -M instead of -A based solely on whether the alias include :main-opts... which... I mean how would it know?

alexmiller 2020-09-04T17:08:45.162600Z

length of "period of time" tbd as well

alexmiller 2020-09-04T17:09:12.163300Z

can you take a look at frequency of that?

seancorfield 2020-09-04T17:09:26.163600Z

What do you mean "frequency of that"?

alexmiller 2020-09-04T17:09:56.164Z

are 95% :main-opts or 50%?

alexmiller 2020-09-04T17:10:12.164400Z

or 5%

seancorfield 2020-09-04T17:11:13.165600Z

Pretty much any library/project out there built on deps.edn that includes instructions for running tests is going to suggest using -A:test or -A:test:runner and that would be broken if -A can't run :main-opts

seancorfield 2020-09-04T17:12:02.166200Z

See https://github.com/cognitect-labs/test-runner#usage for example -- and almost any project using that test runner is going to assume that usage.

alexmiller 2020-09-04T17:12:10.166500Z

yes, that's why it still works

alexmiller 2020-09-04T17:12:27.167Z

but suggests to use -M instead

alexmiller 2020-09-04T17:13:19.167700Z

and only at some later time tbd will stop working

alexmiller 2020-09-04T17:14:01.168300Z

this is step 1 of a multi step plan towards a different place

alexmiller 2020-09-04T17:14:52.168800Z

but, also I'm trying to gauge the level of turmoil this will introduce :)

seancorfield 2020-09-04T17:15:27.169400Z

I think changing -A will introduce a lot of turmoil 🙂

alexmiller 2020-09-04T17:18:16.169800Z

I await more feedback :)

seancorfield 2020-09-04T17:51:20.175600Z

@alexmiller I just checked, comparing behavior between stable (1.10.1.561) and prerelease (1.10.1.672) and there's no compatible way to specify arbitrary combinations of aliases that may or may not include :main-opts in a way that avoids the warnings from -A encountering :main-opts but still includes all the non-`:main-opts` deps. In other words, you can't provide a single command-line that works across stable/prerelease CLI versions the same way, without warnings, as far as I can tell? In stable, -M only brings in :main-opts so you either need -A or repeat the aliases with both -R and -M; in prerelease, if you use -A you get the warning and you can't use -R. Is that a correct reading of the expected behavior?

borkdude 2020-09-04T17:52:09.176400Z

What will be new the new equivalent for clojure -R:foo -C:foo -Spath? So getting the classpath with alias foo deps and paths included?

seancorfield 2020-09-04T17:52:56.177100Z

It seems like -M works as a -A replacement in prerelease but that can't be used on stable (because -M doesn't bring in general alias content in stable)?

seancorfield 2020-09-04T17:56:54.178400Z

@borkdude I don't think that's possible in the prerelease version? Since your only options are -A (which will still run :main-opts), -X, or -M...

dominicm 2020-09-04T17:58:15.178600Z

This is pretty much what I'm asking about. I don't want my code to be dependent on aliases necessarily, then I have to wrap everything... It just seems like there's pitfalls.

seancorfield 2020-09-04T17:59:12.180200Z

Well, I think you can say clojure -Spath -X:foo but there's no command that is compatible across multiple clojure versions?

borkdude 2020-09-04T17:59:14.180300Z

right, but what if you need that? I know I'm using that now sometimes

seancorfield 2020-09-04T17:59:44.181500Z

(you can't say clojure -X:foo -Spath since it tries to interpret -Spath as a function to be executed)

dominicm 2020-09-04T17:59:48.181700Z

I use -R/C also when I have an alias with main opts, and dependencies and I only want the deps

alexmiller 2020-09-04T18:08:16.182500Z

if you want just parts of an alias, you should break that into multiple aliases and combine the parts you want

alexmiller 2020-09-04T18:08:49.183Z

so make an alias for the deps, and an alias for main-opts, and use either one or both

alexmiller 2020-09-04T18:09:55.183700Z

from what I can tell, the number of people that use this very targeted usage of -R/-C is probably mostly the people in this conversation :)

borkdude 2020-09-04T18:11:08.184700Z

maybe we represent thousands of silent users struggling with this behind their corporate proxies ;)

borkdude 2020-09-04T18:11:18.184900Z

j/k

seancorfield 2020-09-04T18:11:26.185300Z

@alexmiller Am I correct that -M in stable does not include other stuff from the alias(es) but in prerelease it does include them?

alexmiller 2020-09-04T18:11:32.185600Z

yes

seancorfield 2020-09-04T18:12:01.186200Z

I was hoping there was a single command that could be used across multiple CLI versions (without warnings), but that seems not possible.

alexmiller 2020-09-04T18:12:36.186900Z

I don't think so. I want you to move to the new thing. :)

borkdude 2020-09-04T18:12:59.187600Z

so in summary: decomplect your aliases and move on?

seancorfield 2020-09-04T18:12:59.187700Z

Every project generated by clj-new so far is going to run into this (because of the :test:runner combination).

alexmiller 2020-09-04T18:14:24.188Z

because -A:test:runner uses :main-opts and produces the warning?

seancorfield 2020-09-04T18:14:28.188200Z

Yup.

seancorfield 2020-09-04T18:14:48.188900Z

In particular, :runner adds the Cognitect runner and its :main-opts.

alexmiller 2020-09-04T18:14:50.189100Z

well the solution is to tell them to use -M:test:runner which is where I want people to end up

seancorfield 2020-09-04T18:15:08.189600Z

But -M:test:runner will not work on stable CLI today.

alexmiller 2020-09-04T18:15:13.189800Z

or even better to coax tools into providing -X friendly entry points

alexmiller 2020-09-04T18:15:41.190300Z

there may need to be a period of dual instructions

alexmiller 2020-09-04T18:17:22.191900Z

another option would be to leave -A alone, but basically deprecate it entirely and only doc other stuff going forward

seancorfield 2020-09-04T18:17:50.192800Z

Removing -R/`-C` completely means there is a non-zero amount of tooling that cannot work at all across multiple CLI versions.

borkdude 2020-09-04T18:18:00.193100Z

I think that would be the sanest: don't remove existing things unless you absolutely have to, undocument them and then wait for a year or so

alexmiller 2020-09-04T18:18:58.193800Z

there is a limit - leaving existing things complicates the impl. some of that's worth it, some isn't.

alexmiller 2020-09-04T18:19:20.194100Z

I think very very few people use -R and -C

borkdude 2020-09-04T18:19:46.194600Z

but a lot of people are using -A

alexmiller 2020-09-04T18:19:55.194800Z

yes

alexmiller 2020-09-04T18:20:06.195100Z

and it continues to work

alexmiller 2020-09-04T18:20:31.195500Z

with the suggestion to do something else :)

borkdude 2020-09-04T18:20:50.196Z

printing a warning / hint is a good thing too imo

alexmiller 2020-09-04T18:20:55.196300Z

it does

alexmiller 2020-09-04T18:21:04.196600Z

you said above Sean "cannot work across multiple versions" but -A does

borkdude 2020-09-04T18:22:14.197700Z

At my job they are just starting to adopt deps.edn. I was away for 1.5 week and my colleague starting porting other projects to deps.edn, after I did only our front-end. He's even using -X. I told him that's only release candidate material ;)

alexmiller 2020-09-04T18:22:41.198200Z

he's a man of the future

borkdude 2020-09-04T18:22:57.198700Z

He also used your boot deps edn thing @seancorfield, since we still rely on boot for most of the stuff, but slowly migrating away

alexmiller 2020-09-04T18:23:15.199300Z

I'm hoping it will soon be in the stable version

borkdude 2020-09-04T18:23:16.199400Z

so I hope the breaking changes won't affect their initial impression

borkdude 2020-09-04T18:24:18.199900Z

but if warnings are printed, I think it's fine

seancorfield 2020-09-04T18:25:04.200300Z

@alexmiller So what is the recommended replacement for clojure -R:foo -C:foo -Spath ?

borkdude 2020-09-04T18:25:37.200900Z

Sean: he already told: break foo up into multiple aliases and use -A

borkdude 2020-09-04T18:26:28.202200Z

(I think: https://clojurians.slack.com/archives/C6QH853H8/p1599242896182500)

seancorfield 2020-09-04T18:26:28.202300Z

So this is accepted as a breaking change? That will force "lots" of users of the CLI to modify their deps.edn files?

alexmiller 2020-09-04T18:26:38.202600Z

clj -Spath -M:foo -P

seancorfield 2020-09-04T18:27:07.203100Z

Because -P suppresses :main-opts?

alexmiller 2020-09-04T18:27:14.203400Z

it suppresses execution

borkdude 2020-09-04T18:27:59.205100Z

that's also slightly confusing to me, always has been, like -A:foo -Spath.... is it going to execute main or not... I always have to try it since I can't remember

alexmiller 2020-09-04T18:28:00.205300Z

it may be that -Spath should imply -P, I haven't thought about that much

seancorfield 2020-09-04T18:28:15.205700Z

But there's no compatible equivalent that works across both stable and prerelease?

alexmiller 2020-09-04T18:28:18.205800Z

I will make a note to look at that next week

alexmiller 2020-09-04T18:28:41.206300Z

like I said, hadn't thought about it

Derek Passen 2020-09-04T18:28:50.206500Z

What’s the reasoning for -Spath to continue to exist but -Stree to move to -X:deps tree?

seancorfield 2020-09-04T18:29:08.206900Z

Because -Spath is handled in the script and doesn't need to run a program.

Derek Passen 2020-09-04T18:29:21.207300Z

Thank you

borkdude 2020-09-04T18:29:31.207800Z

that's not entirely true though? -Spath uses the tools jar which is a JVM program

borkdude 2020-09-04T18:30:25.208900Z

if you have a cache, then it's indeed script only, I get the difference now

seancorfield 2020-09-04T18:30:27.209Z

Only if it isn't cached -- it's related to just the first "part" of the CLI: build classpath etc.

alexmiller 2020-09-04T18:30:47.209600Z

yeah, what Sean said

alexmiller 2020-09-04T18:31:05.210200Z

it seemed silly to pass a path to a Clojure program so it could print it :)

alexmiller 2020-09-04T18:31:36.211400Z

we originally had it in the list of things to change but just didn't make sense (-Sdescribe is similar)

seancorfield 2020-09-04T18:31:47.211600Z

I think my biggest concern here is that several things that work in stable will simply break in the next version.

borkdude 2020-09-04T18:31:47.211700Z

I view clojure as a tool for creating classpaths, and incidentally also executing them ;)

alexmiller 2020-09-04T18:32:02.211900Z

yes, there are breaking changes

seancorfield 2020-09-04T18:32:59.213400Z

Which means that if you use CLI tooling across a team and across various servers/CI/etc, you have to have a coordinated upgrade of the scripts, JARs, and all the changes to your code/tooling.

alexmiller 2020-09-04T18:33:29.214300Z

I've spent a week deciding which migration strategy to take on each of these settings. I tried to make what I judged to be the common things continue to work

alexmiller 2020-09-04T18:34:15.214800Z

none of these is a final decision, that's why it's out here as a prerelease for feedback

alexmiller 2020-09-04T18:34:43.215300Z

the only thing I've heard that is actually breaking you now is the -Spom I think?

alexmiller 2020-09-04T18:35:06.215900Z

well let me flip it and say, please give me a list of what is breaking you

seancorfield 2020-09-04T18:36:10.217Z

It breaks our "outdated dependency" script, which relies on -Stree and now there's no compatible way to run that script across multiple versions of the CLI.

alexmiller 2020-09-04T18:37:58.217700Z

making -Stree or -Spom continue to work is an easy thing to do

alexmiller 2020-09-04T18:38:55.218500Z

(by internally rewriting as -X)

seancorfield 2020-09-04T18:39:23.219100Z

We don't use -R/`-C` but that will be a breakage for others with no compatible way to do it across multiple versions of the CLI.

alexmiller 2020-09-04T18:39:42.219600Z

I don't believe there are more than a handful of people doing that

alexmiller 2020-09-04T18:39:58.219900Z

(but I will be watching to see if I'm wrong)

borkdude 2020-09-04T18:40:47.220700Z

False if old, true if new, just dropping this here :)

$ clojure -Sdescribe | bb '(-> *input* :version (str/split #"\.") (->> (mapv #(Integer. %))) (compare [1 10 1 672]) nat-int?)'
false

alexmiller 2020-09-04T18:41:41.221Z

what am I reading?

seancorfield 2020-09-04T18:41:53.221500Z

CLI version sniffing 🙂

alexmiller 2020-09-04T18:42:01.221700Z

oh, ok

alexmiller 2020-09-04T18:44:48.222400Z

@seancorfield do you use -Stree with other args like -A/R/C?

seancorfield 2020-09-04T18:48:27.222600Z

We use it with -A

seancorfield 2020-09-04T18:50:01.223900Z

Currently, we use -A everywhere in our scripts that drive CLI stuff, because we have :main-opts in "separate" aliases -- but those :main-opts are mostly accompanied by :extra-deps to bring in deps for those mains.

seancorfield 2020-09-04T18:50:59.225Z

The latter means we can't switch to anything that portably runs across multiple CLI versions that doesn't also produce warnings that might interfere with any output parsing we might do.

borkdude 2020-09-04T18:52:23.226600Z

What about a CLJ_VERSION variable that invokes the right version of your CLI tool?

alexmiller 2020-09-04T18:52:54.227500Z

if the warnings were all stderr, would you not care?

alexmiller 2020-09-04T18:53:05.228Z

(right now they are not all stderr, but they could be)

seancorfield 2020-09-04T18:53:27.228500Z

Well, at this point I'm now considering putting clojure and the tools JAR into our repo under version control so we can guarantee a given version everywhere, even if a developer or server environment has a different version of the tooling...

seancorfield 2020-09-04T18:53:52.229200Z

That's never been a problem before because there have not been any outright breaking changes.

borkdude 2020-09-04T18:54:03.229500Z

I'm willing to consider something for deps.clj which allows compatibility with both versions

borkdude 2020-09-04T18:54:12.229700Z

based on some env var

seancorfield 2020-09-04T18:56:11.230600Z

(we used to keep the lein and boot scripts under version control to avoid these sorts of problems)

borkdude 2020-09-04T18:56:46.230800Z

I guess that also works

alexmiller 2020-09-04T18:57:12.230900Z

fyi, there are two jars now :)

alexmiller 2020-09-04T18:57:59.231100Z

-X uses a bootstrap program that does not have any other dependencies and that is in its own jar as of this release

seancorfield 2020-09-04T18:58:42.231300Z

Yeah, a couple of our servers are old enough that I can no longer run the CLI install shell script on them so any upgrades I do on those servers is manual and that was a bit painful because there's more than just a single script to update.

seancorfield 2020-09-04T18:58:59.231500Z

lein/`boot` both used wrappers that auto-downloaded the JARs if they were missing.

seancorfield 2020-09-04T18:59:36.231700Z

But making that work reliably across every environment, including older envs, is tough -- and not good for controlled corp envs with firewall restrictions etc.

borkdude 2020-09-04T19:01:10.232200Z

@seancorfield I'm doing the same with deps.clj (downloading the jar that is). It also has support for proxies.

borkdude 2020-09-04T19:02:35.232400Z

I'm considering adding download instructions when it fails for some reason. I'm not sure if I'm allowed to bundle those jars, so I'm doing it that way mostly for that reason

alexmiller 2020-09-04T19:03:34.233Z

I'm taking off - have a good weekend all. more feedback is fine, just won't see it today :)

borkdude 2020-09-04T19:03:46.233300Z

Have a good weekend!

seancorfield 2020-09-04T19:05:46.235100Z

The lack of "portable" CLI commands/instructions across multiple (unknown) versions of the tooling is definitely my biggest concern about this...

borkdude 2020-09-04T19:06:59.235600Z

Is the issue that the alphabet is too short to use different letters? What about longer option names?

seancorfield 2020-09-04T19:08:00.236400Z

I don't think that solves anything @borkdude -- -M is the natural naming to choose here. It's just the transition between versions that is going to be so painful.

borkdude 2020-09-04T19:09:57.236800Z

I guess especially on CI where you can't interactively react on a warning, yes

borkdude 2020-09-04T19:10:44.237400Z

Checking in the CLI script is a good idea, probably we should also adopt it.

seancorfield 2020-09-04T19:15:33.238300Z

Since clj-new generates new projects for people and those include instructions on how to run tests etc, I'll have to "dual instruction" all of those...

seancorfield 2020-09-04T19:16:51.240400Z

Old model: -A:test:runner New model: -M:test:runner New command doesn't work on old CLI (because -M doesn't pull in :extra-deps) and old command produces a warning on new CLI and users -- especially beginners -- will complain that clj-new is "doing something wrong"...

seancorfield 2020-09-04T19:35:48.248900Z

clojure -A:test:runner -Spath works on both stable and prerelease because the -Spath option prevents execution -- but the prerelease produces a warning about switching to -M, but if you do what the warning says: clojure -M:test:runner -Spath treats -Spath as an argument for clojure.main

alexmiller 2020-09-08T15:44:51.101500Z

I didn't see this go by before but order matters here - the exec opt should be last (same thing you mention later with -X) because in both cases you are passing arbitrary args to another program

alexmiller 2020-09-08T15:45:04.102Z

I understand why that's particularly confusing in this example

seancorfield 2020-09-08T16:53:15.116200Z

clojure -Spath -A:test:runner -- works on stable; works on prerelease but produces a warning (use -M) clojure -Spath -M:test:runner -- works on prerelease (so switching -A to -M per the warning behaves "as expected") clojure -A:test:runner -Spath -- works on stable; works on prerelease but produces a warning (use -M) clojure -M:test:runner -Spath -- does not work on prerelease (so switching -A to -M per the warning "stops working") It's probably not going to be obvious to a user why prerelease is more sensitive to order than stable.

seancorfield 2020-09-08T16:53:21.116400Z

If -Spath implied -P, I think that would provide fewer surprises.

alexmiller 2020-09-08T17:26:10.117800Z

Yeah

alexmiller 2020-09-08T17:26:18.118200Z

I took a note of that

1
alexmiller 2020-09-09T19:41:28.147800Z

have thought about this more. -Spath does already have the same effect as -P, I think the issues here are the warnings (I don't actually think those are an issue) and the ordering constraint. I could probably detect the -M case but I'm not sure it's actually worth doing so.

seancorfield 2020-09-09T19:43:23.148200Z

Maybe update the docs around -Spath to make it clear that it should be before -M or -A on the command-line?

alexmiller 2020-09-09T19:45:55.148900Z

the ordering is explicit in the docs etc already

alexmiller 2020-09-09T19:46:29.149100Z

clj-opt is always listed first and exec-opts listed last

alexmiller 2020-09-09T19:47:27.149300Z

might be someplace it could be made clearer

seancorfield 2020-09-09T19:47:58.149500Z

Ah, I had certainly missed that subtlety...

alexmiller 2020-09-09T19:49:30.149700Z

I'll review next time I update docs

seancorfield 2020-09-09T19:49:41.149900Z

I suspect that I'd gotten used to it working on stable with -Spath at the end

seancorfield 2020-09-09T19:51:33.150100Z

(and, indeed, everywhere I've ever used -Spath it's at the end -- in all my CircleCI configurations and test runner scripts, and even in READMEs where I'm illustrating a usage of -Spath!)

seancorfield 2020-09-04T19:37:11.249600Z

$ clojure -Sforce -A:test:runner -Spath
WARNING: Use of :main-opts with -A is deprecated. Use -M instead.
/Users/sean/.m2/repository/org/apache...
so you think OK,
$ clojure -Sforce -M:test:runner -Spath
Unknown option: "-S"
Unknown option: "-p"
Unknown option: "-a"
Unknown option: "-t"
Unknown option: "-h"

USAGE:

clj -m cognitect.test-runner <options>
🙂

seancorfield 2020-09-04T19:41:27.250500Z

(don't get me wrong: I think the changes overall are good and the direction is good -- it's just the breakage and potential confusion that I think is going to be very problematic)

lread 2020-09-04T21:44:37.266400Z

My 2 cents, fwiw, is that breakage is totally acceptable for an alpha release. Since so many folks are relying on this alpha release component, what would be nice, where possible, is clear guidance. For example I just tried the following with v1.10.1.672:

> clojure -Spom
Option changed, use: clj -X:deps mvn-pom
My usage broke, but the fix is ultra clear. Also since most folks just install Clojure latest with their package managers, it might be nice to highlight how to stick with the previous release until they can schedule migration. This might not help with CI tools that install the latest automatically, so a good amount of forewarning would likely be appreciated so that CI scripts can be updated. And even though you have my 2 cents, there are sure to be folks who don’t follow Clojure closely, and don’t fully realize they have been using a changing alpha component (they knew they were using 1.10.1 but didn’t really realize they were using 1.10.1.xxx) and will be surprised because Clojure is very much known and valued for not breaking on update.

seancorfield 2020-09-04T22:19:28.268100Z

@lee I agree that tools.deps.alpha itself is clearly alpha and subject to change, but I think a lot of people would read https://clojure.org/guides/getting_started and not consider the CLI itself to be alpha and therefore not expect it to "randomly break stuff".

☝️ 2
seancorfield 2020-09-04T22:22:45.270600Z

And if two different beginners have installed the CLI at different times (one before this change and one after this change), their experience following instructions out there on the web are going to be confusingly different.

seancorfield 2020-09-04T22:24:59.272400Z

This will be compounded if they try to follow tutorials out there about the CLI and create new projects (with clj-new), they'll also have confusingly different experiences...

seancorfield 2020-09-04T22:27:17.273900Z

I sympathize that the path from where we are today (at least on the stable CLI) to where we want to be "tomorrow" (when the prerelease becomes stable.next) is complicated by retaining backward compatibility here...

dominicm 2020-09-04T22:30:07.275600Z

Unrelated, is it/will it be considered to specify extra-deps via an alias map? Between that & paths, it would abate most complaints about copy/paste between aliases / remembering which combination of aliases to compose together. Clasically it's :test:run because :run-tests requires copying the paths/deps from :test and people aren't so keen on that. Not something I'm looking to drive, but curious about how that would impact future endeavours of mine.

seancorfield 2020-09-04T22:32:19.278400Z

I think leaving -A alone -- retaining exactly its stable behavior, without even printing a warning message -- and just removing it from the documentation might be the best path. And perhaps at some future date adding a printed warning about using an undocumented option. That will allow a lot of tutorials etc to continue working -- without any potentially confusing warnings -- and let new/updated tutorials start talking the new options (but with caveats about CLI versions, to cater for folks who have older installations).

lread 2020-09-04T22:33:27.280300Z

@seancorfield and @borkdude I too empathize with folks who will be surprised by any cli breakages. And agree that it is likely not clear to the average Clojurian that they have been using an alpha component.

seancorfield 2020-09-04T22:35:36.282900Z

@dominicm I already have :test:runner so I can use :test in various contexts without needing Cognitect's test runner, but today -A:test -M:runner doesn't work with that setup (since -M today does not bring in :extra-deps). So either have to split :runner in two and use something like -A:test:runner -M:run-tests to avoid warnings and be compatible across both versions or provide dual instructions that are version specific (`-A:test:runner` today, -M:test:runner "tomorrow").

nate 2020-09-04T23:03:52.285800Z

Just another vote for what @seancorfield is saying. I use -C for mixing in a classpath into a -A invocation. I see how this can be changed for the next stable version, but having a window of deprecation would really be nice.