https://pantsbuild.org/ logo
h

high-yak-85899

08/31/2022, 4:29 PM
Is there any kind of default passthrough of environment variables pant backend passes through (e.g.
$HOME
)?
f

fast-nail-55400

08/31/2022, 4:35 PM
No, you would have to configure such pass-through depending on the context.
Which backend is this for?
h

high-yak-85899

08/31/2022, 4:40 PM
This was a custom plugin I wrote. The executable we use was throwing an error for a coworker saying it couldn't find the
$HOME
variable. Not sure why it wasn't raising an error for me/our CI system.
f

fast-nail-55400

08/31/2022, 4:41 PM
Your plugin would need to do something like
await Get(Environment, EnvironmentRequest(["HOME"]))
and then pass the result of that to your process invocations.
h

high-yak-85899

08/31/2022, 4:42 PM
Yup, that's what I was thinking. Just trying to decide whether I want to dive into it only not working for them 🙈
f

fast-nail-55400

08/31/2022, 4:42 PM
note that the idiomatic thing for a plugin to do would be to expose a config option that the user can set as needed
(and that is what the linked example does)
h

high-yak-85899

08/31/2022, 4:44 PM
Yeah makes sense. I don't think this is really a configurable thing. It's just something the backing executable we use seems to need.
f

fast-nail-55400

08/31/2022, 4:47 PM
yeah obviously depends on your use case. I agree non-configurable definitely much simpler if it isn't actually needed.
4 Views