How do you read from environment vars in babashka? Looked at https://book.babashka.org/ but didnβt find any examples.
correct :)
Nevermind! Itβs (System/getenv "HOME")
Noob question: Does bb
graalvm compiled work for Windows?
We could move https://github.com/clj-commons/rewrite-clj/blob/f640a38d9267adb0a6a7e06453a13402aa61c9b1/.github/workflows/unit-test.yml#L64 to a Github Action: https://github.com/babashka/babashka/issues/723 π
@ericdallo there is one here: https://github.com/turtlequeue/setup-babashka
You can usually find these things on this page: https://github.com/babashka/babashka/blob/master/doc/projects.md
Perfect! Maybe link it on the installation docs on readme π ?
I first searched for all ways to install babashka there
Soon, we'd could add clojure-lsp
there π
https://github.com/babashka/babashka/blob/master/doc/projects.md
I haven't tried this action myself but if it works, then lets add it
Nice, I'll try it
Just found this: https://github.com/turtlequeue/setup-babashka/blob/55a7551ea77834621fcfcf600782c42b62eb69c9/src/installer.ts#L61
we could just copy and paste the @lee windows install and add support for it
There isn't much to installing bb. You just download the binary, unzip it, and that's basically it
This is the linux/macOS install script https://github.com/babashka/babashka/blob/master/install
It might be nice to add an install.bat which can be used from Windows
Yeah, I know, is just that logic of knowing which OS is would be better to be in the action
but I agree is not hard to install
I think I have a couple of projects where I already do this in CI
https://github.com/babashka/pod-babashka-aws/blob/main/appveyor.yml#L48-L50
Should this work with non appveyor? GH actions only?
this is just some powershell code. Does GH actions support that for Windows?
powershell is easy here because they have expand-zip and download stuff included
yeah, it supports pwsh shell
but Windows also comes with curl.exe nowadays
I'll give a try with that only
Also opened this to make the action perfect in the future: https://github.com/turtlequeue/setup-babashka/issues/3
:thumbsup:
I realized the CI build only has linux, linux-static and macos
And I remeber your talk on Clojure Berlin talking about running bb on windows π
Yes
See appveyor.yaml
thanks
I use appveyor for all Windows stuff
@borkdude any reason to use appveyor instead of windows Github Action image?
I don't know if there is anything missing from the GH image, just wondering if the same work could be done there
Found this: https://gist.github.com/sogaiu/e079cd770051685c46ab24b6658effcf
Appveyor is just a lot easier, I find
And I have already figured that out, GH probably works, but I'm not interested in GH actions per se
Thanks, I'll give a try on GH to follow the repo standard, I'll let you know if it works
@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.
Cool, thanks @lee
@lee this is not about installing bb, it's about compiling a graalvm project on Windows, but thanks :)
yeah, but thanks anyway, it's good to know that π
I am not objecting against people installing bb everywhere
Ah! Okey dokey! :simple_smile:
But now that you are here. Maybe this is already documented at clj-graal-docs? :)
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
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
Oh right that was a bit nasty to figure out.
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.
https://github.com/babashka/babashka/blob/23e12a11ee5c42b3c0ab3ffb39777409c9451dbe/appveyor.yml#L45
What would be the difficulty with jdk8 then?
oh, it's very helpful indeed
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.
Oh crap yeah, that stuff. Let's just ignore it ;)
Exactly the conclusion I came to!
Going forward I only use 11 unless there's some weird bug which requires my to use 8
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.
for graalvm yes, but not for normal JDK I'd say, since people may still use 8
Agreed for sure.
yeah, except that reflection config which now took its place
here a tweak there a tweak everywhere a tweak tweak
It's a more lovely tweak than the other one
yes, the tweaks are getting less tweakier
Oh that action for setupping graalvm is useful too, since it checks automatically the os running
https://github.com/DeLaGuardo/setup-graalvm? Yes, very handy!
@jayzawrotny found out that this CSS-producing lib works with babashka: https://github.com/cdaddr/gaka
Itβs pretty amazing that itβs over 10 years old but still works.