Skip to content

Commit

Permalink
Skip bazel build in objectivec/generate_well_known_types.sh.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Feb 10, 2023
1 parent 363fa89 commit 6e00b6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion objectivec/DevTools/full_mac_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ else
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.
Expand Down
14 changes: 7 additions & 7 deletions objectivec/generate_well_known_types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ readonly ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")")
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
Expand All @@ -19,7 +18,11 @@ if [[ $# -ge 1 && ( "$1" == "--check-only" ) ]] ; then
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__
Expand All @@ -29,9 +32,6 @@ __EOF__
exit 1
fi

# Make sure the compiler is current.
${BazelBin} build //:protoc $@

cd src
declare -a RUNTIME_PROTO_FILES=( \
google/protobuf/any.proto \
Expand All @@ -50,7 +50,7 @@ declare -a OBJC_EXTENSIONS=( .pbobjc.h .pbobjc.m )
# 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
Expand Down

0 comments on commit 6e00b6b

Please sign in to comment.