Fix sanity check issue

pull/21194/head
Muxi Yan 5 years ago
parent 342228bd3b
commit 2999d041eb
  1. 1
      .gitignore
  2. 16
      templates/src/objective-c/BoringSSL-GRPC.podspec.template
  3. 2
      tools/distrib/upgrade_boringssl_objc.sh
  4. 2
      tools/dockerfile/grpc_objc/generate_boringssl_prefix_header/generate_boringssl_prefix_header.sh

1
.gitignore vendored

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

@ -223,9 +223,18 @@
% endfor
EOF
# Grab prefix header from Github repo
# To avoid symbol conflict with OpenSSL, gRPC needs to rename all the BoringSSL symbols with a
# prefix. This is done with BoringSSL's BORINGSSL_PREFIX mechanism
# (https://github.com/google/boringssl/blob/75148d7abf12bdd1797fec3c5da9a21963703516/BUILDING.md#building-with-prefixed-symbols).
# The required prefix header file boringssl_prefix_symbols.h is not part of BoringSSL repo at
# this moment. It has to be generated by BoringSSL's users and be injected to BoringSSL build.
# gRPC generates this file in script /tools/distrib/upgrade_boringssl_objc.sh. This script
# outputs a gzip+base64 encoded version of boringssl_prefix_symbols.h because of Cocoapods'
# limit on the 'prepare_command' field length. The encoded header is put at
# /src/boringssl/boringssl_prefix_symbols.h.gz.b64. Here we decode the content and inject
# the header to correcty location in BoringSSL.
base64 -D <<EOF | gunzip > include/openssl/boringssl_prefix_symbols.h
% for line in open("src/objective-c/boringssl_prefix_headers/boringssl_prefix_symbols.h.gz.base64", "r").readlines():
% for line in open("src/boringssl/boringssl_prefix_symbols.h.gz.b64", "r").readlines():
${line}\
% endfor
EOF
@ -234,7 +243,8 @@
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'
# BoringSSL include boringssl_prefix_symbols.h without any prefix, which does not match the
# Xcode import style. We add it here so that Xcode knows where to find it.
# Include of boringssl_prefix_symbols.h does not follow Xcode import style. We add the package
# name here so that Xcode knows where to find it.
find . -type f \\( -path '*.h' -or -path '*.cc' -or -path '*.c' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <boringssl_prefix_symbols.h>;#include <openssl_grpc/boringssl_prefix_symbols.h>;g'
END_OF_COMMAND
end

@ -22,7 +22,7 @@ cd "$(dirname $0)"
cd ../../third_party/boringssl
BORINGSSL_COMMIT=$(git rev-parse HEAD)
BORINGSSL_PREFIX_HEADERS_DIR=src/objective-c/boringssl_prefix_headers
BORINGSSL_PREFIX_HEADERS_DIR=src/boringssl
# Do the following in grpc root directory
cd ../..

@ -36,6 +36,6 @@ 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.base64
gzip -c symbol_prefix_include/boringssl_prefix_symbols.h | base64 > /output/boringssl_prefix_symbols.h.gz.b64
exit 0

Loading…
Cancel
Save