Commit e8c7b488 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

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
parent a4179ec0
......@@ -222,37 +222,39 @@ class BuildCmd(SubCmd):
install_dirs = []
for m in projects:
print("Assessing %s..." % m.name)
fetcher = m.create_fetcher(opts, ctx)
if args.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)
build_dir = dirs["build_dir"]
inst_dir = dirs["inst_dir"]
built_marker = os.path.join(inst_dir, ".built-by-getdeps")
if os.path.exists(built_marker):
with open(built_marker, "r") as f:
built_hash = f.read().strip()
if built_hash != dirs["hash"]:
# Some kind of inconsistency with a prior build,
# let's run it again to be sure
os.unlink(built_marker)
if m == manifest or not args.no_deps:
print("Assessing %s..." % m.name)
change_status = fetcher.update()
reconfigure = change_status.build_changed()
sources_changed = change_status.sources_changed()
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):
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"])
with open(built_marker, "r") as f:
built_hash = f.read().strip()
if built_hash != dirs["hash"]:
# 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):
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)
......@@ -273,6 +275,17 @@ class BuildCmd(SubCmd):
"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")
......
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