File tree Expand file tree Collapse file tree 5 files changed +34
-0
lines changed
validation-test/BuildSystem Expand file tree Collapse file tree 5 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -796,6 +796,11 @@ class BuildScriptInvocation(object):
796
796
"--llvm-install-components=%s" % args .llvm_install_components
797
797
]
798
798
799
+ if not args .clean_llbuild :
800
+ impl_args += [
801
+ "--skip-clean-llbuild"
802
+ ]
803
+
799
804
# Compute the set of host-specific variables, which we pass through to
800
805
# the build script via environment variables.
801
806
host_specific_variables = self .compute_host_specific_variables ()
Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ KNOWN_SETTINGS=(
162
162
163
163
# # llbuild Options
164
164
llbuild-enable-assertions " 1" " enable assertions in llbuild"
165
+ skip-clean-llbuild " 0" " skip cleaning up llbuild"
165
166
166
167
# # LLDB Options
167
168
lldb-assertions " 1" " build lldb with assertions enabled"
@@ -2189,6 +2190,15 @@ for host in "${ALL_HOSTS[@]}"; do
2189
2190
-DSQLite3_INCLUDE_DIR:PATH=" $( xcrun -sdk macosx -show-sdk-path) /usr/include"
2190
2191
)
2191
2192
fi
2193
+
2194
+ if [[ " ${SKIP_CLEAN_LLBUILD} " == " 0" ]]
2195
+ then
2196
+ # Ensure llbuild will rebuild from scratch, since
2197
+ # arbitrary changes to the compiler can prevent
2198
+ # a successful incremental build
2199
+ echo " Cleaning the llbuild build directory"
2200
+ call rm -rf " $( build_directory ${host} llbuild) "
2201
+ fi
2192
2202
;;
2193
2203
xctest)
2194
2204
XCTEST_BUILD_DIR=$( build_directory ${host} xctest)
Original file line number Diff line number Diff line change @@ -1037,6 +1037,8 @@ def create_argument_parser():
1037
1037
help = 'skip testing Android device targets on the host machine (the '
1038
1038
'phone itself)' )
1039
1039
1040
+ option ('--skip-clean-llbuild' , toggle_false ('clean_llbuild' ),
1041
+ help = 'skip cleaning up llbuild' )
1040
1042
option ('--skip-clean-swiftpm' , toggle_false ('clean_swiftpm' ),
1041
1043
help = 'skip cleaning up swiftpm' )
1042
1044
option ('--skip-clean-swift-driver' , toggle_false ('clean_swift_driver' ),
Original file line number Diff line number Diff line change 212
212
defaults .SWIFT_MAX_PARALLEL_LTO_LINK_JOBS ,
213
213
'swift_user_visible_version' : defaults .SWIFT_USER_VISIBLE_VERSION ,
214
214
'symbols_package' : None ,
215
+ 'clean_llbuild' : True ,
215
216
'clean_swiftpm' : True ,
216
217
'clean_swift_driver' : True ,
217
218
'test' : None ,
@@ -578,6 +579,7 @@ class BuildScriptImplOption(_BaseOption):
578
579
dest = 'build_watchos_device' ),
579
580
DisableOption ('--skip-build-watchos-simulator' ,
580
581
dest = 'build_watchos_simulator' ),
582
+ DisableOption ('--skip-clean-llbuild' , dest = 'clean_llbuild' ),
581
583
DisableOption ('--skip-clean-swiftpm' , dest = 'clean_swiftpm' ),
582
584
DisableOption ('--skip-clean-swift-driver' , dest = 'clean_swift_driver' ),
583
585
DisableOption ('--skip-test-android' , dest = 'test_android' ),
Original file line number Diff line number Diff line change
1
+ # REQUIRES: standalone_build
2
+
3
+ # RUN: %empty-directory(%t)
4
+ # RUN: mkdir -p %t
5
+ # RUN: SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --llbuild --cmake %cmake 2>&1 | %FileCheck --check-prefix=CLEAN-LLBUILD-CHECK %s
6
+
7
+ # RUN: %empty-directory(%t)
8
+ # RUN: mkdir -p %t
9
+ # RUN: SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --llbuild --skip-clean-llbuild --cmake %cmake 2>&1 | %FileCheck --check-prefix=SKIP-CLEAN-LLBUILD-CHECK %s
10
+
11
+ # CLEAN-LLBUILD-CHECK: Cleaning the llbuild build directory
12
+ # CLEAN-LLBUILD-CHECK-NEXT: rm -rf
13
+
14
+ # SKIP-CLEAN-LLBUILD-CHECK-NOT: Cleaning the llbuild build directory
15
+ # SKIP-CLEAN-LLBUILD-CHECK-NOT: rm -rf {{.*/llbuild-[^/]*}}
You can’t perform that action at this time.
0 commit comments