Commit e711c040 authored by Alex Hornby's avatar Alex Hornby Committed by Facebook GitHub Bot

allow expressions for shipit manifest entries

Summary: Add expressions for shipit entries so that we can map different directories if needed

Differential Revision: D33947996

fbshipit-source-id: e765769ae5a6ab90055b63284e538b965d6071b3
parent 62fcc612
......@@ -542,10 +542,11 @@ def get_fbsource_repo_data(build_options):
class SimpleShipitTransformerFetcher(Fetcher):
def __init__(self, build_options, manifest):
def __init__(self, build_options, manifest, ctx):
self.build_options = build_options
self.manifest = manifest
self.repo_dir = os.path.join(build_options.scratch_dir, "shipit", manifest.name)
self.ctx = ctx
def clean(self):
if os.path.exists(self.repo_dir):
......@@ -553,13 +554,15 @@ class SimpleShipitTransformerFetcher(Fetcher):
def update(self):
mapping = ShipitPathMap()
for src, dest in self.manifest.get_section_as_ordered_pairs("shipit.pathmap"):
for src, dest in self.manifest.get_section_as_ordered_pairs(
"shipit.pathmap", self.ctx
):
mapping.add_mapping(src, dest)
if self.manifest.shipit_fbcode_builder:
mapping.add_mapping(
"fbcode/opensource/fbcode_builder", "build/fbcode_builder"
)
for pattern in self.manifest.get_section_as_args("shipit.strip"):
for pattern in self.manifest.get_section_as_args("shipit.strip", self.ctx):
mapping.add_exclusion(pattern)
return mapping.mirror(self.build_options.fbsource_dir, self.repo_dir)
......
......@@ -110,6 +110,8 @@ ALLOWED_EXPR_SECTIONS = [
"install.files",
"rpms",
"debs",
"shipit.pathmap",
"shipit.strip",
]
......@@ -382,7 +384,7 @@ class ManifestParser(object):
and build_options.fbsource_dir
and self.shipit_project
):
return SimpleShipitTransformerFetcher(build_options, self)
return SimpleShipitTransformerFetcher(build_options, self, ctx)
if (
self.fbsource_path
......
......@@ -43,9 +43,13 @@ osxfuse
[dependencies.not(os=windows)]
libcurl
[shipit.pathmap]
[shipit.pathmap.fb=on]
# for internal builds that use getdeps
fbcode/common/rust/fbwhoami = common/rust/fbwhoami
[shipit.pathmap]
# remove once autocargo in place for edenfs
fbcode/common/rust/fbwhoami = common/rust/fbwhoami
fbcode/common/rust/shed = common/rust/shed
fbcode/configerator/structs/scm/hg = configerator/structs/scm/hg
fbcode/eden/oss = .
......@@ -72,8 +76,10 @@ INSTALL_PYTHON_LIB=ON
[cmake.defines.all(not(fb=on),os=windows)]
ENABLE_GIT=OFF
[cmake.defines.fb=on]
[cmake.defines.fbsource=on]
USE_CARGO_VENDOR=ON
[cmake.defines.fb=on]
IS_FB_BUILD=ON
[depends.environment]
......
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