Fork me on GitHub
#babashka
<
2021-04-03
>
djblue15:04:41

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!

🎉 15
djblue15:04:04

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

wilkerlucio20:04:11

inspired by @djblue I'm also porting Pathom 3 scripts to go though babashka (WIP): https://github.com/wilkerlucio/pathom3/pull/34

pathom 6
🎉 6
borkdude20:04:11

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

borkdude20:04:41

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

wilkerlucio20:04:31

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

borkdude20:04:13

A few remarks:

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

borkdude20:04:07

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

borkdude20:04:31

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

wilkerlucio20:04:33

gotccha, gonna change the test

wilkerlucio20:04:54

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

wilkerlucio20:04:07

shell extensions look nice

borkdude20:04:28

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

borkdude20:04:18

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

borkdude20:04:46

maybe sci accept its by accident

wilkerlucio20:04:49

not sure whats different, but I can do:

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

wilkerlucio20:04:53

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

borkdude20:04:43

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

borkdude20:04:00

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

nha08:04:21

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

👍 9
djblue19:04:50

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

😎 3
wilkerlucio20:04:26

same in Pathom 😁

😁 3
nha20:04:35

Happy to hear this! 😄

wilkerlucio22:04:37

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

nha13:04:10

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

borkdude21:04:16

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.

nha23:04:42

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

borkdude17:04:01

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

👍 3