Skip to content

Commit 3b0cf9e

Browse files
authored
Merge pull request #26703 from benlangmuir/install-sourcekit-lsp-51
[5.1] Installation support for sourcekit-lsp
2 parents 1329017 + 775be7d commit 3b0cf9e

File tree

7 files changed

+81
-15
lines changed

7 files changed

+81
-15
lines changed

utils/build-presets.ini

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ dash-dash
1818

1919
swift-install-components=compiler;clang-builtin-headers;stdlib;sdk-overlay;parser-lib;editor-integration;tools;toolchain-tools;testsuite-tools;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers;
2020

21+
[preset: mixin_buildbot_install_components_with_clang]
22+
swift-install-components=compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;parser-lib;toolchain-tools;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
23+
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt;clangd
2124

2225
[preset: mixin_buildbot_trunk_base]
2326
# Build standard library and SDK overlay for iOS device and simulator.
@@ -322,14 +325,18 @@ tvos
322325
watchos
323326

324327
[preset: buildbot_incremental,tools=RA,stdlib=RA]
325-
mixin-preset=buildbot_incremental_base_all_platforms
328+
mixin-preset=
329+
buildbot_incremental_base_all_platforms
330+
mixin_buildbot_install_components_with_clang
326331

327332
build-subdir=buildbot_incremental
328333

329334
# Build Release without debug info, because it is faster to build.
330335
release
331336
assertions
332337

338+
libcxx
339+
333340
# Build llbuild & swiftpm here
334341
llbuild
335342
swiftpm
@@ -351,6 +358,7 @@ skip-test-watchos
351358
install-swift
352359
install-llbuild
353360
install-swiftpm
361+
install-libcxx
354362

355363
[preset: buildbot_incremental,tools=RA,stdlib=RA,xcode]
356364
mixin-preset=buildbot_incremental,tools=RA,stdlib=RA
@@ -518,6 +526,7 @@ swift-stdlib-build-type=RelWithDebInfo
518526
mixin-preset=
519527
buildbot_incremental_base
520528
lldb-smoketest,tools=RA
529+
mixin_buildbot_install_components_with_clang
521530
build-subdir=buildbot_incremental
522531

523532
# We build release+asserts.
@@ -544,13 +553,15 @@ verbose-build
544553
# Build ninja while we are at it
545554
build-ninja
546555

556+
libcxx
547557
llbuild
548558
swiftpm
549559
indexstore-db
550560
sourcekit-lsp
551561
install-swift
552562
install-llbuild
553563
install-swiftpm
564+
install-libcxx
554565

555566
# We need to build the unittest extras so we can test
556567
build-swift-stdlib-unittest-extra
@@ -717,8 +728,14 @@ swift-enable-ast-verifier=0
717728
#===------------------------------------------------------------------------===#
718729
# Linux Builders
719730
#===------------------------------------------------------------------------===#
731+
[preset: mixin_linux_install_components_with_clang]
732+
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;parser-lib;toolchain-tools;license;sourcekit-inproc
733+
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt;clangd
734+
720735
[preset: mixin_linux_installation]
721-
mixin-preset=mixin_lightweight_assertions
736+
mixin-preset=
737+
mixin_lightweight_assertions
738+
mixin_linux_install_components_with_clang
722739

723740
llbuild
724741
swiftpm
@@ -736,9 +753,8 @@ install-swiftpm
736753
install-xctest
737754
install-libicu
738755
install-prefix=/usr
739-
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;parser-lib;toolchain-tools;license;sourcekit-inproc
740-
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt;clangd
741756
install-libcxx
757+
install-sourcekit-lsp
742758
build-swift-static-stdlib
743759
build-swift-static-sdk-overlay
744760
build-swift-stdlib-unittest-extra
@@ -968,9 +984,12 @@ build-ninja
968984
reconfigure
969985

970986
[preset: buildbot_incremental_linux]
971-
mixin-preset=buildbot_incremental_linux_base
987+
mixin-preset=
988+
buildbot_incremental_linux_base
989+
mixin_linux_install_components_with_clang
972990
build-subdir=buildbot_incremental
973991

992+
libcxx
974993
libicu
975994
llbuild
976995
swiftpm
@@ -988,6 +1007,7 @@ install-swiftpm
9881007
install-foundation
9891008
install-libdispatch
9901009
install-xctest
1010+
install-libcxx
9911011

9921012
[preset: buildbot_incremental_linux,long_test]
9931013
mixin-preset=buildbot_incremental_linux
@@ -1022,7 +1042,6 @@ enable-asan
10221042
indexstore-db=0
10231043
sourcekit-lsp=0
10241044

1025-
10261045
# This does not currently pass due to leakers in the optimizer.
10271046
[preset: buildbot_incremental_linux,lsan,tools=RDA,stdlib=RDA,test=no]
10281047
build-subdir=buildbot_incremental_lsan
@@ -1064,6 +1083,7 @@ sourcekit-lsp=0
10641083
# OS X Package Builders
10651084
#===------------------------------------------------------------------------===#
10661085
[preset: mixin_osx_package_base]
1086+
mixin-preset=mixin_buildbot_install_components_with_clang
10671087
ios
10681088
tvos
10691089
watchos
@@ -1105,6 +1125,8 @@ skip-install-swiftsyntax-module
11051125
install-skstresstester
11061126
install-swiftevolve
11071127
install-playgroundsupport
1128+
install-libcxx
1129+
install-sourcekit-lsp
11081130

11091131
install-destdir=%(install_destdir)s
11101132

@@ -1125,10 +1147,6 @@ test-installable-package
11251147
# If someone uses this for incremental builds, force reconfiguration.
11261148
reconfigure
11271149

1128-
swift-install-components=compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;parser-lib;toolchain-tools;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
1129-
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt;clangd
1130-
install-libcxx
1131-
11321150
# Path to the .tar.gz package we would create.
11331151
installable-package=%(installable_package)s
11341152

@@ -1304,18 +1322,29 @@ swift-stdlib-build-type=Release
13041322
mixin-preset=
13051323
buildbot_incremental_base_all_platforms
13061324
lldb-smoketest,tools=RA
1325+
mixin_buildbot_install_components_with_clang
13071326

13081327
build-subdir=buildbot_incremental
13091328

13101329
# Build Release without debug info, because it is faster to build.
13111330
release
13121331
assertions
13131332

1333+
libcxx
1334+
13141335
# Build llbuild & swiftpm here
13151336
llbuild
13161337
swiftpm
13171338
swiftsyntax
13181339

1340+
# Build sourcekit-lsp & indexstore-db
1341+
indexstore-db
1342+
sourcekit-lsp
1343+
install-swift
1344+
install-llbuild
1345+
install-swiftpm
1346+
install-libcxx
1347+
13191348
# Build Playground support
13201349
playgroundsupport
13211350

@@ -1361,14 +1390,18 @@ skip-test-osx
13611390
#===------------------------------------------------------------------------===#
13621391

13631392
[preset: buildbot_swiftpm_macos_platform,tools=RA,stdlib=RA]
1364-
mixin-preset=buildbot_incremental_base
1393+
mixin-preset=
1394+
buildbot_incremental_base
1395+
mixin_buildbot_install_components_with_clang
13651396

13661397
build-subdir=buildbot_incremental
13671398

13681399
# Build Release without debug info, because it is faster to build.
13691400
release
13701401
assertions
13711402

1403+
libcxx
1404+
13721405
# Build llbuild & swiftpm here
13731406
llbuild
13741407
swiftpm
@@ -1378,6 +1411,7 @@ sourcekit-lsp
13781411
install-swift
13791412
install-llbuild
13801413
install-swiftpm
1414+
install-libcxx
13811415

13821416
dash-dash
13831417

@@ -1390,7 +1424,9 @@ skip-test-llbuild
13901424
#===------------------------------------------------------------------------===#
13911425

13921426
[preset: buildbot_swiftpm_linux_platform,tools=RA,stdlib=RA]
1393-
mixin-preset=buildbot_incremental_base
1427+
mixin-preset=
1428+
buildbot_incremental_base
1429+
mixin_linux_install_components_with_clang
13941430

13951431
build-subdir=buildbot_incremental
13961432

@@ -1404,6 +1440,7 @@ xctest
14041440
foundation
14051441
libdispatch
14061442
llbuild
1443+
libcxx
14071444
sourcekit-lsp
14081445

14091446
install-swift
@@ -1412,6 +1449,7 @@ install-swiftpm
14121449
install-foundation
14131450
install-libdispatch
14141451
install-xctest
1452+
install-libcxx
14151453

14161454
skip-test-swift
14171455
skip-test-cmark
@@ -1454,6 +1492,7 @@ build-subdir=buildbot_incremental
14541492
release
14551493
assertions
14561494

1495+
libcxx
14571496
llbuild
14581497
swiftpm
14591498
indexstore-db
@@ -1462,22 +1501,27 @@ sourcekit-lsp
14621501
install-swift
14631502
install-llbuild
14641503
install-swiftpm
1504+
install-libcxx
14651505

14661506
skip-test-swift
14671507
skip-test-cmark
14681508
skip-test-llbuild
14691509
skip-test-swiftpm
14701510

14711511
[preset: buildbot_swiftpm_package_macos]
1472-
mixin-preset=buildbot_swiftpm_package_base
1512+
mixin-preset=
1513+
buildbot_swiftpm_package_base
1514+
mixin_buildbot_install_components_with_clang
14731515

14741516
# Build stdlib for all platforms.
14751517
ios
14761518
tvos
14771519
watchos
14781520

14791521
[preset: buildbot_swiftpm_package_linux]
1480-
mixin-preset=buildbot_swiftpm_package_base
1522+
mixin-preset=
1523+
buildbot_swiftpm_package_base
1524+
mixin_linux_install_components_with_clang
14811525

14821526
libdispatch
14831527
foundation

utils/build-script

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ class BuildScriptInvocation(object):
274274
def apply_default_arguments(toolchain, args):
275275
# Infer if ninja is required
276276
ninja_required = (
277-
args.cmake_generator == 'Ninja' or args.build_foundation)
277+
args.cmake_generator == 'Ninja' or args.build_foundation or
278+
args.build_sourcekitlsp or args.build_indexstoredb)
278279
if ninja_required and toolchain.ninja is None:
279280
args.build_ninja = True
280281

@@ -1015,6 +1016,7 @@ class BuildScriptInvocation(object):
10151016
host_target, product_name))
10161017
product.do_build(host_target)
10171018
product.do_test(host_target)
1019+
product.install(host_target)
10181020

10191021
# Extract symbols...
10201022
for host_target in all_hosts:

utils/build_swift/driver_arguments.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ def create_argument_parser():
553553
help='build IndexStoreDB')
554554
option(['--sourcekit-lsp'], toggle_true('build_sourcekitlsp'),
555555
help='build SourceKitLSP')
556+
option(['--install-sourcekit-lsp'], toggle_true('install_sourcekitlsp'),
557+
help='install SourceKitLSP')
556558

557559
option('--xctest', toggle_true('build_xctest'),
558560
help='build xctest')

utils/build_swift/tests/expected_options.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
'build_swiftevolve': False,
8989
'build_indexstoredb': False,
9090
'build_sourcekitlsp': False,
91+
'install_sourcekitlsp': False,
9192
'build_tvos': True,
9293
'build_tvos_device': False,
9394
'build_tvos_simulator': False,
@@ -450,6 +451,7 @@ class IgnoreOption(_BaseOption):
450451
EnableOption('--libicu', dest='build_libicu'),
451452
EnableOption('--indexstore-db', dest='build_indexstoredb'),
452453
EnableOption('--sourcekit-lsp', dest='build_sourcekitlsp'),
454+
EnableOption('--install-sourcekit-lsp', dest='install_sourcekitlsp'),
453455
EnableOption('--long-test'),
454456
EnableOption('--show-sdks'),
455457
EnableOption('--stress-test'),

utils/swift_build_support/swift_build_support/products/indexstoredb.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def do_test(self, host_target):
3434
if self.args.test and self.args.test_indexstoredb:
3535
run_build_script_helper('test', host_target, self, self.args)
3636

37+
def install(self, host_target):
38+
pass
39+
3740

3841
def run_build_script_helper(action, host_target, product, args):
3942
script_path = os.path.join(
@@ -52,5 +55,6 @@ def run_build_script_helper(action, host_target, product, args):
5255
'--build-path', product.build_dir,
5356
'--configuration', configuration,
5457
'--toolchain', toolchain_path,
58+
'--ninja-bin', product.toolchain.ninja,
5559
]
5660
shell.call(helper_cmd)

utils/swift_build_support/swift_build_support/products/product.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ def do_test(self, host_target):
5757
"""
5858
raise NotImplementedError
5959

60+
def install(self, host_target):
61+
"""install() -> void
62+
63+
Install to the toolchain, for a non-build-script-impl product.
64+
"""
65+
raise NotImplementedError
66+
6067
def __init__(self, args, toolchain, source_dir, build_dir):
6168
self.args = args
6269
self.toolchain = toolchain

utils/swift_build_support/swift_build_support/products/sourcekitlsp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ def do_test(self, host_target):
3131
if self.args.test and self.args.test_sourcekitlsp:
3232
indexstoredb.run_build_script_helper(
3333
'test', host_target, self, self.args)
34+
35+
def install(self, host_target):
36+
if self.args.install_sourcekitlsp:
37+
indexstoredb.run_build_script_helper(
38+
'install', host_target, self, self.args)

0 commit comments

Comments
 (0)