Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly create Bazelisk's cache directory. (#503)
* Explicitly create Bazelisk's cache directory. We have replaced Bazel with Bazelisk on all CI workers. As a consequence, calling "bazel" from PATH will actually invoke Bazelisk, which in turn downloads the requested version of Bazel into a cache directory and then executes it. This caused a problem when an integration test invoked Bazel from PATH (aka Bazelisk) while running inside a sandbox: The sandbox blocked access to the cache directory, thus failing the test. #497 tried to address this problem by whitelisting the cache directory via the --sandbox_writable_path flag. However, this flag requires the given path to exist, which was not the case when tests were running a Bazel binary from their runfiles instead of Bazelisk. Since we cannot easily detect whether a test invokes Bazelisk or another Bazel binary, we're working around this problem by creating the Bazelisk cache directory before running any tests. Fixes #498.
- Loading branch information