Fork me on GitHub
#babashka
<
2019-11-16
>
sogaiu00:11:16

apart from the usual python -> python2 change i make, it appears the nc i have doesn't have a -q option so the socket-repl tests wouldn't pass as is -- once i used the if branch for the mac instead, things were ok. other than that, everything passed.

sogaiu00:11:10

ah, i had to manually set GRAALVM_HOME to get the ssl test to work, but once set, it was fine

sogaiu00:11:58

btw, based on @dharrigan's PKGBUILD for clj-kondo-bin, here's one for babashka-bin:

pkgname=babashka-bin
pkgver=0.0.27
pkgrel=1
pkgdesc='A Clojure babushka for the grey areas of Bash.'
arch=('x86_64')
url=''
license=('EPL')
provides=('babashka')
conflicts=('babashka')

source=("")

sha256sums=('b0b1f0c3d7e0603a7f8f31ea5037e0ec6d04b7c7918164f526d8d2e27007f46f')

package() {
  install -Dm755 "${srcdir}/bb" "${pkgdir}/usr/bin/bb"
}

borkdude08:11:59

@sogaiu thanks for testing

borkdude10:11:13

^ @holyjak added .write, .append etc. ^ @plexus: no more "fake " Java interop

sogaiu21:11:16

i noticed that conch/destroy doesn't appear to succeed for my invocation of shadow-cljs via yarn in a babashka script -- so i tried this with the original conch library on the jvm and noticed the same behavior there. this isn't a babashka issue, so may be i should ask elsewhere, but any clues as to why destroy doesn't appear to work?

sogaiu21:11:56

tnx, will take some time to set up - will report back

sogaiu21:11:00

ah, this was a case of the yarn (node) process being destroyed, but not the process (jvm) it launches...quick searches suggest other folks have had similar issues.

sogaiu21:11:56

in this particular case, shadow-cljs happens to write its own pid to a file, iiuc, so using that info, may be https://docs.oracle.com/javase/9/docs/api/java/lang/ProcessHandle.html#of-long- may be applied. i guess that may not work on java 8 though...

sogaiu22:11:17

...and using kill is not platform-independent (cf. windows)

borkdude22:11:26

feel free to experiment, I don't know the answer

borkdude22:11:11

@holyjak binding now works with clojure.core/*in* and clojure.core/*out*: https://github.com/borkdude/babashka/releases/tag/v0.0.29

sogaiu22:11:46

ok, the processhandle thing seems to work -- apparently graal 19.3 might have support for java 11: https://github.com/oracle/graal/issues/651#issuecomment-533627450

sogaiu22:11:54

so i guess we may know in a few days 🙂

sogaiu22:11:30

btw, it looks like processhandle stuff lets you get at info about child processes as well -- have only skimmed so there may be more of interest

sogaiu22:11:50

by "seems to work", i mean able to get at a process via its pid

borkdude22:11:11

write.clj:

(with-open [wrt (io/writer "/tmp/file.txt")]
  (binding [*out* wrt] (println "hi")))
$ bb /tmp/write.clj
$ cat /tmp/file.txt
hi
Pretty good 🙂