pkl
pkl copied to clipboard
Only build static executable if musl toolchain is installed
This improves the development experience for (WSL) Linux users. They can now run "./gradlew buildNative" without having a musl toolchain installed. In this case, only the dynamically linked executable will be built.
Help me understand WSL a little better (I haven't used it for years and back then not for real); why would WSL users use the Alpine
builds? I guess this comes with two sub-questions:
- Does
gw linuxExecutableAmd64
work on WSL? - If so, shouldn't the fix be to improve platform detection (
buildNative
should end up buildinglinuxExecutableAmd64
)?
This PR achieves exactly what you're proposing: If no musl toolchain is installed, buildNative
should only build linuxExecutableAmd64
and should skip alpineExecutableAmd64
. The problem isn't specific to WSL but applies to Linux in general. Prior discussion: https://github.com/apple/pkl/issues/55#issuecomment-1929075962