Fork me on GitHub
#boot
<
2015-08-04
>
cddr01:08:27

Hey All. I'm trying to figure out how to use environ and boot together. I whipped up a repo that demonstrates what I expected to work with a test that fails. Could I get some help to make the test pass please? Cheers

micha01:08:17

cddr: boot-test runs your tests in a pod

micha01:08:23

that could be the issue

cddr01:08:11

Hm ok, so how do other folks specify different environment variables for different profiles? Or is that just a railsism that I haven't gotten over yet.

ragge16:08:55

@micha: only included stuff since 2.1.2 for now... let me know if you want something like this, how to improve etc

martinklepsch16:08:07

regarding the links — doesn’t github figure this out itself usually?

martinklepsch16:08:19

or is that just in issues?

ragge16:08:38

yeah, looks like it's only in issues/PRs/commits and other select places

martinklepsch16:08:59

@ragge: linking to the changelog from the README is probably a good idea

martinklepsch16:08:57

hm. seems you really need to make proper links 😕

ragge16:08:04

@martinklepsch: would be good to hear if a changelog file is the way to go at all

martinklepsch16:08:44

I think it’s great.

martinklepsch16:08:08

Readme is pretty full with stuff anyways.

ragge16:08:21

also thought about a division similar to clojure, separating new features, enhancements and bugfixes... but seemed overkill for now

ragge16:08:38

distinction was not obvious too

martinklepsch16:08:57

yeah, I was wondering if it might make sense to split between changes in boot and it’s built-in tasks

ragge16:08:13

yeah, that too simple_smile

juhoteperi16:08:29

Changelog file is the way I think

ragge16:08:32

punted on the whole thing and left it to the mind of the reader simple_smile

martinklepsch16:08:57

but at the same time anything going forward is good. we don’t need to overdo it for a first version simple_smile

martinklepsch16:08:11

@ragge: did micha add you to the boot org?

juhoteperi16:08:12

I use github releases for some projects but I think it's easier to just use a file

ragge16:08:32

@martinklepsch: i don't think so, he asked about my id

martinklepsch16:08:44

@ragge: I think he asked with the intention to add you

ragge16:08:38

@martinklepsch: ok, cheers... was wondering if he reported me as a bot or something when nothing happened 😉

ragge17:08:04

@martinklepsch: Added link to changes in readme. Train journey soon over, online again tomorrow...

alandipert17:08:41

@ragge: thanks for the changelog! i’m pushing 2.2.0 today

kenny17:08:26

I am trying to package Chart.js using boot-cljsjs, however, I am getting this error:

clojure.lang.ExceptionInfo: java.lang.AssertionError: Assert failed: No .ext.js file(s) found! (first externs)
I'm almost 100% sure it has to do with the file structure. I have pretty much duplicated what is on the README and the docs so I am not sure what I am doing wrong.. Here is the build.boot: https://gist.github.com/exload/7aa5fb202a59ce7b3cc1

martinklepsch17:08:03

@kenny: do you have a file at resources/cljsjs/chart/common/chart.ext.js?

martinklepsch17:08:25

@kenny: the packaging tasks complains because there is no externs file or it can’t find it

kenny17:08:19

@martinklepsch: Why do I need to include that if it downloading it from GitHub?

martinklepsch17:08:25

@kenny: do you know what externs are and what they’re needed for?

kenny17:08:46

@martinklepsch: Ah. That makes sense. Thank you! simple_smile

martinklepsch18:08:20

@kenny: great 👍 let me know if you have more questions simple_smile

kenny18:08:22

@martinklepsch: Do you know how you would declare a constructor for a subtype (e.g Foo(a).Bar(b))?

kenny18:08:09

Foo = function (a) {};
Foo.Bar = function(b) {};
?

martinklepsch18:08:38

@kenny: not sure myself but I think the firebase externs have something like that and are well-done

martinklepsch18:08:45

maybe that helps

kenny18:08:52

Will check it out. Thanks!

martinklepsch18:08:28

Getting funky things when trying to run an uberjar:

Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/IFn
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3040)
        at java.lang.Class.getMethod0(Class.java:3010)
        at java.lang.Class.getMethod(Class.java:1776)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: clojure.lang.IFn
        at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

martinklepsch18:08:11

The reason for this seems to be passing :as-jars true to the uber task 😕

gtrak19:08:21

trying to figure out how to change the server port with tenzing: https://github.com/martinklepsch/tenzing , I followed code down to a serve deftask in boot-http, but don't know where to go from there: https://github.com/pandeiro/boot-http/blob/master/src/pandeiro/boot_http.clj#L33 What am I missing?

martinklepsch19:08:31

@gtrak: you can set task options using task-options!, e.g. (task-options! serve {:port 23423})

gtrak19:08:43

wooot, thanks!

gtrak19:08:57

somehow this was non-obvious

martinklepsch19:08:40

It’s in the README, although a bit further down: https://github.com/boot-clj/boot#configure-task-options

gtrak19:08:34

ahh, is there also a way to grab it from a boot.properties property?

gtrak19:08:39

got the repl running though, awesome, that was pretty easy.

martinklepsch19:08:07

gtrak: boot.properties is only meant to specify things that must be read before loading boot/clojure. so no simple_smile

martinklepsch19:08:41

@gtrak: is there a reason you don’t want to put the task-options! call into build.boot?

gtrak19:08:15

no, that's fine, just trying to figure out the mental model

gtrak19:08:10

i've just worked with boot for small scripts, this is my first foray into the more complex stuff

ragge20:08:56

@alandipert: thanks for taking time for a release! just noticed my link to the change log in README.md is broken because incorrect case. happy for me to commit a fix to master? @martinklepsch added me to organization

micha20:08:48

:thumbsup:

micha20:08:11

that would be awesome simple_smile

ragge20:08:12

done-diddly-doo

micha20:08:39

excellent!

micha20:08:18

@martinklepsch: are you making a war file?

micha20:08:49

it looks like you're making a regular uberjar there

micha20:08:15

so the :as-jars option is mostly useful for war files

micha20:08:50

in a war file you can put jar files inside the war under WEB-INF/lib/ and the servlet container will add them to the class path

micha20:08:18

so you don't need to fully explode the dependencies to add them to the classpath as you do with uberjar

martinklepsch20:08:28

yeah makes sense

micha20:08:58

alan was working on a classloader solution that could produce an oberjar that used jars inside the uberjar

micha20:08:31

i think he was using it for spark or hadoop

martinklepsch20:08:10

should I add some (war-only) things to the task docstrings/option docs?

micha20:08:53

@martinklepsch: perhaps some mention, but it's not specific to WAR files really

micha20:08:05

that's just the use case that i have for it

micha20:08:23

the uber task doesn't do anything WAR specific or anything

martinklepsch20:08:51

I catched something that it’s faster because it doesn’t do the exploding and thought I could just use it, running straight into an open knife 😛

alandipert20:08:01

had to step out for a bit, working on release again

micha20:08:36

yeah some kind of note would be good there

martinklepsch20:08:55

Cool, will try to come up with something

martinklepsch20:08:04

Error while extracting /Users/martin/.m2/repository/org/apache/tomcat/tomcat-juli/7.0.27/tomcat-juli-7.0.27.jar:META-INF/LICENSE: java.io.FileNotFoundException: /Users/martin/.boot/cache/tmp/Users/martin/projects/gridacus/solglas/nkq/dvwsf6/META-INF/LICENSE (Is a directory)

martinklepsch20:08:28

getting plenty of these when not doing :as-jars true — is the right way around that to exclude them by adding some thing like #\"(?i)^META-INF/LICENSE$\” to excludes?

alandipert20:08:49

@martinklepsch: the thing it doesn’t do is provide a working boot runtime environment (nothing in boot.pod works if program launched via ubermain)

alandipert20:08:23

@martinklepsch: the plan in a future release is to open up some of the java setup methods in boot.App so that the boot runtime can be initialized by containers other than just the boot.sh cli

martinklepsch20:08:33

I like the usage notes simple_smile

micha20:08:59

@martinklepsch: we should be handling that case i think, where you have both a file and a directory with the same path in a jar

micha20:08:14

lol why would someone do that, i have no idea

martinklepsch20:08:08

@micha: I get that printed like a lot of times — all caused by one jar having a LICENSE directory?

micha20:08:38

yeah i think so

micha20:08:53

an interesting situation to be sure

micha20:08:24

this is the problem with non-namespaced things in JARs, basically

micha20:08:54

the uber task should handle this by preferring the directory i think

micha20:08:04

and ignoring the file

martinklepsch20:08:27

@micha “When using as-jars you need a special classloader like a servlet container that picks up the packaged jars and places them on the classpath” — sounds right?

micha20:08:35

awesome, yes

micha20:08:44

so like jetty or tomcat for example

martinklepsch20:08:51

I have no clue if I got the lingo right 😛

micha20:08:56

when you load your app it dumps it to disk

micha20:08:07

like when you deploy to tomcat for example

micha20:08:21

it unzips the war file and dumps the contents to a working directory

micha20:08:49

and it starts a new classloader with the dumped jars and directories on the classpath

micha20:08:03

it runs your servlet in that classloader context

micha20:08:07

does that make sense?

martinklepsch21:08:50

that sounds understandable simple_smile

martinklepsch21:08:57

@micha: thanks for the explanation simple_smile

micha21:08:56

@alandipert: looks great yes

alandipert21:08:09

ok pushing 2.2.0 🚬

micha21:08:34

📡 🍑

martinklepsch21:08:50

making an uberjar without :as-jars is amazingly slow 😵

martinklepsch21:08:59

hopefully it’s faster on CI

alandipert21:08:32

are you making a cli thing?

martinklepsch21:08:28

@alandipert: no. big server thing. will move to starting from boot soon but would like to get it working with plain uberjar first for now

alandipert21:08:18

a web app? i’m just curious if boot-ubermain is an option for you to try

martinklepsch21:08:51

certainly is an option

martinklepsch21:08:06

gave up at:

boot ubermain
             clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: option :subs must be of type {str str}
    data: {:file
           "/var/folders/lz/n73_ylvj7y33bdbm1hngnbv80000gn/T/boot.user9110688719877763746.clj",
           :line 35}
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: option :subs must be of type {str str}
     java.lang.IllegalArgumentException: option :subs must be of type {str str}
    adzerk.boot-template/eval477/fn                 boot_template.clj:   16
                                ...
    adzerk.boot-ubermain/eval525/fn                 boot_ubermain.clj:   36
                                ...
                 clojure.core/apply                          core.clj:  624
            boot.user/eval735/fn/fn  boot.user9110688719877763746.clj:   23
                                ...
                 clojure.core/apply                          core.clj:  624
          boot.core/construct-tasks                          core.clj:  678
                                ...
                 clojure.core/apply                          core.clj:  624
                  boot.core/boot/fn                          core.clj:  706
clojure.core/binding-conveyor-fn/fn                          core.clj: 1910
                                …
should have filed an issue or asked, sorry simple_smile

alandipert21:08:23

i think you just need to supply the -m option to give it an entrypoint

alandipert21:08:37

like boot ubermain -m my.ns/-main

martinklepsch21:08:52

oh. does just the namespace not work?

martinklepsch21:08:14

now that explains why it’s called main-var not main

martinklepsch21:08:36

@alandipert: trying ubermain again.

ragge21:08:52

I've updated the boot nix package (that I'm probably the sole user of but whetever 👯): https://github.com/NixOS/nixpkgs/pull/9118

martinklepsch21:08:15

@ragge: actually just chatted with another nix user and discovered that you maintain that package! simple_smile

martinklepsch21:08:23

the world is crazy small 😄

ragge21:08:30

especially the nix world simple_smile

martinklepsch21:08:15

@ragge there’s going to be a nix conf in Berlin in November: http://conf.nixos.org/

ragge21:08:09

@martinklepsch: yeah, saw that... i'd love to see nix get a bit more attention

ragge21:08:18

@martinklepsch: clojure people should like it

ragge21:08:43

@martinklepsch: are you using nix/nixos?

martinklepsch21:08:30

I’m on mac but I’m considering trying it out before I do a clean install (not that this would be necessary)

martinklepsch21:08:51

@alandipert: could it be that the ubermain doesn’t terminate when there’s an exception while calling the var I gave as main-var?

alandipert22:08:46

@martinklepsch: possible, but i would expect it to terminate - the java code doesn’t catch any exceptions, so i’d expect them to bubble up

alandipert22:08:00

i will test myself

martinklepsch22:08:37

trying again, maybe it was just my computer being slow at printing a prompt

alandipert22:08:03

when my main function throws an exception, i see java.lang.reflect.InvocationTargetException

alandipert22:08:28

(and jvm exit status is 1)

martinklepsch22:08:35

$ java -jar target/project.jar
2015-Aug-05 00:08:55 +0200 MacBook-Air.local INFO [dasession.api] - Dasession/datomic-store @ db-uri test
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at adzerk.MainSploder.main(MainSploder.java:88)
Caused by: java.lang.AssertionError: Assert failed: ENV not set in shell/env, aborting
(env :env)
        at solglas.core$_main.doInvoke(core.clj:19)
        at clojure.lang.RestFn.invoke(RestFn.java:397)
        at clojure.lang.Var.invoke(Var.java:375)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.core$apply.invoke(core.clj:624)
        at clojure.lang.Var.invoke(Var.java:383)
        ... 5 more

martinklepsch22:08:49

Nothing happening until I ^C

martinklepsch22:08:44

java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: boot.App.getClojureName()Ljava/lang/String;

martinklepsch22:08:07

This is the error I should get when using an outdated boot.sh with newer library jars right?

ragge22:08:05

@martinklepsch: i'm currently getting the same error but i thought i had updated boot.sh... currently investigating

martinklepsch22:08:43

@ragge I also updated. I can do boot repl outside of directories that have a boot.properties file

martinklepsch22:08:10

@ragge what tasks are you running?

ragge22:08:33

@martinklepsch: trying just boot and boot repl so far

ragge22:08:56

i also have a custom task that uses make-pod and that fails at https://github.com/boot-clj/boot/blob/master/boot/pod/src/boot/pod.clj#L458

martinklepsch22:08:29

yeah, repl works for me on dirs with boot.properties and without so that does not seem to be the factor

martinklepsch22:08:38

stacktrace also comes from make-pod here

alandipert22:08:21

hey, yeah something is up

alandipert22:08:31

i think i might have uploaded the wrong boot.sh

alandipert22:08:37

what are your boot.sh md5s please?

martinklepsch22:08:50

e0b3ef41bffbedb918e7057a54e1e2ee

ragge22:08:06

e0b3ef41bffbedb918e7057a54e1e2ee

martinklepsch22:08:16

@alandipert: I built from master like half an hour ago and had that exception before I updated the boot executable so yeah

martinklepsch22:08:21

sounds as if that could be the cause

ragge22:08:24

however, I can run (boot.pod/make-pod) in boot repl

alandipert22:08:31

ok weird the one i built is ebe693b4f2283487d8ef6134e2e16485

alandipert22:08:53

and the one on github is definitely e0b3ef41bffbedb918e7057a54e1e2ee

alandipert22:08:00

so either i chose the wrong one or the upload borked somehow

ragge22:08:49

err, (boot.pod/make-pod {}) fails with java.lang.NoSuchMethodError: boot.App.getClojureName()Ljava/lang/String;

ragge22:08:57

wrong arity

alandipert22:08:09

i think i uploaded the wrong boot.sh 😦

martinklepsch22:08:09

d514cd596b38f5f005488b0e240f75eb — that’s what I get when building from master

alandipert22:08:40

can you please try with that one and lemme know if works? if does, suspicion confirmed

alandipert22:08:57

@martinklepsch: our md5s likely differ because you compiled with java 8, we compile with javac 7 for releases

martinklepsch22:08:57

has been said a million times but CircleCI’s ssh access is just great.

ragge22:08:37

@alandipert: i get the same md5 for the boot.sh you just uploaded

ragge22:08:44

to slack that is

ragge22:08:57

e0b3ef41bffbedb918e7057a54e1e2ee

alandipert22:08:33

ok, i updated the release page with a new boot.sh

alandipert22:08:40

should be the correct one - please try

alandipert22:08:51

sorry for all this! thanks for the help fixing

alandipert22:08:15

let’s just pretend that this never happened and that release binaries are immutable

ragge22:08:42

works for me

alandipert22:08:18

immutable-ish

martinklepsch22:08:55

lol — wanted to paste some champagne gif and found this: http://media.giphy.com/media/v65N3d8y7Dj9e/giphy.gif

alandipert22:08:36

i like how he holds it up at the end anyway

martinklepsch22:08:14

commented without reading the thing 😏

alandipert22:08:35

@martinklepsch: yeah i’m confident that exe is new also