babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
djblue 2021-04-03T15:47:41.359Z

Just switched portal to using bb as my task runner https://github.com/djblue/portal/commit/39144dbe520783e18ec13440c70844b3c207d9b5. This is so much better than make, thanks @borkdude!

🎉 5
2021-04-04T08:46:21.368600Z

You might be interested in my https://github.com/turtlequeue/setup-babashka to install babashka in CI. This supports more platforms, you can pin the babashka version and it uses the github api to cache bb

👍 3
djblue 2021-04-04T19:41:50.372800Z

@nha Just switch to using your github action, thanks! https://github.com/djblue/portal/runs/2265646639

😎 1
wilkerlucio 2021-04-04T20:23:26.373200Z

same in Pathom 😁

😁 1
2021-04-04T20:37:35.373400Z

Happy to hear this! 😄

wilkerlucio 2021-04-04T22:22:37.373900Z

@nha about it, is there a way to use a development (from a branch) version of babashka? or plans to support it?

2021-04-05T13:14:10.384600Z

I've never used a development branch. How would I do this? I don't see why I could not support it. Feel free to open an issue @wilkerlucio

borkdude 2021-04-05T21:16:16.393100Z

Maybe you could support setting a custom download link? Then you could get a link from #babashka-circleci-builds to set up a development version. But note that circleci links are only valid for 30 or so days.

2021-04-05T23:15:42.396200Z

I see, I wasn't aware of these CI builds. Yes I can do that.

borkdude 2021-04-03T15:53:53.359200Z

Awesome :)

djblue 2021-04-03T15:57:04.359400Z

It was really nice how I could just directly require my existing scripts and just call them :awesome:

borkdude 2021-04-03T17:09:01.361700Z

@wilkerlucio let's talk in #babashka-sci-dev as this is currently heavily in progress and not something that's ready yet

👍 1
borkdude 2021-04-03T20:44:11.365Z

Note that portal only uses the bb -m foo/bar functionality, the :tasks thing might take longer before it's fully fleshed out

borkdude 2021-04-03T20:44:41.365200Z

but it's great that you are giving it a thorough try already :)

wilkerlucio 2021-04-03T20:45:31.365400Z

yeah, sure, that's why WIP 🙂 glad to keep testing it out until its fully shaped

borkdude 2021-04-03T20:46:13.365600Z

A few remarks:

(require 'tasks)
unfortunately you have to write (require (quote tasks)) because it's EDN

borkdude 2021-04-03T20:47:07.365800Z

and this:

(shell "PATHOM_TEST=true clojure -A:test:test-deps")
doesn't work like you expect, I think you need to prepend bash -c in front of it, since you are using bash syntax here

borkdude 2021-04-03T20:47:31.366Z

we could support (shell {:extra-env {"PATHOM_TEST" "true"}} ...)

wilkerlucio 2021-04-03T20:47:33.366200Z

gotccha, gonna change the test

wilkerlucio 2021-04-03T20:47:54.366400Z

about the require, I tested and it does work currently, is that something is going to change?

wilkerlucio 2021-04-03T20:48:07.366600Z

shell extensions look nice

borkdude 2021-04-03T20:48:28.366800Z

well, I'm surprised it works, let's put it like that, I'm going to try it myself soon

borkdude 2021-04-03T20:50:18.367Z

user=> (edn/read-string "(require '[clojure.set :as set])")
(require ' [clojure.set :as set])
user=> (eval (edn/read-string "(require '[clojure.set :as set])"))
Syntax error compiling at (REPL:1:1).
Unable to resolve symbol: ' in this context

borkdude 2021-04-03T20:50:46.367200Z

maybe sci accept its by accident

wilkerlucio 2021-04-03T20:51:49.367400Z

not sure whats different, but I can do:

wilkerlucio@Wilkers-MacBook-Air pathom3 % bb run format-check
=> cljstyle check src test

wilkerlucio 2021-04-03T20:51:55.367600Z

no errors

wilkerlucio 2021-04-03T20:52:53.367800Z

(and the log printing means its loading and executing my task fn)

borkdude 2021-04-03T20:53:43.368Z

ah, I see yeah, this works by accident, but this might actually be a feature

borkdude 2021-04-03T20:54:00.368200Z

since what happens: it's parsed as EDN but then it's printed back in an expression which is then evaluated again as code, I think