Fork me on GitHub
#babashka
<
2020-04-07
>
bherrmann12:04:40

Does babashka run on the raspberry pi ?

borkdude12:04:37

@bherrmann there is an issue for arm64 but nobody is working on that

borkdude12:04:53

@bherrmann Note the aarch64 download here: https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-19.3.1 - so in theory it should be possible

sogaiu23:04:44

i'm thinking of making an attempt to compile clj-kondo and/or babashka on an android tablet. i'll let you know how it goes.

sogaiu07:04:23

i put some details in the issue -- trying to see if i can set up qemu to do builds in a better environment, but also to test the binary that was built

borkdude07:04:17

Very cool. Why is 11 instead of 8 needed?

borkdude07:04:34

Maybe you can upload the zipped binary to the issue?

sogaiu07:04:40

lol, it just happens to be what i downloaded from the link you posted: https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-19.3.1 -- may be i missed something for java 8

sogaiu07:04:47

ok, i'll work on that

borkdude07:04:17

There are still some issues with 11 and bb

sogaiu07:04:20

ah, you think i forgot? 🙂

sogaiu07:04:53

happy to try another graal -- just don't see a link for java 8

borkdude07:04:58

I keep forgetting about the details myself so see it as a note to self ;-)

borkdude07:04:20

Ah maybe it’s the only one they have for this version then

sogaiu07:04:23

i only remember that there is at least one issue -- i have no clue atm what it is 😅

borkdude07:04:06

Maybe that only affected Mac and java nil

borkdude07:04:16

Nio, fucking phone

borkdude12:04:04

if only we could find a CI which could build it

dominicm13:04:47

https://man.sr.ht/builds.sr.ht/compatibility.md yes, but with software emulation (for now). Benefit of kvm

borkdude13:04:58

how much memory does one have on sourcehut?

dominicm13:04:37

I think they had a high cap, and you can request higher.

rovanion15:04:20

If I expect to be able (find-ns 'clj-ssh) after deps has downloaded it and verified that its jar is on the BABASHKA_CLASSPATH after I start my REPL, but still cannot; how do I go forward in figuring out what's wrong?

borkdude15:04:17

@rovanion what version of bb are you using and are you using the normal REPL, nREPL or socket REPL?

borkdude15:04:13

you should first require your namespace, before find-ns returns it

rovanion15:04:11

Socket REPL, still on that snapshot from last friday. Should probably up it. Requiering it was the first thing I tried, but I didn't know that find-ns wouldn't find a namespace that hasn't been requiered. I'll upgrade my bb version and try again.

rovanion15:04:58

Ah, I think I just didn't read my output well enough earlier. When attempting to require it I actually get an error:

clojure.lang.ExceptionInfo: Unable to resolve classname: .FileInputStream [at clj_ssh/ssh.clj, line , column ]

borkdude15:04:11

@rovanion It seems that library depends on custom Java classes from JSch which are not included in bb either

borkdude15:04:09

if you want to use ssh from babashka your best bet is probably clojure.java.shell/sh or ProcessBuilder

borkdude16:04:34

or take a look at https://github.com/epiccastle/spire which is also a Clojure CLI tool around ssh

rovanion16:04:01

Thank you, will look into them instead!

rovanion16:04:21

What is your opinion on conch?

rovanion17:04:17

Right, missing java.util.concurrent.TimeOutException for that one.

borkdude17:04:41

I first included the low level namespace of conch in bb, but I could never make the core namespace work with it. Eventually I decided that interoperability with ProcessBuilder directly is sufficient and the most flexible option

jrwdunham19:04:17

Does anybody here know if there is something like Python's shlex (shell lexer) in the Clojure/Java ecosystem? Seems like this would be useful given the increasing number of shell/sh calls I'm making with babashka.

wilkerlucio19:04:09

whats the simplest way to ask for user input (prompt in console) in the process of babashka?

borkdude20:04:17

yeah, read-line works 🙂

lilactown20:04:23

I’ve created a process via ProcessBuilder . after I’ve started it, how may I get the pid of it?

lilactown20:04:30

lots of stackoverflow about this, seems to depend on JVM version

borkdude20:04:49

@lilactown Don't know. Could you tell us why you need the PID to begin with?

lilactown20:04:12

I want to start a bunch of local proxies and edit my /etc/hosts so that I can use prod services while developing UI locally. my thinking was to have a script that acts something like:

./web-prod.clj up
which would start the proxies, edit my hosts file, and generally configure my system then when I’m done and want to return my system to normal, I would run:
./web-prod.clj down

lilactown20:04:49

I want the pids so that I can write them to a file .web-prod on up, so that when down is called I can kill those pids

borkdude20:04:44

I do want to upgrade to java11 and the pid seems to be supported since java9. but there are some issues in v20.0, so I want to wait until at least 20.1

lilactown20:04:09

another option would be to have the script run the entire time my system is configured, and on stop kill all the processes and return my system to normal

borkdude20:04:21

that could also work

lilactown20:04:24

that seemed more complicated, but maybe that’s the best way to go

borkdude20:04:50

and you can get the pid of that script using bg and fg etc?

lilactown20:04:45

I wasn’t able to immediately figure out how to keep the script alive. there are 3-5 different processes it needs to manage, so I can’t just waitFor on one then I need to figure out how to do the cleanup before the script halts

borkdude20:04:35

maybe you could use (read-line) and then send a newline to stdin which then executes the cleanup, or something? or start a SocketServer and connect to it?

borkdude20:04:42

(do (println "Press enter to kill") (read-line))

borkdude20:04:01

and then (.destroy p1) etc?

lilactown20:04:08

I like that. seems reasonable

borkdude20:04:41

I guess when you press ctrl-C the script also kills the subprocesses?

borkdude20:04:48

I would expect that, but I'm not sure

lilactown20:04:13

the subprocesses still stick around after bb exits

lilactown20:04:46

I have a script that does all the startup of the proxies and it exits immediately while the processes persist, I have to kill them manually atm

borkdude20:04:57

hmm, so one issue to solve is have some SIGINT handler option in babashka

lilactown20:04:30

that would be lovely

borkdude20:04:20

We already have some functions around SIGPIPE in babashka.signal, maybe it wouldn't be too hard to add.

borkdude21:04:26

Interesting alternative to PHP driven by the Small Clojure Compiler: https://github.com/alekcz/pcp This website is serving an example: http://pcp.musketeers.io/

Mno21:04:15

Isn't pcp the name of a hallucinogen?

Mno21:04:43

Ah yes, he seems to be aware of it

sogaiu22:04:31

angel dust?

lilactown23:04:44

really loving babashka ❤️ thank you borkdude and everyone else who has contributed

👍 16
❤️ 8