Merge pull request #51474 from rrbutani:pasta-repo-patch

PiperOrigin-RevId: 392896869
Change-Id: I83c2ff515dd49b6ff985a1157823d3290414fd06
This commit is contained in:
TensorFlower Gardener
2021-08-25 08:05:07 -07:00
3 changed files with 19 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# Description:
# AST-based python refactoring.
load("@//third_party/pasta:build_defs.bzl", "copy_srcs")
load("//:build_defs.bzl", "copy_srcs")
licenses(["notice"]) # Apache2

View File

@@ -1,4 +1,4 @@
"""Skylark makros for building pasta."""
"""Starlark macros for building pasta."""
def copy_srcs(srcs):
"""Copies srcs from 'pasta' to parent directory."""

View File

@@ -13,4 +13,21 @@ def repo():
sha256 = "c6dc1118250487d987a7b1a404425822def2e8fb2b765eeebc96887e982b6085",
build_file = "//third_party/pasta:BUILD.bazel",
system_build_file = "//third_party/pasta:BUILD.system",
# We want to add a bazel macro for use in the `@pasta` BUILD file.
#
# If we have this file live in this repo, referencing it from `@pasta`
# becomes tricky. If we do `@//` the build breaks when this repo
# (TensorFlow) is *not* the main repo (i.e. when TensorFlow is used as
# a dependency in another workspace). If we hardcode `@org_tensorflow`,
# the build breaks when this repo is used in another workspace under a
# different name.
#
# We could generate `build_defs.bzl` to reference this repo by whatever
# name it's registered with. Or we could just symlink `build_defs.bzl`
# into the `@pasta` repo and then reference it with a repo relative
# label; i.e. `//:build_defs.bzl`:
link_files = {
"//third_party/pasta:build_defs.bzl": "build_defs.bzl",
},
)