This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-04
Channels
- # announcements (1)
- # asami (61)
- # babashka (71)
- # beginners (170)
- # biff (1)
- # calva (14)
- # clj-kondo (23)
- # cljsrn (28)
- # clojars (1)
- # clojure (152)
- # clojure-australia (2)
- # clojure-europe (65)
- # clojure-nl (2)
- # clojure-spec (8)
- # clojure-sweden (3)
- # clojure-uk (45)
- # clojurescript (1)
- # css (12)
- # cursive (16)
- # datomic (9)
- # devcards (2)
- # emacs (1)
- # events (1)
- # graalvm (31)
- # honeysql (10)
- # jackdaw (2)
- # jobs (5)
- # lambdaisland (9)
- # lsp (4)
- # malli (11)
- # meander (43)
- # off-topic (6)
- # pathom (7)
- # polylith (1)
- # portal (14)
- # re-frame (7)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (6)
- # shadow-cljs (101)
- # specter (1)
- # tools-deps (26)
- # vim (9)
- # xtdb (2)
@mike1452 That's cool, but I don't understand why deps.exe
saved you, since it contains the same logic as bb for resolving deps.
> After I added them into cacerts file, deps.exe started to download any deps.
So I suspect bb
will do the same then?
I think so, but I did not check yet.
And you didn't respond yet about the first step: getting the tools.jar on your system. How did you manage that.
After I configured settings.xml
and added certificates deps.exe
downloaded all jars for me.
Before it my .m2 was empty.
Yes, this is about dependencies. But before deps.exe
can download any dependency, it first must download the tools.jar!
you can check this if there is a %USERPROFILE%/.deps.clj
directory with the expected jar
I suppose that after I added corporate certs from CA to the cacerts file, deps.exe can access to Internet via proxy which has dynamic certs signed by root certificate from our CA. And error with PKI path verification disappeared.
cacerts file is located C:\Program Files\AdoptOpenJDK\jdk15\lib\security\cacerts
as I remember, that deps.exe somehow used it. It is the only reason I can see
@mike1452 The only explanation that I have is that the download of the tools.jar succeeded already before. Only the maven and git dependencies are downloaded by java and this was probably fixed by your cacerts in java.
Oh! I have Idea + Cursive. When I configured Idea for Clojure I pressed button to download jars from there.
this is the third step I made
yeah, but this is a different location than what deps.clj uses so this can't be related
(although I realize now that it could maybe use the same tools.jar if clojure is already installed, I'll make an issue for that)
Idea runs under JVM and this step downloaded jars
anyway, there are too many steps going on at once for me too follow. I need precise details of what is going on next time, it's all intermingled now.
@karol.wojcik Congrats on the new holy-lambda release. Note that this doesn't do anything anymore in 0.3.7: https://github.com/FieryCod/holy-lambda/blob/8747d72e4c1a8d7a842d4da392a8d95f9d15b453/examples/bb/babashka/component.example/bb.edn#L80
Thank you. I will adjust a template. Btw I didn't want to poke you around yesterday, so I kinda hacked babashka.deps/add-deps
https://github.com/FieryCod/holy-lambda/blob/master/modules/holy-lambda-babashka-layer/hacks.clj
I would love to have an option to pass :mvn/local-repo to babashka itself.
Yep 😄 That way if someone use add-deps
in lambda context deps are not downloaded 😄
Btw I'm closing the issue https://github.com/babashka/babashka/issues/801 Pods are distributed as a separate layer now. I will write a sum up in the issue.
I've just removed :log-level :info from the template. Thanks!
I think we have had good testing of bb tasks. Maybe it's time to make a stable release announcement sometime soon. I would like to urge everyone who cares to give it another spin so any design mistakes can still be fixed
Nice, will we have a new release (0.4 maybe?) soon? Just asking because I was going to update nixpkgs with 0.3.7 release, but if a new release is coming I think I will wait until it
Added another bb.edn, this time for building the http://babashka.org website: https://github.com/babashka/babashka.github.io
How to troubleshoot this, please?
user=> (require '[babashka.deps :as deps])
nil
user=> (deps/add-deps '{:deps {djblue/portal {:mvn/version "0.11.1"}}})
java.lang.NullPointerException [at <repl>:2:1]
this is thrown at borkdude.deps$which invokeStatic "deps.clj" 171
. babashka v0.3.4
More info: When I am offline, I get a different (and kind of expected) error:
> Could not find /Users/me/.deps.clj/1.10.3.822/ClojureTools/clojure-tools-1.10.3.822.jar
> Attempting download from https://download.clojure.org/install/clojure-tools-1.10.3.822.zip
> java.net.SocketException: Connection reset [at <repl>:6:1]@holyjak Could it be that your PATH
environment variable isn't set?
https://github.com/borkdude/deps.clj/blob/9e0ca8002cca486223a962c06865dbbe3bc1917a/src/borkdude/deps.clj#L164
oh yeah, that is it! I am running env -i
to solve some other issue. Thanks a lot
Another library compatible with babashka! This time the config library from my colleague we're using at work :) https://github.com/dunaj-project/crispin
I also made an env
task in our app tasks:
$ DRE_SCHEDULER_ENABLE=true bb env :dre :scheduler :enable
"true"
✓ env
https://gist.github.com/borkdude/35bc0a20bd4c112dec2c5645f67250e3#file-2-bb-edn-L29-L35@borkdude have you any video, how do you debug babashka tasks from the bb.edn file?
IDEA + Cursive doesn't treat the bb.edn
file as Clojure code. May be in Emacs I can eval and debug bb.edn
scripts?
The next version will support bb --debug <task>
which prints the task as it's executed before running it
Any tips for persisting data between bb invocations (Namely oidc refresh tokens) in cross-os manner independent of the current working directory? On osx/Linux I'd just put a file in ~/.config/mybbstuff but that likely doesn't work so well for Windows..
@holyjak you have two options which I would recommend ot you: use APPDATA environment variable for the roaming profile, for example $APPDATA\appname\tempfile or use LOCALAPPDATA environment variable if you want to avoid roaming profile
roaming profile in fact can be synced between machines, consider it the user directory that can move between the machines eventually.
Thank you!
@borkdude found useful the following way to develop and debug bb.edn
tasks
1. Run babashka nREPL by: bb nrepl-server
in terminal in project root
2. Run Emacs and open bb.edn
3. call cider-connect-clj to repl localhost:1667
4. eval (in-ns 'babashka.tasks)
to make current repl ns
5. now I can call shell
or clojure
functions from babashka.tasks
ns or run particular task by (run 'my-task)
and see result in terminal
The only downside of it is when shell
results in error. This will exit the process of nrepl 😞
I have no such behavior. If the shell fails it will not exit now. Maybe this was before v0.3.7?
Right. I have forgotten that I have my own implementation of shell which does that 😄
Maybe we can make shell throw an exception instead, but I don't know if that would help
now shell
has no exception if command fails ( {:continue true} is default, right?). this behavior is expected in my scripts.
$ bb -e '(babashka.tasks/shell "ls foo") (prn :bar)'
ls: foo: No such file or directory
[bb null] Terminating with non-zero exit code: 1
ah, sorry. My mistake. It works as you described.
but I will change this into an exception, which has the same effect, but works better in a REPL
I just found how to use Idea + Cursive without problems. See https://github.com/cursive-ide/cursive/issues/2452, onetom gave working recipe using vlaad/remote-repl