Hi all! I'm trying to wrap a bash script with an E...
# plugins
s
Hi all! I'm trying to wrap a bash script with an ExternalTool. It uses a lot of linux binaries, so I've added a bunch of shims, but it still fails. Does anyone know how sandboxing works exactly? What are the common mistakes I could have made? Thanks (the plugin https://github.com/grihabor/pants-makeself-plugin)
c
I think easiest is to run with
--keep-sandboxes=always
and then inspect the
__run.sh
from the sandbox you’re interested in.
g
Took a quick peek; I think you're not adding the
BinaryShims.path_component
to the process environment PATH.
I think the most important thing to remember about sandboxes (apart from ^ inspecting) is that if you don't specify something, it's empty - env, files, etc.
s
--keep-sandboxes=always
Yep, I tried that,
__run.sh
works without errors
not adding the
BinaryShims.path_component
to the process environment PATH
Thanks! I'll try that
h
Yeah, unfortunately
__run.sh
doesn't isolate env vars the way Pants does when it runs in the sandbox, so it's not completely 1:1
Actually, that is not true
__run.sh
does use
env -i
to set the environment