Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into master-next
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-ci committed Jun 9, 2020
2 parents 46aac32 + 13f6885 commit 048349f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions utils/build-script
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
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
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
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'),
]

0 comments on commit 048349f

Please sign in to comment.