Skip to content

Commit 5eb1432

Browse files
committed
[build-script] Add sanitizer options to sourcekit-lsp
For now, default to no sanitizers.
1 parent 9b1c4c6 commit 5eb1432

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
@@ -1712,18 +1712,34 @@ install-swiftevolve
17121712
# Test SourceKit-LSP
17131713
#===------------------------------------------------------------------------===#
17141714

1715-
[preset: buildbot_sourcekitlsp_macos]
1715+
[preset: buildbot_sourcekitlsp_macos,no_sanitize]
17161716
mixin-preset=mixin_swiftpm_package_macos_platform
17171717
release
17181718
assertions
17191719
sourcekit-lsp
17201720

1721-
[preset: buildbot_sourcekitlsp_linux]
1721+
[preset: buildbot_sourcekitlsp_linux,no_sanitize]
17221722
mixin-preset=mixin_swiftpm_package_linux_platform
17231723
release
17241724
assertions
17251725
sourcekit-lsp
17261726

1727+
[preset: buildbot_sourcekitlsp_macos,sanitize]
1728+
mixin-preset=buildbot_sourcekitlsp_macos,no_sanitize
1729+
test-sourcekit-lsp-sanitize-all
1730+
1731+
[preset: buildbot_sourcekitlsp_linux,sanitize]
1732+
mixin-preset=buildbot_sourcekitlsp_linux,no_sanitize
1733+
test-sourcekit-lsp-sanitize-all
1734+
1735+
# Default: no sanitizers
1736+
[preset: buildbot_sourcekitlsp_macos]
1737+
mixin-preset=buildbot_sourcekitlsp_macos,no_sanitize
1738+
1739+
# Default: no sanitizers
1740+
[preset: buildbot_sourcekitlsp_linux]
1741+
mixin-preset=buildbot_sourcekitlsp_linux,no_sanitize
1742+
17271743
#===------------------------------------------------------------------------===#
17281744
# Test IndexStore-DB
17291745
#===------------------------------------------------------------------------===#

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)