From af307d7339e0a552352f7eed697b89b8e8329d96 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 25 Mar 2016 14:21:42 -0700 Subject: [PATCH 1/4] always embed zlib and openssl for C# --- tools/run_tests/run_tests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index dc11c0bd51d..99de45adcb1 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -512,7 +512,7 @@ class CSharpLanguage(object): def make_targets(self): # For Windows, this target doesn't really build anything, - # everything is build by buildall script later. + # everything is built by buildall script later. if self.platform == 'windows': return [] else: @@ -521,9 +521,10 @@ class CSharpLanguage(object): def make_options(self): if self.platform == 'mac': # On Mac, official distribution of mono is 32bit. - return ['CFLAGS=-arch i386', 'LDFLAGS=-arch i386'] + return ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true', + 'CFLAGS=-arch i386', 'LDFLAGS=-arch i386'] else: - return [] + return ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true'] def build_steps(self): if self.platform == 'windows': From 78a511a314b5a87036db09f30458c3ad50e2200e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 25 Mar 2016 14:46:52 -0700 Subject: [PATCH 2/4] polish some .bat files --- vsprojects/build_vs2010.bat | 2 +- vsprojects/build_vs2013.bat | 2 +- vsprojects/build_vs2015.bat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vsprojects/build_vs2010.bat b/vsprojects/build_vs2010.bat index 64b0ed5d3f5..1bc3c86a92f 100644 --- a/vsprojects/build_vs2010.bat +++ b/vsprojects/build_vs2010.bat @@ -1,5 +1,5 @@ @rem Convenience wrapper that runs specified gRPC target using msbuild -@rem Usage: build.bat TARGET_NAME +@rem Usage: build_vs2010.bat TARGET_NAME setlocal @rem Set VS variables (uses Visual Studio 2010) diff --git a/vsprojects/build_vs2013.bat b/vsprojects/build_vs2013.bat index be3caa9298c..82c0a3ad824 100644 --- a/vsprojects/build_vs2013.bat +++ b/vsprojects/build_vs2013.bat @@ -1,5 +1,5 @@ @rem Convenience wrapper that runs specified gRPC target using msbuild -@rem Usage: build.bat TARGET_NAME +@rem Usage: build_vs2013.bat TARGET_NAME setlocal @rem Set VS variables (uses Visual Studio 2013) diff --git a/vsprojects/build_vs2015.bat b/vsprojects/build_vs2015.bat index 50485a30f30..c6e1b433a3e 100644 --- a/vsprojects/build_vs2015.bat +++ b/vsprojects/build_vs2015.bat @@ -1,5 +1,5 @@ @rem Convenience wrapper that runs specified gRPC target using msbuild -@rem Usage: build.bat TARGET_NAME +@rem Usage: build_vs2015.bat TARGET_NAME setlocal @rem Set VS variables (uses Visual Studio 2015) From 690914f138d63e9bdf2478ff4e6e1e5d7a3613c3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 25 Mar 2016 15:07:22 -0700 Subject: [PATCH 3/4] refactor C# building --- tools/run_tests/run_tests.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 99de45adcb1..aa4e3eb7cab 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -464,7 +464,17 @@ class CSharpLanguage(object): def configure(self, config, args): self.config = config self.args = args - _check_compiler(self.args.compiler, ['default']) + if self.platform == 'windows': + self._make_options = [_windows_toolset_option(self.args.compiler), + _windows_arch_option(self.args.arch)] + else: + _check_compiler(self.args.compiler, ['default']) + if self.platform == 'mac': + # On Mac, official distribution of mono is 32bit. + self._make_options = ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true', + 'CFLAGS=-arch i386', 'LDFLAGS=-arch i386'] + else: + self._make_options = ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true'] def test_specs(self): with open('src/csharp/tests.json') as f: @@ -511,24 +521,16 @@ class CSharpLanguage(object): return [['tools/run_tests/pre_build_csharp.sh']] def make_targets(self): - # For Windows, this target doesn't really build anything, - # everything is built by buildall script later. - if self.platform == 'windows': - return [] - else: - return ['grpc_csharp_ext'] + return ['grpc_csharp_ext'] def make_options(self): - if self.platform == 'mac': - # On Mac, official distribution of mono is 32bit. - return ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true', - 'CFLAGS=-arch i386', 'LDFLAGS=-arch i386'] - else: - return ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true'] + return self._make_options; def build_steps(self): if self.platform == 'windows': - return [['src\\csharp\\buildall.bat']] + return [[_windows_build_bat(self.args.compiler), + 'src/csharp/Grpc.sln', + '/p:Configuration=%s' % _MSBUILD_CONFIG[self.config.build_config]]] else: return [['tools/run_tests/build_csharp.sh']] From abd7df8b1a4bbd34e494ade05b9c711f43f41eb5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 25 Mar 2016 16:14:41 -0700 Subject: [PATCH 4/4] disable C# arch choosing for now --- tools/run_tests/run_tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index aa4e3eb7cab..c292d08dc27 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -120,7 +120,12 @@ def get_c_tests(travis, test_lang) : def _check_compiler(compiler, supported_compilers): if compiler not in supported_compilers: - raise Exception('Compiler %s not supported.' % compiler) + raise Exception('Compiler %s not supported (on this platform).' % compiler) + + +def _check_arch(arch, supported_archs): + if arch not in supported_archs: + raise Exception('Architecture %s not supported.' % arch) def _is_use_docker_child(): @@ -465,6 +470,8 @@ class CSharpLanguage(object): self.config = config self.args = args if self.platform == 'windows': + # Explicitly choosing between x86 and x64 arch doesn't work yet + _check_arch(self.args.arch, ['default']) self._make_options = [_windows_toolset_option(self.args.compiler), _windows_arch_option(self.args.arch)] else: