diff --git a/tools/distrib/check_boringssl_prefix_symbol.sh b/tools/distrib/check_boringssl_prefix_symbol.sh new file mode 100755 index 00000000000..f101bf902cf --- /dev/null +++ b/tools/distrib/check_boringssl_prefix_symbol.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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. +set -e + +cd "$(dirname $0)" +cd ../../third_party/boringssl + +BORINGSSL_COMMIT=$(git rev-parse HEAD) + +curl -f -L https://storage.googleapis.com/grpc_boringssl_prefix_headers/boringssl_prefix_symbols-$BORINGSSL_COMMIT.h > /dev/null + +[ $? == 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 ; } + +exit 0 diff --git a/tools/distrib/check_shadow_boringssl_symbol_list.sh b/tools/distrib/check_shadow_boringssl_symbol_list.sh deleted file mode 100755 index 67aceacd218..00000000000 --- a/tools/distrib/check_shadow_boringssl_symbol_list.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright 2018 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# Check if the commit version of BoringSSL podspec, BoringSSL submodule, and -# the shadowed symbol list are all based on the same BoringSSL commit. -set -e - -cd $(dirname $0) - -boringssl_podspec_original="../../src/objective-c/BoringSSL-GRPC.podspec" -symbol_list="../../src/objective-c/grpc_shadow_boringssl_symbol_list" - -# Check BoringSSL version matches -ver1=$(git submodule |grep "boringssl " | awk '{print $1}' | head -n 1) -ver2=$(cat $boringssl_podspec_original | grep ':commit =>' | sed -E 's/.*"(.*)".*/\1/g') -ver3=$(cat $symbol_list | sed -n '2 p') -[ $ver1 == $ver2 ] && [ $ver1 == $ver3 ] || { echo "BoringSSL submodule (third_party/boringssl), BoringSSL podspec (src/objective-c/BoringSSL.podspec), and BoringSSL symbol list (src/objective-c/grpc_shadow_boringssl_symbol_list) commit do not match." ; echo "BoringSSL submodule: $ver1" ; echo "BoringSSL podspec: $ver2" ; echo "BoringSSL symbol list: $ver3" ; exit 1 ; } - -exit 0 diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index a994aae1330..50ab2207d67 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -26,4 +26,4 @@ - script: tools/distrib/yapf_code.sh cpu_cost: 1000 - script: tools/distrib/check_protobuf_pod_version.sh -- script: tools/distrib/check_shadow_boringssl_symbol_list.sh +- script: tools/distrib/check_boringssl_prefix_symbol.sh