This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-18
Channels
- # alda (6)
- # architecture (1)
- # bangalore-clj (3)
- # beginners (39)
- # boot (292)
- # braveandtrue (1)
- # cider (7)
- # clara (2)
- # cljs-dev (20)
- # cljsjs (9)
- # cljsrn (42)
- # clojure (127)
- # clojure-chennai (1)
- # clojure-dev (96)
- # clojure-india (1)
- # clojure-russia (175)
- # clojure-spec (56)
- # clojure-uk (11)
- # clojureindia (1)
- # clojurescript (82)
- # core-async (7)
- # cursive (21)
- # data-science (1)
- # datomic (173)
- # funcool (4)
- # hoplon (8)
- # instaparse (1)
- # jobs (7)
- # jobs-discuss (1)
- # jobs-rus (30)
- # lambdaisland (1)
- # lein-figwheel (8)
- # off-topic (5)
- # om (51)
- # onyx (79)
- # other-languages (7)
- # planck (8)
- # re-frame (95)
- # reagent (6)
- # rum (8)
- # specter (4)
- # untangled (54)
- # yada (5)
(deftask deploy-release []
(comp (build-jar)
(show :fileset true)
(push :gpg-sign false
:repo "clojars")))
this gives me "Return code is: 401, ReasonPhrase: Unauthorized"
am I doing something wrong? I'm trying to push a non-SNAPSHOT release
on the assumption that it's a clojars problem, I've added a clojar issue: https://github.com/clojars/clojars-web/issues/555
hm I just can't push at all currently
@pesterhazy: not sure if that’s the problem, but adzerk’s bootlaces uses “deploy-clojars” as the repo
oh it doesn’t matter at all, that’s just the name you give to the repository
¯\(ツ)/¯
Yeah that's what I figured
one thing you can try is not setting the env vars
and it’ll prompt you to insert the username and password in the CLI
it seems like “what pod does this task run in” is a fundamental thing you need to understand to make advanced use of any task
e.g., say I want to customize the classpath used by https://github.com/adzerk-oss/boot-test. How would I know how to do it?
I don’t see a way, other than reading the code for run-tests
to figure out how the pod is made
@anmonteiro, will try that
I'm trying to generate a namespace and then AOT in the same pipeline. Cannot seem to make it AOT, even though it's added to the resources
Looks pretty much like:
(deftask generate [] (with-pre-wrap fs (let [...] (-> fs (add-resource tmp) commit!))))
(comp (generate) (aot :namespace #{'my.generated-ns})
The fileset after generate
contains the .clj
file, I've verifiedok, this seems to be because it's the worker-pod
which actually looks for namespaces in input dirs
@anmonteiro, your comment led me to the solution
I didn't realize that boot proper (without bootlaces) doesn't honor CLOJARS_USER
Now I'm using
(set-env! :repositories [["clojars" (cond-> {:url " "}
(System/getenv "CLOJARS_USER")
(merge {:username (System/getenv "CLOJARS_USER")
:password (System/getenv "CLOJARS_PASS")}))]])
I wish there was at least a warning if you push
without specifying a :username
Building a jar (https://github.com/mjmeintjes/boot-react-native/blob/master/build.boot), but the jar doesn't contain any of the .clj
source files.
It only contains the resources
@pesterhazy: do you have them in source-paths
?
if so, that would be why. try adding to :resource-paths
instaed. source-paths doesn't have "output role" so is on classpath, but doesn't end up in jar
(it's good for e.g. java code, or .clj code you want to AOT compile)
(or cljs in an application)
that's ... surprising 🙂
@stuarthalloway: in any pod you can look at the boot.pod/this-pod
var, which is a WeakReference pointing to the pod you're in
@alandipert, of course that fixed it 🙂
@stuarthalloway: there is also boot.pod/pod-id
and boot.pod/pod-name
if you want to find a specific pod and manipulate its classpath you can find the pod you want by iterating over the keys of boot.pod/pods
and selecting the one you want by name (filter #(= "foop" (pod/pod-name %) (keys pod/pods))
then when you have a reference to the pod you can use with-eval-in
to add dependencies etc
btw pods will by default have their name set as the namespace that called boot.pod/make-pod
(like for instance the test pod should be named something like adzerk.boot-test
or something like that)
iirc boot-test uses a pod pool though, so if you wanted to manipulate the environment you'd need to be constantly tracking down and running code in pods
@micha that is all good to know. That said, having looked at the pod api is it easy enough that I think I will just make my own pods when needed
tasks will start with the dependencies of the core pod, and add their own deps to those when they construct their pod
I can also strip off the core pod deps if I want, right?
@alandipert: would there be a benefit to separating pod construction (or pod construction recipes) from tasks that use them. E.g. maybe I want a pod like (or almost like) the one in boot-test, but I don’t want to run a test
like with stateful transducers, you need to nail down your initial state in the construct phase
it seems like if you want to do something the task doesn't do, you need to make your own task 😄
i see the appeal of e.g. passing tasks the pod to use, but then you're fully responsible. since you must know that the task will still work
if you know that much already, may as well make your own thing that does exactly what you want
and since you've got pods and fileset to work with, it's usually not that hard
vs adding features to plugins in other build tools, where making your own plugin is a huge deal with at least hundreds of lines of code
(deftask foo
[]
(let [env (-> boot.pod/env
(update-in [:dependencies] ...))
pod (future (boot.pod/make-pod env))]
(fn [next-task]
(fn [fileset]
...
looks like you could also alter-var-root adzerk.boot-test/base-pod-deps
(deftask foo
[]
(let [env #(update-in % [:dependencies] ...)
pod (future (boot.pod/make-pod (env boot.pod/env)))]
(fn [next-task]
(fn [fileset]
...
but i think the second way is an anti-pattern and we should make PRs to fix tasks that work that way
there is also this issue https://github.com/boot-clj/boot/issues/468
I don’t (yet) see why I would want that kind of magic ^^ vs. just creating a pod with full control of what is in it
i think the spirit of the env
thing is moving in direction of a container for multiple apps using boot as entrypoint, not necessarily participating in any kind of build
if I am understanding how boot-test works, it demonstrates all I need
Just make a pod with an env you make explicitly, without touching or modifying the global env
use the global env as a basis if you want, or not
like consider a case where your project has a dependency that conflicts with something a task will add to its own local pods
you might want to eliminate that problematic dependency just for that task, so its pods don't have it
like if you're making a webapp and you're running boot-test on the backend code, and maybe something in google closure compiler conflicts
but the test task will still need other dependencies of your project to function correctly
I think “this” (how tasks reuse common things they might need) is orthogonal to two of the key benefits of boot: the pipeline and pods
I might use boot for the pipeline, give tasks I author complete and explicit control of the pods they make, and never/rarely participate in the classpath aspects of the shared env
the with-env thing is to make it easier to integrate other more general tasks into your own specific pipeline when your project is more complex
but yeah this is also my approach, it's easy to make specific tasks that do exactly what i want
I would add that given that the set-env!
is a mutable, one time only operation, sometimes you want the with-env
to pass info to tasks you are not in control of..the workaround to this in lambone is to call set-env!
as late as possible (and be sure only once) and have the main shared boot pod only contain the deps (for instance) necessary to the task downstream.
It works, but feels brittle a bit.
And I had to implement a custom show
for instance
On the other end, I apologize because I didn't have too much time to for the patch above, which would solve the problem
right, this is because you want to resolve your dependencies in one shot, rather than spread across multiple calls to set-env!
, because the dependency graph will be resolved differently
maven likes to have a full view of all dependencies so it can select the correct transitive dependencies when there are conflicts
Yes the one time only constraint I think is key here, I don't even know if there is a way for maven to incrementally resolve conflicts
because it doesn't know how the decisions it makes in the first dependency resolution will affect subsequent ones
once it chooses a specific version of some transitive dependency that's it, it can't change that for the second run
even if it would have preferred a different version given the info provided with the second set of depenedncies
and maven won't need to worry about it, because there will be no conflicts for it to think about
So you shift the problem to your side, mmm..interesting
Because I do conflict resolution manually anyways with with-cp
So I really could just say, hey maven, here it is the list, don't bother checking it :)
right it shouldn't be making any decisions if you specify which version of conflicting transitive deps you want
I am trying to read about the problem and I found a rant, still interesting, I did not know Buck: http://blog.ltgt.net/maven-is-broken-by-design/
i'll read it, but i am highly skeptical of anyone who says maven's dependency resolution is broken
You know that is actually not talking about maven resolution, I 'll explore deeper, don't waste your time on that ah ah
I also discovered jdeps
, which I did not know: http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012485.html
I like npm's dependency resolution. If that's what we're talking about. But it's requires Mr. Anderson for Clojure.
I was talking in absolutes really. https://github.com/benedekfazekas/mranderson exists though. Not sure how it's magic works.
but this is also kind of wacky because what if you have dependencies that pass objects to each other
now in your code you call the function in A that creates a Foo object of version 2.0, and you pass it to the B function that only know about 1.0 verison Foos
An interesting question would be how mranderson would work for package auditing
@micha is there a way in jt
to pretty print the input json ?
@richiardiandrea: i pipe to python -m json.tool
to pretty print, jq
also does it
the python one is nice since it's on nearly every system already
yeah I wanted to stick with your solution guys without installing the competitor jq
😄
yeah the python
option is cool
this is good task for me to study ML, wasn't it written in ML?
oh wow no it is C 😄
alias jpp='python -m json.tool'
will do for now 😄
ahah sorry Alan did not want to cut your speech 😄
when you see me typing i'm usually just fumbling with my window manager keys
lol! I just installed i3
-> tiling window manager, it is about time
yesss that's my fav one
so easy to configure and I was actually using jt
to hack some script 😉
luckily there are plenty of people who NEED i3 even after X
oh you guys, I am always discovering new cool things 😄
I should try Wayland soon now that I have HiDPI display on laptop and normal on desktop, X is horrible with different DPI displays
Though maybe I just fix this by buying 4k 28" display or something
And none of toolkits yet support proper scaling even with Wayland, I think
I don't know I was thinking of buying a bigger monitor but I am one meter from it and I am worried it will feel like I am in the movie theater in the front row
i don't really care about transparent windows or desktops or windows that wiggle like jelly
For one thing, it supports per display DPI
well, it doesn't automatically mean proper scaling but it is requirement for it
Qt, GTK etc. should also support scaling
They have quite limited support currently
I have a similar script
But when switching between 14" 2560x1440 and 27" 2560x1440 displays, all the texts are either huge or small on another display
@richiardiandrea: i have one of the big 34" wide curved monitors on my desk, i like it
yeah i remember with the x1 carbon, its laptop display was the same resolution as a cinema display, but only like 11" or so
it is not clear to me when I should make a pod vs. a pod pool https://github.com/boot-clj/boot/wiki/Pods
e.g., boot-test makes a pod pool that is lexically scoped to run-tests
, so it would be difficult/hacky for somebody else to share the pool. So why pool at all?
OTOH, I might make a pod pool that could be reused across many tasks, or across many invocations of (boot) at the REPL. In that case, I want a pool, but I don’t want to kill the pool at the end of any particular task or boo invocation. So can I just omit calling :shutdown
?
it's easy to leak pods if you make lots of them, and they're like 10M of memory sometimes
the test task appears to be making a fresh pool (not just pod) each time, so where does the pre-warmed opportunity occur?
where does one put code to make it have once-per-pipeline semantics
nevermind, I see it now, test use is once per pipeline
thanks @micha !
@micha hm, still not getting it. If I call the same task twice in one pipeline, that code will run twice, yes?
(deftask foo
[]
(println "Get per-pipeline resource")
(with-pass-thru [_]))
(boot (foo) (foo))
so if I e.g. use the test
task twice in one build pipeline, they don’t get to share, and are making two pools
where would I put the initialization if I want the pool to be shared, but killed at the end of the pipeline?
if they're going to be sharing some resource it seems like that resource will need to originate outside the task itself
yes, but I want the resource to be dependent on the environment established by a single pipeline
and scoped to it
I can make a globally scoped pod pool, or set of pod pools
you could put the pod pool on the fileset as metadata, and your task either uses it or adds it
or you could lift the pod pool to a def and do a promise/latch system of some kind
first-one-creates
@alandipert following that plan, can I :refresh
pods from the pool into a task, and then have the task call destroy-pod
sounds good to me
so the pool has bigger scope than build pipelines, and tasks tear off and manage pods from the pool
i can even imagine a system by which you have a task at the front that puts pods on the FS
and watches out for them on the return value of the subsequent task, destroying
but that introduces an ordering semantic i guess which is not as generally good
@stuarthalloway: the :refresh
message will destroy the pod for you and make sure it's GC'd
the weird message passing is there to make it simpler to use pods from the pool without keeping any references to them
@micha ^^ when the next pod is taken, right?
isn’t refresh wasteful on a brand new pool?
@stuarthalloway: there is also a :take
message that lets you gain ownership of a pod from the pool
@micha with a brand new pool, doesn’t :refresh kill a pod that nobody has ever had a chance to use?
and yep, already switched to :take
+ pod/shutdown
— seems strictly superior to :refresh
Is it possible to customise which files cause watch
to fire, possibly with a regex? Right now it looks like this is not possible.
The use case is I have a single project with both clj and cljs sources (e.g. :resource-paths #{"src/cljs" "src/clj" "resources"}
) and I only want watch
to fire when a cljs or cljc file is change (e.g. #"^.*\.(cljs|cljc)$"
).
have you guys seen-> https://github.com/enkore/j4-dmenu-desktop for i3
...speedy speedy fast!
oh wow
but there's a certain learning curve
Rofi also supports ordering the most often used entries top etc. (not sure about j4-dmenu-desktop)
no well j4-menu-desktop
is super basic
I am interested in the window selector though by regex on Class
or Title
Are there any people here who are using this: https://github.com/ladderlife/om-css with boot-reload?
this writes a css file as a output file from cljs compilation and this triggers another reload.. which basically breaks reloading 😞
Hmm while I am typing this I realize i maybe should just simply not set the output path.. 😛
@mitchelkuijpers I don’t think I ever planned for that to work with Boot 😇
@anmonteiro: it might work with the default out.css to the root of the project
it might. There might also be a way to tell Boot-reload not to reload a particular file?
or rather, the watch
task
I looked for it but unfortonately they don’t have this option
@juhoteperi you opened a whole new world for me, try: j4-dmenu-desktop --dmenu='rofi -dmenu'
or i3-dmenu-desktop --dmenu='rofi -dmenu'
(but way slower)
wonderful
@richiardiandrea: rofi -show drun
The drun switcher has not been enabled
@anmonteiro: I get a very weird filename main.outout.css
but it seems to work!
il simply sift it and then it works
@mitchelkuijpers the weird filename is probably a result of sifting 🙂
@anmonteiro: it is before the sifting, but it’s fine it works!
hello guys, having a problem here with source maps
dont work here when optimizations are set to none
found out, path is incorrect like
but should be
any clues what config could influence this?
@michael.heuberger I'm not understanding the problem or how it relates to source maps?
oh I see the double app.out
chances are it relates to the app.cljs.edn, can you post your settings?
@timothypratley settings … the build.boot
you mean?
yes but more likely ./src/cljs/js/app.cljs.edn
(or whatever you have similar)