babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
2021-02-01T06:23:53.245200Z

How do you read from environment vars in babashka? Looked at https://book.babashka.org/ but didn’t find any examples.

borkdude 2021-02-01T09:33:53.245700Z

correct :)

2021-02-01T06:27:15.245400Z

Nevermind! It’s (System/getenv "HOME")

ericdallo 2021-02-01T17:16:54.246600Z

Noob question: Does bb graalvm compiled work for Windows?

borkdude 2021-02-03T12:38:51.289800Z

@ericdallo there is one here: https://github.com/turtlequeue/setup-babashka

borkdude 2021-02-03T12:39:05.290100Z

You can usually find these things on this page: https://github.com/babashka/babashka/blob/master/doc/projects.md

ericdallo 2021-02-03T12:39:30.290600Z

Perfect! Maybe link it on the installation docs on readme πŸ˜„ ?

ericdallo 2021-02-03T12:39:45.290800Z

I first searched for all ways to install babashka there

ericdallo 2021-02-03T12:40:11.291Z

Soon, we'd could add clojure-lsp there 😜 https://github.com/babashka/babashka/blob/master/doc/projects.md

borkdude 2021-02-03T12:40:48.291200Z

I haven't tried this action myself but if it works, then lets add it

ericdallo 2021-02-03T12:41:54.291400Z

Nice, I'll try it

ericdallo 2021-02-03T12:42:42.291900Z

we could just copy and paste the @lee windows install and add support for it

borkdude 2021-02-03T12:42:54.292100Z

There isn't much to installing bb. You just download the binary, unzip it, and that's basically it

borkdude 2021-02-03T12:43:37.292300Z

This is the linux/macOS install script https://github.com/babashka/babashka/blob/master/install

borkdude 2021-02-03T12:43:47.292600Z

It might be nice to add an install.bat which can be used from Windows

ericdallo 2021-02-03T12:44:32.292900Z

Yeah, I know, is just that logic of knowing which OS is would be better to be in the action

ericdallo 2021-02-03T12:44:40.293100Z

but I agree is not hard to install

borkdude 2021-02-03T12:45:42.293300Z

I think I have a couple of projects where I already do this in CI

πŸ‘ 1
ericdallo 2021-02-03T12:47:03.294Z

Should this work with non appveyor? GH actions only?

borkdude 2021-02-03T12:47:21.294200Z

this is just some powershell code. Does GH actions support that for Windows?

borkdude 2021-02-03T12:47:41.294400Z

powershell is easy here because they have expand-zip and download stuff included

ericdallo 2021-02-03T12:47:45.294600Z

yeah, it supports pwsh shell

borkdude 2021-02-03T12:47:48.294800Z

but Windows also comes with curl.exe nowadays

ericdallo 2021-02-03T12:48:07.295Z

I'll give a try with that only

ericdallo 2021-02-03T12:49:21.295200Z

Also opened this to make the action perfect in the future: https://github.com/turtlequeue/setup-babashka/issues/3

borkdude 2021-02-03T12:50:31.295600Z

:thumbsup:

ericdallo 2021-02-01T17:17:08.246700Z

I realized the CI build only has linux, linux-static and macos

ericdallo 2021-02-01T17:18:38.246900Z

And I remeber your talk on Clojure Berlin talking about running bb on windows πŸ˜›

borkdude 2021-02-01T17:22:18.247100Z

Yes

borkdude 2021-02-01T17:22:28.247300Z

See appveyor.yaml

ericdallo 2021-02-01T17:22:37.247500Z

thanks

borkdude 2021-02-01T17:23:51.247700Z

I use appveyor for all Windows stuff

ericdallo 2021-02-01T18:02:05.247900Z

@borkdude any reason to use appveyor instead of windows Github Action image?

ericdallo 2021-02-01T18:02:30.248100Z

I don't know if there is anything missing from the GH image, just wondering if the same work could be done there

ericdallo 2021-02-01T18:07:37.248300Z

Found this: https://gist.github.com/sogaiu/e079cd770051685c46ab24b6658effcf

borkdude 2021-02-01T18:41:38.248500Z

Appveyor is just a lot easier, I find

borkdude 2021-02-01T18:42:26.248700Z

And I have already figured that out, GH probably works, but I'm not interested in GH actions per se

πŸ‘ 1
ericdallo 2021-02-01T18:43:08.249Z

Thanks, I'll give a try on GH to follow the repo standard, I'll let you know if it works

lread 2021-02-01T19:04:27.249200Z

@ericdallo, all rewrite-clj v1 scripts are written in babashka and run on linux, macOS and Windows via GitHub Actions. https://github.com/clj-commons/rewrite-clj/blob/f640a38d9267adb0a6a7e06453a13402aa61c9b1/.github/workflows/unit-test.yml#L64.

ericdallo 2021-02-01T19:05:02.249500Z

Cool, thanks @lee

borkdude 2021-02-01T19:05:08.249700Z

@lee this is not about installing bb, it's about compiling a graalvm project on Windows, but thanks :)

ericdallo 2021-02-01T19:05:46.249900Z

yeah, but thanks anyway, it's good to know that πŸ™‚

borkdude 2021-02-01T19:06:09.250100Z

I am not objecting against people installing bb everywhere

πŸ˜‚ 1
lread 2021-02-01T19:08:54.250400Z

Ah! Okey dokey! :simple_smile:

borkdude 2021-02-01T19:09:28.250600Z

But now that you are here. Maybe this is already documented at clj-graal-docs? :)

lread 2021-02-01T19:15:45.250800Z

Unless I am still misunderstanding (which is entirely possible), maybe this will help? I do graalvm native-image on GitHub Actions on macOS, linux and Windows for rewrite-clj. https://github.com/clj-commons/rewrite-clj/blob/18d772889dfbd7680fa255ec3eca916912d733cb/.github/workflows/native-image-test.yml

borkdude 2021-02-01T19:16:58.251200Z

Yes, that is very helpful. This is indeed the gnarly bit I do on appveyor as well: https://github.com/clj-commons/rewrite-clj/blob/18d772889dfbd7680fa255ec3eca916912d733cb/.github/workflows/native-image-test.yml#L112-L116

lread 2021-02-01T19:17:44.251600Z

Oh right that was a bit nasty to figure out.

lread 2021-02-01T19:18:43.251800Z

Also I never did figure out what was needed to setup for GraalVM native-image JDK8 for GitHub Actions on Windows so I only do JDK11.

borkdude 2021-02-01T19:19:13.252500Z

What would be the difficulty with jdk8 then?

ericdallo 2021-02-01T19:19:14.252700Z

oh, it's very helpful indeed

lread 2021-02-01T19:22:34.252900Z

It has some https://www.graalvm.org/docs/getting-started/windows/ that I did not work to figure out how to setup on GitHub Actions: > For GraalVM based on JDK 8, you will need MSVC 2010 SP1 version. The recommended installation method is using Microsoft Windows SDK 7.1: > > 1. Download the SDK file GRMSDKX_EN_DVD.iso for from https://www.microsoft.com/en-gb/download. > 2. Mount the image by opening F:\Setup\SDKSetup.exe directly.

borkdude 2021-02-01T19:22:53.253400Z

Oh crap yeah, that stuff. Let's just ignore it ;)

lread 2021-02-01T19:23:16.253600Z

Exactly the conclusion I came to!

borkdude 2021-02-01T19:23:17.253800Z

Going forward I only use 11 unless there's some weird bug which requires my to use 8

lread 2021-02-01T19:24:49.254Z

Yeah, I could probably drop GraalVM JDK8 testing entirely now for rewrite-clj v1. Even more attractive how that reflection fixups aren’t needed anymore for JDK11.

borkdude 2021-02-01T19:25:31.254200Z

for graalvm yes, but not for normal JDK I'd say, since people may still use 8

lread 2021-02-01T19:25:43.254400Z

Agreed for sure.

borkdude 2021-02-01T19:25:47.254600Z

yeah, except that reflection config which now took its place

lread 2021-02-01T19:26:21.254800Z

here a tweak there a tweak everywhere a tweak tweak

borkdude 2021-02-01T19:26:44.255Z

It's a more lovely tweak than the other one

lread 2021-02-01T19:27:21.255200Z

yes, the tweaks are getting less tweakier

ericdallo 2021-02-01T19:46:47.255400Z

Oh that action for setupping graalvm is useful too, since it checks automatically the os running

lread 2021-02-01T21:27:33.255600Z

https://github.com/DeLaGuardo/setup-graalvm? Yes, very handy!

πŸŽ‰ 1
borkdude 2021-02-01T22:52:30.256200Z

@jayzawrotny found out that this CSS-producing lib works with babashka: https://github.com/cdaddr/gaka

2021-02-01T22:56:30.256500Z

It’s pretty amazing that it’s over 10 years old but still works.