Skip to content

Commit d1cfffe

Browse files
authored
Merge pull request grpc#8957 from murgatroid99/makefile_ruby_version_fixes
Fix Ruby compilation problems on MinGW
2 parents b343ef1 + e375975 commit d1cfffe

File tree

4 files changed

+77
-3
lines changed

4 files changed

+77
-3
lines changed

Rakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ require 'rubocop/rake_task'
55
require 'bundler/gem_tasks'
66
require 'fileutils'
77

8+
require_relative 'build_config.rb'
9+
810
load 'tools/distrib/docker_for_windows.rb'
911

1012
# Add rubocop style checking tasks
@@ -83,7 +85,7 @@ task 'dlls' do
8385
env += 'EMBED_ZLIB=true '
8486
env += 'BUILDDIR=/tmp '
8587
env += "V=#{verbose} "
86-
out = '/tmp/libs/opt/grpc-1.dll'
88+
out = GrpcBuildConfig::CORE_WINDOWS_DLL
8789

8890
w64 = { cross: 'x86_64-w64-mingw32', out: 'grpc_c.64.ruby' }
8991
w32 = { cross: 'i686-w64-mingw32', out: 'grpc_c.32.ruby' }

build_config.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2017, Google Inc.
2+
# All rights reserved.
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are
6+
# met:
7+
#
8+
# * Redistributions of source code must retain the above copyright
9+
# notice, this list of conditions and the following disclaimer.
10+
# * Redistributions in binary form must reproduce the above
11+
# copyright notice, this list of conditions and the following disclaimer
12+
# in the documentation and/or other materials provided with the
13+
# distribution.
14+
# * Neither the name of Google Inc. nor the names of its
15+
# contributors may be used to endorse or promote products derived from
16+
# this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
30+
module GrpcBuildConfig
31+
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-2.dll'
32+
end

src/core/ext/census/tracing.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,21 @@
3131
*
3232
*/
3333

34+
//#include "src/core/ext/census/tracing.h"
35+
3436
#include <grpc/census.h>
37+
#include <stdlib.h>
3538

3639
/* TODO(aveitch): These are all placeholder implementations. */
3740

3841
int census_trace_mask(const census_context *context) {
42+
abort();
3943
return CENSUS_TRACE_MASK_NONE;
4044
}
4145

42-
void census_set_trace_mask(int trace_mask) {}
46+
void census_set_trace_mask(int trace_mask) { abort(); }
4347

4448
void census_trace_print(census_context *context, uint32_t type,
45-
const char *buffer, size_t n) {}
49+
const char *buffer, size_t n) {
50+
abort();
51+
}

templates/build_config.rb.template

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
%YAML 1.2
2+
--- |
3+
# Copyright 2017, Google Inc.
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are
8+
# met:
9+
#
10+
# * Redistributions of source code must retain the above copyright
11+
# notice, this list of conditions and the following disclaimer.
12+
# * Redistributions in binary form must reproduce the above
13+
# copyright notice, this list of conditions and the following disclaimer
14+
# in the documentation and/or other materials provided with the
15+
# distribution.
16+
# * Neither the name of Google Inc. nor the names of its
17+
# contributors may be used to endorse or promote products derived from
18+
# this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
32+
module GrpcBuildConfig
33+
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-${settings.core_version.major}.dll'
34+
end

0 commit comments

Comments
 (0)