build C# artifact using cmake

pull/16424/head
Jan Tattermusch 6 years ago
parent 05c23458ab
commit 409def0d73
  1. 20
      tools/run_tests/artifacts/artifact_targets.py
  2. 8
      tools/run_tests/artifacts/build_artifact_csharp.sh
  3. 12
      tools/run_tests/run_tests.py

@ -248,29 +248,19 @@ class CSharpExtArtifact:
],
use_workspace=True)
else:
environ = {
'CONFIG': 'opt',
'EMBED_OPENSSL': 'true',
'EMBED_ZLIB': 'true',
'CFLAGS': '-DGPR_BACKWARDS_COMPATIBILITY_MODE',
'CXXFLAGS': '-DGPR_BACKWARDS_COMPATIBILITY_MODE',
'LDFLAGS': ''
}
if self.platform == 'linux':
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_%s' % self.arch,
'tools/run_tests/artifacts/build_artifact_csharp.sh',
environ=environ)
'tools/run_tests/artifacts/build_artifact_csharp.sh')
else:
archflag = _ARCH_FLAG_MAP[self.arch]
environ['CFLAGS'] += ' %s %s' % (archflag, _MACOS_COMPAT_FLAG)
environ['CXXFLAGS'] += ' %s %s' % (archflag, _MACOS_COMPAT_FLAG)
environ['LDFLAGS'] += ' %s' % archflag
cmake_arch_option = '' # x64 is the default architecture
if self.arch == 'x86':
cmake_arch_option = '-DCMAKE_OSX_ARCHITECTURES=i386'
return create_jobspec(
self.name,
['tools/run_tests/artifacts/build_artifact_csharp.sh'],
environ=environ,
environ={'CMAKE_ARCH_OPTION': cmake_arch_option},
use_workspace=True)
def __str__(self):

@ -17,7 +17,13 @@ set -ex
cd "$(dirname "$0")/../../.."
mkdir -p cmake/build
cd cmake/build
# -DgRPC_BACKWARDS_COMPATIBILITY_MODE=ON
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DgRPC_BUILD_TESTS=OFF "${CMAKE_ARCH_OPTION}" ../..
make grpc_csharp_ext
cd ../..
mkdir -p "${ARTIFACTS_OUT}"
cp libs/opt/libgrpc_csharp_ext.so "${ARTIFACTS_OUT}" || cp libs/opt/libgrpc_csharp_ext.dylib "${ARTIFACTS_OUT}"
cp cmake/build/libgrpc_csharp_ext.so "${ARTIFACTS_OUT}" || cp cmake/build/libgrpc_csharp_ext.dylib "${ARTIFACTS_OUT}"

@ -922,20 +922,13 @@ class CSharpLanguage(object):
self.config = config
self.args = args
if self.platform == 'windows':
_check_compiler(self.args.compiler, ['coreclr', 'default'])
_check_compiler(self.args.compiler, ['default', 'coreclr'])
_check_arch(self.args.arch, ['default'])
self._cmake_arch_option = 'x64'
self._make_options = []
else:
_check_compiler(self.args.compiler, ['default', 'coreclr'])
self._docker_distro = 'jessie'
if self.platform == 'mac':
# TODO(jtattermusch): EMBED_ZLIB=true currently breaks the mac build
self._make_options = ['EMBED_OPENSSL=true']
else:
self._make_options = ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true']
def test_specs(self):
with open('src/csharp/tests.json') as f:
tests_by_assembly = json.load(f)
@ -1010,7 +1003,7 @@ class CSharpLanguage(object):
return ['grpc_csharp_ext']
def make_options(self):
return self._make_options
return []
def build_steps(self):
if self.platform == 'windows':
@ -1028,7 +1021,6 @@ class CSharpLanguage(object):
if self.platform == 'windows':
return 'cmake/build/%s/Makefile' % self._cmake_arch_option
else:
# TODO(jtattermusch): arch option needed?
return 'cmake/build/Makefile'
def dockerfile_dir(self):

Loading…
Cancel
Save