diff --git a/tools/distrib/check_boringssl_prefix_symbol.sh b/tools/distrib/check_boringssl_prefix_symbol.sh index f101bf902cf..11e55e06109 100755 --- a/tools/distrib/check_boringssl_prefix_symbol.sh +++ b/tools/distrib/check_boringssl_prefix_symbol.sh @@ -13,17 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. - -# Check if the current BoringSSL version's corresponding prefix header is uploaded to GCS. +# Check if the current BoringSSL prefix symbols is up to date set -e cd "$(dirname $0)" -cd ../../third_party/boringssl -BORINGSSL_COMMIT=$(git rev-parse HEAD) +BORINGSSL_COMMIT=$(cd ../../third_party/boringssl ; git rev-parse HEAD) + +mkdir -p ./output + +docker build ../dockerfile/grpc_objc/generate_boringssl_prefix_header -t grpc/boringssl_prefix_header +docker run -it --rm -v $(pwd)/output:/output grpc/boringssl_prefix_header $BORINGSSL_COMMIT + +diff ../../src/boringssl/boringssl_prefix_symbols.h.gz.b64 output/boringssl_prefix_symbols.h.gz.b64 -curl -f -L https://storage.googleapis.com/grpc_boringssl_prefix_headers/boringssl_prefix_symbols-$BORINGSSL_COMMIT.h > /dev/null +result=$? -[ $? == 0 ] || { echo "Cannot find prefix header of current BoringSSL commit ($BORINGSSL_COMMIT) on GCS." ; echo "Generate with tools/distrib/upgrade_boringssl_objc.sh" ; exit 1 ; } +rm -rf ./output -exit 0 +exit $result diff --git a/tools/dockerfile/grpc_objc/generate_boringssl_prefix_header/generate_boringssl_prefix_header.sh b/tools/dockerfile/grpc_objc/generate_boringssl_prefix_header/generate_boringssl_prefix_header.sh index 8f10f1a8005..4f1a573bbec 100755 --- a/tools/dockerfile/grpc_objc/generate_boringssl_prefix_header/generate_boringssl_prefix_header.sh +++ b/tools/dockerfile/grpc_objc/generate_boringssl_prefix_header/generate_boringssl_prefix_header.sh @@ -22,8 +22,8 @@ mkdir build cd build cmake .. -# gcc crashes on docker when using -j with too many cores. Limiting to 2 seems to be fine. -make -j2 +# gcc crashes on docker when using -j with too many cores. Limiting to 4 seems to be fine. +make -j4 [ -f ssl/libssl.a ] || { echo "Failed to build libssl.a" ; exit 1 ; } [ -f crypto/libcrypto.a ] || { echo "Failed to build libcrypto.a" ; exit 1 ; }