This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-03
Channels
- # beginners (20)
- # boot (407)
- # cider (17)
- # cljs-dev (29)
- # cljsrn (33)
- # clojure (169)
- # clojure-greece (17)
- # clojure-russia (47)
- # clojure-spec (40)
- # clojure-uk (81)
- # clojurescript (64)
- # clr (3)
- # copenhagen-clojurians (3)
- # core-async (1)
- # cursive (28)
- # datomic (26)
- # editors-rus (4)
- # emacs (10)
- # events (1)
- # figwheel (1)
- # funcool (1)
- # hoplon (82)
- # jobs (1)
- # klipse (10)
- # lein-figwheel (26)
- # leiningen (1)
- # off-topic (2)
- # om (153)
- # overtone (2)
- # pedestal (15)
- # proton (1)
- # re-frame (6)
- # ring-swagger (1)
- # rum (1)
- # slack-help (4)
- # untangled (56)
- # vim (24)
- # yada (2)
If you use target task more than once
hello guys - i’m looking for an example here how to include an external source map to build.boot. it’s for a new cljsjs package that comes with a link to an external one at bottom of the JS file. but somehow boot is not picking it up.
that new cljsjs package has the minified JS file and the source map file both in the production folder (there is no development folder)
any ideas?
What cljsjs package?
a new one i am about to submit a PR for - it wraps the zxcvbn password strength checker
because it already comes minified, i guess it is a special case
Is the only version available minified?
i think all zxcvbn releases are minified
guys trying to run (aot)
, seeing this error:
java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError:
clojure.lang.Compiler$CompilerException: java.lang.ExceptionInInitializerError, compiling:(boot/util.clj:1:1)
java.lang.ExceptionInInitializerError:
clojure.lang.ArityException: Wrong number of args (0) passed to: digest/fn--37
what could this be?any suggestions @flyboarder re external source maps in boot?
did you check to make sure the map file is available at the URL specified in the minified source file?
yes, and it is not available
also checked in the temporary target folder of boot
the external source map isn’t there either
how are you extracting the source map from the jar? you will need to add it to the fileset, no?
well, i think book should do it for me? just listed it as a dependency [cljsjs/zxcvbn “4.4.1-1”]
i am uploading that jar in a private, mirrored repository for our office like all the other cljsjs packages
sorry, dont understand. what does the class path have to do with it?
how can i check this in command line? that the source map is in the class path?
when you use something like :require [cljsjs.zxcvbn]
and you have the deps.cljs
file on the classpth, the cljs compiler will extract the js file from the class path for you
in deps.cljs i see following (source map entry is missing there!):
{:foreign-libs [{:file "cljsjs/zxcvbn/production/zxcvbn.inc.js", :provides ["cljsjs.zxcvbn"]}], :externs ["cljsjs/zxcvbn/common/zxcvbn.ext.js"]}
Can anyone help me figure out why map isn’t executing in this boot task:
(deftask my-test
[]
(fn [next-handler]
(fn [fileset]
(map (fn [num]
(println num))
(range 1 5)))))
ok, so then it’s a cljsjs packaging problem
@chooie it is executed, but because map
is lazy you will never see the println
, in order to see it you need (doall (map ....))
ugh … how?
hmmm … is there an example for inspiration?
@richiardiandrea Thanks again!
then for each of those you could look for a file of the same name but with .map
appended to the name
and if it exists you could copy it from the classpath to a temp dir and add the temp dir to the fileset
the best solution would be to have the deps.cljs
file format include a :source-maps
key or something
thanks heaps … thinking ...
then we could update the cljsjs task that generates the deps.cljs
file to include the source maps
yup but that might take a bit too long as i need to get this working pretty soon
will try your above suggestion with a custom boot task
hmmm, but what path to pick there?
when the source map lands in a temporary directory
that’s the problem. which directory?
with js file you mean the source map?
yes i found it
but problem is that the source map is not in that target folder
./target/js/app.out/zxcvbn.inc.js
there is no ./target/js/app.out/zxcvbn.inc.js.map
there
:resource-paths #{”resources"}
i see what you mean
but that wouldn’t be acceptable here
needs to happen automatically with newer versions
seems like it would be easier to just upgrade it manually until you can really fix the issue
what about a custom boot task you suggested above?
the correct place is really decided by the cljs compiler configuration and boot-cljs options
ugh, you mean to turn //# sourceMappingURL=zxcvbn.inc.js.map
into an absolute url pointing to the one on github?
i ll try
back in half hour + many thanks!
@micha can I compose watch
tasks? Example one that watches all files and one that I can trigger manually ?
boot watch watch --manual ...
lol ok
I'll try
because I was thinking of solving the boot-figwheel
issue with the manual trigger
yeah like what if without --manual
it would trigger when files change or when you manually trigger it
adding a hook in figwheel to call boot
after it finishes compiling
yeah that would be good, basically we need an "or" atom here https://github.com/boot-clj/boot/blob/master/boot/core/src/boot/task/built_in.clj#L398
this can be extended to having the possibility to pass/bind your own atoms
i think it's easy enough to extend with your own atoms since we do expose a function you can call to trigger the update
@micha what is the name? I can only see the boot.core/new-build-at
atom 😉
kk no rush, doing it too 😉
Cool thanks! I'll experiment
Anyone is experiencing slow issue ? For example a basic boot -h
can take 10 seconds to execute
For information, boot -h
installed 2.5.x, and boot -h
again detected the 2.6.x version and installed it
the only thing i can think of is boot somehow needing to manage a huge number of files or something
I may try to update my java version, it's not normal to see a java process at 192% cpu usage
But I tried boot few months ago (with previous version of mac etc) and never had these delays
I think I got a solution, I modified /etc/hosts to match this http://stackoverflow.com/questions/39636792/sbt-test-extremely-slow-on-macos-sierra and now it seems better. It's not blazing fast, but boot -BPh
takes now 3 seconds instead of 10
Tested 5 times with and without the fix, it really changes. From 8 seconds to 3 seconds
does latest mac update give devs anything useful? it looked like just siri and emojis to me
can we get a new boot release? currently running into this https://github.com/boot-clj/boot/commit/e77ef6c4b613b03e80fd58cd7eeaf1693de6e33e issue
last snapshot version seems to be from april
@edannenberg new release will be ready soon
i’m struggling a bit trying to figure out how to include a random github project as a dependency and hack on it. it seems checkout is the way to go but not sure how to use it. i’ve followed the lein guide and symlinked a project under ./checkouts, inlcluded that in the checkouts-path
in boot, then the checkouts
dep vector and it doesn’t find it
that doesn’t seem to give me hackability though. what’s the workflow for this? just add as a source path?
@naomarik did you see https://github.com/boot-clj/boot/issues/154 ? haven't used it myself though yet.
(get-env)
shows the checkouts stuff properly but i don’t know what the benefit is if i have to keep modifying the checkout dependency and running lein install
@naomarik there is a --checkouts
option now. -c --checkouts SYM:VER Add checkout dependency (eg. -c foo/bar:1.2.3)
{adzerk/boot-reload
{:dir
#object[java.io.File 0xfda1c1f "/Users/naomarik/.boot/cache/tmp/Users/naomarik/Sites/boot-test/5y2/-nu80k9"],
:jar
#object[java.io.File 0x615e77a7 "/Users/naomarik/.m2/repository/adzerk/boot-reload/0.4.14/boot-reload-0.4.14.jar"],
:dep nil}}
(get-checkouts)
gives me this and I can refer to it in the code properly, but I’m wondering why there’s reference to this dir since it doesn’t reload my changes. I’m running this in a simple repl with no tasks defined yet@naomarik the flow hasn't changed for using checkouts from boot, the task checkout
was replaced by the option --checkouts
. But the flow is you do auto builds that will generate jars on the checkout project and those will be picked on the project you are running with --checkouts
.
i mean a separate process to build the checkout jar and install it in your local .m2 maven cache
what's the easiest way to have my build process replace one file with another? i'm striking out with both sift and cp in a custom task. Filesets are making me feel boneheaded 😄
the easiest way is to create a file in a temp dir with the same path and the ad temp dir to the fileset
more importantly, i'd love to know how to think about them properly, and what i'm doing wrong.
can you help me get why this doesn't work as i intend https://gist.github.com/christianromney/d03353bf9aff2a58f92d0d22a4097556
https://github.com/onetom/hoplon-layouts/blob/master/build.boot — anyone feel like explaining exactly what “compile” means in terms of maven scopes and clojure(?script) projects ? I know “provided” means the dependency isn’t transitive, for example.
good to know
@christianromney I'm on my phone but I'll look when i get to a computer
@pseud https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
no hurry— 🙂 but if/when you get around to it, i'd be super grateful
really want to further my understanding
tl;dr it's the default scope, is transitive
@alandipert ah, great 🙂
@pseud as alan said, that's the default. i might have it there because i was lazy to delete after converting it from a maven pom.xml
which had the scopes explicitly included (probably because of intellij's maven plugin)
@pseud and i believe this is the official documentation on the topic: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
@naomarik Well, it's the first mac update I find uninteresting... And it seems to have some thorns for advanced users
okay so with boot-reload installing itself every save with its default boot-dev
i’m still not able to find new changes in the other project unless i restart the repl
@naomarik reloading things on the classpath doesn't update objects already constructed in memory
using latest stable clojure.tools instead of alpha removes the error, but still don’t get changes ;/
(require
'[adzerk.boot-reload :as reload] :reload)
re-evaling this worked for me, couldn’t get clojure tools thing to work properlyboot-reload had a dependency on httpkit even when I added it to my own project calling refresh did nothing, even after setting the dirs shown here: https://github.com/boot-clj/boot/wiki/Repl-reloading
@micha based on your last input, i figured it out thanks! turns out i was just forgetting to call (io/make-parents) on a new tempfile with a nested path
now we need them to schedule their follow-up cognicast where we get to hear more about hoplon 🙂
@christianromney it just came out 🙂
part 2?
@devn i heard the cast with them that was mostly boot and they agreed to come back to do hoplon
my podcast feed is behind!
ah there it is
hey guys is there a boot thing that makes “anonymous" deftask? something I can use within (comp)
. with-pre-wrap fileset
does that but I’m not doing anything fileset realted
exactly 🙂
but you can also use with-pre-wrap and just return the unmodified fileset
with-pass-thru
is just sugar
I am running boot uber jar
at the command line, at the uberjar is being generated, but the fileset doesn't appear to be synced(I guess?) because the uberjar doesn't end up in target/ but I do see it in the cache in ~/.boot/
@hiredman you probably need to append the target
task to materialize the file if I understand correctly
so boot uber jar target
@zane it should be thought as the task for materializing files from the fileset to the file system
it is explicit in boot
cause you might want to actually materialize the files somewhere else, on s3
for instance
yeah agree, I guess it is a legacy thing 😉
ok, next, why does the uberjar not contain files from a :source-paths
, which I am setting using set-env!
hey guys… I’m trying to use adzerk.boot-test
. I have the dependency, I have it in require - still test
task not showing up… wtf?
and it does contain all the classfiles and what not from dependencies that are set with the same call to set-env!
for some reason I thought :source-paths
was a thing in the boot env, but once I put my src directory in :resource-paths
now everything is showing up in the jar
@hiredman :source-paths
are input only, :resource-paths
are input and output. I will get a link with a better explanation.
sorry, I was out for lunch… I tried removing ~/.m2 but still boot test -h
doesn’t work:
https://gist.github.com/agzam/e4819cd1255c7d99600e3cc461b26db6
@lxsameer it will put it on the fileset by default. If you want the fileset to be written to disk you need to use the target
task. By default the target
task will put the fileset on the target/
directory.
also there is documentation in the boot gihub repo, in the wiki and there are also api docs
There is also the wiki: https://github.com/boot-clj/boot/wiki
any idea what this is? java[21479] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
there are some workarounds supposedly, but the watcher code for OSX is not something i really want to mess with
i just installed a milllion things on my windows ubuntu bash thing and shocked it all worked
probably a long shot: does anyone have experience using Boot + Appveyor?
So I got the boot repl working, and it was easy. Cursive can just connect to it as if it was a Leiningen REPL and off we go.
Then I’m experimenting with updates and deletions of Maven artifacts, so in one window I: rm -rf ~/.m2/repository/org/apache/zookeeper/
, but when I re-run my task:
(boot (wmsc-query-service-image))
java.nio.file.NoSuchFileException: /Users/hlship/.boot/cache/tmp/Users/hlship/workspaces/walmart/gleam/1ktp/6v03yy/zookeeper-3.4.6.jar -> /Users/hlship/.m2/repository/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar
I’ve already switched my code from using boot.file/hard-link boot.file/copy-with-lastmod, but that didn’t help.
(with-pre-wrap fs
(empty-dir! work-dir)
(doseq [jar jars]
(file/copy-with-lastmod jar (io/file work-dir (get-name jar))))
(-> (cond-> fs
(seq stable) (add-files stable target)
(seq snapshot) (add-files snapshot target))
(add-resource work-dir)
commit!))
That is part of my Docker stuff, it updates a datastructure attached to the fileset to add docker ADD instructions for those files.
It works as expected if I execute boot from the command line twice, with the rm in between.
So something is carrying over from the first execution of (boot (wmsc-query-service-image))
to the second.
You know what, let me delete my ~/.boot/cache directory, maybe there’s something from a prior execution causing trouble.
I deleted ~/.boot/cache/tmp, but still persists:
(boot (wmsc-query-service-image))
java.nio.file.NoSuchFileException: /Users/hlship/.boot/cache/tmp/Users/hlship/workspaces/walmart/gleam/1l49/8uws5d/zookeeper-3.4.6.jar -> /Users/hlship/.m2/repository/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar
java.nio.file.NoSuchFileException: /Users/hlship/.boot/cache/tmp/Users/hlship/workspaces/walmart/gleam/1l49/8uws5d/zookeeper-3.4.6.jar -> /Users/hlship/.m2/repository/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar
file: "/Users/hlship/.boot/cache/tmp/Users/hlship/workspaces/walmart/gleam/1l49/8uws5d/zookeeper-3.4.6.jar"
otherFile: "/Users/hlship/.m2/repository/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar"
sun.nio.fs.UnixException.translateToIOException UnixException.java: 86
sun.nio.fs.UnixException.rethrowAsIOException UnixException.java: 102
sun.nio.fs.UnixFileSystemProvider.createLink UnixFileSystemProvider.java: 476
...
boot.file/hard-link file.clj: 147
gleam.tasks.docker/eval490/fn/fn/fn docker.clj: 105
gleam.tasks.docker/eval328/fn/fn/fn docker.clj: 39
boot.core/run-tasks core.clj: 938
boot.core/boot/fn core.clj: 948
clojure.core/binding-conveyor-fn/fn core.clj: 2019
...
(deftask artifact
"Add one or more Maven artifacts to the image.
Artifacts are retrieved from the Maven repository and added to the fileset, and
a ADD instruction is added to the Dockerdata.
All artifacts, along with transitive dependencies, are imported.
"
[d dependency ID:VER [[sym str]] "Vector of checkout dependencies"
t target DIR str "Target directory for artifact(s)"]
(assert target "--target is required")
(assert (str/ends-with? target "/")
"--target DIR must end with a slash")
(let [env (get-env)
coords (map pod/canonical-coord dependency)
jars (map (comp io/file :jar) (pod/resolve-dependencies (assoc env :dependencies coords)))
jar-names (mapv get-name jars)
{:keys [stable snapshot]} (->> jar-names
sort
(group-by categorize))
work-dir (tmp-dir!)]
(with-pre-wrap fs
(empty-dir! work-dir)
(doseq [jar jars]
;; There's a fair assumption that the file names will never collide. Maven artifacts
;; include a version number that should do the trick.
(file/hard-link jar (io/file work-dir (get-name jar))))
;; There's a method to my madness here. Doing all the stable dependencies first
;; will create an intermediate image, and that might be cached across executions.
;; The snapshots are much less likely to be stable, and should come second.
(-> (cond-> fs
(seq stable) (add-files stable target)
(seq snapshot) (add-files snapshot target))
(add-resource work-dir)
commit!))))
I think there’s an issue with pod/resolve-dependencies. It must be caching some prior results, from when the Maven artifact existed, but doesn’t redo the work of downloading the file now that it is missing.
like i think it's best to leave maven cache alone, it's very complicated and it is shared among many systems that use maven
Normally this might not be a problem, since we don’t expect the files in the local Maven repository to change during the boot execution … but it’s a minor problem while I’m testing some things. And we may be in a case where one task does builds that moves artifacts into the local Maven repo.