Version 2.14.0-198.0.dev

Merge commit 'aea28aba051a8e305c23aaeacb4f0394006c38b7' into 'dev'
diff --git a/pkg/smith/lib/builder.dart b/pkg/smith/lib/builder.dart
index 19b7f2c..2772be2 100644
--- a/pkg/smith/lib/builder.dart
+++ b/pkg/smith/lib/builder.dart
@@ -113,9 +113,9 @@
   static Builder parse(String builderName, List<Map> steps,
       List<Configuration> configurations, String description) {
     var builderParts = builderName.split("-");
-    var systemName = _findPart(builderParts, System.names);
-    var modeName = _findPart(builderParts, Mode.names);
-    var archName = _findPart(builderParts, Architecture.names);
+    var systemName = _findPart(builderParts, System.names, 'linux');
+    var modeName = _findPart(builderParts, Mode.names, 'release');
+    var archName = _findPart(builderParts, Architecture.names, 'x64');
     var sanitizerName = _findPart(builderParts, Sanitizer.names);
     var runtimeName = _findPart(builderParts, Runtime.names);
     var parsedSteps = steps
@@ -178,9 +178,10 @@
   return name != null ? find(name) : null;
 }
 
-String _findPart(List<String> builderParts, List<String> parts) {
+String _findPart(List<String> builderParts, List<String> parts,
+    [String fallback]) {
   return builderParts.firstWhere((part) => parts.contains(part),
-      orElse: () => null);
+      orElse: () => fallback);
 }
 
 List<Builder> parseBuilders(
diff --git a/pkg/smith/test/builder_test.dart b/pkg/smith/test/builder_test.dart
index d3be362..2f1c2be 100644
--- a/pkg/smith/test/builder_test.dart
+++ b/pkg/smith/test/builder_test.dart
@@ -160,56 +160,44 @@
       "foo-x64-none-debug-vm-linux"
     ]);
   });
-  test("'system' is not implied by builder name", () {
-    expectFormatError(
-        r"Undefined value for 'system' in "
-        r"'-nfoo-x64-none-debug-d8-${system}'", () {
-      parseBuilders([
+  test("'system' defaults to 'linux'", () {
+    expectTestedConfigurations({
+      "builders": ["foo"],
+      "steps": [
         {
-          "builders": ["foo"],
-          "steps": [
-            {
-              "name": "foo",
-              "arguments": [r"-nfoo-x64-none-debug-d8-${system}"]
-            }
-          ],
+          "name": "foo",
+          "arguments": [r"-nfoo-x64-none-debug-d8-${system}"]
         }
-      ], configurations);
-    });
+      ],
+    }, [
+      "foo-x64-none-debug-d8-linux",
+    ]);
   });
-  test("'mode' is not implied by builder name", () {
-    expectFormatError(
-        r"Undefined value for 'mode' in "
-        r"'-nfoo-x64-none-${mode}-d8-linux'", () {
-      parseBuilders([
+  test("'mode' defaults to 'release'", () {
+    expectTestedConfigurations({
+      "builders": ["foo"],
+      "steps": [
         {
-          "builders": ["foo"],
-          "steps": [
-            {
-              "name": "foo",
-              "arguments": [r"-nfoo-x64-none-${mode}-d8-linux"]
-            }
-          ],
+          "name": "foo",
+          "arguments": [r"-nfoo-x64-none-${mode}-d8-linux"]
         }
-      ], configurations);
-    });
+      ],
+    }, [
+      "foo-x64-none-release-d8-linux",
+    ]);
   });
-  test("'arch' is not implied by builder name", () {
-    expectFormatError(
-        r"Undefined value for 'arch' in "
-        r"'-nfoo-${arch}-none-debug-d8-linux'", () {
-      parseBuilders([
+  test("'arch' defaults to 'x64'", () {
+    expectTestedConfigurations({
+      "builders": ["foo"],
+      "steps": [
         {
-          "builders": ["foo"],
-          "steps": [
-            {
-              "name": "foo",
-              "arguments": [r"-nfoo-${arch}-none-debug-d8-linux"]
-            }
-          ],
+          "name": "foo",
+          "arguments": [r"-nfoo-${arch}-none-release-d8-linux"]
         }
-      ], configurations);
-    });
+      ],
+    }, [
+      "foo-x64-none-release-d8-linux",
+    ]);
   });
   test("'runtime' is not implied by builder name", () {
     expectFormatError(
diff --git a/tools/VERSION b/tools/VERSION
index d2988ee..130a3c9 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 14
 PATCH 0
-PRERELEASE 197
+PRERELEASE 198
 PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/bots/dart_sdk.py b/tools/bots/dart_sdk.py
index 233ff24..0451f7b 100755
--- a/tools/bots/dart_sdk.py
+++ b/tools/bots/dart_sdk.py
@@ -4,6 +4,7 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
+import argparse
 import os
 import os.path
 import shutil
@@ -12,25 +13,8 @@
 
 import bot_utils
 
-utils = bot_utils.GetUtils()
 
-BUILD_OS = utils.GuessOS()
-BUILD_ARCHITECTURE = utils.GuessArchitecture()
-BUILDER_NAME = os.environ.get('BUILDBOT_BUILDERNAME')
-CHANNEL = bot_utils.GetChannelFromName(BUILDER_NAME)
-
-
-def BuildArchitectures():
-    if BUILD_OS == 'linux':
-        return ['ia32', 'x64', 'arm', 'arm64']
-    elif BUILD_OS == 'macos':
-        arch = 'arm64' if 'arm64' == os.uname().machine else 'x64'
-        return [arch]
-    else:
-        return ['ia32', 'x64']
-
-
-def BuildRootPath(path, arch=BUILD_ARCHITECTURE, build_mode='release'):
+def BuildRootPath(path, arch='x64', build_mode='release'):
     return os.path.join(bot_utils.DART_DIR,
                         utils.GetBuildRoot(BUILD_OS, build_mode, arch), path)
 
@@ -84,14 +68,12 @@
         DartArchiveFile(sdk_zip, path, checksum_files=True)
 
 
-def DartArchiveUnstrippedBinaries():
+def DartArchiveUnstrippedBinaries(arch):
     namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW)
     revision = utils.GetArchiveVersion()
-    binary = namer.unstripped_filename(BUILD_OS)
-    for arch in BuildArchitectures():
-        binary = BuildRootPath(binary, arch=arch)
-        gs_path = namer.unstripped_filepath(revision, BUILD_OS, arch)
-        DartArchiveFile(binary, gs_path)
+    binary = BuildRootPath(namer.unstripped_filename(BUILD_OS), arch=arch)
+    gs_path = namer.unstripped_filepath(revision, BUILD_OS, arch)
+    DartArchiveFile(binary, gs_path)
 
 
 def CreateUploadAPIDocs():
@@ -228,14 +210,31 @@
 
 
 if __name__ == '__main__':
-    if len(sys.argv) > 1 and sys.argv[1] == 'api_docs':
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--arch',
+                        default='x64',
+                        help="comma separated list of architectures")
+    parser.add_argument('command', choices=['api_docs'], nargs='?')
+    args = parser.parse_args()
+    archs = args.arch.split(',')
+    command = args.command
+
+    utils = bot_utils.GetUtils()
+
+    BUILD_OS = utils.GuessOS()
+    BUILDER_NAME = os.environ.get('BUILDBOT_BUILDERNAME')
+    CHANNEL = bot_utils.GetChannelFromName(BUILDER_NAME)
+
+    if command == 'api_docs':
         if BUILD_OS == 'linux':
             CreateUploadAPIDocs()
     elif CHANNEL != bot_utils.Channel.TRY:
-        for arch in BuildArchitectures():
-            sdk_path = BuildRootPath('dart-sdk', arch=arch)
+        for arch in archs:
             print('Create and upload sdk zip for ' + arch)
+            sdk_path = BuildRootPath('dart-sdk', arch=arch)
             CreateAndUploadSDKZip(arch, sdk_path)
-        DartArchiveUnstrippedBinaries()
+            DartArchiveUnstrippedBinaries(arch)
         if BUILD_OS == 'linux':
             CreateUploadVersionFile()
+    else:
+        print('Skipping upload on tryjobs for archs: %s' % archs)
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index 1b2d05a..e553d85 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -2840,7 +2840,10 @@
         },
         {
           "name": "upload sdk",
-          "script": "tools/bots/dart_sdk.py"
+          "script": "tools/bots/dart_sdk.py",
+          "arguments": [
+            "--arch=ia32,x64,arm,arm64"
+          ]
         },
         {
           "name": "build api docs",
@@ -2874,7 +2877,10 @@
         },
         {
           "name": "upload sdk",
-          "script": "tools/bots/dart_sdk.py"
+          "script": "tools/bots/dart_sdk.py",
+          "arguments": [
+            "--arch=${arch}"
+          ]
         }
       ]
     },
@@ -2898,7 +2904,10 @@
         },
         {
           "name": "upload sdk",
-          "script": "tools/bots/dart_sdk.py"
+          "script": "tools/bots/dart_sdk.py",
+          "arguments": [
+            "--arch=ia32,x64"
+          ]
         }
       ]
     },