Fork me on GitHub

@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.exedownloaded 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!


and this is a different step than downloading dependencies


you mentioned that this step also went wrong


or did that step succeed?


anyway, perhaps that step succeeded and it were only the deps that failed?


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.


where is this cacerts file located?


the downloading of the tools.jar isn't going through java


it is part of the binary


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.


The same should work with bb, since it's also going through java for maven/git deps


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 Wójcik08:05:17

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 I would love to have an option to pass :mvn/local-repo to babashka itself.


Nice hack :)

Karol Wójcik08:05:17

Yep 😄 That way if someone use add-deps in lambda context deps are not downloaded 😄

Karol Wójcik08:05:17

Btw I'm closing the issue Pods are distributed as a separate layer now. I will write a sum up in the issue.

Karol Wójcik08:05:56

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


I think 0.4 is appropriate indeed for the tasks feature

👍 3

Added another bb.edn, this time for building the website:

Jakub Holý (HolyJak)09:05:05

How to troubleshoot this, please?

user=>  (require '[babashka.deps :as deps])
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/ > Attempting download from > Connection reset [at <repl>:6:1]

Jakub Holý (HolyJak)09:05:36

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 :)

👍 3
👀 3

I also made an env task in our app tasks:

$ DRE_SCHEDULER_ENABLE=true bb env :dre :scheduler :enable
✓ env


@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?


@mike1452 you can make a repl task which starts (clojure.main/repl) and then debug


The next version will support bb --debug <task> which prints the task as it's executed before running it


you can try this from #babashka-circleci-builds

Jakub Holý (HolyJak)15:05:50

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..


you can get the home directory using (System/getProperty "user.home")


persisting in <home>/.config/.tool also works in Windows

❤️ 3

@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

👍 3

roaming profile in fact can be synced between machines, consider it the user directory that can move between the machines eventually.


I would personally pick LOCALAPPDATA


on linux/macos you could also respect XDG_DATA_HOME or XDG_CACHE_HOME


@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

👍 3
Karol Wójcik17:05:14

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?


The shell function does exit in case of an error


You can avoid this by writing (shell {:continue true} "ls foo")

Karol Wójcik17:05:00

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


I think I'll change it to that, so you can just keep REPLing


now shell has no exception if command fails ( {:continue true} is default, right?). this behavior is expected in my scripts.


shell will exit the babashka process if there is a non-zero exit code


if that doesn't work for you it's a bug


$ 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, onetom gave working recipe using vlaad/remote-repl

👍 3