This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-06
Channels
- # aleph (2)
- # aws (3)
- # bangalore-clj (3)
- # beginners (119)
- # boot (263)
- # cider (13)
- # cljs-dev (16)
- # clojars (2)
- # clojure (114)
- # clojure-austin (1)
- # clojure-chicago (1)
- # clojure-finland (1)
- # clojure-france (24)
- # clojure-italy (6)
- # clojure-russia (28)
- # clojure-serbia (7)
- # clojure-spain (1)
- # clojure-spec (89)
- # clojure-uk (139)
- # clojurescript (216)
- # community-development (3)
- # core-async (135)
- # css (2)
- # cursive (31)
- # datomic (44)
- # emacs (15)
- # hoplon (2)
- # jobs (3)
- # lein-figwheel (14)
- # leiningen (2)
- # lumo (21)
- # off-topic (16)
- # om (7)
- # om-next (1)
- # onyx (53)
- # perun (9)
- # planck (15)
- # portland-or (29)
- # protorepl (2)
- # re-frame (32)
- # reagent (8)
- # ring-swagger (22)
- # rum (51)
- # spacemacs (4)
- # untangled (2)
if you put a library in a maven repo, it's polite to use :scope "test"
in your POM when you declare dependencies that are not needed in prod
which i think also causes some confusion when people start to look at scopes and doing stuff with them
ok, now i'm riily confused. scopes "don't do anything to dependencies you specify that are not transitive." ok that might be what boot means by scope, but it's not what maven means, and boot does depend, even if indirectly, on maven. no? with maven it's very clear (eventually) scopes are about classpaths, and maybe also about transirivity. thats my reading, anyway.
since the maven repo structure and POM is derived from maven the build tool, there are some things in there that are specific to building things with maven
oh, yeah, then the jars for each depenedncy in the transitive deps graph will be downloaded
once it's done looping though all your dependencies it will have all the POMs and all the jars
when building the tree of transitive deps it will ignore any dep with scope other than compile
ok. look, i love boot. but imho this is a really stinky wart. boot supports :scope in :dependencies. so where can i go to find out what this means? maybe im just stupid but maven seems the obvious place. now i find out that boot's :scope is a whole 'nother matter. i still luv boot, but i admit this is a little discouraging. maybe we can clarify this somehow in the docs? it seems like kind of a bigly deal.
use scope "test" if you are making a library that will be loaded as a dependency of another library or application, and your library that you're making has dependencies that are not wanted in prod
fwiw, if anything other than "compile" and "test" is meaningless, the boot should throw an exception in thise cases. nothing worse than a silent error.
or, alternatively, you can just forget about scopes entirely, and provide a :dependencies
vector to the pom
task when you make your libraries POM, and just don't include any dependencies that are not wanted in prod
yep, I think that using boot-cp
is a must for big uberjars
@micha talking about maven, yesterday I added :parent
to pom
, and I was wondering if you are planning a release soon-ish (there a bunch of very good PRs in there) 👼 👼 👼
oh tomorrow would be great, some PRs have been reviewed by me, Martin, Brent, others...
Also I left the relativePath
out of :parent
as we might not need it at all...but I wanted your opinion on splitting task args this way: https://github.com/boot-clj/boot/pull/579/files/f0aa92b7ebc4d1ae6ce9fdf5314052b501427658#diff-a4c54fc631a18b940822c4cc9a9251e1
I mean the code (and tests) is in, the option not there
yeah I know
I'll check, you confirm it should work right?
@micha: dammit, you guys are so far ahead of me it makes me puke! i'm beginning to grok the wisdom of boot's handling of scopes. even if boot ignores :scope "provided" (or whatever), it's still there, so i can write my own "prod" task, and filter stuff on :scope. yeah?
@mobileink sure, or you could even make your own key
i think you want to be careful about what you put into POMs that you will upload to a maven repo
like to not interfere with maven users, for instance, who want to use your library as a dependency
i guess the important thing to know is that scopes are hints for aether to know which dependencies to prune from the transitive dependency tree
I started testing alternative way to serve files during development, which fixes problem with clojure.tools.namespace & cljc files in cljs output and only serves files with output role: https://github.com/Deraen/saapas/pull/15
@juhoteperi the idea is for sure interesting, are you then adding tmp-dir
to the fileset
?
Idea is that the output files are not in fileset or classpath after this task
ok so basically it is writing on a "normal" folder, without fileset enhancement
so no caching (but it might make sense if the compiler caches) / no immutability
Hmm, it uses the Boot filesystem utilities to write files to the output directory
So it should be efficient
The same as target task
And this doesn't affect Cljs caching at all, because Boot-cljs keeps compiler state on it's own tmp-dir
yeah, this is what I meant, it is effectively executing the compile in a "normal" environment, as if it was launched from a build.clj
(it might actually solve some slowness I have noticed in boot-cljs
)
No, this doesn't affect boot-cljs at all
It works the same as always, this only changes how application can access the output files
Due to how I constructed pipeline and the middleware, other tasks never know anything about catch-output
k I will explore the patch better
just gave a shot at another thing that has bothered me for long time: the sift
output 😄 Now it is only dbug*
and more meaningful 😄
hi there, I'm trying to compile some sass files with boot-sass
on my project, one of the file references my node_modules
directory at the root of the project, does Boot has access to files outside of the source-paths
and resource-paths
?
no, and I wouldn't recommend adding node_modules to the source paths as that directory contains a ton of files (and boot automatically watched source directories for modifications)
not sure how to do what you're trying to accomplish... copy the files from node_modules to your repo?
absolutely not intending to add node_modules to the source-paths 🙂, yeah not sure how other people do it, I have seen mentions of people using Webjars but I’m not sold yet
@ska, for open source projects?
@pesterhazy in this particular case, no. I am basically looking for a boot replacement for the maven release plug-in. And I am aware that there is criticism for that plug-in, so maybe in boot-land it is just not considered worth the effort?
Boot comes with push
built in: https://github.com/boot-clj/boot/blob/master/doc/boot.task.built-in.md#push
could that be sufficient?
N.b.: I don't know the requirements of working in a shared java/clojure environment
@pesterhazy I would expect the basics like remove SNAPSHOT, commit, tag, push, increase version number&add SNAPSHOT again, commit.
Ah I see
There is bootlaces
I built my own functions for this
But I can see automating this could be useful
@ska i wish i could remember who made it, i am 50% sure it's @flyboarder ... but there are some boot tasks for manipulating versions and whatnot for release
@juhoteperi That looks very interesting should this make it possible to start seperate tasks to compile cljs, because that seems very helpfull
@mitchelkuijpers That is possible using similar approach, but is not my goal
And that won't work with Boot-reload
Or well, it will work it the reload is on same pipeline as cljs
Ah sure that makes sense, what is the problem then that it solves?
The PR lists three problems it solves
Ah will read that thank you
When working on boot proper (specifically built-in task), I make a change, make install
to a freaky version (like 2.7.999) and the use BOOT_VERSION to try it out. Is there quicker way?
@pesterhazy usually i will prototype things in a separate namespace first
ah and then try it out using (boot...)
yeah that's understandable
I've opened a RFC PR, curious what people think: https://github.com/boot-clj/boot/pull/582
A bare repl is useful for quick experiments, for debugging (to rule out nREPL-releated problems), for direct tty access and probably other use cases
At times point I was actually using cider.diet
: https://github.com/kovrik/cider-diet/blob/master/src/cider/diet.clj and front a task for it. An nrepl non in a pod is definitely useful
I wonder how slower would it be with the middleware
cider-diet looks interesting as well
Yeah it basically does the same thing as you do, plus requiring cider.nrepl
I was using it with this: https://gist.github.com/arichiardi/86ccc450e243e9964e723d73f2f1db2c
why do you spawn another java process?
Good question , I should not do it 😀
I thought that it might be a neat idea to make a fast-repl generator task
that spits out ./quick-repl.sh
, which contains java -cp contents-of-boot-cp clojure.main
or something like that
so you can run that, and it should be quicker
Ahahah yeah good idea
still, usability is not amazing
if you change your build.boot you need to remember to re-generate your quick-repl script etc
But you probably need a bash generator
Yeah that too
well it's just a single line #!/usr/bin/env bash\njava -cp $CP ...
two lines 🙂
It was a quick hack to see if things were faster, but I should make a boot task
No yes but if you have a boot generator you pay the cost of starting the JVM...probably a Lumo script that could read a file with the dependencies and spawn a shell process would be ideal
Just thinking aloud 😀
hmm I'm a bit skeptical about being able to read build.boot
from lumo
it's clojure code, not a declarative list of dependencies after all
Yep no that would be hard, you would need to use edn for declaring your conf, like https://gist.github.com/arichiardi/7e4c430ff4ead706392f22e77c85b16a
I have a macro which parses and creates boot tasks
Fr;m edn
It would be the same but spawning a process
does anyone have a boot electron tempalte I can use? I have tried the frist two "clojurescript electron" github repos, but getting ewird errors
boot is loading the wrong version of cider-nrepl. I followed all the instructions on the wiki, specifying [cider/cider-nrepl “0.14.0”] in my ~/.boot/profile.boot, but 0.13.0 is getting loaded.
@mobileink how are you specifying it in profile.boot?
(deftask cider "CIDER profile" [] (println "FOOBAR") (require 'boot.repl) (swap! @(resolve 'boot.repl/default-dependencies) concat '[[org.clojure/tools.nrepl "0.2.12"] [cider/cider-nrepl "0.14.0"] [refactor-nrepl "2.2.0"]]) (swap! @(resolve 'boot.repl/default-middleware) concat '[cider.nrepl/cider-middleware refactor-nrepl.middleware/wrap-refactor]) identity)
sorry, the dissappeared, it actually says *default-dependencies and default-middleware
(deftask cider "CIDER profile"
[]
(println "FOOBAR")
(require 'boot.repl)
(swap! @(resolve 'boot.repl/*default-dependencies*)
concat '[[org.clojure/tools.nrepl "0.2.12"]
[cider/cider-nrepl "0.14.0"]
[refactor-nrepl "2.2.0"]])
(swap! @(resolve 'boot.repl/*default-middleware*)
concat '[cider.nrepl/cider-middleware
refactor-nrepl.middleware/wrap-refactor])
identity)
when i run cider-jack-in I get:
Starting nREPL server via /usr/local/bin/boot -d org.clojure/tools.nrepl\:0.2.12 -d cider/cider-nrepl\:0.13.0 cider repl -m cider.nrepl/cider-middleware -s wait…
wait, in both cases I get
;; Connected to nREPL server -
;; CIDER 0.14.0 (California), nREPL 0.2.12
but with cider-connect I get the notorious
WARNING: CIDER's version (0.13.0) does not match cider-nrepl's version (0.14.0). Things will break!
. so i guess i can ignore that warning?Starting nREPL server via /usr/local/bin/boot -d org.clojure/tools.nrepl\:0.2.12 -d cider/cider-nrepl\:0.13.0 cider repl -m cider.nrepl/cider-middleware -s wait…
@mobileink I have pushed a couple of patches to the new cider, you might want to use 0.15.0-SNAPSHOT
, basically you don't need the cider task anymore
so you will see a different Starting nREPL
line...if you don't like to upgrade. Make sure the cider-nrepl
version in the cider
task matches the version installed in your emacs
the Starting nRepl
line includes a -d
option with the version of cider
that your emacs is including
where is it getting that? must be some cider config var, i haven’t set it to 0.13.0, that I know of.
anyway it seems to be running, I’m just going to ignore the warning until something breaks.
@juhoteperi I'm having a problem where boot-reload
doesn't seem to be reloading the Clojure namespace where my macros are?
is this possible?
@mobileink there is no way to set a different version at the moment, it is baked with the cider
package
@anmonteiro Boot-reload doesn't reload namespaces, Boot-cljs does that. Boot-reload only cares about changed JS files.
OK wrong package, same bug? 🙂
@mobileink yep see above cider-nrepl
has to be the same version as the installed cider
Well, it should work, but there are probably some corner cases with cljc files or such
https://github.com/boot-clj/boot-cljs/blob/master/src/adzerk/boot_cljs/impl.clj#L127
You can try verbose mode to check if that code correctly sees the changed namespace
this is a cljc file
which requires its own macros
It is possible that ns-tracker get's confused if there is cljc namespace which both is cljs namespace and macro namespace
I think only c.t.n 0.3 alpha supports this and ns-tracker is still using 0.2.11
But checking debug output should be good place to start checking if the problem is with reloading the clj namespace, or with cljs not recompiling dependent namespaces
@richiardiandrea @micha: the secret is to delete and reinstall the cider emacs package. then you can use the latest matching cider-nrepl (0.14.0)
@micha what do you use nowadays for calling stuff in separate classloaders? I am in a maven plugin and I am evaluating if I want classlojure
or dynapath
I would like to execute clojure without having to specify deps in maven
so the plugin will inject deps
I have seen https://github.com/ninjudd/classlojure does that
yeah true
ok thanks! I'll try that
@micha I ended up using boot.pod
in the deps, now I am trying to create a pod with clojure in it
yeah definitely something weird with the options :pom {:parent {'org.sonatype.oss/oss-parent "5"}}
fails with java.lang.IllegalArgumentException: option :parent must be of type [sym str]
hello folks - is there a recipe how to run CLJ and CLJS tests both within a single boot task? have here clj namespaces in an env folder, and cljs namespaces in a src folder.
I'm having this issue where org-tangle is creating a temporary file .#main.cljs -- and when this file is deleted, boot throws an uncaught exception
never mind, got it working now by using CLJC files
@qqq the filesystem is not transactional so there are all kinds of issues that can't be fixed by boot there
the best thing to do is to have editors and stuff keep their lockfiles or whatever in another place
is there a way to wrap the (comp (watch) .... ) in a "just restart everything instaed of killing the jvm on error" ?
watch does what you want, except instead of restarting stuff when an exception is raised, it does it when something changes
just running a repl is a uch better solution; I got way too carried away with my elisp ide