apple / pkl

A configuration as code language with rich validation and tooling.
https://pkl-lang.org
Apache License 2.0
10.15k stars 270 forks source link

Pass `HOMEBREW_*` environment variables on through `native_image` #542

Closed holzensp closed 3 months ago

holzensp commented 3 months ago

We currently have to use NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION to let builds pass in Homebrew. This is because native-image runs its child processes (such as the platform-dependent C compiler) in a "clean" environment. In Homebrew, such compilers (clang, gcc, etc) are wrapper scripts that first check the Homebrew environment is intact.

GraalVM folks have warned that NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION will go away.

This PR preserves all environment variables starting with HOMEBREW_ for the inner native-image environment.

holzensp commented 3 months ago

It should. Will follow-up after more testing if necessary.