Skip to content

[build-script] Define default llvm_install_components. #32257

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
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
5 changes: 5 additions & 0 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,11 @@ class BuildScriptInvocation(object):
os.path.abspath(args.coverage_db)
]

if args.llvm_install_components:
impl_args += [
"--llvm-install-components=%s" % args.llvm_install_components
]

# Compute the set of host-specific variables, which we pass through to
# the build script via environment variables.
host_specific_variables = self.compute_host_specific_variables()
Expand Down
14 changes: 14 additions & 0 deletions utils/build_swift/build_swift/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from __future__ import absolute_import, unicode_literals

import os
import platform

from . import shell
Expand Down Expand Up @@ -113,6 +114,19 @@ def _default_swift_lto_link_jobs():
SWIFT_MAX_PARALLEL_LTO_LINK_JOBS = _default_swift_lto_link_jobs()


def llvm_install_components():
"""Convenience function for getting the default llvm install components for
platforms.
"""
components = ['llvm-cov', 'llvm-profdata', 'IndexStore', 'clang',
'clang-resource-headers', 'compiler-rt', 'clangd']
if os.sys.platform == 'darwin':
components.extend(['llvm-dsymutil'])
else:
components.extend(['lld'])
return ';'.join(components)


# Options that can only be "configured" by editing this file.
#
# These options are not exposed as command line options on purpose. If you
Expand Down
4 changes: 4 additions & 0 deletions utils/build_swift/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ def create_argument_parser():
option('--coverage-db', store_path,
help='coverage database to use when prioritizing testing')

option('--llvm-install-components', store,
default=defaults.llvm_install_components(),
help='A semi-colon split list of llvm components to install')

# -------------------------------------------------------------------------
in_group('Host and cross-compilation targets')

Expand Down
5 changes: 4 additions & 1 deletion utils/build_swift/tests/expected_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@
'validation_test': None,
'verbose_build': False,
'watchos': False,
'watchos_all': False
'watchos_all': False,
'llvm_install_components': defaults.llvm_install_components(),
}


Expand Down Expand Up @@ -675,4 +676,6 @@ class BuildScriptImplOption(_BaseOption):
IgnoreOption('--ios-all'),
IgnoreOption('--tvos-all'),
IgnoreOption('--watchos-all'),

StrOption('--llvm-install-components'),
]