Skip to content

Commit 7fed662

Browse files
gribozavrtkremenek
authored andcommitted
[swift-3.0-preview-2-branch] build-script fixes (#3234)
* build-script: unbreak the 'build-swift-stdlib' option Argparse was trying to helpfully match it with 'build-swift-stdlib-unittest-extra', but this wasn't our intention. rdar://problem/27030803 * [build-script] Support concatenated stdlib-deployment-targets. - This fixes a regression introduced in a4537e8, where we used to accept a list of concatenated deployment targets as a single argument. - <rdar://problem/26928189> build-script fails to split deployment targets before iterating over them
1 parent 8bd98f2 commit 7fed662

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

utils/build-script

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@ class BuildScriptInvocation(object):
245245
if args.build_variant is None:
246246
args.build_variant = "Debug"
247247

248+
# Set the default stdlib-deployment-targets, if none were provided.
249+
if args.stdlib_deployment_targets is None:
250+
stdlib_targets = \
251+
StdlibDeploymentTarget.default_stdlib_deployment_targets()
252+
args.stdlib_deployment_targets = [
253+
target.name for target in stdlib_targets]
254+
248255
# Propagate the default build variant.
249256
if args.cmark_build_variant is None:
250257
args.cmark_build_variant = args.build_variant
@@ -627,6 +634,11 @@ class BuildScriptInvocation(object):
627634
impl_args += ["--skip-build-swiftpm"]
628635
if args.build_swift_stdlib_unittest_extra:
629636
impl_args += ["--build-swift-stdlib-unittest-extra"]
637+
if args.build_swift_stdlib is not None:
638+
if args.build_swift_stdlib:
639+
impl_args += ["--build-swift-stdlib=1"]
640+
else:
641+
impl_args += ["--build-swift-stdlib=0"]
630642

631643
if args.skip_build_linux:
632644
impl_args += ["--skip-build-linux"]
@@ -1081,15 +1093,12 @@ details of the setups of other systems or automated environments.""")
10811093
"tools for. Can be used multiple times.",
10821094
action=arguments.action.concat, type=arguments.type.shell_split,
10831095
default=[])
1084-
stdlib_targets = StdlibDeploymentTarget.default_stdlib_deployment_targets()
10851096
targets_group.add_argument(
10861097
"--stdlib-deployment-targets",
10871098
help="list of targets to compile or cross-compile the Swift standard "
10881099
"library for. %(default)s by default.",
1089-
nargs="*",
1090-
default=[
1091-
target.name
1092-
for target in stdlib_targets])
1100+
action=arguments.action.concat, type=arguments.type.shell_split,
1101+
default=None)
10931102
targets_group.add_argument(
10941103
"--build-stdlib-deployment-targets",
10951104
help="A space-separated list that filters which of the configured "
@@ -1398,6 +1407,14 @@ details of the setups of other systems or automated environments.""")
13981407
"--build-swift-stdlib-unittest-extra",
13991408
help="Build optional StdlibUnittest components",
14001409
action="store_true")
1410+
parser.add_argument(
1411+
"--build-swift-stdlib",
1412+
help="Whether to build the core standard library",
1413+
metavar="BOOL",
1414+
nargs='?',
1415+
type=arguments.type.bool,
1416+
default=None,
1417+
const=True)
14011418

14021419
run_build_group = parser.add_argument_group(
14031420
title="Run build")

0 commit comments

Comments
 (0)