This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-12
Channels
- # alda (3)
- # beginners (17)
- # boot (157)
- # cider (15)
- # cljs-dev (30)
- # cljsjs (4)
- # cljsrn (5)
- # clojure (70)
- # clojure-austin (3)
- # clojure-canada (2)
- # clojure-colombia (1)
- # clojure-czech (1)
- # clojure-dev (27)
- # clojure-greece (34)
- # clojure-japan (6)
- # clojure-russia (114)
- # clojure-sg (3)
- # clojure-uk (8)
- # clojurescript (63)
- # cursive (9)
- # datomic (40)
- # devcards (11)
- # euroclojure (4)
- # events (8)
- # hoplon (61)
- # incanter (1)
- # instaparse (16)
- # jaunt (6)
- # jobs (6)
- # jobs-discuss (52)
- # ldnclj (1)
- # leiningen (2)
- # off-topic (3)
- # om (73)
- # onyx (101)
- # overtone (25)
- # re-frame (18)
- # reagent (6)
- # ring (7)
- # ring-swagger (36)
- # spacemacs (5)
- # sydney (1)
- # untangled (41)
- # yada (6)
I have a very weird error on Travis here with latest boot SNAPSHOT:
clojure.lang.ExceptionInfo: boot.App.setStash(Ljava/lang/Object;)Ljava/lang/String;
data: {:file "/tmp/boot.user5984601081256212445.clj", :line 59}
java.lang.NoSuchMethodError: boot.App.setStash(Ljava/lang/Object;)Ljava/lang/String;
boot.pod/send! pod.clj: 321
confetti.boot-confetti/eval2726/fn/fn/fn boot_confetti.clj: 157
replumb.boot-pack-source/eval2477/fn/fn/fn boot_pack_source.clj: 45
replumb.boot-pack-source/eval2521/fn/fn/fn boot_pack_source.clj: 57
I do rm -Rf ~/.m2/repository/boot
before building so I should have everything in place right? No need to copy boot.sh
?
Maybe I am using it not in the right way https://github.com/confetti-clj/confetti/blob/master/src/confetti/boot_confetti.clj#L157
but as usual it works locally
Ive read through the entire boot docs and have been playing around trying to get a specific task to work, but I think my mental model is missing something: if I create a tmp dir, do some compilation of code, then output to the tmp and commit!
the tmp, is automatically included somewhere inside /target
?
@lwhorton: depends on whether you call the target
task and which role you're adding your compiled files as
@lwhorton: if you remember the fileset docs, there are a couple of roles described with a handy reference table ...
yes add-resource
sounds right
does the target task go after commit!? I’m having a hard time finding a third-party example that does such.
must be the problem is somewhere else .. maybe because i’m executing a shell and just handing the shell --output-dir (.getPath out-file)
, boot doesn’t recognize anything is added to the tmp
@lwhorton: any chance you can share your project on github or similar?
the task itself is really small, I can just post it here:
(trying to find all “.js” files in the project, compile them with browserify, dump them to “bundle.js” inside of /target
)
(let [tmp (boot/tmp-dir!)]
(boot/with-pre-wrap fileset
(let [js-files (find-js-files fileset)
out-file (doto (io/file tmp "bundle.js") io/make-parents)]
(exec/sh [
"./node_modules/.bin/browserify" "-d" "-v" "-t [babelify --stage 2]"
js-files
"-o" (.getPath out-file)])
(-> fileset
(boot/add-resource tmp)
(boot/commit!))))))
@lwhorton: i think you maybe want .getAbsolutePath
instead of .getPath
otherwise that looks legit
oh another thing, you're doing add-resource
to a TmpDir when i think you want to add (tmp-dir tmp)
err, disregard, tmp-dir! returns a File
@lwhorton: i don't think the absolute vs. relative thing matters either, not sure why i ever preferred one over the other
@lwhorton: i tested this and it works, so maybe the issues lies with either find-js-files
or the browserify
tool?
(require '[boot.core :as boot]
'[ :as io]
'[boot.util :as util])
(deftask doit []
(let [tmp (boot/tmp-dir!)]
(boot/with-pre-wrap fileset
(let [js-files []
out-file (doto (io/file tmp "bundle.js") io/make-parents)]
(util/dosh "touch" (.getPath out-file))
(-> fileset
(boot/add-resource tmp)
(boot/commit!))))))
maybe print out find-js-files
to make sure it's finding stuff
(util/info "got here 1\n")
is handy for seeing things
@lwhorton: tried boot.util/dosh
instead of exec/sh
?
not sure where the differences are there exactly but might be worth a go
(defn find-js-files
[fs]
(->> fs
boot/input-files
(boot/by-ext [".js"])
(map (fn [f] (.getPath (boot/tmp-file f))))
(reduce #(str %1 " " %2))))
seems like you wanna perhaps build the arg list via concat
right, it spits out ”/path/to/1 /path/to/2”
, and the whole argument of dosh looks like (apply dosh “./node_modules/browserify -v” js-files “-o” (.getPath out-file))
(apply vector "abc")
[\a \b \c]
turns the strings into individual characters
looking at the source for inspiration but if anyone has good examples for understanding how/when/why?
@trgoodwin: it's for when you want to manipulate the fileset in some common ways, like move things around, delete certain files, things like that
cool. so adding a sift like: ` … (cljs :optimizations :advanced) (sift) ;;??? (target :dir #{"target"}))) `
is there a place that lists the boot- tasks that have been written. or is searching over clojars/maven packages the only way?
Hey @micha do you have any hint on how to debug,
Sifting output files...
clojure.lang.ExceptionInfo: boot.App.setStash(Ljava/lang/Object;)Ljava/lang/String;
data: {:file "/tmp/boot.user2920520248170801716.clj", :line 59}
java.lang.NoSuchMethodError: boot.App.setStash(Ljava/lang/Object;)Ljava/lang/String;
boot.pod/send! pod.clj: 321
confetti.boot-confetti/eval2726/fn/fn/fn boot_confetti.clj: 157
replumb.boot-pack-source/eval2477/fn/fn/fn boot_pack_source.clj: 45
replumb.boot-pack-source/eval2521/fn/fn/fn boot_pack_source.clj: 57
it is a setStash problem I guess
ah, I guess I should do like you did with boot.jar
in Travis
trying
it was not this, but I needed to delete .boot/cache/bin/*
on the CI server
it is not working still ..
hasn't been boot.App.setStash
present for long time now?
it looks like the jar
that I see in
is not the same as ~/.boot/cache/bin/2.6.0-SNAPSHOT/boot.jar
on my machine
I don't know if it makes any difference for my problem, but I wanted to report it
Does anyone have experience running a Boot project on Heroku? I'm using https://github.com/upworthy/heroku-buildpack-boot but it's not finding my "build.boot" file.
Though upworthy has some small problems: https://github.com/upworthy/heroku-buildpack-boot/pull/10
I confirm that boot.jar
currently on github does not build with pod/send!
properly
if I make install
current master
it does
so I would need to build it myself on my CI or ask you guys to update it (sorry I have been a PITA lately :D)
I think boot.jar
?
because of the SNAPSHOT thing right?
when I delete ~/.boot/cache/bin/2.6.0-SNAPSHOT
it downloads it again from that link
well yes I guess this one would be alpha
link still same here, maybe I need Github to refresh stuff
or we can cut a release 😄
@juhoteperi: I'm actually using your patch, not the Upworthy buildpack. When I ls -a
in the build dir it shows all of my project files except boot.properties
and build.boot
. It feels like I've done something very stupid but I haven't pinpointed what yet 😞
Hi. I have created a ui.cljs.edn file located in the directory resources/js/ui.cljs.edn
. The contents of this file look like:
{:require [model-builder.ui]
:init-fns [model-builder.ui/-main]}
This will compile model-builder.ui
to target/js/ui.js
, however, if I try and use this file in my HTML I will get a missing file error. It outputted the wrong directory. It is looking for base.js
in target/ui.out/goog/base.js
when is should be target/js/ui.out/goog/base.js
. It is forgetting the js
directory. Is there something I need to add to my edn file to make this work correctly?To make this clearer, the compiled ui.js looks like this:
var CLOSURE_UNCOMPILED_DEFINES = null;
if(typeof goog == "undefined") document.write('<script src="ui.out/goog/base.js"></script>');
document.write('<script src="ui.out/cljs_deps.js"></script>');
document.write('<script>if (typeof goog != "undefined") { goog.require("boot.cljs.main1497"); } else { console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?"); };</script>’);
As you can see it has the wrong paths. It needs to have the js path first then ui.out.Not really but it makes the app structure a lot better because there are multiple cljs builds
@juhoteperi: Fixed! I was doing something stupid. 😉
I agree. Still seems a bit ignorant to the problem but no big deal Anyways, there should be some documentation about this problem so others don’t run into it.
Probably not worth it. I did not see those workarounds in the documentation though. Are they hidden somewhere?
Probably. Works when not in the js subdirectory. I think there should be some documentation about this in boot-cljs.
Actually the paths are updated with the correct subdirectory but the browser is missing them.
PR welcome (or it can probably be mentioned in the wiki)
just a note boot.jar
stayed the same on GH