tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
seancorfield 2020-09-05T06:42:14.288700Z

Reading over the prerelease Deps/CLI reference again, and reviewing the discussions above, it seems the -A option is being promoted as the way to do everything-except-execution whereas before it used to include execution. Given that it's being referred to as the "REPL option" and, for the most part, -R used to be somewhat similar to -A without :main-opts, I wonder if keeping -R but making it also pull in the classpath stuff (but not :main-opts) would be the less disruptive path?

seancorfield 2020-09-05T06:42:38.289200Z

Then -A could quietly be undocumented, eventually deprecated, and finally removed.

seancorfield 2020-09-05T06:44:33.291300Z

This would be a minor expansion to what -R currently does (it would respect :extra-paths which only -A/`-C` did before) and it would still ignore :main-opts. I suspect -C is the least used option and almost all -A uses could be replaced by either -M (in the new world) or -R (in either world) with no changes in behavior.

seancorfield 2020-09-05T06:45:09.292Z

And -R more closely relates to REPL. So we'd have -R/REPL, -X/execute, and -M/main.

seancorfield 2020-09-05T06:50:24.292800Z

Hmm, I guess -R would also have to subsume -O for that to work fully.

seancorfield 2020-09-05T06:53:12.294100Z

Going back to the :test:runner example, it seems like -A:test:runner -M:runner works identically on both stable and prerelease and produces no warning on prerelease (presumably because -M is present?).

seancorfield 2020-09-05T06:54:14.295100Z

Ugh! So... I guess instructions could change now to recommend -A... -M... and that would work now and tomorrow even though it's a bit redundant.

borkdude 2020-09-05T07:05:43.297200Z

@seancorfield I like your suggestion of extending R to include C, I've always found it weird that these two were separated. Also the -A -M trick is something I tried yesterday, but somehow didn't work for me, since I got file not found -M, but now that I'm trying it again, it seems to work.

seancorfield 2020-09-05T07:08:04.299200Z

Yeah, having integrated CLI/t.d.a into our repo and started to update all our script to match this "new world", I'm very torn between "extending -R and undocumenting -A" and just "documenting -A... -M..." as the preferred approach.

seancorfield 2020-09-05T07:09:16.300Z

I would much prefer a solution that works for today and tomorrow (which is the -A... -M... approach, especially since that suppresses the warning on -A).

seancorfield 2020-09-05T07:10:32.302Z

Either way, our build script that previously just turned build aliases subproject options into cd subproject; CLJ_CONFIG=../versions clojure -A:aliases options needs to be way smarter about handling the options part...

borkdude 2020-09-05T07:10:39.302200Z

Yeah, I guess clojure could override certain deprecated options when the more preferred ones are used, which provides a migration path

seancorfield 2020-09-05T07:10:54.302500Z

Well, it already does.

borkdude 2020-09-05T07:11:27.303600Z

Yes, but also for other deprecated options?

seancorfield 2020-09-05T07:11:32.303800Z

If you use -A:test:runner -M:runner you don't get the warning, even when :runner includes both :extra-deps, :extra-paths, and :main-opts.

seancorfield 2020-09-05T07:11:38.304Z

Which deprecated options?

borkdude 2020-09-05T07:11:46.304400Z

-R, etc

seancorfield 2020-09-05T07:11:57.304700Z

-R, -T, and -O aren't deprecated, they're simply removed.

seancorfield 2020-09-05T07:12:12.305100Z

-A's use of :main-opts is deprecated.

borkdude 2020-09-05T07:12:51.305800Z

I've never used -T or -O, so R is what I'm concerned about. So if you use -R ... -A ... in the new world, does that do the same as in the old world?

seancorfield 2020-09-05T07:13:11.306100Z

-R cannot be used in the new world. It does not exist.

borkdude 2020-09-05T07:13:19.306300Z

but is it ignored?

borkdude 2020-09-05T07:13:24.306600Z

as in, no error

seancorfield 2020-09-05T07:13:32.306800Z

It spits out an error and halts the script.

borkdude 2020-09-05T07:13:42.307Z

that's what I meant

seancorfield 2020-09-05T07:14:13.307600Z

(! 2172)-> clojure -R:test -A:test
-R is no longer supported, use -A for repl, -M for main, or -X for exec

Sat Sep 05 00:13:57
(sean)-(jobs:0)-(/Developer/workspace/wsmain/build)
(! 2173)-> echo $?
1

borkdude 2020-09-05T07:14:22.307900Z

but I guess -A would also override -R in the old world, so in the old case it also doesn't work as a polyfill for both

seancorfield 2020-09-05T07:14:53.308400Z

Right, the problem is that -A in the old world also executes :main-opts

seancorfield 2020-09-05T07:15:28.309100Z

But at least changing -A:... to -A... -M... works identically and doesn't issue a warning in either world.

borkdude 2020-09-05T07:15:37.309300Z

that's already a win

seancorfield 2020-09-05T07:15:56.309700Z

But anything that uses -R today is plain ol' broken tomorrow.

seancorfield 2020-09-05T07:16:49.310600Z

There's no compatible way to run anything that uses -R today in a way that works regardless of clojure version I think.

borkdude 2020-09-05T07:16:59.311Z

I have a fixed version on CI, so I don't think it will break for me: https://github.com/borkdude/clj-kondo/blob/70b3e54130978692c61e53859b126ffbe8a492f0/.circleci/config.yml#L24

seancorfield 2020-09-05T07:17:30.311500Z

So you pin to an old version?

borkdude 2020-09-05T07:17:53.312300Z

I never thought about it really hard, just copied the install instructions and that seems to contain a version number

seancorfield 2020-09-05T07:18:08.312700Z

Fine for CI for you, but not fine for any library code or tools that have to live in a version where members could have any version of CLI installed...

borkdude 2020-09-05T07:18:26.313100Z

I do have one custom installer script for mac CI as the linux script didn't work there: https://github.com/borkdude/clj-kondo/blob/master/.circleci/script/install-clojure

borkdude 2020-09-05T07:18:57.313900Z

But in that arena people see warnings and can react to them

borkdude 2020-09-05T07:19:46.314800Z

which can still be confusing, no argument there

seancorfield 2020-09-05T07:20:35.315700Z

I have a solution for clj-new now so I'm somewhat mollified 🙂 but it doesn't help anything that uses -R and has to live in a multi-version world.

borkdude 2020-09-05T07:21:23.316200Z

I guess clojure could print a link to a more elaborate blog post about the situation

seancorfield 2020-09-05T07:21:59.316800Z

I don't consider that a solution. "We broke your shit. Go read this to fix it!"

seancorfield 2020-09-05T07:22:49.317600Z

Seriously, that is not the right approach, esp. given Rich's whole pulpit-bashing about no breaking changes without renaming things.

borkdude 2020-09-05T07:24:01.318900Z

I agree that it's far from ideal, but assuming that it's going to be like it is now, it provides people a place to read up if they are curious about why it changed.

seancorfield 2020-09-05T07:25:58.320200Z

Considering how many people learn Clojure by using lein and still trip over ~/.lein/profiles.clj stuff, I don't think we should just throw our hands up and accept this and just say "Well, read these docs about why we broke stuff". I really don't.

borkdude 2020-09-05T07:27:02.321300Z

You don't have to convince me that avoiding breakage would be preferred. I think I'm going to take a break from this channel for the rest of the day :)

seancorfield 2020-09-05T07:27:43.322200Z

I can change all the -A uses in clj-new's docs and in the generated projects to be -A... -M... and at least I then say, "Hey, the latest version does recommend using both options so you're future-proofed" but it's still a fairly sucky experience for users.

seancorfield 2020-09-05T07:28:07.322500Z

Enjoy your weekend @borkdude 🙂

seancorfield 2020-09-05T07:44:03.325500Z

Proposal: * Recommend authors change -A:stuff to -A:stuff -M:stuff for compatibility with both versions where they want :main-opts executed. * Keep -R and expand it to include :extra-paths and :jvm-opts so it mnemonically matches REPL: -R/REPL, -X/eXecute, -M/Main. * Undocument -A for now, officially deprecate it later (and add that warning about using -M instead), and eventually drop it altogether.

seancorfield 2020-09-05T07:45:29.326900Z

This provides a migration path for the most common use cases that is minimally disruptive (most uses of -R today won't care about paths or JVM options I suspect). It improves naming for the three desired use cases: REPL, eXecution, and Main opts. It breaks the least amount of code out there.

seancorfield 2020-09-05T07:50:07.328100Z

(question for Alex when he gets back: why are there two identical copies of exec.jar in the CLI distribution -- one at the top level, one in libexec?)

alexmiller 2020-09-05T14:28:14.332Z

Keep in mind that most Clojure users are on Mac and install via brew and that brew aggressively updates you to latest version (our stable) even if you're upgrading something else. So within some period of time (couple months maybe), many people are using newest version.

alexmiller 2020-09-05T14:28:29.332300Z

Also keep in mind that we are in work on a 1.10.2 Clojure cycle and we tie brew versions to Clojure versions, so that might be a natural point to either coax an upgrade or drop some kind of compatibility

👍 1
seancorfield 2020-09-05T14:30:11.332500Z

If you don't introduce the warning for -A -- per bullet 3 -- then, yes, bullet 1 isn't really necessary.

alexmiller 2020-09-05T14:31:14.332700Z

I think there aren't two in the distribution, the install script copies the root one to libexec which is the structure brew expects, although I think maybe I didn't sync the clojure script up to that and it's using the root one. I'll check on that

1
alexmiller 2020-09-05T14:32:28.332900Z

the warning is what tells people how to move to the new world - without that, won't people be stuck on -A forever?

seancorfield 2020-09-05T14:33:42.333100Z

Bullet 3 suggests introducing the warning some time later, after everyone has had a chance to update.

seancorfield 2020-09-05T14:35:00.333300Z

People don't like warnings from their day-to-day development tools. Beginners in particular will complain to library authors about "incorrect instructions" if you introduce that warning before anyone has had a chance to update instructions/tutorials.

alexmiller 2020-09-05T14:36:31.333600Z

I'm ok with that :) I'm not sure I'm in agreement with you on the scope of this as an issue

alexmiller 2020-09-05T14:37:02.333800Z

you're right that they don't like warnings, so they'll change what they do, which is what we want

alexmiller 2020-09-05T14:38:07.334Z

library authors can either do nothing and situation is same or they can use dual instructions for a time or they can doc new instructions and say clj > X.Y.Z (which also gets people on new version)

alexmiller 2020-09-05T14:38:37.334200Z

or they can start using -X style invocation (which also drives to new version)

seancorfield 2020-09-05T14:39:04.334400Z

> I'm not sure I'm in agreement with you on the scope I'm pretty sure we're just not in agreement on that 🙂

alexmiller 2020-09-05T14:39:43.334600Z

there is a middle ground - no warning for -A on first stable release

alexmiller 2020-09-05T14:39:45.334800Z

then warning

alexmiller 2020-09-05T14:39:52.335Z

then (much later?) removal

seancorfield 2020-09-05T14:41:02.335200Z

Having been on the receiving end of complaints about incorrect instructions (or version-specific instructions that weren't absolutely clear on how to determine the version and how to "solve" the problem, on all platforms), I'm perhaps more sensitive to this whole issue than you... 🙂

seancorfield 2020-09-05T14:41:21.335400Z

Yes, bullet 3 is that middle ground.

alexmiller 2020-09-05T14:41:29.335600Z

I'm on the receiving end of those complaints too

practicalli-john 2020-09-05T15:27:08.336300Z

That only covers 55.36% of the survey responders, so this doesnt seem to be the strongest of arguments. Of course I am happy to help encourage upgrading to newer versions in any way I can, once I've understood the changes myself.

seancorfield 2020-09-05T15:31:52.337200Z

I wonder what percentage of the 35%-ish that are on Linux are using brew vs manually installing via the .sh file?

practicalli-john 2020-09-05T15:36:20.337400Z

There are legion of package managers for Linux that brew competes against, maybe a question for the next survey? I find it easier to use the Linux script install.

seancorfield 2020-09-05T15:51:45.345900Z

I use brew on Ubuntu (on WSL) because it's easy to keep clojure up-to-date that way but that's recent for me -- I used to use the manual install script, but I tended to only upgrade when I remembered to do it, or I tried to do something that my older, installed version didn't support 😐

seancorfield 2020-09-05T15:56:36.349500Z

I have updated the depstar README to show usage with the prerelease -X option: https://github.com/seancorfield/depstar/blob/develop/README.md#clojure--x-usage

seancorfield 2020-09-05T15:56:59.350600Z

It works quite nicely that way...

seancorfield 2020-09-05T15:59:22.352Z

I expect I'll update clj-new next, to support -X usage...

seancorfield 2020-09-05T16:03:16.352100Z

FYI, confirmed that script uses the root one:

-classpath "$cp:$install_dir/exec.jar"

borkdude 2020-09-05T16:34:28.352900Z

> Keep in mind that most Clojure users are on Mac and install via brew Have you considered that those Mac users will probably also use the linux scripts on CI? Do you get any stats from that usage? It may be less of an issue since the install script is versioned, but since people tend to develop CI scripts locally (I often do), it might become confusing.

👍 3
borkdude 2020-09-05T16:36:12.353700Z

There might also be less Windows users using this because for some people it's harder to get going than lein. I got this report yesterday and it's not the first time I hear these kinds of issues. > Clojure until 1.6 used to work on Windows from https://chocolatey.org/packages/clojure too, without problems. Clojure Tools broke everything and it seems that OSX ( Homebew ) is the only "first class citizen" now. https://github.com/babashka/babashka.process/issues/15#issuecomment-687035007 Don't shoot the messenger, I don't really have a stake in Windows support because I know how to work around it :)

seancorfield 2020-09-05T16:49:13.357Z

Yeah, you have to be pretty persistent to use Clojure CLI/`deps.edn` on Windows, and willing to work with very "alpha" tooling. Which a lot of Windows users are not willing to do: they often have different expectations of the user experience than devs on macOS/Linux.

borkdude 2020-09-05T16:49:46.357400Z

One personal data point: I found it difficult to install clojure on Windows CI because the powershell stuff you had to enable and whatnot. That's why I also went with lein to run tests there: https://github.com/borkdude/clj-kondo/blob/master/appveyor.yml

borkdude 2020-09-05T16:51:27.358700Z

I do use clojure on the other two major OS CIs

seancorfield 2020-09-05T16:53:57.359500Z

I'll be using Windows for development a lot more going forward (Microsoft had a great deal on Surface Laptop 3 so I just ordered an i7 with 16GB RAM and 256GB SSD). But I'll be leaning on WSL2 very heavily, and using (Linux) brew for installation.

Quest 2020-09-05T17:03:20.363300Z

I have an odd case -- at least from my pure Clojure background (didn't start in Java.) I have a Java dependency that doesn't publish to maven. I can run ./gradlew build on it to get a library .jar. What's the best way to include this into deps.edn dependencies?

Quest 2020-09-05T17:06:31.363800Z

Can I publish just a .jar to maven under my own repo? I could try updating the library to properly publish to Maven & PR'ing it, but I'm just unfamiliar with the gradle ecosystem. The library author says he'll start publishing to maven soon...

seancorfield 2020-09-05T17:08:18.364100Z

You can use a local .jar file directly in deps.edn via a :local/root dependency. We use that for a couple of things that have to build locally because they aren't published anywhere.

Quest 2020-09-05T17:09:04.364300Z

oh man, I immediately get what you mean, but how did I utterly fail to find this in a doc somewhere? I spent 20 minutes searching around

Quest 2020-09-05T17:09:32.364500Z

anyway thanks Sean, you're a big help in many channels 🙂

seancorfield 2020-09-05T17:09:55.364700Z

It's mentioned here https://clojure.org/guides/deps_and_cli#_using_local_libraries

seancorfield 2020-09-05T17:10:22.364900Z

And here in more detail https://clojure.org/reference/deps_and_cli#_dependencies

👍 1
seancorfield 2020-09-05T17:10:58.365100Z

It doesn't "scale" so well if you're part of a team or want to use it in a CI pipeline, but it's fine for local development and testing.

Quest 2020-09-05T17:11:39.365300Z

Ahh, I'll try just reading through the whole deps guide. I kept searching for "clojure deps include .jar library" and similar terms, never thought of "local library"

Quest 2020-09-05T17:13:55.365600Z

As far as "scaling" this approach, I was just going to git submodule the dependency library. I could see how many layers of builds would take a long time / cause odd failures. Thankfully still at "fun personal project" size for now

practicalli-john 2020-09-05T17:26:07.371Z

For the up-coming release of Clojure CLI tools: I have been using clojure -R:cognitect-rebl -A:nrebl to run REBL with nREPL. The -R:congnitect-rebl load in dependencies from an alias that also has a :main-opts (which it not the main namespace to run) and -A:nrebl which has a :main-opts I do want to run. If I create a separate alias for cognitect-repl without the :main-opts and use clojure -M:rebl-deps:nrebl it works. Or I could just add all the rebl dependencies into the :nrebl alias. Does that seem the right approach?

seancorfield 2020-09-05T17:32:18.372500Z

@jr0cket I suspect if you used -A:cognitect-rebl:nrebl it would run the :main-opts from :nrebl since they overwrite each other -- last one wins.

☝️ 1
seancorfield 2020-09-05T17:34:32.374300Z

You could also use -A:cognitect-rebl:nrebl -M:nrebl which would work on both today's stable version and the current prerelease version without the -A warning about using -M to run the :main-opts (since the "winning" :main-opts here is using -M).

seancorfield 2020-09-05T17:39:25.377Z

I think the guidance from Alex has fairly consistently been to separate out :main-opts from other stuff if you need to mix'n'match main opts from several aliases. But the expansion of both -M and -X to respect :extra-deps and other stuff in the latest prerelease feels like the pressure is in the opposite direction -- toward bundling more things into a single alias for convenience @jr0cket Not sure how closely you've been following the discussions generally in this channel?

practicalli-john 2020-09-06T08:02:14.457900Z

Certainly in my mind would be as part of the syntax rather than convention. If the convention changed in a release without requiring a change to the syntax of use. Convention also means more to remember, especially as some parts of slides are merged and others only take the last. I assume (hope) nothing takes just the first. Not saying it's an issue, but it adds to the learning curve.

practicalli-john 2020-09-06T08:11:21.458100Z

As it's a current issue and there isn't anything in the up coming changes to resolve it, then this aspect seems a moot discuss point. I'll make a decision and move on.

alexmiller 2020-09-08T15:52:20.102200Z

fwiw, I don't see this as an issue - the documented behavior is what it does and what I expect it to do in the future

1
seancorfield 2020-09-05T17:41:13.378100Z

(but of course, at this point, there's still some potential for changes in the prerelease that the -A/`-M` usage recommendations may change)

2020-09-05T17:42:08.378200Z

I happened to watch Spec’able before reading Alex’s post. Seems pretty ironic.

seancorfield 2020-09-05T17:42:48.378400Z

Spec'able?

Quest 2020-09-05T17:43:16.378500Z

deps.edn didn't seem to pick up on the .jar (silent failure?) as I couldn't load any expected classes. I realized there's no pom.xml, probably why. At a minimum, I believe I need to tweak the library to use https://docs.gradle.org/current/userguide/maven_plugin.html

2020-09-05T17:43:47.378800Z

sorry, sepc’ulation

seancorfield 2020-09-05T17:44:05.379Z

Ah yes, https://www.youtube.com/watch?v=oyLBGkS5ICk

seancorfield 2020-09-05T17:51:53.380Z

TL;DR: don't break stuff, only add stuff and fix bugs 🙂

seancorfield 2020-09-05T17:54:25.380100Z

@quest You shouldn't need a pom.xml for this usage -- but if that Java library has any dependencies, you need some way to tell clojure about them (if the JAR contains a pom.xml the t.d.a machinery would take care of that, else you could just add those deps directly to your deps.edn file).

1
Quest 2020-09-05T17:57:33.380400Z

@seancorfield Hmm, I could uptake them into my deps.edn. Do you know of a way to determine if the jar was loaded or not? I've just been trying to run an :import on a class that I expect to exist, but wondering it there's a better way to poke around

seancorfield 2020-09-05T18:00:48.380600Z

Use the -Spath option on the clojure CLI to see what the classpath contains.

seancorfield 2020-09-05T18:01:43.380800Z

Or even inside your REPL: (System/getProperty "java.class.path")

seancorfield 2020-09-05T18:02:50.381Z

user=> (run! println (clojure.string/split (System/getProperty "java.class.path") #":"))
/home/seanc/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar
/home/seanc/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar
/home/seanc/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar
src
nil
user=>
(example from a bare REPL)

Quest 2020-09-05T18:05:25.381200Z

^ I figured there was something from the REPL, but -Spath is a good tip. Appreciate the knowledge-share, you had a hand in me starting adoption of deps.edn a year ago too and I doubt I would've tried it otherwise :thumbsup:

seancorfield 2020-09-05T18:07:07.381400Z

Cool. We've never regretted switching to CLI/`deps.edn` in 2018 at work.

seancorfield 2020-09-05T18:08:15.381600Z

(and we're using the bleeding edge prerelease version right now -- as of yesterday)

practicalli-john 2020-09-05T18:56:25.382300Z

I've read the whole conversation in here and reading through the docs Alex wrote. Still digesting what it all means. I'm currently testing all the aliases I have to understand the changes

1
seancorfield 2020-09-05T19:07:37.382600Z

I'm working on updating clj-new to work with -X, much as I've updated depstar. I'll probably add :new-x and :depstar-x aliases to my .clojure/deps.edn file so folks can use those tools via -X as examples. It'll be a while before that can become the default 🙂

2020-09-05T19:13:17.382800Z

at least once you decide you are out of alpha

seancorfield 2020-09-05T19:35:26.384300Z

Feedback on the "WARNING: When invoking clojure.main, use -M" message (for @alexmiller) -- this usage produces that warning: clojure -m my.entry.point -- is that intentional? Do you really want folks to write clojure -M -m my.entry.point instead?

alexmiller 2020-09-05T20:19:01.384600Z

Yes

alexmiller 2020-09-05T20:28:52.385200Z

@jr0cket would love to hear your feedback too

alexmiller 2020-09-05T20:32:48.386300Z

Oh I definitely think that’s a factor

borkdude 2020-09-05T20:34:34.386700Z

Is this to discourage that usage in favor of -X? It seems to be another maybe unnecessary breaking thing that's been there for a long time

alexmiller 2020-09-05T20:35:31.387700Z

It’s not to discourage it as much as that we are trying to open up the repl arg space for other things

alexmiller 2020-09-05T20:35:58.388400Z

And that means making clojure.main usage explicit

seancorfield 2020-09-05T20:41:07.389500Z

Interesting choice. A lot of tutorials out there talk about running simple Clojure projects with just clojure -m my.entry.point

seancorfield 2020-09-05T20:41:47.390100Z

I think beginners will (quite rightly) ask "Why do we have to specify two m options?"...

alexmiller 2020-09-05T20:43:52.390900Z

“Lot” = ? 2 or 3?

alexmiller 2020-09-05T20:44:25.391500Z

And if these tutorials transition into talking about -X...

alexmiller 2020-09-05T20:46:02.393900Z

We want clj to do more. In some cases that means restructuring these options. It’s either that, or clj2 and clojure2 which do not seem better to me

seancorfield 2020-09-05T20:46:02.394Z

Sure, if all the books and tutorials that exist today are updated to use -X instead of -m, it's not going to be a problem 🙂

dpsutton 2020-09-05T20:52:40.395400Z

Thanks for balancing all these things in a spreadsheet so lots of concerns are managed. On a Saturday no less. Looking forward to the previews

seancorfield 2020-09-05T21:05:54.396500Z

(I just want to be clear that I think all the new functionality is great -- all of my concerns are around how existing (stable) functionality is deprecated and/or removed over time)

seancorfield 2020-09-05T21:06:50.397600Z

And, ultimately, I'm not going to be the one complaining about the changes since I'm already on the latest prerelease version on every machine and I'm aggressively adopting the new functionality!

seancorfield 2020-09-05T21:08:09.398500Z

(I am somewhat concerned about users of my CLI/`deps.edn`-based projects, of course 🙂 )

seancorfield 2020-09-05T21:08:53.399600Z

Coming in the next version of clj-new: https://github.com/seancorfield/clj-new#clojure--x-usage

borkdude 2020-09-05T21:09:21.400500Z

There was a time when the clojure CLI wasn't driven by tools.deps.alpha right? Wasn't it non-alpha back then? Isn't only tools.deps alpha but the CLI / shell script now also got alpha?

seancorfield 2020-09-05T21:09:39.400700Z

(`depstar` added support for -X in its most recent 1.1.104 release, last week)

💯 1
borkdude 2020-09-05T21:12:20.401800Z

I could be misremembering things, but I think there was a clojure package already years ago, before tools.deps.alpha? Not sure what it did back then, but -m was maybe already a part of it back then

seancorfield 2020-09-05T21:14:22.402500Z

I know there was an unofficial clojure script floating around which behaved differently than the official one, once it appeared.

borkdude 2020-09-05T21:14:59.403Z

maybe it just did java -jar clojure.jar $@

seancorfield 2020-09-05T21:17:52.405100Z

Yeah, I think that was pretty much it. My recollection of the official CLI was that it appeared in tandem with t.d.a during the 1.9 cycle once Spec was split out of the core clojure.jar since you could no longer just run a REPL with the JAR file alone so it was supporting machinery for that... but I'm having a hard time finding any of the original posts about it (maybe I should scan back through Inside Clojure since I bet Alex blogged about it).

dominicm 2020-09-05T21:18:11.405200Z

I've used Linux for many years, the brew stuff is extremely rare.

borkdude 2020-09-05T21:18:21.405600Z

ah right, thanks

seancorfield 2020-09-05T21:19:24.406200Z

Hmm, the pre-1.10 Inside Clojure posts are fairly sparse...

seancorfield 2020-09-05T21:21:58.407900Z

This is the first mention of t.d.a on the Clojure mailing list: https://groups.google.com/g/clojure/c/FpMqtNu0TCE/m/wc2n1tPHBwAJ

seancorfield 2020-09-05T21:22:12.408100Z

(July 2017)

seancorfield 2020-09-05T21:24:14.408300Z

Yup, I'm just glad it exists for clojure. Getting stuff into the more standard installer repos on Linux seems very laborious? What relatively painless options exist for Linux package managers that the Clojure core team could leverage @dominicm?

dominicm 2020-09-05T21:25:59.408800Z

Ha! 😂

dominicm 2020-09-05T21:26:09.409Z

If only you knew the rabbit hole you'd just asked about

dominicm 2020-09-05T21:27:15.409200Z

Every distribution has its own rules and timelines. Consider Ubuntu LTS. They don't take changes. Canonical pay people to backport security patches. Every now and then you get a system upgrade (like mac) and that's when you get changes. New features, bug fixes, etc.

1
dominicm 2020-09-05T21:28:36.409600Z

There are, of course cutting edge distributions like arch and void. They'll update whenever the package maintainer feels like it. Usually regularly for important changes.

dominicm 2020-09-05T21:29:06.409800Z

Some distributions care about reproducibility. They have other constraints I don't understand.

dominicm 2020-09-05T21:30:24.410Z

I am a void clojure package contributor, and my life is pretty easy. The installer script was "ported" to the void build system in ~10 lines and it's just worked since then. Maybe I'll need to make changes with the new system.

2020-09-05T22:45:31.410200Z

The deps/cli reference page only talks about the library being in alpha. The guide doesn’t mention it at all, and besides “But, that is not to say just leave your thing 0.0.967. At a certain point, you are going to have users, and whether you change it to 1.0 or not, they are going to be depending on your stuff.”

seancorfield 2020-09-05T23:52:45.412600Z

Been playing with the new features, and it's nice that you can have the following

:new {:extra-deps {seancorfield/clj-new {:mvn/version "RELEASE"}}
        :exec-fn clj-new/create
        :exec-args {:template lib} ; default
        :main-opts ["-m" "clj-new.create"]}
and it works with -A:new today (or -A:new -M:new) and, with the prerelease it works with -M:new (or -A:new -M:new without giving a warning) and it also works with -X:new so you can have a single alias provide for both styles of execution.

👍 2
practicalli-john 2020-09-07T15:52:28.012800Z

Forgetting migration for a moment, would you see :exec-fn and :exec-args replacing :main-opts in the long term? Using these new keys seems a nicer approach for the design of the alias code itself. Would this be an example of edn over strings that Alex mentions?

seancorfield 2020-09-07T16:47:43.013100Z

I think we'll see a good uptake on the :exec-fn approach because you can avoid parsing strings to get your arguments and you can easily provide defaults -- configurable defaults, since each alias have have its own :exec-args map.

seancorfield 2020-09-05T23:57:29.413900Z

That's probably what I'll do in my dot-clojure repo by way of education for folks and as a way to encourage folks to transition (or at least see what the options available are).