This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-27
Channels
- # aws-lambda (3)
- # beginners (3)
- # boot (327)
- # capetown (2)
- # cider (156)
- # cljs-dev (368)
- # cljsjs (13)
- # cljsrn (53)
- # clojure (403)
- # clojure-czech (5)
- # clojure-dev (4)
- # clojure-greece (2)
- # clojure-russia (72)
- # clojure-spec (12)
- # clojure-uk (129)
- # clojurescript (156)
- # core-async (1)
- # cursive (33)
- # datomic (35)
- # emacs (10)
- # events (1)
- # hoplon (4)
- # jobs-discuss (3)
- # klipse (1)
- # lein-figwheel (14)
- # leiningen (5)
- # luminus (5)
- # off-topic (15)
- # om (69)
- # om-next (2)
- # onyx (2)
- # parinfer (15)
- # perun (12)
- # re-frame (30)
- # reagent (7)
- # ring-swagger (8)
- # spacemacs (10)
- # specter (6)
- # untangled (69)
- # yada (13)
they don't really work the way you'd expect though, so maybe there are unfortunate design decisions in the maven repo system
Right. We’ve had this discussion before. Unfortunately that doesn’t work well for our company because we iterate on code very rapidly. It is very easy to forget to increment the version number causing us to run out of date code. The snapshot system would work perfectly except for the the way the local install works. If you locally install a snapshot it seems to override any snapshot with a timestamp in the name.
I was thinking about writing a custom install
task that manually sets the jar name to have the timestamp but I’m not sure if that would solve the problem
how could your local snapshot have a timestamp older than a snapshot you previously downloaded from a repo?
The problem is that if you ever do boot pom jar install
then even a week later that old non-timestamped SNAPSHOT jar would override the latest timestamped SNAPSHOT jar pulled from the repo
your local version could be like :project 'my/dependency :version (str "1.2.3-" (System/currentTimeMillis))
your local version could be like :project 'my/dependency :version (str "1.2.3-r" (System/currentTimeMillis))
i think nobody in maven world wants to support SNAPSHOT versions very well, it may actually be impossible
i believe the timestamp business on the SNAPSHOT jars in the repo is an implementation detail basically
Well, the main problem with that is then I’d need to update every dependent project with the latest version. Using RELEASE isn’t ideal because it’s possible there is a later version of the code pushed to the repository
Yeah totally but I think our use case is kinda unique. We are a small team with ~100 libraries, all of which are pretty much always changing. We always want the latest version of the code, even if it is broken, without needing to update 10+ projects to the latest version number.
We are using S3 for our repo so that’s already a thing. The problem is there is no way to pull them down
There is a special version "LATEST"
I don't think the star is a thing
Yeah, we talked about LATEST but for the reasons I mentioned earlier, it won’t work for our situation 🙂
Yeah, with [
and )
type stuff
Sorry, reading from the end
Version ranges are broken in some weird subtle ways
”[0.1.0,)"
should do what you want.
Aye, best to avoid them if you can — “here be dragons!"
This page has examples of Maven-compatible version ranges: http://maven.apache.org/enforcer/enforcer-rules/versionRanges.html
I've been getting notifications on this one for better part of a decade https://issues.apache.org/jira/plugins/servlet/mobile#issue/MNG-3092
Hmm, not sure if version ranges will actually work because I don’t want the latest given a lower bound — I want the latest of an exact version, regardless of the timestamp/patch
i think if you avoid version ranges in transitive dependencies it should eliminate most of the pain
remember that the :dependencies
at the application level will override transitive dependencies
You can use an open range like [0.1.0,) I think
Oh wait, I think [0.1,0.2) would include 0.1.* < x < 0.2.*
, where the third number is the timestamp
Or [0.1.0,0.2.0)
Actually I bet I could write a super awesome wrapper around set-env!
that replaces snapshot versions in our group with the correct version range
TBH, that’s what I was thinking. It’d be transparent and it wouldn’t require a huge code change
Again, special situation 🙂 None of this code is ever “production” code. It’s mostly research stuff
you can use it to set up the classpath from a file of jar paths, like the -cp
java option
with 100 of your own jars all at the bleeding edge i imagine you're pretty careful about changing transitive dependencies
like if the 100 jars depend on 10 different versions of some OSS artifact that would be terrible
so given that you need to coordinate anyway, the maven dependency resolution machinery is maybe less of a win
at least you have a few options to make things easier, not sure if they are good options 😉
Well, the version ranges sounds easier. We just need something that works without spending weeks trying to implement a custom maven 😛
If that doesn’t work then I’ll look into doing something like that. I’d be curious if we could come up with a more stable (is that the right word? 😆) version of Maven
alan pointed out that it's an easier job for them though, since it's a distro and all packages are vetted for compatiblity with each other
@micha @alandipert I’d like some enhancements to boot-test
to mirror functionality in boot-expectations
— specifically, options to specify the Clojure version, a startup function (to be called before any tests are run) and a shutdown function (to be called after all tests are run). Are you happy to take a pull request?
@seancorfield that sounds great
(I notice that you also have —exclusions and —filters but they don’t work the same way boot-expectations
‘s —include and —exclude options do…?)
I’ve had a few problems with apt-get
in the past. Maybe it was a user error, but I remember I had to uninstall ubuntu-desktop
which also caused my linux headers to get removed as well.
(doc target) // talksa bout :dir #{str} my question: is the same file writen to every directory in that set ?
@micha PR sent for that… It would be real nice if boot-test
had regex-based include / exclude options like boot-expectations
too but I suspect I can use the filters option instead…?
Hmm, that seems to be for filtering Var
s, not namespaces… OK, so how would I actually use —filters
? I see it takes an EDN expression… and the filter function is passed a var-under-test…
@seancorfield I wanted to add those as well, then tried boot-alt-test
and the speed is way way better as it does not run them in a pod. And I have never looked back basically.
Yeah they are missing
Well, I need the pods for testing with different versions of Clojure I think?
Ah yes in your case it probably makes sense true, my use case is more boot watch test
Sorry yeah I forgot about that case
I tend to do boot watch expections -i #”some-regex”
to just re-run expectations for the namespace(s) I’m interested in and that works great.
Maybe I’ll see if @micha and @alandipert are interested in -I
/ —includes
and -X
/ —excludes
regex-based options for filtering namespaces like boot-expectations
has? That would be my preferred approach.
(although I did get -f
/ —filters
to do what I wanted: -f '(re-find #"expectations" (str %))’
but unfortunately it still requires every namespace in my project and I only want a subset loaded!)
I added a comment to that issue. We’ll see what they say.
(my motivation for this is that I’m adding clojure.test
compatibility to Expectations and so I’m looking at how that changes our build process)
hello, where does boot-cljs compile the files, I can't find the js result so I can serve in my ring server
@vinnyataide You probably need to specify target
as a task so that generated files are written back to disk?
@seancorfield hello sean! So I put my target path the same as the resource folder that ring is serving right?
@vinnyataide it "materialises" on the fileset and if you want to serve it from there you usually use boot-http
I made a route in compojure, since I'm using my own http server I can't work with boot-http
maybe with CORS that could work, I'm trying to make my system as trivvial as possible http-wise, I'm gonna rely more on sockets to build a webapp
I'm thinking that compojure is adding some unnecessary layer but whatever
Yeah well boot-http accepts a handler as well, so you might want to pass your handler...Or if you want to use your own server for serving files the clojurescript stuff should be in resource so you can try using
to return it from some handler
does anyone know how to set “—namespaces” for test-cljs from command line? I need to pass multiple namespaces. this doesn’t work: boot test-cljs --namespaces [”baz" “bar”])
the actual problem is: it seems you can tell it to run specific namespace, but then it fails (because that namespace with the test depends on other things). So how do I tell it to include everything, exclude all the tests, except the one I want to test?
so to pass multiple namespaces you can simply use the --namespaces
option multiple times
the --help
docs for that option should say something like -n, --namespaces NS Conj NS onto the set of namespaces to test.
so how do I do the exact thing? still a bit not clear to me. I want test-cljs to run for only one namespace, but when I tell it so like this boot test-cljs —namespaces “.*foo-test.*”
, for some reason it’s failing, I can’t figure out why. When they run together it’s fine
so I thought maybe I just exclude all the tests include add foo-test, can’t figure this either
I have test.check.clojure-test/defspec in the test file, when I run test-cljs with no params - it’s fine. when I run telling it —namespaces “^.*foo.*$”
it complains
ERROR: Invalid :refer, var clojure.test.check.clojure-test/defspec does not exist in file
I completely deleted /Users/pupeno/.boot/cache but when I run boot package, it looks like it’s not re-doing previous tasks that are needed now that the files are gone.
What’s the proper way to clean a project in boot?
@pupeno there’s no such thing as cleaning since state isn’t carried over between boot invocations
@pupeno can you describe you problem at a higher level?
@martinklepsch Sure. when I run boot package, the first thing I should see is the download of the package, but it jumps straight into minimizing js and css: https://github.com/pupeno/packages/blob/react-toolbox/react-toolbox/build.boot
For example, I’m not seeing the output of running npm.
I used to.
@pupeno try commenting out the println
lines inside the comp
@pupeno you can’t compose nil
🙂
What the comp
does there is constructing the task pipeline. It’s not actually being ran at that point. So your printlns will also print at the “construction time”
Right… I missed that. Thanks.
you want to print when the build pipeline reaches a certain stage you’ll need to use something like this:
(with-pass-thru _
(println “Reached level 9000”))
It’s working now.
Great! Thanks for packaging something! 😊
Another noob question...Writing react-toolbox-1.3.3-0.jar… where is it?
@pupeno somewhere in boot/cache — you can use target
to have it dumped into target/
or install
to have it installed into your local .m2/
Thanks.
@martinklepsch I’d rather not do that as it goes against cljsjs style, but do you know how I can just manually install it?
into .m2
@pupeno not sure I understand the question, is the install
task not doing that?
I don’t want to add an install task
because you don’t want to add it to the build.boot file?
Correct.
tasks can be composed in build.boot or on the CLI so you can just do boot package install
I’m just following the style cljsjs seems to have.
Ah… let me try that. Thanks.
(I’m sorry, I’m very new to boot)
Have you seen this? https://github.com/cljsjs/packages/wiki/Creating-Packages
And then I forgot about point 7.
I’ve been stuck in point 6 for days.
Sorry about that 🙂
I will need nevertheless to copy that jar to another machine and manually installed into the .m2 repo
gotta do what you gotta do 😄
right now in ./target/... it only dumps class files for (1) my clj files and (2) parts of libaries my clj files depend on
================== Is there an example of how to use watch? I've read (doc watch), and I tried sticking it as
(comp
(watch)
... rest of my task ...
)
but it compiles once, then it ends; I want a "watch task" which infinite loops, watiting for changes, then recompiling@micha: (re uber): so I'm using the gae dev server, which needs stuff to be in the war/WEB-INF/classes directory -- is there a way to "copy the jar" without "explding it" -- gae was complainig about being unable to find clojure/lang/Var until I "exploded the clojure classes" in it via (uber)
@micha: for wars, do I have to "exlode the jar" via uber, or can I just somehow copy the jar over and point to it?
Hey everybody.. for those that use boot + CIDER to do ClojureScript + Clojure development I just wrote a technical study on setting up a Dual CLJS + CLJ REPL Big thanks to @martinklepsch and @clfeming for helping out! Please take a look and suggest improvements! https://github.com/tmarble/tenzing3
@micha: yeah, read through that, unfortunately, :as-jars true prepends some hash to the jars, which the war then has problem picking up on
@qqq how so? why would it care about the jar file name, it should just be on the class path
the application should just be loading classes, whose names are not related to the jar file name in any way
@tmarble funny because two days ago I contributed a patch for fixing cider-jack-in-clojuriscript
in cider ;) https://github.com/clojure-emacs/cider/pull/1928
So now basically what you have to do is just to change cider-boot-parameters
to point to the dev
task
@richiardiandrea ooh.. .i'll look at that. FWIW I set my cider-boot-parameters
to cider-boot
that can be customized in each build.boot (as to avoid twiddilng the customization every time)
@richiardiandrea do you have any example projects where you show how you use (in your workflow) cider-cljs-boot-repl
?
Separately it seems to me that wrap-cljs-repl
injects a call to weasel.repl/connect
which works in Cursive, but not in CIDER due to either
1) there is no "default" multimethod on handle (causing the application to crash) https://github.com/adzerk-oss/boot-reload/blob/master/src/adzerk/boot_reload/client.cljs#L35
and/or
2) timing (the nREPL may not be set up to send the proper (:type msg) ??
I'm reading boot --help , but I don'ts ee an option for this: is there a way to speify a different location for build.boot ? i.e. I want there to be a server.boot and a client.boot and tell different boot sessions which one to use
you can also use "flavors", as @richiardiandrea does
@micha: I'm sorry, I have no idea what "flavors" and " @richiardiandrea " means
at the bottom of boot -h
thre are a bunch of env vars listed, the one you want to specify alternate boot file is BOOT_FILE`
ie BOOT_FILE=client.boot boot foo bar baz
@alandipert : ah, thanks!
@qqq this:
$ boot -e flavor=client repl
nREPL server started on port 39654 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_91-b14
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from : [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
boot.user=> (get-env :flavor)
"client"
@tmarble mmm I have basically the standard set up boot-reload
and boot-cljs-repl
for that and no crashes. I actually use the super alpha boot-figreload
but OK one thing at the time
or:
$ FLAVOR=client boot repl
nREPL server started on port 35713 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_91-b14
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from : [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
boot.user=> (System/getenv "FLAVOR")
"client"
With that in place I just tell cider to launch my dev
and as micha always says, it just works 😄
Ah yeah the above are "flavors" 😁
@micha: just to clarifyk you're saying "instead of client.boot + server.boot", you can just ahve a single boot.build, and have it run different stuff based on the "FLAVOR" ?
I was using boot -e flavor=prod blabla
but it is similar
@richiardiandrea so the questions is... in your *.cljs do you specifically call weasel.repl/connect
as shown here: https://cider.readthedocs.io/en/latest/up_and_running/#browser-connected-clojurescript-repl
@tmarble no, that is done by the boot tasks internally
you can also make tasks:
(def flavor (atom "server"))
(deftask client []
(reset! flavor "client")
identity)
(deftask server []
(reset! flavor "server")
identity)
$ boot client dev
@richiardiandrea wow I wonder why I'm having trouble with it? do you have any smallish CLJS apps I could use to try to reproduce?
@tmarble the project at the end should work but for the cider PR you have to checkout my branch or wait for the merge: https://github.com/arichiardi/figreload-demo
You will also see an update in the docs you were pointing to
you know those elephants, that as babies, were tied to immovable objects -- and then as grown ups, they have "learned" that plain rope has "infinite strength" -- going from lein to boot is a bit like that, seems so much of the obstacle is unlearning "this is impossible to do"
Hey @micha @alandipert — I sent two separate PRs for the additional options on boot-test
and noted that if you apply either one, the other likely won’t apply cleanly (the conflict is easy to resolve). LMK if you’d prefer a PR for both sets of options together — or if you have objections to either PR and want changes.
I’m slowly converting our Expectations suite over to the new clojure.test
-compatible defexpect
format so we’ll be using boot-test
heavily soon (and will no longer be using boot-expectations
, but I’ll continue to support it).
@seancorfield are they both backward-compatible? is so, a single patch is easiest
and i would have no qualms merging
Cool. I wasn’t sure you’d be as open to the include/exclude regex options as the Clojure version and startup/shutdown options.
i'm game. i kind of regret the current filtering thing
but it's cool, we can 'fix' it by adding better things
Combined the two PRs and closed the old include/exclude one.
@alandipert: thanks for the merge -- will a 1.1.3 release be made?
i think 1.2.0, workin on it
ok boot-test 1.2.0 is out 🍾
thanks for the cool additions @seancorfield