On Sat, Sep 17, 2022 at 1:16 AM Robert Cauble <
robert...@gmail.com> wrote:
>
> File ownership change requires a sudo and I’m not sure that’ll work within a custom rule? To clarify, these are intermediate output files within a sub directory. I am assuming bazel won’t know about these files since they are not registered as outputs?
Bazel still has to remove the whole temporary directory though. I'm
thinking you could use sudo from within the docker container that's
creating them in the first place? Or another docker container you run
afterwards?
> tools/bazel sounds good. I assume that’s a workspace-relative path? Do you have an example of how to call the real bazel from within the script? Seems like it would need to call bazel again but tell it not to use the script override.
Yes it's workspace-relative. If you're using bazelisk or something
similar, just call it. Otherwise, take a look at /usr/bin/bazel (or
equivalent for your OS), it's the script that looks for tools/bazel.
The logic that uses after not finding a tools/bazel is pretty similar
to what you're looking for. Basically you want to take over the
process of finding a real bazel binary and exec it, not the wrapper
script again.