[jiri] Build for mac-arm64

Bug: b/225173088
Bug: fxbug.dev/94853
Change-Id: I2f7393af4646b0cf260338517e72d37f7e16fce2
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/678312
Reviewed-by: Anthony Fandrianto <atyfto@google.com>
Commit-Queue: Nathan Mulcahey <nmulcahey@google.com>
diff --git a/recipes/jiri.expected/ci.json b/recipes/jiri.expected/ci.json
index 3e8b7f1..cf494d1 100644
--- a/recipes/jiri.expected/ci.json
+++ b/recipes/jiri.expected/ci.json
@@ -1280,6 +1280,196 @@
     ]
   },
   {
+    "cmd": [],
+    "name": "mac-arm64"
+  },
+  {
+    "cmd": [
+      "[START_DIR]/cipd/go/bin/go",
+      "build",
+      "-o",
+      "[CLEANUP]/jiri_tmp_1/jiri",
+      "-ldflags",
+      "-X \"go.fuchsia.dev/jiri/version.GitCommit=c22471f4e3f842ae18dd9adec82ed9eb78ed1127\" -X \"go.fuchsia.dev/jiri/version.BuildTime=2012-05-14T12:53:30.500000\"",
+      "./cmd/jiri"
+    ],
+    "cwd": "[START_DIR]/fuchsia-manifest/go/src/fuchsia.googlesource.com/jiri",
+    "env": {
+      "GOARCH": "arm64",
+      "GOOS": "darwin",
+      "GOROOT": "[START_DIR]/cipd/go"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd/go/bin"
+      ]
+    },
+    "luci_context": {
+      "realm": {
+        "name": "project:ci"
+      },
+      "resultdb": {
+        "current_invocation": {
+          "name": "invocations/build:8945511751514863184",
+          "update_token": "token"
+        },
+        "hostname": "rdbhost"
+      }
+    },
+    "name": "mac-arm64.go build",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [],
+    "name": "mac-arm64.cipd",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@",
+      "@@@SET_BUILD_PROPERTY@git_revision@\"c22471f4e3f842ae18dd9adec82ed9eb78ed1127\"@@@",
+      "@@@SET_BUILD_PROPERTY@instance_id@\"40-chars-fake-of-the-package-instance_id\"@@@",
+      "@@@SET_BUILD_PROPERTY@package@\"fuchsia/tools/jiri/mac-arm64\"@@@"
+    ]
+  },
+  {
+    "cmd": [
+      "cipd",
+      "search",
+      "fuchsia/tools/jiri/mac-arm64",
+      "-tag",
+      "git_revision:c22471f4e3f842ae18dd9adec82ed9eb78ed1127",
+      "-json-output",
+      "/path/to/tmp/json"
+    ],
+    "cwd": "[START_DIR]/fuchsia-manifest/go/src/fuchsia.googlesource.com/jiri",
+    "env": {
+      "GOARCH": "arm64",
+      "GOOS": "darwin"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd/go/bin"
+      ]
+    },
+    "luci_context": {
+      "realm": {
+        "name": "project:ci"
+      },
+      "resultdb": {
+        "current_invocation": {
+          "name": "invocations/build:8945511751514863184",
+          "update_token": "token"
+        },
+        "hostname": "rdbhost"
+      }
+    },
+    "name": "mac-arm64.cipd.cipd search fuchsia/tools/jiri/mac-arm64 git_revision:c22471f4e3f842ae18dd9adec82ed9eb78ed1127",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@2@@@",
+      "@@@STEP_LOG_LINE@json.output@{@@@",
+      "@@@STEP_LOG_LINE@json.output@  \"result\": []@@@",
+      "@@@STEP_LOG_LINE@json.output@}@@@",
+      "@@@STEP_LOG_END@json.output@@@"
+    ]
+  },
+  {
+    "cmd": [
+      "cipd",
+      "create",
+      "-pkg-def",
+      "{\"data\": [{\"file\": \"jiri\"}, {\"version_file\": \".versions/jiri.cipd_version\"}], \"install_mode\": \"copy\", \"package\": \"fuchsia/tools/jiri/mac-arm64\", \"root\": \"[CLEANUP]/jiri_tmp_1\"}",
+      "-hash-algo",
+      "sha256",
+      "-ref",
+      "latest",
+      "-tag",
+      "git_revision:c22471f4e3f842ae18dd9adec82ed9eb78ed1127",
+      "-metadata",
+      "bbid:8945511751514863184",
+      "-metadata",
+      "git_repository:https://fuchsia.googlesource.com/manifest",
+      "-json-output",
+      "/path/to/tmp/json"
+    ],
+    "cwd": "[START_DIR]/fuchsia-manifest/go/src/fuchsia.googlesource.com/jiri",
+    "env": {
+      "GOARCH": "arm64",
+      "GOOS": "darwin"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd/go/bin"
+      ]
+    },
+    "luci_context": {
+      "realm": {
+        "name": "project:ci"
+      },
+      "resultdb": {
+        "current_invocation": {
+          "name": "invocations/build:8945511751514863184",
+          "update_token": "token"
+        },
+        "hostname": "rdbhost"
+      }
+    },
+    "name": "mac-arm64.cipd.create fuchsia/tools/jiri/mac-arm64",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@2@@@",
+      "@@@STEP_LOG_LINE@json.output@{@@@",
+      "@@@STEP_LOG_LINE@json.output@  \"result\": {@@@",
+      "@@@STEP_LOG_LINE@json.output@    \"instance_id\": \"40-chars-fake-of-the-package-instance_id\", @@@",
+      "@@@STEP_LOG_LINE@json.output@    \"package\": \"fuchsia/tools/jiri/mac-arm64\"@@@",
+      "@@@STEP_LOG_LINE@json.output@  }@@@",
+      "@@@STEP_LOG_LINE@json.output@}@@@",
+      "@@@STEP_LOG_END@json.output@@@",
+      "@@@STEP_LINK@40-chars-fake-of-the-package-instance_id@https://chrome-infra-packages.appspot.com/p/fuchsia/tools/jiri/mac-arm64/+/40-chars-fake-of-the-package-instance_id@@@"
+    ]
+  },
+  {
+    "cmd": [
+      "vpython",
+      "-vpython-spec",
+      "RECIPE_MODULE[fuchsia::gsutil]/resources/gsutil.vpython",
+      "[START_DIR]/cipd_tool/path/to/gsutil/version%3Apinned-version/gsutil",
+      "-h",
+      "Custom-Time:2012-05-14T12:53:32.000000Z",
+      "-o",
+      "GSUtil:software_update_check_period=0",
+      "cp",
+      "[CLEANUP]/jiri_tmp_1/jiri",
+      "gs://fuchsia-build/jiri/darwin-arm64/c22471f4e3f842ae18dd9adec82ed9eb78ed1127"
+    ],
+    "cwd": "[START_DIR]/fuchsia-manifest/go/src/fuchsia.googlesource.com/jiri",
+    "env": {
+      "GOARCH": "arm64",
+      "GOOS": "darwin"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd/go/bin"
+      ]
+    },
+    "infra_step": true,
+    "luci_context": {
+      "realm": {
+        "name": "project:ci"
+      },
+      "resultdb": {
+        "current_invocation": {
+          "name": "invocations/build:8945511751514863184",
+          "update_token": "token"
+        },
+        "hostname": "rdbhost"
+      }
+    },
+    "name": "mac-arm64.gsutil cp",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@",
+      "@@@STEP_LINK@gsutil.upload@https://storage.googleapis.com/fuchsia-build/jiri/darwin-arm64/c22471f4e3f842ae18dd9adec82ed9eb78ed1127@@@"
+    ]
+  },
+  {
     "name": "$result"
   }
 ]
\ No newline at end of file
diff --git a/recipes/jiri.expected/cq.json b/recipes/jiri.expected/cq.json
index 8ecdd50..7c172db 100644
--- a/recipes/jiri.expected/cq.json
+++ b/recipes/jiri.expected/cq.json
@@ -1149,6 +1149,46 @@
     ]
   },
   {
+    "cmd": [],
+    "name": "mac-arm64"
+  },
+  {
+    "cmd": [
+      "[START_DIR]/cipd/go/bin/go",
+      "build",
+      "-o",
+      "[CLEANUP]/jiri_tmp_1/jiri",
+      "./cmd/jiri"
+    ],
+    "cwd": "[START_DIR]/fuchsia-manifest/go/src/fuchsia.googlesource.com/jiri",
+    "env": {
+      "GOARCH": "arm64",
+      "GOOS": "darwin",
+      "GOROOT": "[START_DIR]/cipd/go"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd/go/bin"
+      ]
+    },
+    "luci_context": {
+      "realm": {
+        "name": "project:try"
+      },
+      "resultdb": {
+        "current_invocation": {
+          "name": "invocations/build:8945511751514863184",
+          "update_token": "token"
+        },
+        "hostname": "rdbhost"
+      }
+    },
+    "name": "mac-arm64.go build",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
     "name": "$result"
   }
 ]
\ No newline at end of file
diff --git a/recipes/jiri.py b/recipes/jiri.py
index 8885ea7..656f059 100644
--- a/recipes/jiri.py
+++ b/recipes/jiri.py
@@ -30,6 +30,7 @@
     ("linux", "amd64"),
     ("linux", "arm64"),
     ("darwin", "amd64"),
+    ("darwin", "arm64"),
 )