Skip to content

[build-script] Installation support for sourcekit-lsp #26619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ install-xctest
install-libicu
install-prefix=/usr
install-libcxx
install-sourcekit-lsp
build-swift-static-stdlib
build-swift-static-sdk-overlay
build-swift-stdlib-unittest-extra
Expand Down Expand Up @@ -1067,7 +1068,6 @@ enable-asan
indexstore-db=0
sourcekit-lsp=0


# This does not currently pass due to leakers in the optimizer.
[preset: buildbot_incremental_linux,lsan,tools=RDA,stdlib=RDA,test=no]
build-subdir=buildbot_incremental_lsan
Expand Down Expand Up @@ -1150,6 +1150,7 @@ install-skstresstester
install-swiftevolve
install-playgroundsupport
install-libcxx
install-sourcekit-lsp

install-destdir=%(install_destdir)s

Expand Down
1 change: 1 addition & 0 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ class BuildScriptInvocation(object):
host_target, product_name))
product.build(host_target)
product.test(host_target)
product.install(host_target)

# Extract symbols...
for host_target in all_hosts:
Expand Down
2 changes: 2 additions & 0 deletions utils/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ def create_argument_parser():
help='build IndexStoreDB')
option(['--sourcekit-lsp'], toggle_true('build_sourcekitlsp'),
help='build SourceKitLSP')
option(['--install-sourcekit-lsp'], toggle_true('install_sourcekitlsp'),
help='install SourceKitLSP')
option(['--toolchain-benchmarks'],
toggle_true('build_toolchainbenchmarks'),
help='build Swift Benchmarks using swiftpm against the just built '
Expand Down
2 changes: 2 additions & 0 deletions utils/build_swift/tests/expected_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
'build_swiftevolve': False,
'build_indexstoredb': False,
'build_sourcekitlsp': False,
'install_sourcekitlsp': False,
'build_toolchainbenchmarks': False,
'build_tvos': True,
'build_tvos_device': False,
Expand Down Expand Up @@ -459,6 +460,7 @@ class IgnoreOption(_BaseOption):
EnableOption('--libicu', dest='build_libicu'),
EnableOption('--indexstore-db', dest='build_indexstoredb'),
EnableOption('--sourcekit-lsp', dest='build_sourcekitlsp'),
EnableOption('--install-sourcekit-lsp', dest='install_sourcekitlsp'),
EnableOption('--toolchain-benchmarks', dest='build_toolchainbenchmarks'),
EnableOption('--tsan-libdispatch-test'),
EnableOption('--long-test'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def test(self, host_target):
bench_Osize = os.path.join(self.build_dir, 'bin', 'Benchmark_Osize')
shell.call([bench_Osize] + cmdline)

def install(self, host_target):
pass


def run_build_script_helper(host_target, product, args):
toolchain_path = args.install_destdir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def test(self, host_target):
if self.args.test and self.args.test_indexstoredb:
run_build_script_helper('test', host_target, self, self.args)

def install(self, host_target):
pass


def run_build_script_helper(action, host_target, product, args):
script_path = os.path.join(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ def test(self, host_target):
"""
raise NotImplementedError

def install(self, host_target):
"""install() -> void

Install to the toolchain, for a non-build-script-impl product.
"""
raise NotImplementedError

def __init__(self, args, toolchain, source_dir, build_dir):
self.args = args
self.toolchain = toolchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ def test(self, host_target):
if self.args.test and self.args.test_sourcekitlsp:
indexstoredb.run_build_script_helper(
'test', host_target, self, self.args)

def install(self, host_target):
if self.args.install_sourcekitlsp:
indexstoredb.run_build_script_helper(
'install', host_target, self, self.args)
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ def test(self, host_target):

with shell.pushd(self.build_dir):
shell.call(cmd, env=env)

def install(self, host_target):
pass