Fork me on GitHub
#boot
<
2015-11-16
>
onetom01:11:01

how can i require stuff in my repl by default? i saw there is a boot.repl/*default-middleware*, but not sure how to write one... i guess is just have to check its source

onetom01:11:15

i just want to require a bunch of defaults to my repl so i can interact with my api from the command line. is it not the recommended way to start a repl or why i can't find examples about it?

alandipert02:11:51

@onetom: maybe the --eval option of repl?

alandipert02:11:15

in your profile you could do task-options and require a bunch of stuff

onetom03:11:08

@alandipert: that worked... almost... but it seems to run in a separate pod as the http server and that is the pod which have the reference to our in-memory datomic db

micha03:11:37

or you could make a namespace that is all set up the way you want it and then use the --init-ns option of the repl task to start your repl in that namespace

onetom03:11:40

is there a way to "leak" that out for the nrepl?

onetom03:11:18

micha: would start the repl in the same pod as the boot-http server then?

micha03:11:48

you need to access datomic on the repl right?

micha03:11:25

the in memory transactor listens on a port?

onetom03:11:57

i dont think it listens on any port, but i can double check

onetom03:11:16

i've seen both datomic: and datomic: variants in examples...

onetom03:11:34

but no it doesn't listen on any port

onetom03:11:01

in the 2nd case probably the whole localhost:4334/some-db-name becomes the name itself

micha03:11:30

i guess you need to start a repl in the jetty pod

onetom03:11:11

should i just add a repl to a ring middleware?

micha03:11:27

or you can do it via the --context-create option to the web task

micha03:11:45

make a function that starts nREPL server

onetom03:11:21

hm... we were using boot-http until now. im not sure what that web task is for, but thx for the pointer

micha03:11:37

oh, that's easier then

micha03:11:43

i think boot-http has a repl option

micha03:11:56

i thought you were using boot-jetty

micha03:11:45

the web task creates web.xml files, which are used to deploy applications in servlet containers

micha03:11:52

like when you make a war file or something like that

onetom03:11:56

ah, and boot-jetty is like a mini servlet container, right?

micha03:11:03

it's like boot-http, but its goal is 100% accuracy with respect to dev vs production

onetom03:11:20

great, thx!

micha03:11:28

i.e. if it works in boot-jetty in dev it'll work if you make a war file and upload to beanstalk etc

onetom03:11:34

we will go w boot-http for now 1st

micha03:11:42

-n, --nrepl REPL          Set nREPL server parameters e.g. "{:port 3001, :bind "0.0.0.0"}" to REPL.

micha03:11:49

this is from boot-http

micha03:11:54

looks like what you want

micha03:11:06

[pandeiro/boot-http "0.7.0"]

onetom03:11:10

yup, thats the one we are trying now

micha03:11:33

i wonder if the repl task should be modified to be able to inject itself in any pod

micha03:11:00

this seems like a pretty useful thing, now that all pods are named and discoverable

onetom03:11:15

oh, are they? simple_smile then an injectable repl would be really useful indeed

micha03:11:01

well they will be

micha03:11:04

with 2.5.0

micha04:11:13

@onetom: i think this will be a straightforward change

micha04:11:27

to be able to start a repl server in any pod

micha04:11:38

from the repl even lol

onetom05:11:00

i was also wondering if it would make sense to pass pods as parameters to boot tasks, so u can wire different pods together within boot where all of them could sit in the same lexical scope... 😕

micha05:11:58

you can refer to them by name now, in 2.5.0, and get a reference by calling afunction with the name as an argument

onetom05:11:58

so instead of starting a repl within any pod, the repl would start itself within the pod u give it as a parameter

micha05:11:08

yeah that's the idea

micha05:11:16

boot repl --pod core

micha05:11:20

like that

micha05:11:49

i'm not sure about passing actual references to pod objects around, because it could interfere with garbage collection

micha05:11:18

i guess you'd still need to get a reference to the pod anyway, before you could pass it to a task, so you'd have to look it up by name in the pod registry

micha05:11:16

man, pandeiro's user icon is amazing

onetom05:11:44

thats why i asked him last time who is the artist, but then i forgot who was it...

onetom05:11:59

https://en.wikipedia.org/wiki/Mati_Klarwein -- @ayaz helped to find it w google image search

micha05:11:28

wow that's a miles davis album cover

micha05:11:26

> During the 1980s and 1990s, Klarwein would occasionally search for cheap paintings at flea markets and "improve" them, painting over them or adding things at his whim. Klarwein made over a hundred of these "improved paintings" throughout his career.

micha05:11:50

we call that "chutzpa" where i come from

micha05:11:55

bill gates should do something like that, buy priceless works of art and "improve" them

micha05:11:23

i guess that would be the exact opposite, but he should still do it

pandeiro11:11:59

Funny I never knew that about Klarwein, the "improved paintings"...

mbertheau12:11:49

How do I get back in the cljs-repl after I killed it? When I just do boot repl --client (start-repl) again, it hangs waiting for a client connection.

martinklepsch12:11:23

@mbertheau: is your browser tab still open?

martinklepsch12:11:29

you might need to reload it

mbertheau12:11:12

I reloaded it, the browser says Opened Websocket REPL connection, (start-repl) is still waiting.

mbertheau12:11:46

I interrupt (start-repl) with Ctrl-C, (start-repl) again, and it's still waiting for a client connection.

mbertheau12:11:06

Only thing that works is killing the tab, the repl and the boot dev server, and starting them up again.

mbertheau12:11:33

Which is a bit frustrating because boot dev takes so long until everything is up.

martinklepsch12:11:18

let me see if this happens for me as well

martinklepsch13:11:14

works for me: 1. boot repl —client 2. (start-repl) 3. reload page 4. eval stuff 5. :cljs/quit 6. (start-repl) 7. reload page 8. eval stuff

mbertheau13:11:41

I'm getting RangeError: Maximum call stack size exceeded in step 6 😞

mbertheau13:11:27

In the boot dev terminal there's ERROR - increase :queue-size if this happens often

martinklepsch13:11:59

strange I got that error too but just ignored it and things worked fine

martinklepsch13:11:28

@mbertheau: if you can provide a reproduction case please open an issue in the boot-cljs-repl repo

mbertheau13:11:51

@martinklepsch: I was back at the clojure prompt after this error.

andrewboltachev16:11:48

Hi. If I have project P1 and lib L1, where lib might be useful in much more than one project, I'd deploy one to Clojars (via bootlace commands). But, if I'm producing new versions of it in parallel with development of P1, can I make some "development dependancy" (i.e. not to re-push and re-install L1 each time I change it)?

andrewboltachev16:11:03

ah, exactly what I needed. Nice how my thoughts and needs fit with yours guys 👍 simple_smile

andrewboltachev17:11:51

btw, does this README say that I should actually fork bootlaces in order to use it? https://github.com/adzerk-oss/bootlaces#bootlaces

micha17:11:16

it's just kind of opinionated

micha17:11:36

it was an example of how to make highly specialized task libraries

micha17:11:41

in the beginning

micha17:11:51

but it seems to work well for a lot of people

andrewboltachev17:11:53

ah. so probably I want this also

andrewboltachev17:11:28

i.e. my project will be divided into many libraries, even (likely three) layers of them

micha17:11:00

the bootlaces project implements the workflow we use at adzerk

micha17:11:06

which might not work for everyone

micha17:11:28

so there is the message to fork rather than open many issues

andrewboltachev17:11:50

aha. but in order to use forked repo, one must deploy it also with bootlaces, or?

andrewboltachev17:11:34

recursion detected then! simple_smile

micha17:11:13

bootlaces just composes built-in tasks, tasks that already are included with boot

micha17:11:30

bootlaces has tasks that set certain default options that work for us

micha17:11:46

you could totally use it to deploy your own modified version of bootlaces, if you want

micha17:11:07

you'd want to name yours something else, of course

micha17:11:28

but if the bootlaces configuration conventions work for you you might just use that for a while

andrewboltachev17:11:46

ok. anyway deployments are about practice

micha17:11:13

yeha i have a test repo on clojars that i can deploy things to

micha17:11:33

which is nice for experimenting with different workflows etc

andrewboltachev17:11:38

good. btw, is there an explicit format for version numbers? or a convention?

andrewboltachev17:11:56

though they're rather "version strings"

micha17:11:11

the policies are set by what maven does

micha17:11:20

basically the version is a freeform string

micha17:11:36

however, if the string ends with -SNAPSHOT it's handled specially

micha17:11:01

and maven does understand correct ordering of 1.2.3 formatted versions

andrewboltachev17:11:22

ah, and e.g. 2.1.4-alpha10 is prior to 2.1.4

micha17:11:27

i.e. 10.0.0 > 9.0.0

andrewboltachev17:11:33

2.1.4 is release

micha17:11:40

yeah it does some of that

micha17:11:04

basically understanding how maven does things will help a lot

micha17:11:04

@andrewboltachev: if you feel like adding some notes to a page on the boot wiki with info that would have helped you get going that would be greatly appreciated simple_smile

andrewboltachev17:11:05

it can be sth like "start my own series of developments"

andrewboltachev17:11:13

i.e. few projects and libs

andrewboltachev17:11:04

btw, trying to run boot w/o arguments

micha17:11:25

@andrewboltachev: can you delete ~/.boot/cache/boot.properties and try again?

andrewboltachev17:11:13

and it acually refused working

andrewboltachev17:11:20

after I renamed boot2 to boot

andrewboltachev17:11:26

(and boot to boot1)

micha17:11:52

ok perhaps rm -rf ~/.boot

micha17:11:08

this is fixed in master i think

andrewboltachev17:11:28

all works, thanks! simple_smile

andrewboltachev17:11:04

and, may be add this or the like to FAQ?

andrewboltachev17:11:10

(if there is one)

micha17:11:10

sure, we could use a FAQ simple_smile

micha17:11:18

i don't think we have one yet

andrewboltachev17:11:53

btw, just realized I would need some of my stuff to be avaliable to Java guys LOL 😄

andrewboltachev17:11:08

and would Clojars work then?

andrewboltachev17:11:02

but, each Java guy I ask says that "IDE does every single thing for me, so I dunno what happens behind the scenes"

martinklepsch18:11:23

@andrewboltachev: afaik clojars is just a maven repo with some clojure focused web ui so when your people add clojars as a repo it would probably work

micha19:11:14

yeah clojars totally works with java, maven is maven

michal20:11:56

hi. i’m trying to tweak cljs options a bit a change default location where generated js should be placed. is something like this

(task-options! cljs {:compiler-options {:output-to "js/entry.js"} :optimizations :none})
correct? seems it does not really work...

michal20:11:31

@andrewboltachev: you mean

(task-options! :cljs …. )
? it produces ClassCastException as
task-options!
expects Symbol instead of Keyword

andrewboltachev20:11:10

oh true, with task-options! 1st arg is name of the task which is symbol

michal20:11:19

yup, exactly

andrewboltachev20:11:33

@michal: btw, do you have many places in your code (I guess in build.boot) where cljs is used?

andrewboltachev20:11:15

you can probably solve it like replacing bare (cljs) with (cljs :output-to "..." :optimizations :none)

martinklepsch20:11:28

@michal: to change output location it’s best to move cljs.edn files (see multiple builds section in readme)

andrewboltachev20:11:10

@michal: and and yep... :optimizations should be sibling of :compiler-options, not child of it

andrewboltachev20:11:19

> The --compiler-options option can be used to set any other options <...>

juhoteperi20:11:14

No, :output-to doesn't work. It is always set by boot-cljs.

michal20:11:26

ok, I will try to experiment with those .cljs.edn files then

andrewboltachev21:11:38

btw, are tasks like checkout and watch re-run their "tail" when they are triggered?

andrewboltachev21:11:49

i.e. when they do detect a change?

adamfrey21:11:33

I was trying to reinstall boot on OS X, and I’m running into a strange problem. After I install boot from the github instructions, I try to run boot -h and I get

Downloading  in thread "main" java.io.FileNotFoundException: 

adamfrey21:11:04

why would it be trying to download such an old jar version when I’m installing boot 2.4.2?

juhoteperi21:11:58

@adamfrey: Check if you have old boot.properties file at ~/.boot/boot.properties

martinklepsch21:11:16

or ~/.boot/cache/boot.properties

adamfrey21:11:17

that’s it. I just opened that file

adamfrey21:11:24

before you mentioned it

juhoteperi21:11:44

This should probably be pinned somewhere until 2.5.0 is released

martinklepsch21:11:23

someone said FAQ earlier. Probably worth adding to README/wiki

andrewboltachev21:11:14

My checkout does successfully re-run the next task (which is dev and it just outputs the string from the module), when the module-of-interest-which-is-in-development is changed (when I save a file there), but it doesn't seem to be reloaded then. How can I fix that?

andrewboltachev21:11:40

Playing with all the checkout stuff finally got this: http://dpaste.com/3KTK20Z 😛

alandipert21:11:48

you are on java 9?

andrewboltachev21:11:06

➜  regexpforobj git:(master) ✗ java -version
java version "1.9.0-ea"
Java(TM) SE Runtime Environment (build 1.9.0-ea-b81)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b81, mixed mode)

andrewboltachev21:11:31

yep... I can't remember why I upgraded it

andrewboltachev21:11:39

probably for no reason

andrewboltachev22:11:32

i.e. the same way C compiler is written in C

andrewboltachev22:11:44

Boot requires boot to build it

micha22:11:26

some parts can't be built by boot yet, because compiling a different version of a namespace that is already loaded is tricky

andrewboltachev22:11:07

@micha, btw, can you suggest on how to make checkout work for me properly? Otherwise I'm about to start digging into boot's source (which might be cool btw) 😄

andrewboltachev22:11:30

Well, that sounds a little awkward. I'll anyway try to learn boot's source, 'cause it should be very interesting (from any point of view)

micha22:11:49

@andrewboltachev: how are you setting up your checkouts?

micha22:11:05

what problem are you encountering?

flyboarder23:11:14

anyone deploying to heroku?

codefinger23:11:46

Got some questions?

flyboarder23:11:40

yeah im using exactly that package

flyboarder23:11:42

the build portion is great and im super happy with it, plus the new docker container with boot is also great!!

flyboarder23:11:28

but it seems that boot is to slow for Heroku and doesnt bind to the available port in time (1 minute max.)

codefinger23:11:56

oh, are you using boot to run the app? rather than an uberjar with a java -jar command?

flyboarder23:11:37

yeah I just started down the road of uberjar

codefinger23:11:01

yea, i definitely recommend that. also, have you checked that the port is configured right (in the app), and it's not actually trying to connect some default (like 3000)?

codefinger23:11:27

that's a pretty common mistake, and if it binds to 3000 or whatever instead of $PORT you'll get that error (R10)

flyboarder23:11:43

yeah I have the port as a env var

micha23:11:58

hi codefinger, welcome!

codefinger23:11:12

micha: hello simple_smile

codefinger23:11:02

flyboarder: worst case scenario, we (Heroku) can increase the boot timeout for you. but you have to open a support ticket and request it

codefinger23:11:12

i work at heroku

flyboarder23:11:56

well i’d like to keep everything within the limits

micha23:11:59

also if you make a repo that demonstrates the issue i can try and give it a shot

micha23:11:06

i've been meaning to get a nice heroku based deploy setup worked out for hoplon, so this would be a good way to start simple_smile

codefinger23:11:48

micha: ping me if you need any help

micha23:11:20

codefinger: thanks!

flyboarder23:11:25

i’d like to make boot my single build tool across all my projects so I started on a docker and heroku wrapper tasks

micha23:11:49

there is a docker image on dockerhub, adzerk/boot-clj

micha23:11:53

did you see that one?

flyboarder23:11:55

the docker container is awesome but im having issues getting anything to run docker properly

flyboarder23:11:17

@micha: yeah thats the one im using thanks for the work!! 😛

micha23:11:55

sweet :thumbsup:

flyboarder23:11:49

who do you guys have hosting your docker images? or is that just internal?

flyboarder23:11:22

for deployment i mean

micha23:11:22

we are using AWS

micha23:11:50

most of the docker things are deployed to beanstalk, where the images are built and then cached

micha23:11:11

hosting images on s3 seems like it would be a good way to go

flyboarder23:11:19

yeah i’d like to get RancherOS running in S3 or azure

flyboarder23:11:29

for container management http://rancher.com

micha23:11:46

interesting, i hadn't seen that

flyboarder23:11:06

i’v played around with the rancher container it’s pretty neat, the OS is the really cool part, docker as PID 1

micha23:11:02

boot show -d will help you debug deps issues

micha23:11:08

and boot show -p

micha23:11:23

ok i must ride

micha23:11:28

i'll be back later