Merge pull request #11516 from murgatroid99/upmerge_1.4.x

Upmerge 1.4.x into Master
pull/11455/merge
Michael Lumish 8 years ago committed by GitHub
commit 8399f92fd6
  1. 4
      BUILD
  2. 20
      binding.gyp
  3. 130
      config.w32
  4. 2
      package.json
  5. 16
      src/csharp/Grpc.Core.Tests/ServerTest.cs
  6. 21
      src/csharp/Grpc.Core/Server.cs
  7. 14
      src/csharp/ext/grpc_csharp_ext.c
  8. 7
      src/node/src/grpc_extension.js
  9. 47
      src/node/test/surface_test.js
  10. 2
      src/php/ext/grpc/version.h
  11. 20
      templates/binding.gyp.template
  12. 36
      templates/config.w32.template
  13. 2
      templates/package.json.template
  14. 2
      templates/src/php/ext/grpc/version.h.template
  15. 4
      test/distrib/node/run_distrib_test.sh
  16. 6
      tools/run_tests/artifacts/build_artifact_node.bat
  17. 6
      tools/run_tests/artifacts/build_artifact_node.sh
  18. 6
      tools/run_tests/helper_scripts/pre_build_node.bat
  19. 6
      tools/run_tests/helper_scripts/pre_build_node.sh
  20. 7
      tools/run_tests/run_tests.py
  21. 9
      tools/run_tests/run_tests_matrix.py

@ -930,8 +930,8 @@ grpc_cc_library(
deps = [ deps = [
"grpc_base", "grpc_base",
"grpc_client_channel", "grpc_client_channel",
"grpc_secure",
"grpc_resolver_fake", "grpc_resolver_fake",
"grpc_secure",
], ],
) )
@ -1025,8 +1025,8 @@ grpc_cc_library(
name = "grpc_resolver_fake", name = "grpc_resolver_fake",
srcs = ["src/core/ext/filters/client_channel/resolver/fake/fake_resolver.c"], srcs = ["src/core/ext/filters/client_channel/resolver/fake/fake_resolver.c"],
hdrs = ["src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"], hdrs = ["src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"],
visibility = ["//test:__subpackages__"],
language = "c", language = "c",
visibility = ["//test:__subpackages__"],
deps = [ deps = [
"grpc_base", "grpc_base",
"grpc_client_channel", "grpc_client_channel",

@ -115,6 +115,15 @@
] ]
}, { }, {
'conditions': [ 'conditions': [
["target_arch=='ia32'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
}],
["target_arch=='x64'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
}],
["target_arch=='arm'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
}],
['grpc_alpn=="true"', { ['grpc_alpn=="true"', {
'defines': [ 'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=1' 'TSI_OPENSSL_ALPN_SUPPORT=1'
@ -127,17 +136,6 @@
], ],
'include_dirs': [ 'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include', '<(node_root_dir)/deps/openssl/openssl/include',
],
'conditions': [
["target_arch=='ia32'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
}],
["target_arch=='x64'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
}],
["target_arch=='arm'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
}]
] ]
}], }],
['OS == "win"', { ['OS == "win"', {

@ -640,4 +640,134 @@ if (PHP_GRPC != "no") {
"/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+ "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+
"/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+
"/I"+configure_module_dirname+"\\third_party\\zlib"); "/I"+configure_module_dirname+"\\third_party\\zlib");
base_dir = get_define('BUILD_DIR');
FSO.CreateFolder(base_dir+"\\ext");
FSO.CreateFolder(base_dir+"\\ext\\grpc");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\boringssl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\census");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\census\\gen");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\fake");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\deadline");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\client");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\message_compress");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\server");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\load_reporting");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\max_age");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\message_size");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\workarounds");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\alpn");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client\\insecure");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client\\secure");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\insecure");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\secure");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\channel");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\compression");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\debug");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\json");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\profiling");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\context");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\composite");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\fake");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\google_default");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\iam");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\jwt");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\oauth2");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\plugin");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\ssl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\util");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\slice");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\support");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\surface");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\plugin_registry");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php\\ext");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php\\ext\\grpc");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\aes");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\asn1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\base64");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\bio");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\bn");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\bn\\asm");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\buf");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\bytestring");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\chacha");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\cipher");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\cmac");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\conf");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\curve25519");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\des");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\dh");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\digest");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\dsa");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\ec");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\ecdh");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\ecdsa");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\engine");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\err");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\evp");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\hkdf");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\hmac");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\lhash");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\md4");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\md5");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\modes");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\newhope");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\obj");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\pem");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\pkcs8");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\poly1305");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\rand");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\rc4");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\rsa");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\sha");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\stack");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\x509");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\crypto\\x509v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\ssl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\nanopb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\zlib");
_build_dirs = new Array();
for (i = 0; i < build_dirs.length; i++) {
if (build_dirs[i].indexOf('grpc') == -1) {
_build_dirs[_build_dirs.length] = build_dirs[i];
}
}
build_dirs = _build_dirs;
} }

@ -33,7 +33,7 @@
"arguejs": "^0.2.3", "arguejs": "^0.2.3",
"lodash": "^4.15.0", "lodash": "^4.15.0",
"nan": "^2.0.0", "nan": "^2.0.0",
"node-pre-gyp": "^0.6.0", "node-pre-gyp": "^0.6.35",
"protobufjs": "^5.0.0" "protobufjs": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {

@ -17,6 +17,7 @@
#endregion #endregion
using System; using System;
using System.IO;
using System.Linq; using System.Linq;
using Grpc.Core; using Grpc.Core;
using Grpc.Core.Internal; using Grpc.Core.Internal;
@ -65,6 +66,21 @@ namespace Grpc.Core.Tests
server.ShutdownAsync().Wait(); server.ShutdownAsync().Wait();
} }
[Test]
public void StartThrowsWithUnboundPorts()
{
int twiceBoundPort = 9999;
Server server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) })
{
Ports = {
new ServerPort("localhost", twiceBoundPort, ServerCredentials.Insecure),
new ServerPort("localhost", twiceBoundPort, ServerCredentials.Insecure)
}
};
Assert.Throws(typeof(IOException), () => server.Start());
server.ShutdownAsync().Wait();
}
[Test] [Test]
public void CannotModifyAfterStarted() public void CannotModifyAfterStarted()
{ {

@ -19,6 +19,7 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core.Internal; using Grpc.Core.Internal;
@ -140,6 +141,7 @@ namespace Grpc.Core
/// <summary> /// <summary>
/// Starts the server. /// Starts the server.
/// Throws <c>IOException</c> if not successful.
/// </summary> /// </summary>
public void Start() public void Start()
{ {
@ -148,7 +150,8 @@ namespace Grpc.Core
GrpcPreconditions.CheckState(!startRequested); GrpcPreconditions.CheckState(!startRequested);
GrpcPreconditions.CheckState(!shutdownRequested); GrpcPreconditions.CheckState(!shutdownRequested);
startRequested = true; startRequested = true;
CheckPortsBoundSuccessfully();
handle.Start(); handle.Start();
for (int i = 0; i < requestCallTokensPerCq; i++) for (int i = 0; i < requestCallTokensPerCq; i++)
@ -301,6 +304,22 @@ namespace Grpc.Core
} }
} }
/// <summary>
/// Checks that all ports have been bound successfully.
/// </summary>
private void CheckPortsBoundSuccessfully()
{
lock (myLock)
{
var unboundPort = ports.FirstOrDefault(port => port.BoundPort == 0);
if (unboundPort != null)
{
throw new IOException(
string.Format("Failed to bind port \"{0}:{1}\"", unboundPort.Host, unboundPort.Port));
}
}
}
private void DisposeHandle() private void DisposeHandle()
{ {
var activeCallCount = activeCallCounter.Count; var activeCallCount = activeCallCounter.Count;

@ -398,8 +398,14 @@ GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_channel_create_call(
host_slice = grpc_slice_from_copied_string(host); host_slice = grpc_slice_from_copied_string(host);
host_slice_ptr = &host_slice; host_slice_ptr = &host_slice;
} }
return grpc_channel_create_call(channel, parent_call, propagation_mask, cq, grpc_call *ret =
method_slice, host_slice_ptr, deadline, NULL); grpc_channel_create_call(channel, parent_call, propagation_mask, cq,
method_slice, host_slice_ptr, deadline, NULL);
grpc_slice_unref(method_slice);
if (host != NULL) {
grpc_slice_unref(host_slice);
}
return ret;
} }
GPR_EXPORT grpc_connectivity_state GPR_CALLTYPE GPR_EXPORT grpc_connectivity_state GPR_CALLTYPE
@ -790,7 +796,9 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server(
ops[nops].reserved = NULL; ops[nops].reserved = NULL;
nops++; nops++;
} }
return grpcsharp_call_start_batch(call, ops, nops, ctx, NULL); grpc_call_error ret = grpcsharp_call_start_batch(call, ops, nops, ctx, NULL);
grpc_slice_unref(status_details_slice);
return ret;
} }
GPR_EXPORT grpc_call_error GPR_CALLTYPE GPR_EXPORT grpc_call_error GPR_CALLTYPE

@ -16,6 +16,13 @@
* *
*/ */
/**
* @module
* @private
*/
'use strict';
var binary = require('node-pre-gyp/lib/pre-binding'); var binary = require('node-pre-gyp/lib/pre-binding');
var path = require('path'); var path = require('path');
var binding_path = var binding_path =

@ -1363,3 +1363,50 @@ describe('Cancelling surface client', function() {
call.cancel(); call.cancel();
}); });
}); });
describe('Client reconnect', function() {
var server;
var Client;
var client;
var port;
beforeEach(function() {
var test_proto = ProtoBuf.loadProtoFile(__dirname + '/echo_service.proto');
var echo_service = test_proto.lookup('EchoService');
Client = grpc.loadObject(echo_service);
server = new grpc.Server();
server.addService(Client.service, {
echo: function(call, callback) {
callback(null, call.request);
}
});
port = server.bind('localhost:0', server_insecure_creds);
client = new Client('localhost:' + port, grpc.credentials.createInsecure());
server.start();
});
afterEach(function() {
server.forceShutdown();
});
it('should reconnect after server restart', function(done) {
client.echo({value: 'test value', value2: 3}, function(error, response) {
assert.ifError(error);
assert.deepEqual(response, {value: 'test value', value2: 3});
server.tryShutdown(function() {
server = new grpc.Server();
server.addService(Client.service, {
echo: function(call, callback) {
callback(null, call.request);
}
});
server.bind('localhost:' + port, server_insecure_creds);
server.start();
client.echo(undefined, function(error, response) {
if (error) {
console.log(error);
}
assert.ifError(error);
assert.deepEqual(response, {value: '', value2: 0});
done();
});
});
});
});
});

@ -20,6 +20,6 @@
#ifndef VERSION_H #ifndef VERSION_H
#define VERSION_H #define VERSION_H
#define PHP_GRPC_VERSION "1.5.0" #define PHP_GRPC_VERSION "1.5.0dev"
#endif /* VERSION_H */ #endif /* VERSION_H */

@ -105,6 +105,15 @@
] ]
}, { }, {
'conditions': [ 'conditions': [
["target_arch=='ia32'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
}],
["target_arch=='x64'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
}],
["target_arch=='arm'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
}],
['grpc_alpn=="true"', { ['grpc_alpn=="true"', {
'defines': [ 'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=1' 'TSI_OPENSSL_ALPN_SUPPORT=1'
@ -117,17 +126,6 @@
], ],
'include_dirs': [ 'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include', '<(node_root_dir)/deps/openssl/openssl/include',
],
'conditions': [
["target_arch=='ia32'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
}],
["target_arch=='x64'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
}],
["target_arch=='arm'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
}]
] ]
}], }],
['OS == "win"', { ['OS == "win"', {

@ -28,4 +28,40 @@
"/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+ "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+
"/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+
"/I"+configure_module_dirname+"\\third_party\\zlib"); "/I"+configure_module_dirname+"\\third_party\\zlib");
<%
dirs = {}
for lib in libs:
if lib.name in php_config_m4.get('deps', []) and lib.name != 'ares':
for source in lib.src:
tmp = source
prev = ''
while (True):
idx = tmp.find('/');
if (idx == -1):
break
dirs[prev + '\\\\' + tmp[:idx]] = 1
prev += ('\\\\' + tmp[:idx]);
tmp = tmp[idx+1:]
dirs['\\\\src'] = 1;
dirs['\\\\src\\\\php'] = 1;
dirs['\\\\src\\\\php\\\\ext'] = 1;
dirs['\\\\src\\\\php\\\\ext\\\\grpc'] = 1;
dirs = dirs.keys()
dirs.sort()
%>
base_dir = get_define('BUILD_DIR');
FSO.CreateFolder(base_dir+"\\ext");
FSO.CreateFolder(base_dir+"\\ext\\grpc");
% for dir in dirs:
FSO.CreateFolder(base_dir+"\\ext\\grpc${dir}");
% endfor
_build_dirs = new Array();
for (i = 0; i < build_dirs.length; i++) {
if (build_dirs[i].indexOf('grpc') == -1) {
_build_dirs[_build_dirs.length] = build_dirs[i];
}
}
build_dirs = _build_dirs;
} }

@ -35,7 +35,7 @@
"arguejs": "^0.2.3", "arguejs": "^0.2.3",
"lodash": "^4.15.0", "lodash": "^4.15.0",
"nan": "^2.0.0", "nan": "^2.0.0",
"node-pre-gyp": "^0.6.0", "node-pre-gyp": "^0.6.35",
"protobufjs": "^5.0.0" "protobufjs": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {

@ -22,6 +22,6 @@
#ifndef VERSION_H #ifndef VERSION_H
#define VERSION_H #define VERSION_H
#define PHP_GRPC_VERSION "${settings.php_version.php_composer()}" #define PHP_GRPC_VERSION "${settings.php_version.php()}"
#endif /* VERSION_H */ #endif /* VERSION_H */

@ -34,8 +34,8 @@ npm install -g node-static
STATIC_SERVER=127.0.0.1 STATIC_SERVER=127.0.0.1
# If port_server is running, get port from that. Otherwise, assume we're in # If port_server is running, get port from that. Otherwise, assume we're in
# docker and use 8080 # docker and use 12345
STATIC_PORT=$(curl 'localhost:32767/get' || echo '8080') STATIC_PORT=$(curl 'localhost:32767/get' || echo '12345')
# Serves the input_artifacts directory statically at localhost: # Serves the input_artifacts directory statically at localhost:
static "$EXTERNAL_GIT_ROOT/input_artifacts" -a $STATIC_SERVER -p $STATIC_PORT & static "$EXTERNAL_GIT_ROOT/input_artifacts" -a $STATIC_SERVER -p $STATIC_PORT &

@ -12,7 +12,7 @@
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
set node_versions=4.0.0 5.0.0 6.0.0 7.0.0 set node_versions=4.0.0 5.0.0 6.0.0 7.0.0 8.0.0
set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0
@ -30,13 +30,13 @@ for %%v in (%node_versions%) do (
@rem Try again after removing openssl headers @rem Try again after removing openssl headers
rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\%%v\include\node\openssl" /S /Q rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\%%v\include\node\openssl" /S /Q
rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\iojs-%%v\include\node\openssl" /S /Q rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\iojs-%%v\include\node\openssl" /S /Q
call .\node_modules\.bin\node-pre-gyp.cmd build package testpackage --target=%%v --target_arch=%1 || goto :error call .\node_modules\.bin\node-pre-gyp.cmd build package --target=%%v --target_arch=%1 || goto :error
xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error
) )
for %%v in (%electron_versions%) do ( for %%v in (%electron_versions%) do (
cmd /V /C "set "HOME=%HOMEDRIVE%%HOMEPATH%\electron-gyp" && call .\node_modules\.bin\node-pre-gyp.cmd configure rebuild package testpackage --runtime=electron --target=%%v --target_arch=%1 --disturl=https://atom.io/download/electron" || goto :error cmd /V /C "set "HOME=%HOMEDRIVE%%HOMEPATH%\electron-gyp" && call .\node_modules\.bin\node-pre-gyp.cmd configure rebuild package --runtime=electron --target=%%v --target_arch=%1 --disturl=https://atom.io/download/electron" || goto :error
xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error xcopy /Y /I /S build\stage\* %ARTIFACTS_OUT%\ || goto :error
) )

@ -27,18 +27,18 @@ mkdir -p "${ARTIFACTS_OUT}"
npm update npm update
node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 ) node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 )
electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 ) electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 )
for version in ${node_versions[@]} for version in ${node_versions[@]}
do do
./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --target=$version --target_arch=$NODE_TARGET_ARCH --grpc_alpine=true ./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$NODE_TARGET_ARCH --grpc_alpine=true
cp -r build/stage/* "${ARTIFACTS_OUT}"/ cp -r build/stage/* "${ARTIFACTS_OUT}"/
done done
for version in ${electron_versions[@]} for version in ${electron_versions[@]}
do do
HOME=~/.electron-gyp ./node_modules/.bin/node-pre-gyp configure rebuild package testpackage --runtime=electron --target=$version --target_arch=$NODE_TARGET_ARCH --disturl=https://atom.io/download/electron HOME=~/.electron-gyp ./node_modules/.bin/node-pre-gyp configure rebuild package --runtime=electron --target=$version --target_arch=$NODE_TARGET_ARCH --disturl=https://atom.io/download/electron
cp -r build/stage/* "${ARTIFACTS_OUT}"/ cp -r build/stage/* "${ARTIFACTS_OUT}"/
done done

@ -14,5 +14,7 @@
set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
@rem Expire cache after 1 day @rem Update npm to at least version 5
call npm update --cache-min 86400 call npm update -g npm
call npm update --prefer-online

@ -20,10 +20,12 @@ source ~/.nvm/nvm.sh
nvm install $NODE_VERSION nvm install $NODE_VERSION
set -ex set -ex
# Update npm to at least version 5
npm update -g npm
export GRPC_CONFIG=${CONFIG:-opt} export GRPC_CONFIG=${CONFIG:-opt}
# Expire cache after 1 day npm update --prefer-online
npm update --cache-min 86400
npm install node-gyp-install npm install node-gyp-install
./node_modules/.bin/node-gyp-install ./node_modules/.bin/node-gyp-install

@ -450,10 +450,11 @@ class NodeLanguage(object):
# we should specify in the compiler argument # we should specify in the compiler argument
_check_compiler(self.args.compiler, ['default', 'node0.12', _check_compiler(self.args.compiler, ['default', 'node0.12',
'node4', 'node5', 'node6', 'node4', 'node5', 'node6',
'node7', 'electron1.3', 'electron1.6']) 'node7', 'node8',
'electron1.3', 'electron1.6'])
if self.args.compiler == 'default': if self.args.compiler == 'default':
self.runtime = 'node' self.runtime = 'node'
self.node_version = '7' self.node_version = '8'
else: else:
if self.args.compiler.startswith('electron'): if self.args.compiler.startswith('electron'):
self.runtime = 'electron' self.runtime = 'electron'
@ -1192,7 +1193,7 @@ argp.add_argument('--compiler',
'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7', 'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7',
'vs2013', 'vs2015', 'vs2013', 'vs2015',
'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine', 'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine',
'node0.12', 'node4', 'node5', 'node6', 'node7', 'node0.12', 'node4', 'node5', 'node6', 'node7', 'node8',
'electron1.3', 'electron1.6', 'electron1.3', 'electron1.6',
'coreclr', 'coreclr',
'cmake'], 'cmake'],

@ -287,6 +287,15 @@ def _create_portability_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS)
extra_args=extra_args, extra_args=extra_args,
inner_jobs=inner_jobs) inner_jobs=inner_jobs)
test_jobs += _generate_jobs(languages=['node'],
configs=['dbg'],
platforms=['linux'],
arch='default',
compiler='node7',
labels=['portability'],
extra_args=extra_args,
inner_jobs=inner_jobs)
return test_jobs return test_jobs

Loading…
Cancel
Save