Fork me on GitHub
#boot
<
2016-03-29
>
jethroksy06:03:18

am I doing something really silly here?

jethroksy06:03:20

(set-env!
 :source-paths #{"src"}
 :resource-paths #{"resources"}
 :dependencies'[[org.clojure/clojurescript "1.8.40"]
                [adzerk/boot-reload "0.4.6"]
                [adzerk/boot-cljs-repl   "0.3.0"]
                [adzerk/boot-cljs "1.7.228-1" :scope "test"]
                [com.cemerick/piggieback "0.2.1"  :scope "test"]
                [weasel                  "0.7.0"  :scope "test"]
                [org.clojure/tools.nrepl "0.2.12" :scope "test"]])

jethroksy06:03:40

I'm getting a class not found error

jethroksy06:03:51

❯ boot dev                                                                                                                           02:52:16 PM 9s 589ms → 1 
      clojure.lang.ExceptionInfo: org.clojure
    data: {:file "/tmp/boot.user5470485860592388448.clj", :line 5}
java.lang.ClassNotFoundException: org.clojure
               ...                
boot.main/-main/fn   main.clj: 200
   boot.main/-main   main.clj: 200
               ...                
  boot.App.runBoot   App.java: 403
     boot.App.main   App.java: 492
               ...                
         Boot.main  Boot.java: 258

juhoteperi06:03:32

@jethroksy: Missing space after '

jethroksy07:03:08

has anyone else faced the problem of localhost getting trimmed off when initiating a websocket connection with boot-reload?

jethroksy07:03:40

I get Uncaught SyntaxError: Failed to construct 'WebSocket': The URL 'ws://:33471' is invalid.

jethroksy07:03:56

but localhost is all there:

❯ ag 33471                                                                                                                     03:14:31 PM 2m 20s 943ms → 130 
target/renderer.out/adzerk/boot_reload.cljs
2:(client/connect "" {:ws-host nil, :asset-host nil, :on-jsload (fn* [] (app.renderer/init))})

target/renderer.out/adzerk/boot_reload.js
6:adzerk.boot_reload.client.connect.call(null,"",new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"ws-host","ws-host",587956291),null,new cljs.core.Keyword(null,"asset-host","asset-host",-899289050),null,new cljs.core.Keyword(null,"on-jsload","on-jsload",-395756602),(function (){

jethroksy07:03:56

I'm trying to get cljs to work with electron and boot, and I'm following @martinklepsch 's original code, just bumping the deps and changing some deprecated stuff https://github.com/jethrokuan/electron-cljs

jethroksy07:03:21

ah okay issue resolved, I had to specifically add the :ws-host option in boot-reload

juhoteperi07:03:09

should not be needed

jethroksy07:03:09

I was under that impression as well

slotkenov12:03:41

Is there an option for boot-http to proxy some calls to another server?

nberger12:03:27

@slotkenov: boot-http has a :handler option which you can use to respond to requests however you want https://github.com/pandeiro/boot-http#3-start-server-with-given-ring-handler

slotkenov13:03:25

@nberger: of course! I should be able to set it up there

johannjohann16:03:24

hey guys im trying to set up new relic for my dear program

johannjohann16:03:35

a lot of the tutorials show that lein has a 'java-agents' param to set. is there anything comparable to that in boot?

alandipert16:03:01

BOOT_JVM_OPTIONS

alandipert16:03:21

e.g. export BOOT_JVM_OPTIONS="-javaagent:/path/to/newrelic.jar"

alandipert16:03:28

then start boot

johannjohann16:03:36

thank you sir simple_smile

sekao16:03:13

I'm trying to run boot tasks programmatically in my project. I added boot/core as a dependency and am running the boot function meant for REPL use. Is there any issue with this? It seems to work, but when I close my program it throws an error about not finding a file in ~/.boot, as if it's trying to do cleanup or something.

alandipert17:03:54

is boot the entrypoint to your program?

alandipert17:03:43

or are you e.g. running via your own main method

alandipert17:03:37

if not through boot, you'll run into weird issues... currently boot.App/main does a bunch of setup. it does stuff because it needs to run before any clojures are loaded

micha17:03:45

also there is mutable state in boot.core, which is not thread-safe

sekao17:03:08

I'm running it in my own main method. Perhaps I can manually run boot.App/main to set everything up

alandipert17:03:04

cool, that's another way to do it

micha17:03:21

that's how boot does it itself

micha17:03:51

it's adding boot.jar to the classpath itself there

micha17:03:04

you may or may not need that

sekao19:03:10

running boot.App/main and passing the arguments to it seems to work. it seems to be much slower than I expected, so i wonder if it is starting a new process. also i was hoping to also include third-party tasks in my project’s dependencies, but with this technique I think I have to retrieve them by passing -d, which isn’t ideal since it has to download it dynamically. nonetheless it seems to be a reliable way of doing it.

alandipert19:03:21

@sekao: what kind of project is it?

sekao19:03:45

i’m trying to bundle boot with my IDE, nightcode

alandipert19:03:49

one way around -d is to ship with the dep jars and install them manually into the maven cache using boot.aether/install

alandipert19:03:01

vs. letting aether resolve and install them

alandipert19:03:26

well, you could still call set-env or -d, except aether wouldn't get them from the net since they'd already be in the cache

alandipert19:03:35

although i guess there's a chicken/egg problem there... since boot.aether needs boot to be running already to do its thing

alandipert19:03:08

i guess that could still be a way, but you'd have to install them using non-boot methods

sekao19:03:52

i wonder if the slowness is due to this issue. i’m running boot-new by passing "-d" "seancorfield/boot-new” to the main method, and i suppose it could be querying clojars every time to see if there is a new version of the task.

martinklepsch19:03:58

@sekao: nightcode is awesome btw, we've been using it for clojurebridge workshops and it's the best thing simple_smile

alandipert19:03:54

@sekao: you could test by doing "-d" "seancorfield/boot-new:0.4.2"

alandipert19:03:20

(cli deps support a gradle-ish version syntax)

sekao19:03:52

@martinklepsch: really great to hear! i’m experimenting with a rewrite that uses javafx for the UI and boot for the build system, we’ll see how it goes

sekao19:03:24

@alandipert: seems slightly faster but may be my perception. i checked activity monitor and it doesn’t look like a new process is being spawned so i suppose it’s just the setup code

micha22:03:43

@sekao: when you do boot.App/main and initialize things you can then create pods in which you can install dependencies etc

kenny23:03:24

When I call boot pom jar push -r s3repo. I get a stacktrace that looks like:

WARNING: Error Response: GET '/releases%2Fs3repo%2Fstormpath%2Fmaven-metadata.xml' -- ResponseCode: 404, ResponseStatus: Not Found, Request Headers: [Content-Type: , Date: Tue, 29 Mar 2016 23:25:18 GMT, Authorization: AWS AKI..., User-Agent: JetS3t/0.7.1 (Mac OS X/10.11.4; x86_64; en; JVM 1.8.0_60), Host: , Response Headers: [x-amz-request-id: 51C0..., x-amz-id-2: tV4DK..., Content-Type: application/xml, Transfer-Encoding: chunked, Date: Tue, 29 Mar 2016 23:25:18 GMT, Server: AmazonS3]
Mar 29, 2016 4:25:18 PM org.jets3t.service.impl.rest.httpclient.RestS3Service performRequest
SEVERE: Request Failed.
org.jets3t.service.S3ServiceException: S3 Error Message. GET '/releases%2Fs3repo%2Fstormpath%2Fmaven-metadata.xml' on Host '' @ 'Tue, 29 Mar 2016 23:25:18 GMT' -- ResponseCode: 404, ResponseStatus: Not Found, XML Error Message: <?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>releases/s3repo/stormpath/maven-metadata.xml</Key><RequestId>51C0...</RequestId></Error>
        at org.jets3t.service.impl.rest.httpclient.RestS3Service.performRequest(RestS3Service.java:441)
        at org.jets3t.service.impl.rest.httpclient.RestS3Service.performRestGet(RestS3Service.java:876)
        at org.jets3t.service.impl.rest.httpclient.RestS3Service.getObjectImpl(RestS3Service.java:1712)
        at org.jets3t.service.impl.rest.httpclient.RestS3Service.getObjectImpl(RestS3Service.java:1655)
        at org.jets3t.service.S3Service.getObject(S3Service.java:2215)
        at org.jets3t.service.S3Service.getObject(S3Service.java:1424)
        at org.springframework.aws.maven.SimpleStorageServiceWagon.getResource(SimpleStorageServiceWagon.java:93)
        at org.springframework.aws.maven.AbstractWagon.get(AbstractWagon.java:184)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:601)
        at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Has anyone else experience a similar issue when pushing to a s3 repo? It seems like there is some sort of additional setup I need to do to the s3 repo..

micha23:03:49

is it in the bucket though?

kenny23:03:27

I forgot to mention.. The push succeeded: the artifact is uploaded to s3.

micha23:03:28

there's a known issue of spurious warnings

micha23:03:16

disregard that

micha23:03:20

they fixed it

micha23:03:41

which version are you using?

micha23:03:58

maybe try with 1.2.0

micha23:03:21

you only get the stack trace the first time you push a new repo, so it might rquire making a new thing to test if it's fixed

kenny23:03:18

Ah yes. The error only occurs when I push to a new repo.

micha23:03:36

lol nobody could figure out how to suppress the logging

kenny23:03:36

No error when pushing to a repo that already exists.

micha23:03:39

becuse java

micha23:03:53

but try with 1.2.0 if you could

micha23:03:05

i'd be interested to know if the issue is fixed with the new version

micha23:03:17

because they removed it from the troubleshooting section

micha23:03:20

of the readme

kenny23:03:46

Trying now..

micha23:03:50

awesome thanks

kenny23:03:51

Yup, no error. I emptied out the test s3 bucket, pushed, and no error.

micha23:03:07

good news!

micha23:03:24

and nothing else broken, which is also nice simple_smile

micha23:03:07

i updated the wiki page

micha23:03:13

with the new version number