Reland "Run malioc_diff.py in Linux Unopt"

This reverts commit 79f15453da415f53acaeede12f9f8d5694216b5a.

Reason for revert: The speculative revert turned out not to be needed.

Original change's description:
> Revert "Run malioc_diff.py in Linux Unopt"
>
> This reverts commit 723fa987980dcec71e219f488b4c454f4b1cad77.
>
> Reason for revert: malioc.json not found
>
> Original change's description:
> > Run malioc_diff.py in Linux Unopt
> >
> > Change-Id: I07e99da83cf1587bd95e7740289f84206e5938a4
> > Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/38840
> > Reviewed-by: Jonah Williams <jonahwilliams@google.com>
> > Commit-Queue: Zach Anderson <zra@google.com>
>
> TBR=zra@google.com,godofredoc@google.com,flutter-scoped@luci-project-accounts.iam.gserviceaccount.com,jonahwilliams@google.com
>
> Change-Id: I66b9b1d348762ef5f191d1832841e3c8fdeac151
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/38880
> Reviewed-by: Jonah Williams <jonahwilliams@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Zach Anderson <zra@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: Ia0a128984a9a08b347f26f07c1420f35718edbee
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/38900
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
diff --git a/recipes/engine/engine_unopt.expected/linux.json b/recipes/engine/engine_unopt.expected/linux.json
index 0809b6c..0991f12 100644
--- a/recipes/engine/engine_unopt.expected/linux.json
+++ b/recipes/engine/engine_unopt.expected/linux.json
@@ -1601,6 +1601,52 @@
   },
   {
     "cmd": [
+      "vpython3",
+      "-vpython-spec",
+      "RECIPE_REPO[depot_tools]/.vpython3",
+      "[CACHE]/builder/src/flutter/impeller/tools/malioc_diff.py",
+      "--before",
+      "[CACHE]/builder/src/flutter/impeller/tools/malioc.json",
+      "--after",
+      "[CACHE]/builder/src/out/host_debug_unopt/gen/malioc"
+    ],
+    "cwd": "[CACHE]/builder",
+    "env": {
+      "ANDROID_HOME": "[CACHE]/builder/src/third_party/android_tools/sdk",
+      "FLUTTER_LOGS_DIR": "[CLEANUP]/flutter_logs_dir",
+      "FLUTTER_PREBUILT_DART_SDK": "True",
+      "FLUTTER_TEST_OUTPUTS_DIR": "[CLEANUP]/flutter_logs_dir",
+      "GOMA_DIR": "[CACHE]/goma/client"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[CACHE]/builder/src/third_party/dart/tools/sdks/dart-sdk/bin"
+      ]
+    },
+    "env_suffixes": {
+      "DEPOT_TOOLS_UPDATE": [
+        "0"
+      ],
+      "PATH": [
+        "RECIPE_REPO[depot_tools]"
+      ]
+    },
+    "luci_context": {
+      "realm": {
+        "name": "flutter:ci"
+      },
+      "resultdb": {
+        "current_invocation": {
+          "name": "invocations/build:8945511751514863184",
+          "update_token": "token"
+        },
+        "hostname": "rdbhost"
+      }
+    },
+    "name": "malioc diff"
+  },
+  {
+    "cmd": [
       "python3",
       "[CACHE]/builder/src/flutter/tools/gn",
       "--goma",
diff --git a/recipes/engine/engine_unopt.expected/linux_lto.json b/recipes/engine/engine_unopt.expected/linux_lto.json
index 9915282..afefab7 100644
--- a/recipes/engine/engine_unopt.expected/linux_lto.json
+++ b/recipes/engine/engine_unopt.expected/linux_lto.json
@@ -1600,6 +1600,52 @@
   },
   {
     "cmd": [
+      "vpython3",
+      "-vpython-spec",
+      "RECIPE_REPO[depot_tools]/.vpython3",
+      "[CACHE]/builder/src/flutter/impeller/tools/malioc_diff.py",
+      "--before",
+      "[CACHE]/builder/src/flutter/impeller/tools/malioc.json",
+      "--after",
+      "[CACHE]/builder/src/out/host_debug_unopt/gen/malioc"
+    ],
+    "cwd": "[CACHE]/builder",
+    "env": {
+      "ANDROID_HOME": "[CACHE]/builder/src/third_party/android_tools/sdk",
+      "FLUTTER_LOGS_DIR": "[CLEANUP]/flutter_logs_dir",
+      "FLUTTER_PREBUILT_DART_SDK": "True",
+      "FLUTTER_TEST_OUTPUTS_DIR": "[CLEANUP]/flutter_logs_dir",
+      "GOMA_DIR": "[CACHE]/goma/client"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[CACHE]/builder/src/third_party/dart/tools/sdks/dart-sdk/bin"
+      ]
+    },
+    "env_suffixes": {
+      "DEPOT_TOOLS_UPDATE": [
+        "0"
+      ],
+      "PATH": [
+        "RECIPE_REPO[depot_tools]"
+      ]
+    },
+    "luci_context": {
+      "realm": {
+        "name": "flutter:ci"
+      },
+      "resultdb": {
+        "current_invocation": {
+          "name": "invocations/build:8945511751514863184",
+          "update_token": "token"
+        },
+        "hostname": "rdbhost"
+      }
+    },
+    "name": "malioc diff"
+  },
+  {
+    "cmd": [
       "python3",
       "[CACHE]/builder/src/flutter/tools/gn",
       "--goma",
diff --git a/recipes/engine/engine_unopt.py b/recipes/engine/engine_unopt.py
index a8cefaf..8d422d8 100644
--- a/recipes/engine/engine_unopt.py
+++ b/recipes/engine/engine_unopt.py
@@ -118,6 +118,25 @@
   )
 
 
+def RunMaliocDiff(api, out_dir):
+  script_path = GetCheckoutPath(api).join(
+      'flutter', 'impeller', 'tools', 'malioc_diff.py'
+  )
+  # TODO(godofredoc): use .vpython from engine when file are available.
+  venv_path = api.depot_tools.root.join('.vpython3')
+  args = [
+      'vpython3',
+      '-vpython-spec',
+      venv_path,
+      script_path,
+      '--before',
+      GetCheckoutPath(api).join('flutter', 'impeller', 'tools', 'malioc.json'),
+      '--after',
+      GetCheckoutPath(api).join('out', out_dir, 'gen', 'malioc')
+  ]
+  api.step('malioc diff', args)
+
+
 def BuildLinux(api, env, env_prefixes):
   RunGN(
       api,
@@ -133,6 +152,7 @@
   )
   Build(api, 'host_debug_unopt')
   RunTests(api, 'host_debug_unopt', types='dart,engine', suppress_sanitizers=True)
+  RunMaliocDiff(api, 'host_debug_unopt')
 
 
 def TestObservatory(api):