[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.
diff --git a/objectivec/DevTools/compile_testing_protos.sh b/objectivec/DevTools/compile_testing_protos.sh index eb43cae..604a5b5 100755 --- a/objectivec/DevTools/compile_testing_protos.sh +++ b/objectivec/DevTools/compile_testing_protos.sh
@@ -120,8 +120,7 @@ # 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" \
diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh index 0af0e40..1e10653 100755 --- a/objectivec/DevTools/full_mac_build.sh +++ b/objectivec/DevTools/full_mac_build.sh
@@ -10,6 +10,9 @@ 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 @@ -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 @@ echo "========================================================================" } -NUM_JOBS=auto +BAZEL=bazel DO_CLEAN=no REGEN_DESCRIPTORS=no CORE_ONLY=no @@ -82,10 +83,6 @@ -r | --regenerate-descriptors ) REGEN_DESCRIPTORS=yes ;; - -j | --jobs ) - shift - NUM_JOBS="${1}" - ;; --core-only ) CORE_ONLY=yes ;; @@ -134,7 +131,7 @@ 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 @@ 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 @@ 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 ""
diff --git a/objectivec/generate_well_known_types.sh b/objectivec/generate_well_known_types.sh index 10b2a10..0fb9f4c 100755 --- a/objectivec/generate_well_known_types.sh +++ b/objectivec/generate_well_known_types.sh
@@ -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 @@ fi # Make sure the compiler is current. -bazel build $@ //:protoc +"${BazelBin}" build $@ //:protoc cd src declare -a RUNTIME_PROTO_FILES=( \