aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/git
diff options
context:
space:
mode:
authorGravatar Michael Case <mikecase@google.com>2017-12-22 15:44:29 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-12-22 15:48:23 -0800
commita64485dbb378d7ac6afc9082fd7176a957815a8c (patch)
tree8569696c2116f674fcc1ba7e324602d0de0cc5e5 /tensorflow/tools/git
parentf10a598e34da5ea4060ccfb8a027dd5c37c108c0 (diff)
Run gen_git_source.py inside of a repo_rule instead of configure.
PiperOrigin-RevId: 179971055
Diffstat (limited to 'tensorflow/tools/git')
-rw-r--r--tensorflow/tools/git/BUILD4
-rw-r--r--tensorflow/tools/git/gen/branch_ref1
-rw-r--r--tensorflow/tools/git/gen/head1
-rw-r--r--tensorflow/tools/git/gen/spec.json3
-rwxr-xr-xtensorflow/tools/git/gen_git_source.py11
5 files changed, 9 insertions, 11 deletions
diff --git a/tensorflow/tools/git/BUILD b/tensorflow/tools/git/BUILD
index f502c8dde0..942ceab85f 100644
--- a/tensorflow/tools/git/BUILD
+++ b/tensorflow/tools/git/BUILD
@@ -7,9 +7,7 @@ package(default_visibility = ["//tensorflow:internal"])
licenses(["notice"]) # Apache 2.0
exports_files(
- glob(["gen/*"]) + [
- "gen_git_source.py",
- ],
+ ["gen_git_source.py"],
)
# -----------------------------------------------------------------------------
diff --git a/tensorflow/tools/git/gen/branch_ref b/tensorflow/tools/git/gen/branch_ref
deleted file mode 100644
index 8b13789179..0000000000
--- a/tensorflow/tools/git/gen/branch_ref
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/tensorflow/tools/git/gen/head b/tensorflow/tools/git/gen/head
deleted file mode 100644
index 8b13789179..0000000000
--- a/tensorflow/tools/git/gen/head
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/tensorflow/tools/git/gen/spec.json b/tensorflow/tools/git/gen/spec.json
deleted file mode 100644
index 176bbc21cc..0000000000
--- a/tensorflow/tools/git/gen/spec.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "git": false
-}
diff --git a/tensorflow/tools/git/gen_git_source.py b/tensorflow/tools/git/gen_git_source.py
index 2e27487d2f..3630dbd740 100755
--- a/tensorflow/tools/git/gen_git_source.py
+++ b/tensorflow/tools/git/gen_git_source.py
@@ -62,7 +62,7 @@ def parse_branch_ref(filename):
raise RuntimeError("Git directory has unparseable HEAD")
-def configure(src_base_path, debug=False):
+def configure(src_base_path, gen_path, debug=False):
"""Configure `src_base_path` to embed git hashes if available."""
# TODO(aselle): No files generated or symlinked here are deleted by
@@ -71,7 +71,6 @@ def configure(src_base_path, debug=False):
# without running ./configure again.
git_path = os.path.join(src_base_path, ".git")
- gen_path = os.path.join(src_base_path, "tensorflow", "tools", "git", "gen")
# Remove and recreate the path
if os.path.exists(gen_path):
@@ -261,6 +260,10 @@ parser.add_argument(
help="Path to configure as a git repo dependency tracking sentinel")
parser.add_argument(
+ "--gen_root_path", type=str,
+ help="Root path to place generated git files (created by --configure).")
+
+parser.add_argument(
"--generate",
type=str,
help="Generate given spec-file, HEAD-symlink-file, ref-symlink-file",
@@ -274,7 +277,9 @@ parser.add_argument(
args = parser.parse_args()
if args.configure is not None:
- configure(args.configure, debug=args.debug)
+ if args.gen_root_path is None:
+ raise RuntimeError("Must pass --gen_root_path arg when running --configure")
+ configure(args.configure, args.gen_root_path, debug=args.debug)
elif args.generate is not None:
generate(args.generate)
elif args.raw_generate is not None: