Andy Yan
Andy Yan

Reputation: 136

Avoid “convenience symlinks” AND output directly to workspace

Similar to this question, but one step further - I want to have Bazel skip the symlinking (at least for BINDIR) AND output directly to workspace, so that e.g. I see the binary itself under WORKSPACE\bazel-bin, not a symlink to that binary elsewhere.

Reason behind doing so is I'm bind mounting the workspace from the host into a Docker container, so that both host/container will have immediate access to both code/output. It doesn't make sense for the host to follow a symlink into the container's filesystem, especially when said container is offline, etc.

Can this even be done? Note that I'm on Bazel 2.0.0.

Upvotes: 0

Views: 438

Answers (1)

Benjamin Peterson
Benjamin Peterson

Reputation: 20530

Bazel is quite insistent on writing to its output tree and not mutating the source tree. You could bind mount the output tree—bazel info output_base—into the container, so the symlinks continue to work, though.

Upvotes: 1

Related Questions