Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bazel, I want to avoid all the "convenience symlinks" to be generated

Tags:

build

bazel

When you build a Bazel project, your WORKSPACE project root directory is populated by a bunch of convenience symlinks:

<workspace-name>/                         <== The workspace directory
  bazel-my-project => <...my-project>     <== Symlink to execRoot
  bazel-out => <...bin>                   <== Convenience symlink to outputPath
  bazel-bin => <...bin>                   <== Convenience symlink to ...
  bazel-genfiles => <...genfiles>         <== Convenience symlink to ...

See the official doc, Bazel internals: Directory layout, for details.

My question: is there a Bazel option to avoid all these links to be generated or at least an option to tell Bazel to put all these links in another place (in /tmp/my-project for instance)?

(My motivation is that I also use other tools that scan *.hpp and *.cpp files in my project directory, unfortunatly all the symlinks generated by Bazel are messing up the result...).

like image 605
Picaud Vincent Avatar asked Oct 30 '17 15:10

Picaud Vincent


2 Answers

--symlink_prefix=/ will stop these symlinks from being created.

https://docs.bazel.build/versions/master/command-line-reference.html

like image 113
Adam Avatar answered Nov 13 '22 19:11

Adam


Quoting the documentation of --symlink_prefix:

Warning: the special functionality for / will be deprecated soon; use --experimental_convenience_symlinks=ignore instead.

like image 42
piarston Avatar answered Nov 13 '22 19:11

piarston