rules_js icon indicating copy to clipboard operation
rules_js copied to clipboard

[FR]: Use hermetic Java toolchain to execute npm lifecycle hooks

Open neeraj-retool opened this issue 1 year ago • 1 comments

What is the current behavior?

Some NPM packages execute Java or use Java paths (example package) in their postinstall hooks. Those paths currently point to the system JDK.

Describe the feature

We'd like to be able to use the Bazel Java toolchain when running lifecycle hooks instead.

Ideally this is a general solution for passing in hermetic toolchains for actions run by npm_import

neeraj-retool avatar Feb 18 '24 19:02 neeraj-retool

We chatted about this today, have some ideas but want to start with a simple repro so we can get hands-on.

alexeagle avatar Feb 22 '24 02:02 alexeagle

We think it's a pretty messy situation to have node-java involved (it also needs Python??) and it will be hard to make it work under Bazel the way you'd expect. Better to just not promise anything :)

If someone really wants it we need funding or contribution.

alexeagle avatar Jun 03 '25 17:06 alexeagle