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):
796796 "--llvm-install-components=%s" % args .llvm_install_components
797797 ]
798798
799+ if not args .clean_llbuild :
800+ impl_args += [
801+ "--skip-clean-llbuild"
802+ ]
803+
799804 # Compute the set of host-specific variables, which we pass through to
800805 # the build script via environment variables.
801806 host_specific_variables = self .compute_host_specific_variables ()
Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ KNOWN_SETTINGS=(
162162
163163 # # llbuild Options
164164 llbuild-enable-assertions " 1" " enable assertions in llbuild"
165+ skip-clean-llbuild " 0" " skip cleaning up llbuild"
165166
166167 # # LLDB Options
167168 lldb-assertions " 1" " build lldb with assertions enabled"
@@ -2189,6 +2190,15 @@ for host in "${ALL_HOSTS[@]}"; do
21892190 -DSQLite3_INCLUDE_DIR:PATH=" $( xcrun -sdk macosx -show-sdk-path) /usr/include"
21902191 )
21912192 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
21922202 ;;
21932203 xctest)
21942204 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():
10371037 help = 'skip testing Android device targets on the host machine (the '
10381038 'phone itself)' )
10391039
1040+ option ('--skip-clean-llbuild' , toggle_false ('clean_llbuild' ),
1041+ help = 'skip cleaning up llbuild' )
10401042 option ('--skip-clean-swiftpm' , toggle_false ('clean_swiftpm' ),
10411043 help = 'skip cleaning up swiftpm' )
10421044 option ('--skip-clean-swift-driver' , toggle_false ('clean_swift_driver' ),
Original file line number Diff line number Diff line change 212212 defaults .SWIFT_MAX_PARALLEL_LTO_LINK_JOBS ,
213213 'swift_user_visible_version' : defaults .SWIFT_USER_VISIBLE_VERSION ,
214214 'symbols_package' : None ,
215+ 'clean_llbuild' : True ,
215216 'clean_swiftpm' : True ,
216217 'clean_swift_driver' : True ,
217218 'test' : None ,
@@ -578,6 +579,7 @@ class BuildScriptImplOption(_BaseOption):
578579 dest = 'build_watchos_device' ),
579580 DisableOption ('--skip-build-watchos-simulator' ,
580581 dest = 'build_watchos_simulator' ),
582+ DisableOption ('--skip-clean-llbuild' , dest = 'clean_llbuild' ),
581583 DisableOption ('--skip-clean-swiftpm' , dest = 'clean_swiftpm' ),
582584 DisableOption ('--skip-clean-swift-driver' , dest = 'clean_swift_driver' ),
583585 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