babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
Jakub Holý 2020-12-16T12:04:32.336300Z

@borkdude Hi! Shouldn't https://github.com/borkdude/deps.clj/blob/master/resources/DEPS_CLJ_RELEASED_VERSION be changed to 0.0.11 since there is a release for that version? Also, which version of #tools-deps does which version of deps.clj correspond to? (I am trying to track down a problem with :extra-deps ). Thank you!

borkdude 2020-12-16T12:05:54.336600Z

@holyjak sorry about that, changed it

❤️ 1
borkdude 2020-12-16T12:06:12.336900Z

deps.clj currently depends on the newest. you will see this with -Sdescribe

Jakub Holý 2020-12-16T12:06:51.337200Z

thank you!

borkdude 2020-12-16T12:09:06.337700Z

@holyjak Note that deps.clj comes bundled with babashka since the latest release (0.2.5 released a few days ago)

👍 2
Jakub Holý 2020-12-16T12:16:46.338400Z

hm, the 0.0.10 install script https://raw.githubusercontent.com/borkdude/deps.clj/master/install is failing for me on AWS linux: > 3: set: Illegal option -o pipefail

borkdude 2020-12-16T12:17:23.338600Z

they don't allow you to set -o pipefail?

Jakub Holý 2020-12-16T12:18:04.339Z

So it seems. I am running via sh ... perhaps that is the cause ...

borkdude 2020-12-16T12:18:25.339200Z

because you have no bash?

👀 1
Jakub Holý 2020-12-16T12:30:25.339500Z

no, sorry, I can use bash. My bad!

helios 2020-12-16T13:17:29.340200Z

I feel i already asked, but is there already some documentation in shipping a self-contained binary? (i.e. BB + my script)

borkdude 2020-12-16T13:18:49.341200Z

@helios this came up recently. https://clojurians.slack.com/archives/CLX41ASCS/p1608045575304800 tl;dr: no, bb doesn't support this because I don't know how you can package bb + script into one thing. some options: - bb + uberscript - bb + uberjar - docker image

Eugen 2020-12-17T22:32:14.354400Z

@helios I saw this technique with games installers on linux: https://stackoverflow.com/questions/955460/how-do-linux-binary-installers-bin-sh-work And alos https://makeself.io/ (from the link)

Eugen 2020-12-17T22:32:21.354700Z

I hope it helps

helios 2020-12-17T22:59:15.354900Z

thanks!

borkdude 2020-12-16T13:19:25.341600Z

uberscript + uberjar are two ways of packaging a multi-file project into one thing

borkdude 2020-12-16T13:19:41.342100Z

uberjar should be used if you also want to package non-source files

helios 2020-12-16T13:21:24.343900Z

I see, thanks! Asking because for our on-prem process we give our customers setup scripts for the infrastructure (a single bb "project" if you will) but it'd be simpler to release binaries.

borkdude 2020-12-16T13:22:36.344300Z

installing bb + delivering the uberjar is probably the most cross platform/portable way

borkdude 2020-12-16T13:23:16.344800Z

bb is already multi-platform. if you would support multiple platforms yourself you would have to compile for each OS again

borkdude 2020-12-16T13:23:56.345300Z

you could give them a zip files with bb included and then use a local shebang possibly too

borkdude 2020-12-16T13:24:06.345600Z

or have a small bash script download the bb

borkdude 2020-12-16T13:25:37.345800Z

but maybe docker will work too

2020-12-16T20:01:23.348Z

The newer error breakdown where it shows locals is soooo great

❤️ 1
2020-12-16T20:05:09.348700Z

it would seem possible to make an interactive debugger for babashka if those locals are accessible somewhere

borkdude 2020-12-16T20:12:31.349500Z

@bhurlow using this lib you kind of get that as well: https://github.com/borkdude/babashka/blob/master/doc/projects.md#limit-break

borkdude 2020-12-16T20:14:58.349900Z

(require '[babashka.deps :as deps])

(deps/add-deps
 '{:deps
   {limit-break
    {:git/url "<https://github.com/technomancy/limit-break>"
     :sha "050fcfa0ea29fe3340927533a6fa6fffe23bfc2f" :deps/manifest :deps}}})

(require '[limit.break :as lb])

(let [x 1]
  (lb/break))

borkdude 2020-12-16T20:15:10.350100Z

$ bb /tmp/foo.clj
Babashka v0.2.5-SNAPSHOT REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

break&gt; x
1

borkdude 2020-12-16T20:16:41.350300Z

break&gt; (lb/local-bindings)
{locals {x 1}, form (lb/local-bindings), nil nil, x 1}

borkdude 2020-12-16T20:17:02.350500Z

(not sure what the nil nil is...)

2020-12-16T20:17:51.350900Z

very nice

borkdude 2020-12-16T20:18:07.351400Z

and this works in Clojure itself too

2020-12-16T20:18:15.351700Z

oh really

2020-12-16T20:18:19.352Z

will have to see how

borkdude 2020-12-16T20:18:39.352700Z

(which it was originally written for, this is a 9 year old library which happens to work well with bb)

💯 2
2020-12-16T20:18:48.352900Z

other debugger attempts in clojure do a very deep macro transform to instrument the forms, wondering if SCI and being interpreted in general might give more control

2020-12-16T20:19:17.353200Z

by Phil Hagelberg tho 🙂