This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-30
Channels
- # adventofcode (95)
- # announcements (17)
- # babashka (28)
- # beginners (107)
- # calva (34)
- # clj-kondo (7)
- # cljs-dev (20)
- # cljsrn (1)
- # clojure (95)
- # clojure-europe (41)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (4)
- # clojurescript (77)
- # cursive (7)
- # data-science (1)
- # datalog (4)
- # datomic (12)
- # events (3)
- # fulcro (32)
- # graalvm (2)
- # hugsql (19)
- # introduce-yourself (4)
- # jobs (2)
- # lsp (20)
- # membrane-term (19)
- # numerical-computing (1)
- # off-topic (8)
- # pathom (3)
- # polylith (17)
- # portal (42)
- # re-frame (7)
- # reagent (32)
- # remote-jobs (1)
- # shadow-cljs (86)
- # spacemacs (3)
- # tools-deps (52)
- # uncomplicate (1)
- # xtdb (23)
Hi, I’m not sure if this is the most suitable channel but I’m trying to figure out the differences between clj -T:something
and clj -Tsomething
. They seem to give different output:
$ clj -Ttools list
TOOL LIB TYPE VERSION
tools io.github.clojure/tools.tools :git v0.2.2
$ clj -T:tools list
Unqualified function can't be resolved: list
Could anyone give me a hint? Thanks!you came to the right place, and yes they are different
-T:something says to use the alias :something in your deps.edn -Tsomething says to use the installed tool named something
both will remove your project deps/paths and add :paths ["."]
in the case above, tools
is the name of a pre-installed tool (you can find the guts of it at ~/.clojure/tools/tools.edn - which is really just a lib/coord that will be added to your deps)
:tools
is nothing, which is why it errors
https://clojure.org/reference/deps_and_cli#tool_install is more reference material on this
Thanks for the info! So tools
in -Ttools
is the name of a built-in, and deps
in -X:deps
is the alias of a built-in. I see how I got confused.
the latter is correct
the former is (sloppily) allowed
really just a by-product of how the parsing is implemented
wasn't the first one the default syntax in the very beginning and eventually -A:foo:bar
became the standard? By the time -M
came it was an established idiom?
no, the first one has never been a documented thing
it has always been concatenated keywords
Anyone know what might be causing this? When running clojure -X:deps prep
clojure --help | grep Version
Version: 1.10.3.1029
Prepping metabase/java-deps in /Users/<person>/repos/metabase_master/java
Error compiling Java sources: nil
{:via
[{:type java.lang.NullPointerException,
:at
[clojure.tools.build.tasks.javac$javac
invokeStatic
"javac.clj"
28]}],
:trace
[[clojure.tools.build.tasks.javac$javac invokeStatic "javac.clj" 28]
[clojure.tools.build.tasks.javac$javac invoke "javac.clj" 21]
[clojure.lang.Var invoke "Var.java" 384]
[clojure.tools.build.api$javac invokeStatic "api.clj" 229]
@jeffrey.wayne.evans What do you get when you evaluate
(javax.tools.ToolProvider/getSystemJavaCompiler)
I have no idea why it returns nil in your case, but I'm not that familiar with the javax.tools.Provider API to be honest
This may help: https://stackoverflow.com/a/10944833/6264
JRE would be my guess too
thanks, folks. this is for a colleague who is just trying to iterate without becoming an expert in Clojure, so I’ll double check to ensure the environment is completely sane. I think we had some recent confusion around the whole Temurin project switchover stuff
To close the loop, that is indeed what the issue was (JRE as opposed to JDK)
Probably something that can be better reported
Cloning:
I see this on every Circle run for a Tools-based job. Is there a recommended way to cache it?
Using circleci/clojure:openjdk-17-tools-deps-buster-node btw.it's a bug in the clojure action
I think there's an issue for it
at least I assume that's the same cause
This is how nvd-clojure
works around it for now: https://github.com/rm-hull/nvd-clojure/blob/master/.github/integration_test.sh#L14-L16
(although that doesn't help with the caching option, it could at least get it into your cachable folder if you then ran clojure -P ...
afterward)
not sure if the GH Actions and Circle thingies are the same issue, although if you're sure I'll take your word about it from my side other than the lack of caching I'm not experiencing an issue in Circle
Are you caching ~/.gitlibs
?
Sorry, I sort of assumed you already would be...
Here's what I cache in my GH Actions jobs: https://github.com/seancorfield/next-jdbc/blob/develop/.github/workflows/test.yml#L21-L29
(I've stopped using CircleCI at this point)
> Are you caching `~/.gitlibs`?
yes but /.clojure /.cpcache seem needed as well, thanks!
Ah, yes, otherwise it will want to recompute dependencies.
(make sure you're on a non-XDG system -- on XDG systems, it's ~/.config/clojure
not ~/.clojure
)
I mention that because the nvd-clojure
integration test seems to be on an XDG system -- note the path for tool/tools.edn
-- so ~/.clojure
wouldn't help you there.
No, CircleCI doesn't use setup-clojure
- that one is specific for Github Actions (as always: I reserve the right to be wrong)
Good to know but caching ~/.gitlibs
and ~/.clojure
is the important part, right? Even for CircleCI.
@seancorfield don't you need to cache $PWD/.cpcache
as well as the clojure CLI writes cp caches there too? Or does setup-clojure behave otherwise?
True, you could cache that to avoid recomputes for the classpath for running tests, which would speed up repeated runs where the classpath hasn't changed. And it's probably not worth caching ~/.cpcache
to be honest. My main concern was preventing unnecessary git checkouts and Maven/Clojars downloads.
I'm not entirely sure what $PWD
would be for GH Actions. I think ~
is /home/runner
and I think $PWD
might be /home/runner/work/<repo>/<repo>
based on some of what I'm seeing in the logs but I haven't confirmed that... Not sure if how to specify that in the cache action without hard-coding the path, per repo tho'?