Fork me on GitHub
#tools-deps
<
2018-06-19
>
cfleming04:06:15

Is there a list of likely locations I can try to look for the clojure command, so I can default it for the user if it exists?

cfleming04:06:32

Currently my list only contains /usr/local/bin/clojure from OSX.

cfleming04:06:53

Where is it on linux or WSL?

richiardiandrea04:06:08

@cfleming not sure about windows but I guess on Linux it really depends, I actually added a prefix option to make install location customizable. Usually you use something like which or env depending on the use case. This answer might help you: https://unix.stackexchange.com/questions/12736/how-does-usr-bin-env-know-which-program-to-use#12749

cfleming04:06:50

@richiardiandrea Thanks. The problem is that when I execute from within IntelliJ, the user’s path is generally not set correctly.

cfleming04:06:22

So the user will have to configure it, but I was hoping for a list of likely absolute paths I could check.

richiardiandrea04:06:32

The one you mentioned is most likely one. I use $HOME/.local/bin/clojure

richiardiandrea04:06:46

Some distro might install in /opt

richiardiandrea04:06:33

Some directly in /usr/bin maybe? I guess these are the most common if I were to answer that

cfleming04:06:04

How many installers for linux distros are out there at the moment?

seancorfield05:06:47

@cfleming Why is the user's path not set for IntelliJ? (genuinely curious -- I'm not used to programs running without the standard user shell environment being available... I think?)

dottedmag06:06:40

@seancorfield I have stumbled upon it on Mac: Dock and Finder are launched directly by user's launchd, which is launched directly by system launchd, so no shell is executed or profile file is read, so their environment is pretty bare.

dottedmag06:06:14

@cfleming /opt/local/bin/clojure for MacPorts

dottedmag06:06:41

@cfleming /usr/bin/clojure on Arch Linux (and I suppose in every other distro that bothered to package Clojure)

dottedmag06:06:33

@cfleming /usr/local/bin/clojure for Linux installer from http://clojure.org

dominicm07:06:49

void places it in /usr/bin/clojure too

cfleming09:06:04

@dominicm Is that on linux?

mfikes11:06:20

@cfleming FWIW, lein-tools-deps went with a mixture of overridable defaults along with searching https://github.com/RickMoynihan/lein-tools-deps/blob/master/src/lein_tools_deps/env.clj#L14-L22

mfikes11:06:29

Given the above, it would ultimately end up having defaults like this on non-Windows platforms

["/usr/local/bin/clojure" "/usr/bin/clojure" "/opt/local/bin/clojure"]

rickmoynihan12:06:44

Yeah I’d much rather of not relied on the executable at all (and just used the library); but then you don’t know where the find the :install deps.edn file

alexmiller12:06:32

I’m considering moving that into tools.deps

rickmoynihan16:06:04

so it would be on the classpath?

dominicm16:06:45

The risk with that I guess is that organisations cannot specify repos globally. Maybe the root directory should go into /etc/clojure.conf or something. That's what apache, nginx, etc. do

alexmiller17:06:16

it would be on the classpath or perhaps it would be automatically included such that it isn’t even a distinct deps.edn. still tbd.

alexmiller17:06:08

@dominicm I think that would be the right solution to that problem, if we wanted to do something about it (which I do not at this time)

cfleming23:06:15

@rickmoynihan Yes, I would much prefer that too - then the user could just specify a tools.deps version.

cfleming23:06:50

@alexmiller Moving the install file into tools.deps would be great.

cfleming23:06:22

One possible source of confusion with that is that the versioning is different for tools.deps and the cli stuff.

cfleming23:06:35

@mfikes Thanks - I looked through the lein-tools-deps issues when researching this but hadn’t found the code.