envtest: Only run bootstrap once

Bug: 585
Change-Id: I188f4bee75c54d36036316fec248dee7b839f8b5
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/75620
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Oliver Newman <olivernewman@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/recipes/envtest.expected/environment_variables.json b/recipes/envtest.expected/environment_variables.json
index 4eed291..c8f2dea 100644
--- a/recipes/envtest.expected/environment_variables.json
+++ b/recipes/envtest.expected/environment_variables.json
@@ -715,14 +715,13 @@
       "--json-output",
       "/path/to/tmp/json",
       "copy",
-      ". [START_DIR]/checkout/bootstrap.sh\n. [START_DIR]/checkout/bootstrap.sh\npw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build\n",
+      ". [START_DIR]/checkout/bootstrap.sh\npw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build\n",
       "[START_DIR]/checkout/run.sh"
     ],
     "infra_step": true,
     "name": "write run.sh",
     "~followup_annotations": [
       "@@@STEP_LOG_LINE@run.sh@. [START_DIR]/checkout/bootstrap.sh@@@",
-      "@@@STEP_LOG_LINE@run.sh@. [START_DIR]/checkout/bootstrap.sh@@@",
       "@@@STEP_LOG_LINE@run.sh@pw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build@@@",
       "@@@STEP_LOG_END@run.sh@@@"
     ]
diff --git a/recipes/envtest.expected/fail.json b/recipes/envtest.expected/fail.json
index 8d1e59f..2baf6c6 100644
--- a/recipes/envtest.expected/fail.json
+++ b/recipes/envtest.expected/fail.json
@@ -1153,7 +1153,7 @@
       "--json-output",
       "/path/to/tmp/json",
       "copy",
-      ". [START_DIR]/checkout/bootstrap.sh\n. [START_DIR]/checkout/bootstrap.sh\npw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build\n",
+      ". [START_DIR]/checkout/bootstrap.sh\npw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build\n",
       "[START_DIR]/checkout/run.sh"
     ],
     "infra_step": true,
@@ -1172,7 +1172,6 @@
     "name": "write run.sh",
     "~followup_annotations": [
       "@@@STEP_LOG_LINE@run.sh@. [START_DIR]/checkout/bootstrap.sh@@@",
-      "@@@STEP_LOG_LINE@run.sh@. [START_DIR]/checkout/bootstrap.sh@@@",
       "@@@STEP_LOG_LINE@run.sh@pw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build@@@",
       "@@@STEP_LOG_END@run.sh@@@"
     ]
diff --git a/recipes/envtest.expected/pigweed.json b/recipes/envtest.expected/pigweed.json
index 0dd39b4..5bc3b2a 100644
--- a/recipes/envtest.expected/pigweed.json
+++ b/recipes/envtest.expected/pigweed.json
@@ -1153,7 +1153,7 @@
       "--json-output",
       "/path/to/tmp/json",
       "copy",
-      ". [START_DIR]/checkout/bootstrap.sh\n. [START_DIR]/checkout/bootstrap.sh\npw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build\n",
+      ". [START_DIR]/checkout/bootstrap.sh\npw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build\n",
       "[START_DIR]/checkout/run.sh"
     ],
     "infra_step": true,
@@ -1172,7 +1172,6 @@
     "name": "write run.sh",
     "~followup_annotations": [
       "@@@STEP_LOG_LINE@run.sh@. [START_DIR]/checkout/bootstrap.sh@@@",
-      "@@@STEP_LOG_LINE@run.sh@. [START_DIR]/checkout/bootstrap.sh@@@",
       "@@@STEP_LOG_LINE@run.sh@pw --directory $PW_ROOT --loglevel debug presubmit --step gn_clang_build@@@",
       "@@@STEP_LOG_END@run.sh@@@"
     ]
diff --git a/recipes/envtest.expected/windows.json b/recipes/envtest.expected/windows.json
index bbc836e..ce6ca95 100644
--- a/recipes/envtest.expected/windows.json
+++ b/recipes/envtest.expected/windows.json
@@ -1153,7 +1153,7 @@
       "--json-output",
       "/path/to/tmp/json",
       "copy",
-      "call [START_DIR]\\\\checkout\\\\bootstrap.bat\ncall [START_DIR]\\\\checkout\\\\bootstrap.bat\npw --directory %PW_ROOT% --loglevel debug presubmit --step gn_clang_build\n",
+      "call [START_DIR]\\\\checkout\\\\bootstrap.bat\npw --directory %PW_ROOT% --loglevel debug presubmit --step gn_clang_build\n",
       "[START_DIR]\\checkout\\run.bat"
     ],
     "infra_step": true,
@@ -1172,7 +1172,6 @@
     "name": "write run.bat",
     "~followup_annotations": [
       "@@@STEP_LOG_LINE@run.bat@call [START_DIR]\\\\checkout\\\\bootstrap.bat@@@",
-      "@@@STEP_LOG_LINE@run.bat@call [START_DIR]\\\\checkout\\\\bootstrap.bat@@@",
       "@@@STEP_LOG_LINE@run.bat@pw --directory %PW_ROOT% --loglevel debug presubmit --step gn_clang_build@@@",
       "@@@STEP_LOG_END@run.bat@@@"
     ]
diff --git a/recipes/envtest.py b/recipes/envtest.py
index c40893e..a7be616 100644
--- a/recipes/envtest.py
+++ b/recipes/envtest.py
@@ -79,7 +79,8 @@
     # Call bootstrap twice because occasionally there are issues with the second
     # call but not the first.
     commands.append(bootstrap_command)
-    commands.append(bootstrap_command)
+    # TODO(pwbug/585) Uncomment next line.
+    # commands.append(bootstrap_command)
     commands.append(command)
 
     sh_source = ''.join(x + '\n' for x in commands)