Commit 75b2e2f4 authored by Lukas Piatkowski's avatar Lukas Piatkowski Committed by Facebook Github Bot

mononoke: make mononoke_types OSS-buildable

Summary: (Note: this ignores all push blocking failures!)

Reviewed By: farnz

Differential Revision: D19948740

fbshipit-source-id: 9d0cfc4ccbcb3c08bb969f23229ed3096470fa86
parent 594f484b
......@@ -982,9 +982,12 @@ path = "/dev/null"
dep_to_git = {}
for dep in dependencies.keys():
dep_manifest = self.loader.load_manifest(dep)
if dep_manifest.get("build", "builder", ctx=self.ctx) != "cargo":
dep_builder = dep_manifest.get("build", "builder", ctx=self.ctx)
if dep_builder not in ["cargo", "nop"] or dep == "rust":
# This is a direct dependency, but it is not build with cargo
# so ignore it.
# and it is not simply copying files with nop, so ignore it.
# The "rust" dependency is an exception since it contains the
# toolchain.
continue
git_conf = dep_manifest.get_section_as_dict("git", ctx=self.ctx)
......@@ -992,7 +995,10 @@ path = "/dev/null"
raise Exception(
"A cargo dependency requires git.repo_url to be defined."
)
git_conf["inst_dir"] = self.loader.get_project_install_dir(dep_manifest)
source_dir = self.loader.get_project_install_dir(dep_manifest)
if dep_builder == "cargo":
source_dir = os.path.join(source_dir, "source")
git_conf["source_dir"] = source_dir
dep_to_git[dep] = git_conf
return dep_to_git
......@@ -1042,7 +1048,7 @@ path = "/dev/null"
Tries to find <crate> in git_conf["inst_dir"] by searching a [package]
keyword followed by name = "<crate>".
"""
source_dir = os.path.join(git_conf["inst_dir"], "source")
source_dir = git_conf["source_dir"]
search_pattern = '[package]\nname = "{}"'.format(crate)
for root, _, files in os.walk(source_dir):
......
[manifest]
name = fbthrift-rust
fbsource_path = fbcode/thrift
shipit_project = fbthrift
shipit_fbcode_builder = true
[git]
repo_url = https://github.com/facebook/fbthrift.git
[build]
builder = nop
[shipit.pathmap]
fbcode/thrift/public_tld = .
fbcode/thrift = thrift
[shipit.strip]
^fbcode/thrift/thrift-config\.h$
^fbcode/thrift/perf/canary.py$
^fbcode/thrift/perf/loadtest.py$
......@@ -27,10 +27,11 @@ tools/rust/ossconfigs = .
[shipit.strip]
# strip all code unrelated to mononoke to prevent triggering unnecessary checks
^fbcode/eden/(?!mononoke)/.*$
^fbcode/eden/(?!mononoke|scm/lib/xdiff.*)/.*$
^fbcode/eden/mononoke/(?!public_autocargo).+/Cargo\.toml$
[dependencies]
fbthrift-rust
rust-shed
[dependencies.fb=on]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment