Skip to content

Commit 318e199

Browse files
authored
Merge pull request swiftlang#32341 from gottesmm/pr-2f5315e6db5c454c6021990aa55528e7ec1c27c2
[build-script] Print out inferred products/build order when --verbose-build is enabled.
2 parents def6e24 + a7b3e37 commit 318e199

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

utils/build-script

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,11 @@ class BuildScriptInvocation(object):
889889
# list.
890890
if self.args.infer_dependencies:
891891
combined = impl_product_classes + product_classes
892+
if self.args.verbose_build:
893+
print("-- Build Graph Inference --")
894+
print("Initial Product List:")
895+
for p in combined:
896+
print(" {}".format(p.product_name()))
892897

893898
# Now that we have produced the schedule, resplit. We require our
894899
# dependencies to respect our build-script-impl property. This means
@@ -908,6 +913,12 @@ class BuildScriptInvocation(object):
908913
impl_product_classes.append(p)
909914
else:
910915
product_classes.append(p)
916+
if self.args.verbose_build:
917+
print("Final Build Order:")
918+
for p in impl_product_classes:
919+
print(" {}".format(p.product_name()))
920+
for p in product_classes:
921+
print(" {}".format(p.product_name()))
911922
return (impl_product_classes, product_classes)
912923

913924
def execute(self):
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# RUN: %empty-directory(%t)
2+
# RUN: mkdir -p %t
3+
# RUN: SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --verbose-build --dry-run --infer --swiftpm --cmake %cmake 2>&1 | %FileCheck %s
4+
5+
# REQUIRES: standalone_build
6+
7+
# Just make sure we compute the build graph/emit output.
8+
#
9+
# CHECK: -- Build Graph Inference --
10+
# CHECK: Initial Product List:
11+
# CHECK: cmark
12+
# CHECK: llvm
13+
# CHECK: swift
14+
# CHECK: Final Build Order:
15+
# CHECK: cmark
16+
# CHECK: llvm
17+
# CHECK: swift
18+
19+
# Then make sure we are installing/building at the appropriate times.
20+
#
21+
# CHECK: --- Installing cmark ---
22+
# CHECK: --- Installing llvm ---
23+
# CHECK: --- Installing swift ---
24+
# CHECK: --- Installing llbuild ---
25+
# CHECK: --- Building swiftpm ---
26+
# CHECK: --- Installing swiftpm ---

0 commit comments

Comments
 (0)