:wave: I'm writing a pants plugin that uses a Node...
# plugins
b
👋 I'm writing a pants plugin that uses a NodeJSTool as subsystem. I have a publish goal that's looks something like this
Copy code
result = await Get(
        Process,
        NodeJSToolRequest,
        subsystem.request(
            args=tuple(
                [
                    .....
                ]
            ),
            input_digest=digest,
            description="",
            level=LogLevel.DEBUG,
            extra_env=env,
        ),
    )

    process = InteractiveProcess.from_process(result)
when trying to return this process in a
PublishProcesses
result I'm hitting this issue. Is it possible to go around it somehow? I've tested passing in the PATH as extra envs but the
NodeJSTool
chain overwrites the PATH env variable
f
You would probably need to modify the Pants node rules to prepend or append its path elements to
PATH
instead of overwriting.
There was a similar issue with the adhoc/shell backends with
PATh
being overwritten. That logic was modified to allow the user to configure prepending or appending the additional elements to
PATH
. See https://github.com/pantsbuild/pants/pull/21185 as one of the PRs.
prepare_env_vars
is actually generic enough that you could likely reuse it in the nodejs rules.
b
oh, thank you for the help. I'll look into those examples first thing tomorrow 🙏