Skip bazel build in objectivec/generate_well_known_types.sh.

Every where the script is invoked from protoc is already built, and this more
follows the model used by similar scripts for other languages.

PiperOrigin-RevId: 508694936
diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh
index d091a95..84b0aab 100755
--- a/objectivec/DevTools/full_mac_build.sh
+++ b/objectivec/DevTools/full_mac_build.sh
@@ -204,7 +204,7 @@
 fi
 
 # Ensure the WKT sources checked in are current.
-time objectivec/generate_well_known_types.sh --check-only $BazelFlags
+objectivec/generate_well_known_types.sh --check-only
 
 header "Checking on the ObjC Runtime Code"
 # Some of the kokoro machines don't have python3 yet, so fall back to python if need be.
diff --git a/objectivec/generate_well_known_types.sh b/objectivec/generate_well_known_types.sh
index 7e23a99..4b77412 100755
--- a/objectivec/generate_well_known_types.sh
+++ b/objectivec/generate_well_known_types.sh
@@ -9,8 +9,7 @@
 readonly ObjCDir="${ScriptDir}"
 readonly ProtoRootDir="${ObjCDir}/.."
 
-# Invoke with BAZEL=bazelisk to use that instead.
-readonly BazelBin="${BAZEL:-bazel} ${BAZEL_STARTUP_FLAGS:-}"
+cd "${ProtoRootDir}"
 
 # Flag for continuous integration to check that everything is current.
 CHECK_ONLY=0
@@ -19,7 +18,11 @@
   shift
 fi
 
-cd "${ProtoRootDir}"
+readonly PROTOC_PATH="${PROTOC:-${ProtoRootDir}/bazel-bin/protoc}"
+if [[ ! -x "${PROTOC_PATH}" ]] ; then
+  echo "Failed to find executable protoc: ${PROTOC_PATH}"
+  exit 1
+fi
 
 if [[ ! -e src/google/protobuf/stubs/common.h ]]; then
   cat >&2 << __EOF__
@@ -29,9 +32,6 @@
   exit 1
 fi
 
-# Make sure the compiler is current.
-${BazelBin} build //:protoc $@
-
 cd src
 declare -a RUNTIME_PROTO_FILES=( \
   google/protobuf/any.proto \
@@ -50,7 +50,7 @@
 # Generate to a temp directory to see if they match.
 TMP_DIR=$(mktemp -d)
 trap "rm -rf ${TMP_DIR}" EXIT
-${ProtoRootDir}/bazel-bin/protoc --objc_out="${TMP_DIR}" ${RUNTIME_PROTO_FILES[@]}
+"${PROTOC_PATH}" --objc_out="${TMP_DIR}" ${RUNTIME_PROTO_FILES[@]}
 
 DID_COPY=0
 for PROTO_FILE in "${RUNTIME_PROTO_FILES[@]}"; do