From 132013366d202dbd5d5c6463c60898bdd420055b Mon Sep 17 00:00:00 2001 From: Islam AbdelRahman Date: Fri, 14 Jul 2017 15:36:20 -0700 Subject: [PATCH] Make TARGETS file portable Summary: Instead of hard coding the path of the internal repo. Make TARGETS file work anywhere in fbcode Closes https://github.com/facebook/rocksdb/pull/2586 Differential Revision: D5428122 Pulled By: IslamAbdelRahman fbshipit-source-id: 21adec82bfbff14ea93532bee789b5f5bbee5b01 --- TARGETS | 6 +++++- buckifier/targets_cfg.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/TARGETS b/TARGETS index 001bf7cb2..1bafb01ca 100644 --- a/TARGETS +++ b/TARGETS @@ -1,4 +1,8 @@ -REPO_PATH = "internal_repo_rocksdb/repo/" + +import os + +TARGETS_PATH = os.path.dirname(__file__) +REPO_PATH = TARGETS_PATH[(TARGETS_PATH.find('fbcode/') + len('fbcode/')):] + "/" BUCK_BINS = "buck-out/gen/" + REPO_PATH TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh" rocksdb_compiler_flags = [ diff --git a/buckifier/targets_cfg.py b/buckifier/targets_cfg.py index de504e4d9..079b892a7 100644 --- a/buckifier/targets_cfg.py +++ b/buckifier/targets_cfg.py @@ -2,7 +2,11 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals -rocksdb_target_header = """REPO_PATH = "internal_repo_rocksdb/repo/" +rocksdb_target_header = """ +import os + +TARGETS_PATH = os.path.dirname(__file__) +REPO_PATH = TARGETS_PATH[(TARGETS_PATH.find('fbcode/') + len('fbcode/')):] + "/" BUCK_BINS = "buck-out/gen/" + REPO_PATH TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh" rocksdb_compiler_flags = [