bazel: Building fails with "ERROR: Source forest creation failed: ... (File exists)"
In CLion 2017.2.2 with the Bazel plugin 2017.08.29.0.2 I import this sample workspace: https://github.com/danieldanciu/clion-bazel
First time I press Sync it says it succeeds, but the second time it does an incremental build and this error is printed:
ERROR: Source forest creation failed: /private/var/tmp/_bazel_ab/fc7ea4530f9bdd4f1119eb797c96880e/execroot/__main__/bazel-clion-bazel (File exists).
You can see here the diff between the first run and the second, and the command which generated that error: https://gist.github.com/aleb/7f306b83d681f8283c2368c8f5a244c6/revisions
Command: /usr/local/bin/bazel build --tool_tag=ijwb:CLion --keep_going --experimental_build_event_binary_file=/var/folders/yd/nc6_vq355v352hm7_q86gfmw0000gn/T/intellij-bep-627b7f50-2b93-4f0d-bb2d-a5aca85aa48d --noexperimental_build_event_binary_file_path_conversion --curses=no --color=no --noexperimental_ui --noprogress_in_terminal_title --aspects=@intellij_aspect//:intellij_info.bzl%intellij_info_aspect --override_repository=intellij_aspect=/Users/ab/Library/Application Support/CLion2017.2/clwb/aspect --output_groups=intellij-info-cpp,intellij-info-py,intellij-info-generic -- //...:all //:all //bazel-clion-bazel:all
Further “Syncs” fail or succeed depending on whether it’s an incremental sync or a full sync, respectively.
Environment info
macOS 10.12.6 release 0.6.0-homebrew
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 29 (18 by maintainers)
Commits related to this issue
- Ignore external/ directory in users' source tree when creating execroot symlink tree. Fixes https://github.com/bazelbuild/bazel/issues/3857#issuecomment-510538152 RELNOTES: None PiperOrigin-RevId: 2... — committed to bazelbuild/bazel by meteorcloudy 5 years ago
- Ignore external/ directory in users' source tree when creating execroot symlink tree. Fixes https://github.com/bazelbuild/bazel/issues/3857#issuecomment-510538152 RELNOTES: None Pipe... — committed to luca-digrazia/DatasetCommitsDiffSearch by deleted user 2 years ago
Ha I think in our case it’s because we have a directory called
external
at the top level checked into our repo. Removing that works around thisSomething to do with
.gitignore
🤷♂️ ? With https://github.com/wcurrie/bazel-kt-test I was seeing this error on the second sync:Until I added this to
.gitignore
:The IJ plugin does execute git for
Computing VCS working set...
Also seeing this issue,
ERROR: Source forest creation failed: /home/jenkins/workspace/test/master/origin/master/execroot/__main__/.git (File exists)
On ubuntu 16.04.3
I’m also seeing this with
.../__main__/.#out.json
on Mac OSX with Bazel version 0.11.0It works if I manually remove the file. However, I then have to manually remove that file before/after every build.
bazel clean
has the same affect: it must be run before/after every build.