bazel: Unexpected IO error (Not a directory)

ERROR: /Users/buildkite/builds/darwin-x86-64-1-1/bazel/re2/BUILD:26:1: Couldn't build
file _objs/re2/re2/filtered_re2.o: C++ compilation of rule '//:re2' failed: Unexpected IO error.:
/private/var/tmp/_bazel_buildkite/90b05a586a8f6522c740e54d1334c7a0/execroot/
com_googlesource_code_re2/external/local_config_cc/wrapped_clang (Not a directory)

We see this error frequently on macOS. @mhlopko suggested that it’s a somewhat known bug in external repositories.

cc: @aehlig @dslomov

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 37 (37 by maintainers)

Commits related to this issue

Most upvoted comments

I have finally found the problem and solution to this bug.The issue is that we always create Path objects using execRoot.getRelativePath(rootRelativePath). Now that mostly works except for external dependencies, because these aren’t symlinked under the execroot but only below their artifact root, which happens to be the output base.

The solution is to create the path object for an Artifact only using its ArtifactRoot (Path p = artifact.getRoot().getRoot().getRelative(rootRelativePath) and to only use the exec path for ActionInput objects.

I ll send out a fix.