<#18190 `root_output_directory` value is awkward w...
# github-notifications
q
#18190 `root_output_directory` value is awkward when chaining `experimental_shell_command`/`experimental_run_in_sandbox` targets Issue created by chrisjrn per @huonw in #18157:
> This addresses the ../../../docs.html example listed in @huonw's #17616 (comment) on #17616: The correct incantation would allow running in the working directory of the script, and the docs.html would be at the digest root automatically.
>
> @huonw if you're game, I'd love some verification that this does what you want.
(Thanks @chrisjrn for waiting while I was on leave.)
I had a play with this. I think the new working directory default is a good change 👍
However, I found I got kinda confused for two reasons:
1. the new
root_output_directory
and its default
2. behaviour when
output_files
isn't found, but that's not directly related to the change here, so I've filed #18183
* * *
For 1, I think there's tension between:
1. "internal" commands, like
npm ci
(
:node_modules
in the case study in #17616 (comment)).
2. archive/external ones.
In particular, with the change here, it seems like
npm ci
etc. will be installing to
$CHROOT/path/to/target/node_modules
and then moving to
$CHROOT/node_modules
for later commands that use it.
npm
happens to handle this fine (it'll traverse parents), but this seems rife for confusion (e.g. commands that don't traverse parents) and conflicts (e.g. if there's two commands that have their own "internal"/"private"
node_modules
(aka resolves), and both of those are pulled into the same sandbox 💥 ).
Proposal: Maybe
root_output_directory
could continue to default to
/
, but a user can set it to
"."
(or whatever) to do relocation, if they want?
I'm fine with this default, and will make this change. pantsbuild/pants