I'm using Bazel to build my project, and I notice that on some incremental builds I see the following error:
Analyzing: target <target I'm building>
INFO: Repository remote_java_tools_linux instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:374:6: in <toplevel>
<project_root_dir>/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule http_archive defined at:
<project_root_dir>/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
ERROR: An error occurred during the fetch of repository 'remote_java_tools_linux':
Traceback (most recent call last):
File "<project_root_dir>/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Couldn't delete temporary directory (<project_root_dir>/remote_java_tools_linux/temp6718266017446538312)
AFAICT, Bazel should handle this directory internally since it's part of the built-in @bazel_tools, and I shouldn't need to rm it myself between builds.
I also see this problem whenever I attempt to delete my project's directory, which seems related:
rm: cannot remove <project_root_dir>/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/bazel_tools/tools/jdk/platformclasspath_classes/DumpPlatformClassPath.class: Permission denied
Any hints as to what I'm doing wrong? I'm new to Bazel and not doing anything atypical as far as modifying permissions it's running with, so I'm not sure what the problem is