1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-08 18:02:05 +03:00

add a ManifestContext and ContextGenerator class

Summary:
Add a ContextGenerator class so that we actually use the correct per-project
context when loading projects and computing dependencies.

Previously commands like `build` and `test` would change the contexts for each
project as they iterated through and performed the build.  However, they did
not do this when first loading the projects.  This could cause them to use
different context values when loading dependencies than when performing the
build.  For instance, this could cause issues if a project depends on
`googletest` only when testing is enabled, as the code previously did not set
the "test" parameter when evaluating dependencies.

Reviewed By: pkaush

Differential Revision: D16477396

fbshipit-source-id: c1e055f07de1cb960861d19594e3bda20a2ccd87
This commit is contained in:
Adam Simpkins
2019-07-31 20:53:07 -07:00
committed by Facebook Github Bot
parent 7844e79b03
commit f1ed28a52c
5 changed files with 113 additions and 53 deletions

View File

@@ -83,7 +83,7 @@ def load_all_manifests(build_opts):
return LOADER.load_all(build_opts)
def manifests_in_dependency_order(build_opts, manifest, ctx):
def manifests_in_dependency_order(build_opts, manifest, ctx_gen):
""" Given a manifest, expand its dependencies and return a list
of the manifest objects that would need to be built in the order
that they would need to be built. This does not evaluate whether
@@ -109,6 +109,7 @@ def manifests_in_dependency_order(build_opts, manifest, ctx):
# a correct order even if they aren't sorted, but we prefer
# to produce the same order regardless of how they are listed
# in the project manifest files.
ctx = ctx_gen.get_context(m.name)
dep_list = sorted(m.get_section_as_dict("dependencies", ctx).keys())
builder = m.get("build", "builder", ctx=ctx)
if builder == "cmake":