Fork me on GitHub
#babashka
<
2021-02-01
>
Eccentric J06:02:53

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

Eccentric J06:02:15

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

ericdallo17:02:54

Noob question: Does bb graalvm compiled work for Windows?

ericdallo17:02:08

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

ericdallo17:02:38

And I remeber your talk on Clojure Berlin talking about running bb on windows 😛

borkdude17:02:28

See appveyor.yaml

borkdude17:02:51

I use appveyor for all Windows stuff

ericdallo18:02:05

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

ericdallo18:02:30

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

borkdude18:02:38

Appveyor is just a lot easier, I find

borkdude18:02:26

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

👍 3
ericdallo18:02:08

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

lread19:02:27

@UKFSJSM38, 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.

borkdude19:02:08

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

ericdallo19:02:46

yeah, but thanks anyway, it's good to know that 🙂

borkdude19:02:09

I am not objecting against people installing bb everywhere

😂 3
lread19:02:54

Ah! Okey dokey! simple_smile

borkdude19:02:28

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

lread19:02:45

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

lread19:02:44

Oh right that was a bit nasty to figure out.

lread19:02:43

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.

borkdude19:02:13

What would be the difficulty with jdk8 then?

ericdallo19:02:14

oh, it's very helpful indeed

lread19:02:34

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.

borkdude19:02:53

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

lread19:02:16

Exactly the conclusion I came to!

borkdude19:02:17

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

lread19:02:49

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.

borkdude19:02:31

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

lread19:02:43

Agreed for sure.

borkdude19:02:47

yeah, except that reflection config which now took its place

lread19:02:21

here a tweak there a tweak everywhere a tweak tweak

borkdude19:02:44

It's a more lovely tweak than the other one

lread19:02:21

yes, the tweaks are getting less tweakier

ericdallo19:02:47

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

ericdallo03:02:04

I managed to make a GH action windows build compiling the native image 😄 https://github.com/clojure-lsp/clojure-lsp/blob/master/.github/workflows/release.yml#L235-L279

👍 3
ericdallo12:02:30

Perfect! Maybe link it on the installation docs on readme 😄 ?

ericdallo12:02:45

I first searched for all ways to install babashka there

borkdude12:02:48

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

ericdallo12:02:54

Nice, I'll try it

ericdallo12:02:42

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

borkdude12:02:54

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

borkdude12:02:47

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

ericdallo12:02:32

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

ericdallo12:02:40

but I agree is not hard to install

borkdude12:02:42

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

👍 3
ericdallo12:02:03

Should this work with non appveyor? GH actions only?

borkdude12:02:21

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

borkdude12:02:41

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

ericdallo12:02:45

yeah, it supports pwsh shell

borkdude12:02:48

but Windows also comes with curl.exe nowadays

ericdallo12:02:07

I'll give a try with that only

ericdallo12:02:21

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

borkdude22:02:30

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

Eccentric J22:02:30

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