From b691a475164cc692e3d97cfedc98efb080e1bb94 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Mon, 27 Jun 2016 16:10:27 -0700 Subject: [PATCH 1/2] 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 --- utils/build-script | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/build-script b/utils/build-script index 9e469e9ce1704..f0d93365a69c3 100755 --- a/utils/build-script +++ b/utils/build-script @@ -627,6 +627,11 @@ class BuildScriptInvocation(object): impl_args += ["--skip-build-swiftpm"] if args.build_swift_stdlib_unittest_extra: impl_args += ["--build-swift-stdlib-unittest-extra"] + if args.build_swift_stdlib is not None: + if args.build_swift_stdlib: + impl_args += ["--build-swift-stdlib=1"] + else: + impl_args += ["--build-swift-stdlib=0"] if args.skip_build_linux: impl_args += ["--skip-build-linux"] @@ -1398,6 +1403,14 @@ details of the setups of other systems or automated environments.""") "--build-swift-stdlib-unittest-extra", help="Build optional StdlibUnittest components", action="store_true") + parser.add_argument( + "--build-swift-stdlib", + help="Whether to build the core standard library", + metavar="BOOL", + nargs='?', + type=arguments.type.bool, + default=None, + const=True) run_build_group = parser.add_argument_group( title="Run build") From 34cbf37f6a64b4bf7025b8a3e652c88fdd82de27 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 23 Jun 2016 09:04:34 -0700 Subject: [PATCH 2/2] [build-script] Support concatenated stdlib-deployment-targets. - This fixes a regression introduced in a4537e8a0fba765343e1b62af243055fc922f18d, where we used to accept a list of concatenated deployment targets as a single argument. - build-script fails to split deployment targets before iterating over them --- utils/build-script | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/utils/build-script b/utils/build-script index f0d93365a69c3..e478f77e1091b 100755 --- a/utils/build-script +++ b/utils/build-script @@ -245,6 +245,13 @@ class BuildScriptInvocation(object): if args.build_variant is None: args.build_variant = "Debug" + # Set the default stdlib-deployment-targets, if none were provided. + if args.stdlib_deployment_targets is None: + stdlib_targets = \ + StdlibDeploymentTarget.default_stdlib_deployment_targets() + args.stdlib_deployment_targets = [ + target.name for target in stdlib_targets] + # Propagate the default build variant. if args.cmark_build_variant is None: args.cmark_build_variant = args.build_variant @@ -1086,15 +1093,12 @@ details of the setups of other systems or automated environments.""") "tools for. Can be used multiple times.", action=arguments.action.concat, type=arguments.type.shell_split, default=[]) - stdlib_targets = StdlibDeploymentTarget.default_stdlib_deployment_targets() targets_group.add_argument( "--stdlib-deployment-targets", help="list of targets to compile or cross-compile the Swift standard " "library for. %(default)s by default.", - nargs="*", - default=[ - target.name - for target in stdlib_targets]) + action=arguments.action.concat, type=arguments.type.shell_split, + default=None) targets_group.add_argument( "--build-stdlib-deployment-targets", help="A space-separated list that filters which of the configured "