Fork me on GitHub
#tools-deps
<
2019-04-17
>
orestis11:04:34

Is there an invocation of Clojure that will give the current version number?

mpenet11:04:23

*clojure-version* I think

mpenet11:04:48

*clojure-version*
{:major 1, :minor 10, :incremental 0, :qualifier nil}

orestis12:04:47

Ah, sorry - I meant about the Clojure CLI tools

orestis12:04:21

When installing in Linux, I don’t want to download curl -O every time if it’s already present and at the correct version.

dominicm12:04:26

clojure -Sdescribe?

dominicm12:04:32

❯ clojure -Sdescribe | grep -o ':version ".*"' | sed 's/:version //' | sed 's/"//g'

orestis12:04:08

Fantastic! Thanks 🙂

orestis12:04:33

OK, I’m having trouble running the Clojure CLI tools in Elastic Beanstalk, and the AWS support this time isn’t very helpful.

orestis12:04:58

In my logs, I see this error: mkdir: cannot create directory '/.clojure': Permission denied

orestis12:04:17

Which indicates to me that something is trying create a .clojure directory at the root of the filesystem, which is weird.

dominicm12:04:10

Are you installing during user data?

dominicm12:04:36

Does -Sdescribe try and create .clojure unconditionally?

orestis12:04:38

It seems so — it’s a mess because Elastic Beanstalk is just duct tape under the hood.

orestis12:04:58

So you run your Java command with ruby foreman and supervisord…

orestis12:04:06

Got it, they were setting HOME=/tmp whereas the user actually running the clojure command didn’t have permissions there.

orestis12:04:25

Setting CLJ_CONFIG to /home/webapp/.clojure seemed to have fixed the problem.

Alex Miller (Clojure team)12:04:03

there's a ticket about working in read-only fs btw

orestis13:04:50

.ebextensions/setup.config file that works:

orestis13:04:54

option_settings:
  - option_name: CLJ_CONFIG
    value: /home/webapp/.clojure

commands:
  01_install_clojure:
    command: |
      curl -O 
      chmod +x linux-install-1.10.0.442.sh
      sudo ./linux-install-1.10.0.442.sh

Alex Miller (Clojure team)13:04:36

currently, clj does need some writable path to work as it always drives at least the cp through the cached cp file

orestis13:04:44

The project .cpcache works fine, it’s the $CLJ_CONFIG that was giving me trouble…

tanzoniteblack18:04:00

is there an equivalent of lein's :init-nsconfig, where you specify which namespace to load and switch into by default when starting a repl?

dominicm18:04:20

-e "(in-ns 'foo)"

kenny21:04:36

Any ideas why I'd hit this? I'm running on a CI that has permission to git clone via HTTPS.

Error building classpath. ...: Authentication is required but no CredentialsProvider has been registered

kenny21:04:40

Shoot. Looking at tools.gitlibs, it seems like it may not support cloning private repos via HTTPS 😞

ghadi21:04:44

It doesn't. I've worked on that.

ghadi21:04:56

Have two different approaches for tackling that.

kenny21:04:03

Ah, I see TDEPS-91 and TDEPS-33. I assume there's no workaround for this right now?

kenny21:04:11

I suppose I could try using the shell-git branch here: https://github.com/ghadishayban/tools.gitlibs/tree/shell-git.

kenny21:04:24

... if you could override the tools-deps version the CLI uses.

ghadi23:04:37

@kenny GitHub or otherwise?

kenny23:04:06

Where my git deps are coming from?

Alex Miller (Clojure team)23:04:48

you can override it if you just hack your clojure script :)

Alex Miller (Clojure team)23:04:30

just prepend the source dir to tools_cp