]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Do not print u'string' in TARGETS file (#6841)
authorYanqin Jin <yanqin@fb.com>
Wed, 13 May 2020 04:35:08 +0000 (21:35 -0700)
committerYanqin Jin <yanqin@fb.com>
Wed, 13 May 2020 23:15:06 +0000 (16:15 -0700)
Summary:
Before this PR, extra deps passed in from cmd line to buckifier will be parsed
and used to populate a dict. Using this dict and printing to TARGETS file will
lead to printing u'', disallowed by build tools. This PR removes the u''.

Test Plan (local dev server):
```
python buckifier/buckify_rocksdb.py  '{"fake": {"extra_deps": [":test_dep", "//fake/module:mock1"], "extra_compiler_flags": ["-Os", "-DROCKSDB_LITE"]}}'
```
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6841

Reviewed By: siying

Differential Revision: D21538155

Pulled By: riversand963

fbshipit-source-id: 09403668a4aa1a15bad7dac229c2bc8ce8ee1349

buckifier/buckify_rocksdb.py

index 15fa0c2d8fdcfd33cc482d0ce3a7a7446d03f6ff..83b0bbc683cedd6491972130092a054865ad65e1 100644 (file)
@@ -175,7 +175,7 @@ def generate_targets(repo_path, deps_map):
         + ["test_util/testutil.cc"],
         [":rocksdb_lib", ":rocksdb_test_lib"])
 
-    print("Extra dependencies:\n{0}".format(str(deps_map)))
+    print("Extra dependencies:\n{0}".format(json.dumps(deps_map)))
     # test for every test we found in the Makefile
     for target_alias, deps in deps_map.items():
         for test in sorted(tests):
@@ -196,8 +196,8 @@ def generate_targets(repo_path, deps_map):
                 test_target_name,
                 match_src[0],
                 is_parallel,
-                deps['extra_deps'],
-                deps['extra_compiler_flags'])
+                json.dumps(deps['extra_deps']),
+                json.dumps(deps['extra_compiler_flags']))
 
             if test in _EXPORTED_TEST_LIBS:
                 test_library = "%s_lib" % test_target_name