Skip to content

[build-script] Add extra-stdlib-deployment-targets to build-util #13106

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

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 6 additions & 0 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ class BuildScriptInvocation(object):
args.stdlib_deployment_targets = [
target.name for target in stdlib_targets]

# Additional stdlib targets if we want to still build the default
# deployment targets as well.
if args.extra_stdlib_deployment_targets is not None:
args.stdlib_deployment_targets += \
args.extra_stdlib_deployment_targets

# SwiftPM and XCTest have a dependency on Foundation.
# On OS X, Foundation is built automatically using xcodebuild.
# On Linux, we must ensure that it is built manually.
Expand Down
6 changes: 6 additions & 0 deletions utils/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,12 @@ def create_argument_parser():
help='list of targets to compile or cross-compile the Swift '
'standard library for. %(default)s by default.')

option('--extra-stdlib-deployment-targets', append,
type=argparse.ShellSplitType(),
default=None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind making the default an empty list? Then you wouldn't need this explicit line at all.

help='list of additional targets to cross-compile the Swift standard '
'library for in addition to default')

option('--build-stdlib-deployment-targets', store,
type=argparse.ShellSplitType(),
default=['all'],
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 @@ -119,6 +119,7 @@
'enable_ubsan': False,
'export_compile_commands': False,
'extra_cmake_options': [],
'extra_stdlib_deployment_targets': None,
'extra_swift_args': [],
'force_optimized_typechecker': False,
'foundation_build_variant': 'Debug',
Expand Down Expand Up @@ -510,6 +511,7 @@ class IgnoreOption(_BaseOption):
AppendOption('--extra-cmake-options'),
AppendOption('--extra-swift-args'),
AppendOption('--stdlib-deployment-targets'),
AppendOption('--extra-stdlib-deployment-targets'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for adding this to the test suite!

AppendOption('--test-paths'),

UnsupportedOption('--build-jobs'),
Expand Down