Use gRPC repo to store boringssl prefix headers

pull/21194/head
Muxi Yan 5 years ago
parent ac92253fe8
commit 4ba1864cd9
  1. 1
      .gitignore
  2. 3243
      src/objective-c/boringssl_prefix_headers/boringssl_prefix_symbols-7f02881e96e51f1873afcf384d02f782b48967ca.h
  3. 4
      templates/src/objective-c/BoringSSL-GRPC.podspec.template
  4. 41
      tools/distrib/generate_grpc_shadow_boringssl_symbol_list.sh
  5. 17
      tools/distrib/upgrade_boringssl_objc.sh

1
.gitignore vendored

@ -95,7 +95,6 @@ DerivedData
*.pbobjc.*
*.pbrpc.*
src/objective-c/**/Build
boringssl_prefix_header_out
# Cocoapods artifacts
Pods/

@ -223,8 +223,8 @@
% endfor
EOF
# Grab prefix header from GCS
curl -o include/openssl/boringssl_prefix_symbols.h https://storage.googleapis.com/grpc_boringssl_prefix_headers/boringssl_prefix_symbols-${boringssl_commit}.h
# Grab prefix header from Github repo
curl -o include/openssl/boringssl_prefix_symbols.h -L https://raw.githubusercontent.com/grpc/grpc/master/src/objective-c/boringssl_prefix_headers/boringssl_prefix_symbols-${boringssl_commit}.h
# We are renaming openssl to openssl_grpc so that there is no conflict with openssl if it exists
find . -type f \\( -path '*.h' -or -path '*.cc' -or -path '*.c' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <openssl/;#include <openssl_grpc/;g'

@ -1,41 +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.
# Generate the list of boringssl symbols that need to be shadowed based on the
# current boringssl submodule. Requires local toolchain to build boringssl.
cd "$(dirname $0)"
cd ../../third_party/boringssl
BORINGSSL_COMMIT=$(git rev-parse HEAD)
# Do the following in grpc root directory
cd ../..
docker build tools/dockerfile/grpc_objc/generate_boringssl_prefix_header -t grpc/boringssl_prefix_header
mkdir ./boringssl_prefix_header_out
docker run -it --rm -v $(pwd)/boringssl_prefix_header_out:/output grpc/boringssl_prefix_header $BORINGSSL_COMMIT
# increase the minor version by 1
POD_VER=$(cat templates/src/objective-c/BoringSSL-GRPC.podspec.template | grep 'version = ' | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/')
POD_VER_NEW="${POD_VER%.*}.$((${POD_VER##*.}+1))"
sed -i.grpc_back -e "s/version = '$POD_VER'/version = '$POD_VER_NEW'/g" templates/src/objective-c/BoringSSL-GRPC.podspec.template
rm templates/src/objective-c/BoringSSL-GRPC.podspec.template.grpc_back
RED=$'\e[1;31m'
DEFAULT=$'\e[0m'
echo "${RED}Generated prefix header at /boringssl_prefix_header_out/boringssl_prefix_symbols-$BORINGSSL_COMMIT.h. Upload it to gRPC Team Cloud Storage at location gs://grpc_boringssl_prefix_headers. Regenerate the project.${DEFAULT}"
exit 0

@ -22,27 +22,24 @@ cd "$(dirname $0)"
cd ../../third_party/boringssl
BORINGSSL_COMMIT=$(git rev-parse HEAD)
BORINGSSL_PREFIX_HEADERS_DIR=src/objective-c/boringssl_prefix_headers
# Do the following in grpc root directory
cd ../..
docker build tools/dockerfile/grpc_objc/generate_boringssl_prefix_header -t grpc/boringssl_prefix_header
mkdir -p ./boringssl_prefix_header_out
docker run -it --rm -v $(pwd)/boringssl_prefix_header_out:/output grpc/boringssl_prefix_header $BORINGSSL_COMMIT
mkdir -p $BORINGSSL_PREFIX_HEADERS_DIR
docker run -it --rm -v $(pwd)/$BORINGSSL_PREFIX_HEADERS_DIR:/output grpc/boringssl_prefix_header $BORINGSSL_COMMIT
git add $BORINGSSL_PREFIX_HEADERS_DIR/boringssl_prefix_symbols-$BORINGSSL_COMMIT.h
# increase the minor version by 1
# Increase the minor version by 1
POD_VER=$(cat templates/src/objective-c/BoringSSL-GRPC.podspec.template | grep 'version = ' | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/')
POD_VER_NEW="${POD_VER%.*}.$((${POD_VER##*.}+1))"
sed -i.grpc_back -e "s/version = '$POD_VER'/version = '$POD_VER_NEW'/g" templates/src/objective-c/BoringSSL-GRPC.podspec.template
sed -i.grpc_back -e "s/dependency 'BoringSSL-GRPC', '$POD_VER'/dependency 'BoringSSL-GRPC', '$POD_VER_NEW'/g" templates/gRPC-Core.podspec.template
rm templates/src/objective-c/BoringSSL-GRPC.podspec.template.grpc_back templates/gRPC-Core.podspec.template.grpc_back
RED=$'\e[1;31m'
DEFAULT=$'\e[0m'
echo ""
echo "Upgrade is completed."
echo "${RED}TODOs:"
echo "1. The script generated prefix header at /boringssl_prefix_header_out/boringssl_prefix_symbols-$BORINGSSL_COMMIT.h. Upload it to gRPC Team Cloud Storage at location gs://grpc_boringssl_prefix_headers."
echo "2. Regenerate the project.${DEFAULT}"
# Regenerated the project
tools/buildgen/generate_projects.sh
exit 0

Loading…
Cancel
Save