parent
fc4a780207
commit
67d70ee059
8 changed files with 74 additions and 627 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,60 @@ |
||||
#!/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 renamed based on the |
||||
# current boringssl submodule. The script should be run after a boringssl |
||||
# upgrade in third_party/boringssl. Note that after the script is run, you will |
||||
# typically need to manually upgrade the BoringSSL-GRPC podspec |
||||
# (templates/src/objective-c/BoringSSL-GRPC.podspec.template) version and the |
||||
# corresponding version number in gRPC-Core podspec |
||||
# (templates/gRPC-Core.podspec.template). |
||||
|
||||
set -ev |
||||
|
||||
cd "$(dirname $0)" |
||||
cd ../../third_party/boringssl |
||||
|
||||
BORINGSSL_COMMIT=$(git rev-parse HEAD) |
||||
BORINGSSL_PREFIX_HEADERS_DIR=src/boringssl |
||||
|
||||
# generate the prefix header |
||||
mkdir -p build |
||||
cd build |
||||
cmake .. |
||||
make clean |
||||
make -j |
||||
|
||||
[ -f ssl/libssl.a ] || { echo "Failed to build libssl.a" ; exit 1 ; } |
||||
[ -f crypto/libcrypto.a ] || { echo "Failed to build libcrypto.a" ; exit 1 ; } |
||||
|
||||
go run ../util/read_symbols.go ssl/libssl.a > ./symbols.txt |
||||
go run ../util/read_symbols.go crypto/libcrypto.a >> ./symbols.txt |
||||
|
||||
# generates boringssl_prefix_symbols.h |
||||
cmake .. -DBORINGSSL_PREFIX=GRPC -DBORINGSSL_PREFIX_SYMBOLS=symbols.txt |
||||
make boringssl_prefix_symbols |
||||
|
||||
[ -f symbol_prefix_include/boringssl_prefix_symbols.h ] || { echo "Failed to build boringssl_prefix_symbols.sh" ; exit 1 ; } |
||||
|
||||
cd ../../.. |
||||
mkdir -p $BORINGSSL_PREFIX_HEADERS_DIR |
||||
echo "// generated by generate_boringssl_prefix_header.sh on BoringSSL commit: $BORINGSSL_COMMIT" > $BORINGSSL_PREFIX_HEADERS_DIR/boringssl_prefix_symbols.h |
||||
echo "" >> $BORINGSSL_PREFIX_HEADERS_DIR/boringssl_prefix_symbols.h |
||||
cat third_party/boringssl/build/symbol_prefix_include/boringssl_prefix_symbols.h >> $BORINGSSL_PREFIX_HEADERS_DIR/boringssl_prefix_symbols.h |
||||
|
||||
# Regenerated the project |
||||
tools/buildgen/generate_projects.sh |
||||
|
||||
exit 0 |
@ -1,44 +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. |
||||
|
||||
set -e |
||||
|
||||
cd "$(dirname $0)" |
||||
cd ../../third_party/boringssl |
||||
|
||||
BORINGSSL_COMMIT=$(git rev-parse HEAD) |
||||
BORINGSSL_PREFIX_HEADERS_DIR=src/boringssl |
||||
|
||||
# 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_HEADERS_DIR |
||||
docker run -it --rm -v $(pwd)/$BORINGSSL_PREFIX_HEADERS_DIR:/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 |
||||
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 |
||||
|
||||
# Regenerated the project |
||||
tools/buildgen/generate_projects.sh |
||||
|
||||
exit 0 |
@ -1,36 +0,0 @@ |
||||
# Copyright 2019 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. |
||||
|
||||
FROM debian:buster |
||||
|
||||
ENV BORINGSSL_COMMIT=master |
||||
|
||||
RUN apt-get update && apt-get install -y \ |
||||
autoconf \ |
||||
cmake \ |
||||
curl \ |
||||
g++ \ |
||||
gcc \ |
||||
git \ |
||||
gnupg \ |
||||
golang \ |
||||
perl |
||||
|
||||
COPY generate_boringssl_prefix_header.sh / |
||||
|
||||
VOLUME /output |
||||
|
||||
WORKDIR / |
||||
|
||||
ENTRYPOINT ["/generate_boringssl_prefix_header.sh"] |
@ -1,41 +0,0 @@ |
||||
#!/bin/bash |
||||
# Copyright 2019 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. |
||||
|
||||
[ $# == 1 ] || { echo "Usage: generate_boringssl_prefix_header.sh <boringssl_commit>" ; exit 1 ; } |
||||
|
||||
git clone -n https://github.com/google/boringssl.git |
||||
cd boringssl |
||||
git checkout $1 || { echo "Unable to checkout the commit $1" ; exit 1 ; } |
||||
mkdir build |
||||
cd build |
||||
cmake .. |
||||
|
||||
# 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 ; } |
||||
|
||||
go run ../util/read_symbols.go ssl/libssl.a > ./symbols.txt |
||||
go run ../util/read_symbols.go crypto/libcrypto.a >> ./symbols.txt |
||||
|
||||
cmake .. -DBORINGSSL_PREFIX=GRPC -DBORINGSSL_PREFIX_SYMBOLS=symbols.txt |
||||
make boringssl_prefix_symbols |
||||
|
||||
[ -f symbol_prefix_include/boringssl_prefix_symbols.h ] || { echo "Failed to build boringssl_prefix_symbols.sh" ; exit 1 ; } |
||||
|
||||
gzip -c symbol_prefix_include/boringssl_prefix_symbols.h | base64 > /output/boringssl_prefix_symbols.h.gz.b64 |
||||
|
||||
exit 0 |
Loading…
Reference in new issue