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

extract get_dependencies method

Summary:
A number of places were extracting dependencies from manifests, but only one was adding in the implicit dependencies for build tools.

Extract the logic to one place and use so that a change in a tool like cmake will now correctly affect all tools using cmake, as it will be taken into account as a dependency hash when the manifest's hash is computed.

Tests for this change revealed that install_dirs needed to be populated in reverse order from the manifest topo-sort, so have also addressed that

Reviewed By: wittgenst

Differential Revision: D32730717

fbshipit-source-id: 1b2a25e460de6085d274c99acfd391b3bd259264
This commit is contained in:
Alex Hornby
2022-01-07 01:31:45 -08:00
committed by Facebook GitHub Bot
parent c62be75fd3
commit 88f96e63cb
6 changed files with 31 additions and 23 deletions

View File

@@ -246,6 +246,24 @@ class ManifestParser(object):
return defval
def get_dependencies(self, ctx):
dep_list = list(self.get_section_as_dict("dependencies", ctx).keys())
dep_list.sort()
builder = self.get("build", "builder", ctx=ctx)
if builder in ("cmake", "python-wheel"):
dep_list.insert(0, "cmake")
elif builder == "autoconf" and self.name not in (
"autoconf",
"libtool",
"automake",
):
# they need libtool and its deps (automake, autoconf) so add
# those as deps (but obviously not if we're building those
# projects themselves)
dep_list.insert(0, "libtool")
return dep_list
def get_section_as_args(self, section, ctx=None):
"""Intended for use with the make.[build_args/install_args] and
autoconf.args sections, this method collects the entries and returns an
@@ -290,9 +308,8 @@ class ManifestParser(object):
res.append((key, value))
return res
def get_section_as_dict(self, section, ctx=None):
def get_section_as_dict(self, section, ctx):
d = {}
ctx = ctx or {}
for s in self._config.sections():
if s != section: