Fork me on GitHub
#boot
<
2017-06-12
>
souenzzo13:06:58

There is a easy way to try a library without setup a project?

micha13:06:26

$ boot -xd cheshire repl
nREPL server started on port 44805 on host 127.0.0.1 - 
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_91-b14
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from : [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (require '[cheshire.core :as json])
nil
boot.user=> (json/generate-string {:asdf "qwer"})
"{\"asdf\":\"qwer\"}"

micha13:06:18

you can also make an interpreted script that is a single file, it can pull in dependencies

micha13:06:22

$ cat doit.boot
#!/usr/bin/env boot

(set-env! :dependencies '[[org.clojure/clojure "1.8.0"] [cheshire "RELEASE"]])

(require '[cheshire.core :as json])

(defn -main [& args]
  (println (json/generate-string {:hello "world"})))

$ ./doit.boot
{"hello":"world"}

souenzzo13:06:38

boot.user=> (set-env! :dependencies '[[com.walmartlabs/lacinia "0.17.0"]])
Classpath conflict: org.clojure/clojure version 1.7.0 already loaded, NOT loading version 1.8.0
nil
boot.user=> (require '[com.walmartlabs.lacinia :refer [execute]])

             java.lang.RuntimeException: No such var: str/starts-with?
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: str/starts-with?, compiling:(com/walmartlabs/lacinia/internal_utils.clj:119:3)
It's a lacinia problem? Same error with -xd

micha13:06:45

@souenzzo looks like you need to be using clojure version 1.8.0

micha13:06:49

you can edit ~/.boot/boot.properties

micha13:06:12

$ cat ~/.boot/boot.properties
#
#Fri Dec 23 12:48:01 EST 2016
BOOT_EMIT_TARGET=no
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.8.0
BOOT_VERSION=2.7.1

souenzzo13:06:35

awesome 😄 Thanks

micha13:06:45

that file tells boot which version of clojure it should use

micha13:06:58

since it needs to have its own clojure before your program can even be evaled

souenzzo13:06:09

I cant understand why default boot target's to 1.7.0.... My system-wide clojure was 1.8.0 (`/usr/bin/clojure`)

micha13:06:36

usually that's because you already had a ~/.boot/boot.properties file

micha13:06:43

with 1.7.0 in it

micha13:06:53

it should default to 1.8.0 with a new install

ghadi15:06:28

Any chance of merging in https://github.com/boot-clj/boot-bin/pull/4 ? I've been testing it locally again boot-2.7.2-SNAPSHOT and JDK-9 -- all good.

ghadi15:06:16

(and yes it still works on jdk8)

alandipert15:06:52

have you tested on 7 by any chance?

alandipert15:06:14

that’s the earliest we’ve claimed to support

ghadi15:06:11

confession: I tested "that PR+" - I hacked the shell script to ignore jdk7 requirement

ghadi15:06:26

ok I'm testing it in a docker jdk7 container, it's downloading the whole earth (which means: it's working so far)

ghadi15:06:54

/app # BOOT_AS_ROOT=yes ./build/boot  -V
#
#Mon Jun 12 15:26:37 GMT 2017
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.8.0
BOOT_VERSION=2.7.2-SNAPSHOT
/app # java -version
java version "1.7.0_131"
OpenJDK Runtime Environment (IcedTea 2.6.9) (Alpine 7.131.2.6.9-r1)
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)

ghadi15:06:42

and repl works 👌

ghadi15:06:57

so JDK 7, 8 and 9 work fine

ghadi15:06:07

Not sure what the timeframe is for the next release of boot (2.7.2?) but maybe L29 in that file could/should also adapt prior to release