This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-17
Channels
- # aws (10)
- # beginners (64)
- # boot (3)
- # cider (20)
- # cljs-dev (32)
- # cljsrn (6)
- # clojure (126)
- # clojure-dusseldorf (3)
- # clojure-finland (1)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-poland (3)
- # clojure-spec (46)
- # clojure-uk (100)
- # clojurescript (37)
- # cursive (11)
- # datomic (6)
- # defnpodcast (2)
- # emacs (1)
- # events (3)
- # figwheel (2)
- # fulcro (20)
- # immutant (2)
- # jobs (1)
- # jobs-discuss (9)
- # keechma (3)
- # lein-figwheel (1)
- # luminus (2)
- # lumo (3)
- # mount (2)
- # off-topic (19)
- # om (3)
- # om-next (2)
- # onyx (20)
- # other-languages (55)
- # parinfer (11)
- # pedestal (8)
- # portkey (3)
- # protorepl (3)
- # re-frame (22)
- # ring (9)
- # rum (1)
- # shadow-cljs (82)
- # spacemacs (28)
- # sql (15)
- # test-check (15)
- # testing (2)
- # tools-deps (102)
- # vim (26)
I think you understand correctly. Or put in a better way I understand the same.
Also, is Clojure itself an implicit dependency? The examples don’t add it like lein does.
It's been rough in CIDER so far as well. It feels a bit like boot. It's not super obvious how to best approach it
I think @dominicm has done some work towards that end but it's still a little brittle
@cfleming clj -Sdescribe
lists the deps.edn
files that are read in.
You can also get that from tools.deps.alpha
as clojure-environment
(I think).
My bad: clojure.tools.deps.alpha.reader/clojure-env
(it shells out to clj -Sdescribe
tho')
Do you inject your dependencies like cider or do you run another process? I know cursive is big on static analysis
For clj-new
I ended up having to ask clj
what deps.edn
files it would load, reading them, resolving them, making a classpath, and loading those files...
environment (clojure-env)
all-deps (read-deps (:config-files environment))
...
(-> (deps/resolve-deps all-deps resolve-args)
(deps/make-classpath (:paths all-deps) {})
(str/split (re-pattern java.io.File/pathSeparator))
(->> (run! pom/add-classpath))))
You can use :local/root
(instead)
(although I’m mostly trying to avoid having to publish to github just to play around 🙂 )
So :local/root
deps just stay where they are on disk, with no version. :git/url
is cached to ~/.gitlibs
per :sha
. :mvn/version
is cached to ~/.m2
with a real version.
@cfleming re prior question, the default Clojure version is specified in the install-level deps.edn (which is merged with ~/.clojure/deps.edn and local deps.edn). You can specify it in local deps.edn too if you like.
I’m thinking about the case when a Cursive user imports a deps project and maybe doesn’t even have the CLI installed.
yeah, but clj -Sdescribe will tell you that
you can use the tools.gitlibs library to determine where the gitlibs are being cached https://github.com/clojure/tools.gitlibs/blob/master/src/main/clojure/clojure/tools/gitlibs.clj#L23
The problem is that IntelliJ, at least on OSX, doesn’t typically know what the users’s shell path is.
I mean, some of it can be used directly via the lib but the lib really works in tandem with the scripts
the scripts are the bridge from the user’s environment and config files into the lib
I’ll have to see if I can detect the install, and consider what to do if it’s not there or I can’t find it.
the scripts are the only layer that know about (for example) classpath caching
but they use the lib to build the cache
there is no simple answer to that
the lib can compute a classpath given a configuration
but the configuration is inherently a product of the environment
to some degree, yes. and I think the question is how much you let the user know that :)
I think the user expectation will be that they get the same effect as running clj in the root of the project
I’ve tried to provide a lot of tools to replicate some or all of what’s in the script layer from inside the lib (Sean is using many of those in the boot tooling)
right, but even running clj in the root of the project will be different when run from IntelliJ.
Well, the environment will be different, I have no idea if the differences will be significant.
the only things that are critical are current working directory and path
there are potentially some environment variables that can affect things but none of them are likely to be in use
can you explicitly add an option to point to the bin dir for clojure?
In general OSX doesn’t give apps access to env vars, and doesn’t execute shell init scripts anyway.
on os x, if you install via brew (recommended) clojure will be in /usr/local/bin
well, on linux too if you follow the script
windows is … coming
and the install level deps.edn will be at /usr/local/lib/clojure/deps.edn
that last is linux, mac will vary per brew install
mac will be at something like /usr/local/Cellar/clojure/1.9.0.375/deps.edn when installed via brew. maybe there’s a symlink that
’s version independent, not sure
I have tried to do what I can to make things discoverable and computable. if there’s things I can do to help more, I’m open to suggestions
With boot-tools-deps
I actually pull the install-level deps.edn
from the Clojure brew-install
GitHub repo, into the JAR of the library. Looking back, that was probably a bad idea 🙂
I probably ought to change it to use clojure-env
instead!
it’s a bad idea :)
@cfleming If it helps, I've been using Cursive for deps.edn
projects by first doing clj -Spom
and then using the resulting pom.xml
I also imagine Cursive might be able to use the output of clojure -Spath
, as it gives you the classpath, including paths for any :local/root
s or :git/url
/ :sha
deps
So...say I have a colleague who does not trust brew install
and would like to use the linux script for installing clojure
...is it possible to do that?
(answer is no, we tried and install -D
does not unfortunately work on mac)
@dominicm yep he probably will do that
you’ll notice the brew install just runs an install.sh in the tar
so you can manually do basically the same thing
with some effort and messiness, install.sh for mac and linux-install.sh could become the same script. I have so far not been able to convince myself that gives me any great value though and there are some useful reasons for them to be different.
@alexmiller thanks for answering, was wondering about that as well, good to know
so the difference about install
on Macosx is only with -d Create directories. Missing parent directories are created as required.
No -D
(capital).
I think for mac is even a bit different from BSD, I did not see -D
at all