This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-10
Channels
- # beginners (61)
- # boot (264)
- # cider (125)
- # cljs-dev (3)
- # clojure (118)
- # clojure-gamedev (3)
- # clojure-greece (1)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-poland (3)
- # clojure-russia (38)
- # clojure-spain (2)
- # clojure-spec (17)
- # clojure-taiwan (1)
- # clojure-uk (42)
- # clojurescript (118)
- # clojutre (5)
- # cursive (24)
- # datomic (22)
- # emacs (3)
- # events (2)
- # figwheel (19)
- # funcool (1)
- # jobs-discuss (224)
- # jobs-rus (1)
- # klipse (14)
- # luminus (1)
- # lumo (49)
- # off-topic (51)
- # om (34)
- # pedestal (1)
- # perun (1)
- # planck (93)
- # powderkeg (1)
- # re-frame (15)
- # ring (4)
- # rum (9)
- # slack-help (3)
- # spacemacs (2)
- # specter (13)
- # uncomplicate (1)
- # unrepl (22)
- # untangled (10)
- # yada (36)
is there a way to install all dependencies in a build.boot
file but ignore the set-env!
call to source paths?
@anmonteiro don’t think that’s possible. Workaround could be storing these things in an edn file.
@thheller https://github.com/boot-clj/boot/wiki/Boot-Environment#env-keys this has some docs on :directories
basically boot creates a bunch of directories with different “roles” https://github.com/boot-clj/boot/wiki/Filesets#fileset-components
@thheller you never explained what you want to do so not sure what specifically to tell you? 😄
I filter all paths names resources
but they are not named resources
anymore in boot 😛
right because they’re on the classpath and the contents of resources are added to the classpath, as you sure know 🙂
so you want to get all files that originate from your resources
folder?
In boot adding compiled stuff to “resources” is sort of an anti-pattern
you said you don’t have access to boot.core or you do have access?
here is the wiki page about it: https://github.com/boot-clj/boot/wiki/Filesets
if you add the source paths after you add the jar then they will override the jar's things
don't worry about it .. I'm just used to lein
classpaths and noticed that boot looks different. doesn't mean it is wrong, just different
but I suppose there is no way to tell which path something like /Users/zilence/.boot/cache/tmp/Users/zilence/code/boot-test/n7q/mh5540
used to be?
which is a problem because then you need to keep track of which things the user owns and which things the build tool can mess with
it doesn't have to be target
, could be any directory really. lein
has a target
anyways so that is what I use
@micha shadow-build
/`shadow-devtools` compile CLJS and use the java classpath to locate CLJS resources (so anything compilation relevant)
the workaround for this is ignoring the resources
folder .. which I can't do in boot since the name is different
yeah its a bad habit anyways but every other CLJS tutorial seems to put everything into resources
😞
With Boot writing (with target task) to a path that is in resource-paths, would cause infinite loop with watch task
So I don't think it is very common with Boot
@juhoteperi I was looking into this https://github.com/tonsky/datascript/issues/206 from #clojurescript
Oh right, to classpath, not to a folder in resource-paths
Yes, it is common that Cljs results are added to classpath and it does indeed cause problems..
I like actually looking at generated sources but couldn't find where boots put stuff
~/.boot/cache/tmp/{path-to-project}/{boot-process}/{temp-dir-id}/path
doubt I can use the filesets, this is all intended to be build-tool agnostic so it works everywhere
need to read up on how this works in boot-cljs, that index.html
accesses main.js
in the same directory confused me
@thheller serve
serves files fromm classpath, both index and main.js are in classpath
boot-cljs adds the results to classpath
boot-cljs doesn't currently handle cache between processes
hasn't been problem for me as I don't restart boot
@martinklepsch thanks. looks like I didn’t need it anyway after all
I thought I did but that was just a symptom I was doing something wrong 🙂
@thheller Do you know if there is a good value to use for cache key for analysis cache? Perhaps the Cljs version? Do compiler-options matter, I think Cljs compiler should take those into account itself?
Boot does have cache-dirs, but using them requires a cache key: https://github.com/boot-clj/boot/blob/master/boot/core/src/boot/core.clj#L359
@juhoteperi the analysis cache depends on compiler options I believe
@juhoteperi it is more complicated than that .. in shadow-build I use the last modified timestamp of everything that was required to compile the file
for cljs.core there is also :optimize-constants
(shadow-build uses something else to automate that)
https://github.com/thheller/shadow-build/blob/master/src/main/shadow/cljs/build.clj#L1002 probably won't make much sense but maybe this helps
I currently do not account for any of the new stuff yet, so no externs inference etc
I've been thinking about cljs caching too. It's a hard problem to solve. Lein doesn't get it right. But it's a complaint I hear a lot, I'd love to have cljs caching on boot
@dominicm use https://github.com/thheller/shadow-devtools works fine with boot 😉
It's mostly just about inputs and outputs. So your devtools.edn should come from the source file set. You should create a temp folder and write to that. (This can be managed by the boot task)
hehe shadow-build actually always write everything to a cache folder, then does a flush
to write to the actual output dir
if it wasn't for the cache it wouldn't write anything until flush .. its all kept in memory
boot -d org.clojure/clojure:1.9.0-alpha15 repl
nREPL server started on port 56759 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.8
Clojure 1.7.0
BOOT_CLOJURE_VERSION=1.9.0-alpha15
I run this from the REPL most of the time but I guess I could write some boot tasks that set the required config parts
shadow-devtools
needs access to all dependencies since it must be able to require
macro namespaces
(with-pass-thru fs (doit))
;; same as
(fn [next-task]
(fn [fileset]
(doit)
(next-task fileset)))
(require '[shadow.cljs.devtools.api :as cljs])
(deftask cljs
[m mode VAL kw "mode (dev, once, release)"
b build VAL kw "build id (defined in shadow-cljs.edn)"]
(with-pass-thru fs
(let [{:keys [mode build] :as opts} *opts*]
(case mode
:dev
(cljs/dev build)
:once
(cljs/once build)
:release
(cljs/release build)
;; else
(throw (ex-info "invalid mode" opts))
))))
I guess deftask
is expected to return rather than actually calling the code directly? or is it fine to leave out the with-pass-thru
?
(cljs/dev build)
actually starts a CLJS REPL as well so that basically never finishes until the user exits
and does code reloading in the background, no idea how I supposed to hook that in the fileset stuff yet
just wanted something like that, sometimes you just want a :release
built without running REPL
(deftask runit []
(with-pass-thru _
(require 'my.namespace)
((resolve 'my.namespace/-main) "arg1" :arg2)))
I'll just use BOOT_CLOJURE_VERSION=1.9.0-alpha15 boot -r src/main -d thheller/shadow-devtools:0.1.20170410 repl
as an example for now
if you add dependencies with -d
boot will look for tasks and automatically require the namespaces
this PR would remove the need for a deftask for this kind of thing, if I understand you correctly @thheller: https://github.com/boot-clj/boot/pull/597
or at least make it a bit more convenient
@thheller I think you don't want a task that blocks forever: - the repl / boot cljs repl tasks do not. - check out boot-sass and boot-cljs for examples of tasks that know how to be called repeatedly
Anyone have any idea why I might be getting this rather opaque error message when trying to push a jar to clojars?
gpg: signing failed: No such file or directory
That’s it. That is the entire error message 😞This is the output from running boot build-jar push-release
Writing pom.xml and pom.properties...
Writing boot-tasks-1.4.jar...
Installing boot-tasks-1.4.jar...
Signing boot-tasks-1.4.jar...
Could not sign /var/folders/09/rhhm7hw51j396mljlvx22str0000gn/T/pom987689368313024651.xml
gpg: signing failed: No such file or directory
gpg: signing failed: No such file or directory
If you don't expect people to need to verify the authorship of your jar, don't set :gpg-sign option of push task to true.
clojure.lang.ExceptionInfo: /var/folders/09/rhhm7hw51j396mljlvx22str0000gn/T/pom987689368313024651.xml.asc (No such file or directory)
data: {:file
"/var/folders/09/rhhm7hw51j396mljlvx22str0000gn/T/boot.user190151716003145822.clj",
:line 29}
java.io.FileNotFoundException: /var/folders/09/rhhm7hw51j396mljlvx22str0000gn/T/pom987689368313024651.xml.asc (No such file or directory)
Not sure what that pom987689368313024651.xml file is anyway. It must be auto-generated by boot.
Could be internal temp file from push task, I think it writes some temp files for gpg
@kenny try something like gpg --sign anyfile.txt
perhaps the No such file or directory
is about missing gpg
executable?
Yeah, it is probably just the exception message from shell calling the command
Any idea how to correctly install gpg on a mac? I assumed brew install gnupg
would do it but apparently not
oh well, it does link to homebrew also
though it does mention gnupg2
is gpg2
available?
If so, you need to se BOOT_GPG_COMMAND
to gpg2
I think I used https://gpgtools.org/
Same here, for some reason you have to set it to gpg2
There's two versions of gpg. Instead of breaking backwards compat, they created gpg2. Some people use gpg1 without realising.
@dominicm this means though that we are only gpg2
compatible, and I could not find it anywhere in the doc (maybe it's just me)
@richiardiandrea probably! I think there's confusion in this area.
yeah true
https://github.com/franciscocpg/gopass/commit/ffc578d7f61defb55551ba6e80effa4794dc3f44 gross
https://superuser.com/a/655250 interesting, so the differences aren't in API, oops! I thought the default key type changed
https://lists.fedoraproject.org/archives/list/[email protected]/thread/LK4OC43LQROZV7NKXADBD3B2BKABOXOD/ RHEL seem to package gpg2 as gpg. Some distros won't do that ever though.