Fork me on GitHub
#tools-deps
<
2022-04-22
>
lepistane10:04:59

I am trying to create uberjar for my deps.edn project. i must be doing something wrong but when i run

clj -T:build uber :aot true 
i get
-T is no longer supported, use -A with repl, -M for main, or -X for exec
Am i using outdated cli or something? I am using this lib and i see the -T being used https://github.com/seancorfield/build-clj#standalone-cli-usage

pavlosmelissinos10:04:18

I think you might have an older version of the CLI tools. What do you get if you run clj --version?

lepistane10:04:55

WARNING: When invoking clojure.main, use -M
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
--version (No such file or directory)

Full report at:
/tmp/clojure-10539041283103714829.edn

pavlosmelissinos10:04:20

I fail to recall the old command for checking the version of your Clojure CLI but after the upgrade clojure --version should give you something like Clojure CLI version 1.11.1.1105 edit: I think it was clojure -Sversion but that doesn't seem to work anymore

lepistane10:04:40

yeah now it does! I managed to use -T

👍 1
practicalli-johnny14:04:00

clojure -Sdescribe will show the version of the Clojure CLI tool along with the paths it uses, so quite a useful tool clojure -Sverbose will show the same info, but also run a REPL or clojure code as well, so useful for debugging classpaths and other issues

🙏 1
pavlosmelissinos14:04:16

Oh right, I was thinking of -Sdescribe, thanks

👍 1
mpenet15:04:31

is it bad to want to have a way to chain multiple -X call in the same process (a bit like lein do ...?

mpenet15:04:08

clj -X:foo bar -X:baz quuq ...

mpenet15:04:45

I guess it becomes a bit ambiguous (-X arg vs -X invocation)

mpenet15:04:30

and classpath isolation would come up I suppose

seancorfield15:04:54

For a while it was possible to chain calls but that was removed because of exactly those sorts of issues. Write functions to do the chaining and then you have control of that. See build.clj for example.

mpenet15:04:30

it's easy to emulate other ways, it's not so easy when it wants to be dynamic (in the user controlled sense)

mpenet15:04:44

anyway, I am fine without it, I was just curious

Alex Miller (Clojure team)15:04:45

if you want a program, write a program, and call that :)

Alex Miller (Clojure team)15:04:13

if you want a dynamic program, there's this cool thing called a REPL :)

2
seancorfield18:04:20

☝️:skin-tone-2: That is why I mostly run our build.clj as a REPL instead of a set of tasks to invoke from the CLI:

(! 543)-> clj -M:build -i build.clj -r
Clojure 1.11.1
user=> (-> {} (build/cold-start) (build/all-tests-ci))
...

seancorfield18:04:13

(I can also do clojure -T:build some-task :the '"args"' when I need something running standalone elsewhere)

mpenet18:04:29

Most build tasks are quite static for us anyway, you never run them manually (ci/cd does the work).

mpenet18:04:50

For the rest we re trying to standardize profile names for common aliases across repos to lower the learning curve

seancorfield19:04:16

We have all sorts of useful stuff in our build.clj script for local dev/test work -- as well as several for CI/CD automation.

borkdude20:04:42

@seancorfield I recently added a :dev alias to a project where I added "." to the classpath, so I could do:

clojure -A:build:dev
and just develop tools build from the REPL in addition to the rest

seancorfield20:04:58

We already have a :dev alias for other reasons (Polylith) but I do often add :build when starting a REPL so I can work on build.clj as well as everything else 🙂

borkdude20:04:07

another workaround (hack) I sometimes do is clj -Scp $(clojure -Spath -A:build):$(clojure -Spath -A:whatever-else):. , works as well ;)

👀 2