use third_party/boringssl-with-bazel/err_data.c instead of err_data.c

pull/21834/head
Jan Tattermusch 5 years ago
parent b8aa71ded7
commit 5d9a67a56d
  1. 9
      src/boringssl/gen_build_yaml.py
  2. 2
      templates/gRPC-Core.podspec.template
  3. 24
      templates/src/objective-c/BoringSSL-GRPC.podspec.template
  4. 4
      tools/distrib/check_copyright.py

@ -134,14 +134,15 @@ try:
# so we don't need to generate them again, but there's no option to disable that behavior.
# - crypto_test_data.cc is required to run boringssl_crypto_test but we already
# use the copy under third_party/boringssl-with-bazel so we just delete it
# - err_data.c is currently only used by the obj-C boringssl podspec
# TODO(jtattermusch): avoid the need to keep src/boringssl/err_data.c
# - err_data.c is already under third_party/boringssl-with-bazel so we just delete it
generate_build_files.main([grpc_platform])
print(yaml.dump(grpc_platform.yaml))
finally:
# we don't want err_data.c and crypto_test_data.cc (see comment above)
if os.path.exists('err_data.c'):
os.remove('err_data.c')
if os.path.exists('crypto_test_data.cc'):
os.remove('crypto_test_data.cc'
) # we don't want this file (see comment above)
os.remove('crypto_test_data.cc')
shutil.rmtree('src')

@ -184,7 +184,7 @@
ss.header_mappings_dir = '.'
ss.libraries = 'z'
ss.dependency "#{s.name}/Interface", version
ss.dependency 'BoringSSL-GRPC', '0.0.6'
ss.dependency 'BoringSSL-GRPC', '0.0.7'
abseil_version = '0.20190808.1'
% for abseil_spec in grpc_abseil_specs:
ss.dependency '${abseil_spec}', abseil_version

@ -11,9 +11,7 @@
# Please make modifications to
# `templates/src/objective-c/BoringSSL-GRPC.podspec.template` instead. This
# file can be regenerated from the template by running
# `tools/buildgen/generate_projects.sh`. Because of some limitations of this
# template, you might actually need to run the same script twice in a row.
# (see err_data.c section)
# `tools/buildgen/generate_projects.sh`.
# BoringSSL CocoaPods podspec
@ -48,7 +46,7 @@
Pod::Spec.new do |s|
s.name = 'BoringSSL-GRPC'
version = '0.0.6'
version = '0.0.7'
s.version = version
s.summary = 'BoringSSL is a fork of OpenSSL that is designed to meet Google\'s needs.'
# Adapted from the homepage:
@ -141,8 +139,8 @@
'src/crypto/**/*.{h,c,cc}',
# We have to include fiat because spake25519 depends on it
'src/third_party/fiat/*.{h,c,cc}',
# Include the err_data.c generated in prepare_command below
'src/err_data.c'
# Include the err_data.c pre-generated in boringssl's master-with-bazel branch
'err_data.c'
ss.private_header_files = 'src/ssl/*.h',
'src/ssl/**/*.h',
@ -211,20 +209,6 @@
}
EOF
# To build boringssl, we need the generated file err_data.c, which is normally generated
# by boringssl's err_data_generate.go, but we already have a copy of err_data.c checked into the
# grpc/grpc repository that gets regenerated whenever we update the third_party/boringssl submodule.
# To make the podspec independent of the grpc repository, the .podspec.template just copies
# the contents of err_data.c directly into the .podspec.
# TODO(jtattermusch): avoid needing to run tools/buildgen/generate_projects.sh twice on update
# TODO(jtattermusch): another pre-generated copy of err_data.c is under third_party/boringssl-with-bazel
# investigate if we could use it.
cat > src/err_data.c <<EOF
% for err_data in open("src/boringssl/err_data.c", "r").readlines():
${err_data.replace('\\0', '\\\\0')}\
% endfor
EOF
# The symbol prefixing mechanism is performed by redefining BoringSSL symbols with "#define
# SOME_BORINGSSL_SYMBOL GRPC_SHADOW_SOME_BORINGSSL_SYMBOL". Unfortunately, some symbols are
# already redefined as macros in BoringSSL headers in the form "#define SOME_BORINGSSL_SYMBOL

@ -161,9 +161,7 @@ for filename in filename_list:
m = re.search(re_license, text)
if m:
pass
elif 'DO NOT EDIT' not in text and filename not in [
'src/boringssl/err_data.c'
]:
elif 'DO NOT EDIT' not in text:
log(1, 'copyright missing', filename)
ok = False

Loading…
Cancel
Save