question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building fails with "ERROR: Source forest creation failed: ... (File exists)"

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:29 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
keithcommented, Jul 11, 2019

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 this

2reactions
wcurriecommented, Nov 18, 2018

Something to do with .gitignore 🤷‍♂️ ? With https://github.com/wcurrie/bazel-kt-test I was seeing this error on the second sync:

Error:Source forest creation failed: /private/var/tmp/_bazel_wcurrie/1a27f38007016ddde30139a478158fc3/execroot/__main__/bazel-bazel-kt-test (File exists).

Until I added this to .gitignore:

bazel-*

The IJ plugin does execute git for Computing VCS working set...

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source forest creation failed error : r/bazel - Reddit
Any bazel command is failing with the error in the title and no other information. Tried removing caches but did not work.
Read more >
Rebuilds fail with "Source forest creation failed" when a top ...
If a top-level directory name starts with an underscore, Bazel won't delete its symlink when regenerating the symlink forest.
Read more >
Windows system error codes and what they mean - Ivanti
0 The operation completed successfully. 1 Incorrect function. 2 The system cannot find the file specified. 3 The system cannot find the path...
Read more >
Permission Denied When Creating Directory or Writing a File
There are a couple of possible solutions to this issue: Create a folder that the user running the build has permissions to. Change...
Read more >
Azure AD Connect: Troubleshoot errors during synchronization
Remove the duplicated value from the object that should not have that value. Make the change in the directory from where the object...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found