Skip to content

Commit bb89c46

Browse files
authored
Merge pull request #31015 from benlangmuir/sk-sanitize
[build-script] Add sanitizer options to sourcekit-lsp
2 parents 727e222 + 5eb1432 commit bb89c46

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

utils/build-presets.ini

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,18 +1716,34 @@ install-swiftevolve
17161716
# Test SourceKit-LSP
17171717
#===------------------------------------------------------------------------===#
17181718

1719-
[preset: buildbot_sourcekitlsp_macos]
1719+
[preset: buildbot_sourcekitlsp_macos,no_sanitize]
17201720
mixin-preset=mixin_swiftpm_package_macos_platform
17211721
release
17221722
assertions
17231723
sourcekit-lsp
17241724

1725-
[preset: buildbot_sourcekitlsp_linux]
1725+
[preset: buildbot_sourcekitlsp_linux,no_sanitize]
17261726
mixin-preset=mixin_swiftpm_package_linux_platform
17271727
release
17281728
assertions
17291729
sourcekit-lsp
17301730

1731+
[preset: buildbot_sourcekitlsp_macos,sanitize]
1732+
mixin-preset=buildbot_sourcekitlsp_macos,no_sanitize
1733+
test-sourcekit-lsp-sanitize-all
1734+
1735+
[preset: buildbot_sourcekitlsp_linux,sanitize]
1736+
mixin-preset=buildbot_sourcekitlsp_linux,no_sanitize
1737+
test-sourcekit-lsp-sanitize-all
1738+
1739+
# Default: no sanitizers
1740+
[preset: buildbot_sourcekitlsp_macos]
1741+
mixin-preset=buildbot_sourcekitlsp_macos,no_sanitize
1742+
1743+
# Default: no sanitizers
1744+
[preset: buildbot_sourcekitlsp_linux]
1745+
mixin-preset=buildbot_sourcekitlsp_linux,no_sanitize
1746+
17311747
#===------------------------------------------------------------------------===#
17321748
# Test IndexStore-DB
17331749
#===------------------------------------------------------------------------===#

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,9 @@ def create_argument_parser():
572572
help='run indexstore-db tests under all sanitizers')
573573
option(['--sourcekit-lsp'], toggle_true('build_sourcekitlsp'),
574574
help='build SourceKitLSP')
575+
option('--test-sourcekit-lsp-sanitize-all',
576+
toggle_true('test_sourcekitlsp_sanitize_all'),
577+
help='run sourcekit-lsp tests under all sanitizers')
575578
option('--install-swiftsyntax', toggle_true('install_swiftsyntax'),
576579
help='install SwiftSyntax')
577580
option('--swiftsyntax-verify-generated-files',

utils/build_swift/tests/expected_options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
'build_swiftevolve': False,
9393
'build_indexstoredb': False,
9494
'test_indexstoredb_sanitize_all': False,
95+
'test_sourcekitlsp_sanitize_all': False,
9596
'build_sourcekitlsp': False,
9697
'install_swiftpm': False,
9798
'install_swiftsyntax': False,
@@ -507,6 +508,8 @@ class BuildScriptImplOption(_BaseOption):
507508
EnableOption('--test-indexstore-db-sanitize-all',
508509
dest='test_indexstoredb_sanitize_all'),
509510
EnableOption('--sourcekit-lsp', dest='build_sourcekitlsp'),
511+
EnableOption('--test-sourcekit-lsp-sanitize-all',
512+
dest='test_sourcekitlsp_sanitize_all'),
510513
EnableOption('--install-swiftsyntax', dest='install_swiftsyntax'),
511514
EnableOption('--swiftsyntax-verify-generated-files',
512515
dest='swiftsyntax_verify_generated_files'),

utils/swift_build_support/swift_build_support/products/sourcekitlsp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def should_test(self, host_target):
3535

3636
def test(self, host_target):
3737
indexstoredb.run_build_script_helper(
38-
'test', host_target, self, self.args)
38+
'test', host_target, self, self.args,
39+
self.args.test_sourcekitlsp_sanitize_all)
3940

4041
def should_install(self, host_target):
4142
return self.args.install_sourcekitlsp

0 commit comments

Comments
 (0)