pkl icon indicating copy to clipboard operation
pkl copied to clipboard

Only build static executable if musl toolchain is installed

Open translatenix opened this issue 1 year ago • 2 comments

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.

translatenix avatar Feb 07 '24 04:02 translatenix

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 building linuxExecutableAmd64)?

holzensp avatar Feb 07 '24 20:02 holzensp

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

translatenix avatar Feb 07 '24 20:02 translatenix