Hey folks, before I open an issue, has anyone else encountered this when using bb v0.2.5
?
19:35 $ bb
Babashka v0.2.5 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (require '[babashka.curl])
nil
user=> (curl/get "<http://example.com>")
Segmentation fault (core dumped)
The backtrace looks like:
(gdb) bt
#0 0x00007ffff4c5496e in nss_getline (line=0x7ffff5a004a0 "passwd: compat systemd") at ../include/ctype.h:41
#1 nss_parse_file (fname=0x7ffff4cc75b7 "/etc/nsswitch.conf") at nsswitch.c:584
#2 __GI___nss_database_lookup2 (database=database@entry=0x7ffff7f9904f "passwd_compat", alternate_name=alternate_name@entry=0x0,
defconfig=defconfig@entry=0x7ffff7f99000 "nis", ni=ni@entry=0x7ffff7f9b390 <ni>) at nsswitch.c:127
#3 0x00007ffff7f93740 in init_nss_interface () at nss_compat/compat-pwd.c:94
#4 0x00007ffff7f956b5 in _nss_compat_getpwuid_r (uid=1000, pwd=0x48d9560, buffer=0x48ee8d0 "\250\061\215\004", buflen=1024, errnop=0x48db848)
at nss_compat/compat-pwd.c:1064
#5 0x000000000221dcda in getpwuid_r ()
#6 0x000000000221dab4 in getpwuid ()
#7 0x000000000095e5f2 in ?? ()
...
Thanks!Perhaps the static compiled one? Don't use it if you don't have to
It likely was the statically compiled one, I'll try again otherwise and see what happens. Thanks for the suggestion!
What bb binary did you download?
For Reasons(TM) I wanted to have bb be part of my circle ci environment.
Of course, I’m stuck on how to install bb in circle.
Yes, it’s most likely me, but any help on how to make bb
available during my circle jobs would be really appreciated.
The bash wget
thingy fails with a missing filedescriptor.
Not using bb
in circle, but we just straight up curl -L
via GH release urls
Thanks! that worked.
- run:
name: Install babashka
command: |
curl -L --output bb.zip <https://github.com/borkdude/babashka/releases/download/v0.2.5/babashka-0.2.5-linux-amd64.zip>
unzip bb.zip
chmod a+x bb
Please don’t get me started on how much I love yaml…
Yep,also you can leverage Circle's cache and not download the file on each run
@slipset babashka also has an install script: https://raw.githubusercontent.com/borkdude/babashka/master/install It supports a --version argument if you want to lock the version
but curl and unzip is fine too
and btw, you can generate the yaml from edn with babashka too ;)
That’s what I tried first, but it failed on circle. Maybe /tmp is not available on circle?
each run is in a separate container I believe, and only cached storage is shared
makes sense. in clj-kondo that is configurable too: https://github.com/borkdude/clj-kondo/blob/0d31f63e40f220dff88670335ad639d39647314c/script/install-clj-kondo#L18 should probably copy that
sorry - I need to clarify, you can write to tmp, but you also instruct circle to persist paths in cache and restore it
it's a bit fiddly to be honest
here's how we're caching maven deps: https://github.com/nomnom-insights/nomnom.bunnicula/blob/master/.circleci/config.yml#L23-L35 - similar mechanism works for anything
@slipset I now added the --download-dir
option to the script:
https://raw.githubusercontent.com/borkdude/babashka/master/install
E.g.:
./install --dir . --version 0.2.5 --download-dir .
should workThanks!
My first bb script https://github.com/slipset/cautious-engine/blob/main/.circleci/maybe-deploy.bb
And 🙂
#!/bin/bash -eo pipefail
bash <(curl -s <https://raw.githubusercontent.com/borkdude/babashka/master/install>) --dir . --download-dir .
Downloading <https://github.com/borkdude/babashka/releases/download/v0.2.5/babashka-0.2.5-linux-amd64.zip> to .
Successfully installed bb in ..
CircleCI received exit code 0
Thanks for the quick turnaround!
@slipset ha, we have exactly the same script in bash because Circle cannot do conditional step runs
@lukaszkorecki so do we 🙂