Skip to content

Commit

Permalink
Add --only-deps option for caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Sep 25, 2024
1 parent c2389ce commit 3249f83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions alibuild_helpers/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def doParseArgs():
"in multiple packages. The comment will only be stored if "
"PACKAGE is compiled or downloaded during this run; if it "
"already exists, this does not happen."))
build_parser.add_argument("--only-deps", dest="onlyDeps", default=False, action="store_true",
help="Only build dependencies, not the main package (e.g. for caching)")

build_docker = build_parser.add_argument_group(title="Build inside a container", description="""\
Builds can be done inside a Docker container, to make it easier to get a
Expand Down
6 changes: 6 additions & 0 deletions alibuild_helpers/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,12 @@ def doBuild(args, parser):
deps=",".join(buildOrder[:-1]),
), args.architecture)

# If we are building only the dependencies, the last package in
# the build order can be considered done.
if args.onlyDeps:
mainPackage = buildOrder.pop()
warning("Not rebuilding %s because --only-deps option provided.", mainPackage["package"])

while buildOrder:
p = buildOrder[0]
spec = specs[p]
Expand Down

0 comments on commit 3249f83

Please sign in to comment.