mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-05 19:55:47 +03:00
fbcode_builder: getdeps: add build --no-deps
flag
Summary: This is useful especially on Windows where the up-to-date checks for the dependencies take a long time. The idea is that you might run this to start: ``` $ getdeps.py build eden ``` and then while in the edit/debug/build iteration cycle: ``` $ getdeps.py build --no-deps eden ``` Reviewed By: pkaush Differential Revision: D15200352 fbshipit-source-id: 086f2f49db967ef4d1914a69fa80067104d79136
This commit is contained in:
committed by
Facebook Github Bot
parent
5dfcb6175b
commit
38ac8844c0
@@ -222,37 +222,39 @@ class BuildCmd(SubCmd):
|
|||||||
install_dirs = []
|
install_dirs = []
|
||||||
|
|
||||||
for m in projects:
|
for m in projects:
|
||||||
print("Assessing %s..." % m.name)
|
|
||||||
fetcher = m.create_fetcher(opts, ctx)
|
fetcher = m.create_fetcher(opts, ctx)
|
||||||
|
|
||||||
if args.clean:
|
if args.clean:
|
||||||
fetcher.clean()
|
fetcher.clean()
|
||||||
change_status = fetcher.update()
|
|
||||||
reconfigure = change_status.build_changed()
|
|
||||||
sources_changed = change_status.sources_changed()
|
|
||||||
|
|
||||||
dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx)
|
dirs = opts.compute_dirs(m, fetcher, manifests_by_name, ctx)
|
||||||
build_dir = dirs["build_dir"]
|
build_dir = dirs["build_dir"]
|
||||||
inst_dir = dirs["inst_dir"]
|
inst_dir = dirs["inst_dir"]
|
||||||
|
|
||||||
built_marker = os.path.join(inst_dir, ".built-by-getdeps")
|
if m == manifest or not args.no_deps:
|
||||||
if os.path.exists(built_marker):
|
print("Assessing %s..." % m.name)
|
||||||
with open(built_marker, "r") as f:
|
change_status = fetcher.update()
|
||||||
built_hash = f.read().strip()
|
reconfigure = change_status.build_changed()
|
||||||
if built_hash != dirs["hash"]:
|
sources_changed = change_status.sources_changed()
|
||||||
# Some kind of inconsistency with a prior build,
|
|
||||||
# let's run it again to be sure
|
|
||||||
os.unlink(built_marker)
|
|
||||||
|
|
||||||
if sources_changed or reconfigure or not os.path.exists(built_marker):
|
built_marker = os.path.join(inst_dir, ".built-by-getdeps")
|
||||||
if os.path.exists(built_marker):
|
if os.path.exists(built_marker):
|
||||||
os.unlink(built_marker)
|
with open(built_marker, "r") as f:
|
||||||
src_dir = fetcher.get_src_dir()
|
built_hash = f.read().strip()
|
||||||
builder = m.create_builder(opts, src_dir, build_dir, inst_dir, ctx)
|
if built_hash != dirs["hash"]:
|
||||||
builder.build(install_dirs, reconfigure=reconfigure)
|
# Some kind of inconsistency with a prior build,
|
||||||
|
# let's run it again to be sure
|
||||||
|
os.unlink(built_marker)
|
||||||
|
|
||||||
with open(built_marker, "w") as f:
|
if sources_changed or reconfigure or not os.path.exists(built_marker):
|
||||||
f.write(dirs["hash"])
|
if os.path.exists(built_marker):
|
||||||
|
os.unlink(built_marker)
|
||||||
|
src_dir = fetcher.get_src_dir()
|
||||||
|
builder = m.create_builder(opts, src_dir, build_dir, inst_dir, ctx)
|
||||||
|
builder.build(install_dirs, reconfigure=reconfigure)
|
||||||
|
|
||||||
|
with open(built_marker, "w") as f:
|
||||||
|
f.write(dirs["hash"])
|
||||||
|
|
||||||
install_dirs.append(inst_dir)
|
install_dirs.append(inst_dir)
|
||||||
|
|
||||||
@@ -273,6 +275,17 @@ class BuildCmd(SubCmd):
|
|||||||
"causing the projects to be built from scratch"
|
"causing the projects to be built from scratch"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--no-deps",
|
||||||
|
action="store_true",
|
||||||
|
default=False,
|
||||||
|
help=(
|
||||||
|
"Only build the named project, not its deps. "
|
||||||
|
"This is most useful after you've built all of the deps, "
|
||||||
|
"and helps to avoid waiting for relatively "
|
||||||
|
"slow up-to-date-ness checks"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@cmd("test", "test a given project")
|
@cmd("test", "test a given project")
|
||||||
|
Reference in New Issue
Block a user