Skip to content

Commit

Permalink
Use BUILD.bazel for third_party packages
Browse files Browse the repository at this point in the history
Both `BUILD` and `BUILD.bazel` could be used as the bazel project file
and `BUILD.bazel` is preferred (see bazelbuild/bazel#4517 (comment))

This fix changes generated BUILD in third_party packages to `BUILD.bazel`.
This will help avoid conflict with `BUILD` or `build` file/directory names
in third party packages.

For example, while working on 19461 I noticed that apache thrift package
consists of a `build` directory and that causes issues in case-insensitive
systems like macOS. This PR should help avoid such conflict issues.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
  • Loading branch information
yongtang committed May 24, 2018
1 parent 774d501 commit 0f84f48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def _tf_http_archive(ctx):
if ctx.attr.patch_file != None:
_apply_patch(ctx, ctx.attr.patch_file)
if ctx.attr.build_file != None:
ctx.template("BUILD", ctx.attr.build_file, {
# Use BUILD.bazel to avoid conflict with third party projects with
# BUILD or build (directory) underneath.
ctx.template("BUILD.bazel", ctx.attr.build_file, {
"%prefix%": ".." if _repos_are_siblings() else "external",
}, False)

Expand Down

0 comments on commit 0f84f48

Please sign in to comment.