[Mac] Support bazelisk and drop -j argument.

The support for -j was there since make didn't do parallel builds by default.

Remove some references to the intermedia results of an autotools build.
pull/10423/head
Thomas Van Lenten 2 years ago
parent 373d8225af
commit 2b673bbb57
  1. 3
      objectivec/DevTools/compile_testing_protos.sh
  2. 25
      objectivec/DevTools/full_mac_build.sh
  3. 9
      objectivec/generate_well_known_types.sh

@ -120,8 +120,7 @@ if [[ "${RUN_PROTOC}" != "yes" ]] ; then
# under)
readonly NewestInput=$(find \
src/google/protobuf/*.proto \
objectivec/Tests/*.proto \
src/.libs src/*.la $PROTOC \
objectivec/Tests/*.proto $PROTOC \
objectivec/DevTools/compile_testing_protos.sh \
-type f -print0 \
| xargs -0 stat -f "%m %N" \

@ -10,6 +10,9 @@ readonly ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")")
readonly ProtoRootDir="${ScriptDir}/../.."
readonly BazelFlags="-k --test_output=streamed --macos_minimum_os=10.9"
# Invoke with BAZEL=bazelisk to use that instead.
readonly BazelBin="${BAZEL:=bazel}"
printUsage() {
NAME=$(basename "${0}")
cat << EOF
@ -28,8 +31,6 @@ OPTIONS:
-r, --regenerate-descriptors
Run generate_descriptor_proto.sh to regenerate all the checked in
proto sources.
-j #, --jobs #
Force the number of parallel jobs (useful for debugging build issues).
--core-only
Skip some of the core protobuf build/checks to shorten the build time.
--skip-xcode
@ -59,7 +60,7 @@ header() {
echo "========================================================================"
}
NUM_JOBS=auto
BAZEL=bazel
DO_CLEAN=no
REGEN_DESCRIPTORS=no
CORE_ONLY=no
@ -82,10 +83,6 @@ while [[ $# != 0 ]]; do
-r | --regenerate-descriptors )
REGEN_DESCRIPTORS=yes
;;
-j | --jobs )
shift
NUM_JOBS="${1}"
;;
--core-only )
CORE_ONLY=yes
;;
@ -134,7 +131,7 @@ cd "${ProtoRootDir}"
if [[ "${DO_CLEAN}" == "yes" ]] ; then
header "Cleaning"
bazel clean
"${BazelBin}" clean
if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
XCODEBUILD_CLEAN_BASE_IOS=(
xcodebuild
@ -178,23 +175,23 @@ fi
if [[ "${REGEN_DESCRIPTORS}" == "yes" ]] ; then
header "Regenerating the descriptor sources."
./generate_descriptor_proto.sh -j "${NUM_JOBS}"
./generate_descriptor_proto.sh
fi
if [[ "${CORE_ONLY}" == "yes" ]] ; then
header "Building core Only"
bazel build //:protoc //:protobuf //:protobuf_lite -j "${NUM_JOBS}" $BazelFlags
"${BazelBin}" build //:protoc //:protobuf //:protobuf_lite $BazelFlags
else
header "Building"
# Can't issue these together, when fully parallel, something sometimes chokes
# at random.
bazel test //src/... $BazelFlags
"${BazelBin}" test //src/... $BazelFlags
# Fire off the conformance tests also.
bazel test //objectivec:conformance_test $BazelFlags
"${BazelBin}" test //objectivec:conformance_test $BazelFlags
fi
# Ensure the WKT sources checked in are current.
objectivec/generate_well_known_types.sh --check-only -j "${NUM_JOBS}"
BAZEL="${BazelBin}" 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.
@ -354,7 +351,7 @@ fi
if [[ "${DO_OBJC_CONFORMANCE_TESTS}" == "yes" ]] ; then
header "Running ObjC Conformance Tests"
bazel test //objectivec:conformance_test $BazelFlags
"${BazelBin}" test //objectivec:conformance_test $BazelFlags
fi
echo ""

@ -3,16 +3,15 @@
# Run this script to regenerate *.pbobjc.{h,m} for the well known types after
# the protocol compiler changes.
# HINT: Flags passed to generate_well_known_types.sh will be passed directly
# to bazel when building protoc. This is particularly useful for passing
# -j4 to run 4 jobs simultaneously.
set -eu
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}"
# Flag for continuous integration to check that everything is current.
CHECK_ONLY=0
if [[ $# -ge 1 && ( "$1" == "--check-only" ) ]] ; then
@ -31,7 +30,7 @@ __EOF__
fi
# Make sure the compiler is current.
bazel build $@ //:protoc
"${BazelBin}" build $@ //:protoc
cd src
declare -a RUNTIME_PROTO_FILES=( \

Loading…
Cancel
Save