This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-04
Channels
- # announcements (7)
- # aws (5)
- # babashka (72)
- # beginners (43)
- # calva (12)
- # cider (9)
- # clara (3)
- # clj-kondo (12)
- # cljdoc (32)
- # cljs-dev (10)
- # cljsrn (1)
- # clojure (78)
- # clojure-dev (50)
- # clojure-europe (17)
- # clojure-gamedev (8)
- # clojure-nl (1)
- # clojure-spec (30)
- # clojure-uk (3)
- # clojurescript (52)
- # core-async (1)
- # cursive (5)
- # datomic (8)
- # emacs (58)
- # events (2)
- # fulcro (5)
- # graalvm (7)
- # holy-lambda (37)
- # honeysql (9)
- # jobs (5)
- # leiningen (3)
- # lsp (7)
- # lumo (2)
- # malli (3)
- # meander (13)
- # membrane-term (64)
- # missionary (19)
- # music (3)
- # nextjournal (8)
- # off-topic (29)
- # pathom (16)
- # polylith (14)
- # portal (16)
- # re-frame (2)
- # reagent (5)
- # sci (14)
- # shadow-cljs (20)
- # spacemacs (6)
- # sql (1)
- # tools-deps (58)
- # vim (14)
Does babashka support?
runtime.getShutdown().addShutdownHook()
But if this is enabled:
export BABASHKA_DISABLE_SIGNAL_HANDLERS="true"
shutdown hooks doesn't work?Oh. cool!
Hello. Recently, I saw an example how to execute local bb script on a remote machine using ssh. Can't find it.
@mike1452 https://github.com/babashka/babashka/wiki/Bash-and-Babashka-equivalents#run-local-script-on-remote-server-bb-installed
How to enter 'sudo' password locally for command, executed remotely?
I'm trying to execute remotely:
(sh "sudo ls -la /")
if you don't want this, use babashka.process
which tokenizes all arguments automatically for you
(babashka.process/process ["sudo" "ls" "/"] {:out :inherit})
?inherit also works of course, it depends if you want to get a string out or print the output immediately
Got error: sudo: no tty and program askpass
Yes. I want transfer all my bash scripts for program install to babashka scripts. And I need to enter sudo password locally once.
ssh rssys "bb -e '(load-string (slurp in))'" < install.clj
install.clj contains sudo commands
ssh user@remotehost "sudo bb -e '(load-string (slurp in))'" < install.clj
the same result: sudo: no tty and program askpass
same error
mike@mbp02 ~ ssh -t rssys "sudo bb -e '(load-string (slurp *in*))'" < install.clj
Pseudo-terminal will not be allocated because stdin is not a terminal.
sudo: нет tty и не указана программа askpass
@mike1452 hmm, it works for me:
$ ssh user@host "bb -e '(babashka.tasks/shell \"sudo ls -la\")'"
sudo: no tty present and no askpass program specified
Error while executing task:
$ ssh -t user@host "bb -e '(babashka.tasks/shell \"sudo ls -la\")'"
[sudo] password for user:
I see, it's something with stdin:
$ ssh -t "bb -e '(load-string (slurp *in*))'" <<< '(+ 1 2 3)'
Pseudo-terminal will not be allocated because stdin is not a terminal.
6
Somehow this doesn't work for me:
SCRIPT="(prn (+ 1 2 3))" ssh -t user@host "bb -e $SCRIPT"
@borkdude thank you.
For now I'll bump babashka to GraalVM 21.3.0 JDK 11 and hope GraalVM will solve https://github.com/oracle/graal/issues/3225 so I can strip some classes when upgrading to JDK 17.
@borkdude for the linux static failure in the last build in ci, maybe adding a ln -s /usr/bin/musl-gcc /usr/bin/x86_64-linux-musl-gcc
after https://github.com/babashka/babashka/blob/master/script/setup-musl#L15 could solve it? I think thats the new executable they are looking for now?
awesome
I'm trying to create a bb task to setup clj-kondo by linting the dependencies. (shell "clj-kondo --lint \"$(clojure -A:test-deps -Spath)\" --dependencies --parallel --copy-configs")
is not working, it prints nothing and exits. The command works on the terminal (minus escaped quotes).
I don't know that sub-shelling works in shell
.
(shell "echo \"$(clojure -Spath)\"")
just echoes the literal string for me
@U05094X3J yeah, shelling out doesn't mean you're invoking bash. it's best to invoke clojure -A:test-deps -Spath
as another step and then just feed that input back into the other command
{:tasks
{lint (let [cp (with-out-str (clojure "-Spath"))]
(shell "clj-kondo --lint" cp))}}
and if I'm not mistaken, the --dependencies
switch causes clj-kondo to not report anything, right?
(let [cp (with-out-str (clojure "-A:test-deps -Spath"))]
(shell "clj-kondo --lint" cp "--dependencies --parallel --copy-configs"))
@U05094X3J after the first string you probably have to tokenize the arguments yourself into separate strings