build protoc artifacts with cmake

pull/24000/head
Jan Tattermusch 4 years ago
parent 82fb6a4b7a
commit a35cd4f89d
  1. 7
      src/ruby/end2end/package_with_underscore_test.rb
  2. 8
      src/ruby/spec/pb/codegen/package_option_spec.rb
  3. 12
      tools/run_tests/artifacts/artifact_targets.py
  4. 10
      tools/run_tests/artifacts/build_artifact_protoc.sh
  5. 11
      tools/run_tests/helper_scripts/build_ruby.sh

@ -19,12 +19,9 @@ def main
root_dir = File.join(File.dirname(__FILE__), '..', '..', '..')
pb_dir = File.join(root_dir, 'src', 'ruby', 'end2end', 'protos')
fail 'CONFIG env variable unexpectedly unset' unless ENV['CONFIG']
bins_sub_dir = ENV['CONFIG']
bins_dir = File.join(root_dir, 'bins', bins_sub_dir)
bins_dir = File.join(root_dir, 'cmake', 'build')
plugin = File.join(bins_dir, 'grpc_ruby_plugin')
protoc = File.join(bins_dir, 'protobuf', 'protoc')
protoc = File.join(bins_dir, 'third_party', 'protobuf', 'protoc')
got = nil

@ -71,14 +71,10 @@ describe 'Code Generation Options' do
end
def with_protos(file_paths)
fail 'CONFIG env variable unexpectedly unset' unless ENV['CONFIG']
bins_sub_dir = ENV['CONFIG']
pb_dir = File.dirname(__FILE__)
bins_dir = File.join('..', '..', '..', '..', '..', 'bins', bins_sub_dir)
bins_dir = File.join('..', '..', '..', '..', '..', 'cmake', 'build')
plugin = File.join(bins_dir, 'grpc_ruby_plugin')
protoc = File.join(bins_dir, 'protobuf', 'protoc')
protoc = File.join(bins_dir, 'third_party', 'protobuf', 'protoc')
# Generate the service from the proto
Dir.mktmpdir(nil, File.dirname(__FILE__)) do |tmp_dir|

@ -304,17 +304,9 @@ class ProtocArtifact:
def build_jobspec(self):
if self.platform != 'windows':
cxxflags = '-DNDEBUG %s' % _ARCH_FLAG_MAP[self.arch]
ldflags = '%s' % _ARCH_FLAG_MAP[self.arch]
if self.platform != 'macos':
ldflags += ' -static-libgcc -static-libstdc++ -s'
environ = {
'CONFIG': 'opt',
'CXXFLAGS': cxxflags,
'LDFLAGS': ldflags,
'PROTOBUF_LDFLAGS_EXTRA': ldflags
}
environ = {'CXXFLAGS': '', 'LDFLAGS': ''}
if self.platform == 'linux':
environ['LDFLAGS'] += ' -static-libgcc -static-libstdc++ -s'
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_centos6_{}'.format(

@ -17,7 +17,13 @@ set -ex
cd "$(dirname "$0")/../../.."
EMBED_ZLIB=true PROTOBUF_CONFIG_OPTS=--with-zlib=no make plugins
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../..
make protoc plugins -j2
popd
mkdir -p "${ARTIFACTS_OUT}"
cp bins/opt/protobuf/protoc bins/opt/*_plugin "${ARTIFACTS_OUT}"/
cp cmake/build/third_party/protobuf/protoc cmake/build/*_plugin "${ARTIFACTS_OUT}"/

@ -25,4 +25,13 @@ rm -rf ./tmp
rake compile
# build grpc_ruby_plugin
make grpc_ruby_plugin -j8
# TODO: fix this
#make grpc_ruby_plugin -j8
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../..
make protoc grpc_ruby_plugin -j2
popd
# unbreak subsequent make builds by restoring zconf.h (previously renamed by cmake build)
(cd third_party/zlib; git checkout zconf.h)

Loading…
Cancel
Save