infra: Include autoconf bin directory to PATH

This CL addresses the following error.
https://logs.chromium.org/logs/gn/buildbucket/cr-buildbucket/8697618079436444433/+/u/jemalloc/autoconf/stdout
> /b/s/w/ir/x/w/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin/autoconf: 533: exec: autom4te: not found

No-Try: true
Bug: 462546993
Change-Id: I854adfe3f49a56515ccece440d54c6e425711b20
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/20420
Commit-Queue: Junji Watanabe <jwata@google.com>
Reviewed-by: Takuto Ikuta <tikuta@google.com>
diff --git a/infra/recipes/gn.expected/ci_linux.json b/infra/recipes/gn.expected/ci_linux.json
index 9a43b9e..d819909 100644
--- a/infra/recipes/gn.expected/ci_linux.json
+++ b/infra/recipes/gn.expected/ci_linux.json
@@ -326,6 +326,11 @@
       "[START_DIR]/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin/autoconf"
     ],
     "cwd": "[START_DIR]/jemalloc",
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin"
+      ]
+    },
     "infra_step": true,
     "luci_context": {
       "realm": {
diff --git a/infra/recipes/gn.expected/cipd_exists.json b/infra/recipes/gn.expected/cipd_exists.json
index 6397d57..1f544ca 100644
--- a/infra/recipes/gn.expected/cipd_exists.json
+++ b/infra/recipes/gn.expected/cipd_exists.json
@@ -326,6 +326,11 @@
       "[START_DIR]/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin/autoconf"
     ],
     "cwd": "[START_DIR]/jemalloc",
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin"
+      ]
+    },
     "infra_step": true,
     "luci_context": {
       "realm": {
diff --git a/infra/recipes/gn.expected/cipd_register.json b/infra/recipes/gn.expected/cipd_register.json
index 48611c8..f9c3096 100644
--- a/infra/recipes/gn.expected/cipd_register.json
+++ b/infra/recipes/gn.expected/cipd_register.json
@@ -326,6 +326,11 @@
       "[START_DIR]/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin/autoconf"
     ],
     "cwd": "[START_DIR]/jemalloc",
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin"
+      ]
+    },
     "infra_step": true,
     "luci_context": {
       "realm": {
diff --git a/infra/recipes/gn.expected/cq_linux.json b/infra/recipes/gn.expected/cq_linux.json
index 6c7164c..d12efc0 100644
--- a/infra/recipes/gn.expected/cq_linux.json
+++ b/infra/recipes/gn.expected/cq_linux.json
@@ -377,6 +377,11 @@
       "[START_DIR]/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin/autoconf"
     ],
     "cwd": "[START_DIR]/jemalloc",
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/cipd_tool/infra/3pp/tools/autoconf/79821582576f6f08410b2d2f2c0658c2be62aae6ca2df4ab28cc6b4d75002f20/bin"
+      ]
+    },
     "infra_step": true,
     "luci_context": {
       "realm": {
diff --git a/infra/recipes/gn.py b/infra/recipes/gn.py
index 8123518..ea95e35 100644
--- a/infra/recipes/gn.py
+++ b/infra/recipes/gn.py
@@ -207,7 +207,11 @@
               'infra/3pp/tools/autoconf/${platform}',
               "version:3@2.71.chromium.1",
               executable_path='bin/autoconf')
-          api.step('autoconf', [autoconf_path])
+          # Add the autoconf bin directory to be able to find other
+          # executables.
+          with api.context(
+              env_prefixes={'PATH': [api.path.dirname(autoconf_path)]}):
+            api.step('autoconf', [autoconf_path])
 
         for platform in all_config_platforms:
           # Convert target architecture and os to jemalloc format.