From f7f6a1480fe75456eed55b53e31ad715a7061190 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Thu, 25 Apr 2019 13:16:59 +0200 Subject: [PATCH 1/2] Add NodeJS v12 support Fixes #2070 --- native_client/javascript/Makefile | 3 +- native_client/javascript/deepspeech.i | 12 +- native_client/javascript/package.json.in | 2 +- native_client/swig_node_v10.12.patch | 203 ++++++ ...0001-Move-from-v8-Handle-to-v8-Local.patch | 591 ++++++++++++++++++ ...-to-new-MaybeLocal-based-NewInstance.patch | 29 + ...-to-new-MaybeLocal-based-GetFunction.patch | 45 ++ taskcluster/.shared.yml | 22 +- taskcluster/darwin-opt-base.tyml | 4 +- .../test-nodejs_12x-armbian-arm64-opt.yml | 13 + .../test-nodejs_12x-darwin-amd64-opt.yml | 13 + .../test-nodejs_12x-linux-amd64-opt.yml | 14 + ...odejs_12x-linux-amd64-prod_pbmodel-opt.yml | 13 + .../test-nodejs_12x-raspbian-rpi3-opt.yml | 13 + taskcluster/test-nodejs_12x-win-amd64-opt.yml | 13 + taskcluster/win-opt-base.tyml | 2 +- tc-tests-utils.sh | 2 +- 17 files changed, 980 insertions(+), 14 deletions(-) create mode 100644 native_client/swig_node_v10.12.patch create mode 100644 native_client/swig_node_v12_0001-Move-from-v8-Handle-to-v8-Local.patch create mode 100644 native_client/swig_node_v12_0002-Move-to-new-MaybeLocal-based-NewInstance.patch create mode 100644 native_client/swig_node_v12_0003-Move-to-new-MaybeLocal-based-GetFunction.patch create mode 100644 taskcluster/test-nodejs_12x-armbian-arm64-opt.yml create mode 100644 taskcluster/test-nodejs_12x-darwin-amd64-opt.yml create mode 100644 taskcluster/test-nodejs_12x-linux-amd64-opt.yml create mode 100644 taskcluster/test-nodejs_12x-linux-amd64-prod_pbmodel-opt.yml create mode 100644 taskcluster/test-nodejs_12x-raspbian-rpi3-opt.yml create mode 100644 taskcluster/test-nodejs_12x-win-amd64-opt.yml diff --git a/native_client/javascript/Makefile b/native_client/javascript/Makefile index e0bba0cffd..a6893c1612 100644 --- a/native_client/javascript/Makefile +++ b/native_client/javascript/Makefile @@ -45,8 +45,9 @@ node-wrapper: copy-deps build $(NODE_BUILD_TOOL) $(NODE_PLATFORM_TARGET) $(NODE_RUNTIME) $(NODE_ABI_TARGET) $(NODE_DIST_URL) package $(NODE_BUILD_VERBOSE) npm-pack: clean package.json README.md index.js - npm install node-pre-gyp@0.12.x + npm install node-pre-gyp@0.13.x npm pack $(NODE_BUILD_VERBOSE) deepspeech_wrap.cxx: deepspeech.i + swig -version swig -c++ -javascript -node deepspeech.i diff --git a/native_client/javascript/deepspeech.i b/native_client/javascript/deepspeech.i index b22b863e9c..0575b15648 100644 --- a/native_client/javascript/deepspeech.i +++ b/native_client/javascript/deepspeech.i @@ -14,7 +14,7 @@ using namespace node; // convert Node Buffer into a C ptr + length %typemap(in) (short* IN_ARRAY1, int DIM1) { - Local bufferObj = $input->ToObject(); + Local bufferObj = SWIGV8_TO_OBJECT($input); char* bufferData = Buffer::Data(bufferObj); size_t bufferLength = Buffer::Length(bufferObj); @@ -68,18 +68,18 @@ using namespace node; %nodefaultdtor MetadataItem; %extend Metadata { - v8::Handle items; - v8::Handle items_get() { - v8::Handle jsresult = SWIGV8_ARRAY_NEW(); + v8::Local items; + v8::Local items_get() { + v8::Local jsresult = SWIGV8_ARRAY_NEW(); for (int i = 0; i < self->num_items; ++i) { jsresult = SWIGV8_AppendOutput(jsresult, SWIG_NewPointerObj(SWIG_as_voidptr(&self->items[i]), SWIGTYPE_p_MetadataItem, SWIG_POINTER_OWN)); } fail: return jsresult; } - v8::Handle items_set(const v8::Handle arg) { + v8::Local items_set(const v8::Local arg) { fail: - v8::Handle result = SWIGV8_ARRAY_NEW(); + v8::Local result = SWIGV8_ARRAY_NEW(); return result; } } diff --git a/native_client/javascript/package.json.in b/native_client/javascript/package.json.in index 7f46b200c7..afbd3fd3f8 100644 --- a/native_client/javascript/package.json.in +++ b/native_client/javascript/package.json.in @@ -30,7 +30,7 @@ "host" : "https://index.taskcluster.net/v1/task/project.deepspeech.tensorflow.pip.v1.0.0-warpctc.arm/artifacts/public/" }, "dependencies" : { - "node-pre-gyp": "0.12.x", + "node-pre-gyp": "0.13.x", "argparse": "1.0.x", "sox-stream": "2.0.x", "memory-stream": "0.0.3", diff --git a/native_client/swig_node_v10.12.patch b/native_client/swig_node_v10.12.patch new file mode 100644 index 0000000000..9fb51e3930 --- /dev/null +++ b/native_client/swig_node_v10.12.patch @@ -0,0 +1,203 @@ +diff --git a/Lib/javascript/v8/javascripthelpers.swg b/Lib/javascript/v8/javascripthelpers.swg +index 7b8a5ec237..80fbd7aa1a 100644 +--- a/Lib/javascript/v8/javascripthelpers.swg ++++ b/Lib/javascript/v8/javascripthelpers.swg +@@ -93,7 +93,7 @@ SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local sproperty; + if (property->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocal(&sproperty)) { +- sproperty->WriteUtf8(buffer, 256); ++ SWIGV8_WRITE_UTF8(sproperty, buffer, 256); + res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); + } + else { +diff --git a/Lib/javascript/v8/javascriptprimtypes.swg b/Lib/javascript/v8/javascriptprimtypes.swg +index c0055c48ee..f76be983b1 100644 +--- a/Lib/javascript/v8/javascriptprimtypes.swg ++++ b/Lib/javascript/v8/javascriptprimtypes.swg +@@ -22,7 +22,7 @@ int SWIG_AsVal_dec(bool)(v8::Handle obj, bool *val) + return SWIG_ERROR; + } + +- if (val) *val = obj->BooleanValue(); ++ if (val) *val = SWIGV8_BOOLEAN_VALUE(obj); + return SWIG_OK; + } + } +@@ -44,7 +44,7 @@ int SWIG_AsVal_dec(int)(v8::Handle valRef, int* val) + if (!valRef->IsNumber()) { + return SWIG_TypeError; + } +- if(val) *val = valRef->IntegerValue(); ++ if(val) *val = SWIGV8_INTEGER_VALUE(valRef); + + return SWIG_OK; + } +@@ -68,7 +68,7 @@ int SWIG_AsVal_dec(long)(v8::Handle obj, long* val) + if (!obj->IsNumber()) { + return SWIG_TypeError; + } +- if(val) *val = (long) obj->IntegerValue(); ++ if(val) *val = (long) SWIGV8_INTEGER_VALUE(obj); + + return SWIG_OK; + } +@@ -95,7 +95,7 @@ int SWIG_AsVal_dec(unsigned long)(v8::Handle obj, unsigned long *val) + return SWIG_TypeError; + } + +- long longVal = (long) obj->NumberValue(); ++ long longVal = (long) SWIGV8_NUMBER_VALUE(obj); + + if(longVal < 0) { + return SWIG_OverflowError; +@@ -133,7 +133,7 @@ int SWIG_AsVal_dec(long long)(v8::Handle obj, long long* val) + if (!obj->IsNumber()) { + return SWIG_TypeError; + } +- if(val) *val = (long long) obj->IntegerValue(); ++ if(val) *val = (long long) SWIGV8_INTEGER_VALUE(obj); + + return SWIG_OK; + } +@@ -168,7 +168,7 @@ int SWIG_AsVal_dec(unsigned long long)(v8::Handle obj, unsigned long + return SWIG_TypeError; + } + +- long long longVal = (long long) obj->NumberValue(); ++ long long longVal = (long long) SWIGV8_NUMBER_VALUE(obj); + + if(longVal < 0) { + return SWIG_OverflowError; +@@ -198,7 +198,7 @@ int SWIG_AsVal_dec(double)(v8::Handle obj, double *val) + if(!obj->IsNumber()) { + return SWIG_TypeError; + } +- if(val) *val = obj->NumberValue(); ++ if(val) *val = SWIGV8_NUMBER_VALUE(obj); + + return SWIG_OK; + } +diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg +index 84bd4cc67e..2452f4040d 100644 +--- a/Lib/javascript/v8/javascriptrun.swg ++++ b/Lib/javascript/v8/javascriptrun.swg +@@ -91,6 +91,32 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; + #define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ.Reset(v8::Isolate::GetCurrent(), class); + #endif + ++#ifdef NODE_VERSION ++#if NODE_VERSION_AT_LEAST(10, 12, 0) ++#define SWIG_NODE_AT_LEAST_1012 ++#endif ++#endif ++ ++//Necessary to check Node.js version because V8 API changes are backported in Node.js ++#if (defined(NODE_VERSION) && !defined(SWIG_NODE_AT_LEAST_1012)) || \ ++ (!defined(NODE_VERSION) && (V8_MAJOR_VERSION-0) < 7) ++#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject() ++#define SWIGV8_TO_STRING(handle) (handle)->ToString() ++#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue() ++#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue() ++#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue() ++#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(buffer, len) ++#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length() ++#else ++#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() ++#define SWIGV8_TO_STRING(handle) (handle)->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked() ++#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() ++#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() ++#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(SWIGV8_CURRENT_CONTEXT()).ToChecked() ++#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(v8::Isolate::GetCurrent(), buffer, len) ++#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length(v8::Isolate::GetCurrent()) ++#endif ++ + /* --------------------------------------------------------------------------- + * Error handling + * +@@ -258,7 +284,7 @@ SWIGRUNTIME int SWIG_V8_GetInstancePtr(v8::Handle valRef, void **ptr) + if(!valRef->IsObject()) { + return SWIG_TypeError; + } +- v8::Handle objRef = valRef->ToObject(); ++ v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); + + if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; + +@@ -352,7 +378,7 @@ SWIGRUNTIME int SWIG_V8_ConvertPtr(v8::Handle valRef, void **ptr, swi + if(!valRef->IsObject()) { + return SWIG_TypeError; + } +- v8::Handle objRef = valRef->ToObject(); ++ v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); + return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); + } + +@@ -479,7 +505,7 @@ SWIGRUNTIMEINLINE + int SwigV8Packed_Check(v8::Handle valRef) { + SWIGV8_HANDLESCOPE(); + +- v8::Handle objRef = valRef->ToObject(); ++ v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); + if(objRef->InternalFieldCount() < 1) return false; + #if (V8_MAJOR_VERSION-0) < 5 + v8::Handle flag = objRef->GetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__")); +@@ -489,7 +515,7 @@ int SwigV8Packed_Check(v8::Handle valRef) { + if (!objRef->GetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey).ToLocal(&flag)) + return false; + #endif +- return (flag->IsBoolean() && flag->BooleanValue()); ++ return (flag->IsBoolean() && SWIGV8_BOOLEAN_VALUE(flag)); + } + + SWIGRUNTIME +@@ -499,7 +525,7 @@ swig_type_info *SwigV8Packed_UnpackData(v8::Handle valRef, void *ptr, + + SwigV8PackedData *sobj; + +- v8::Handle objRef = valRef->ToObject(); ++ v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); + + #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) + v8::Handle cdataRef = objRef->GetInternalField(0); +diff --git a/Lib/javascript/v8/javascriptruntime.swg b/Lib/javascript/v8/javascriptruntime.swg +index 0e40593263..c78e04efbb 100644 +--- a/Lib/javascript/v8/javascriptruntime.swg ++++ b/Lib/javascript/v8/javascriptruntime.swg +@@ -44,6 +44,8 @@ + #ifdef BUILDING_NODE_EXTENSION + %insert("runtime") %{ + #include ++//Older version of node.h does not include this ++#include + %} + #endif + +diff --git a/Lib/javascript/v8/javascriptstrings.swg b/Lib/javascript/v8/javascriptstrings.swg +index 65ba20e5a9..e767a6d662 100644 +--- a/Lib/javascript/v8/javascriptstrings.swg ++++ b/Lib/javascript/v8/javascriptstrings.swg +@@ -7,11 +7,11 @@ SWIGINTERN int + SWIG_AsCharPtrAndSize(v8::Handle valRef, char** cptr, size_t* psize, int *alloc) + { + if(valRef->IsString()) { +- v8::Handle js_str = valRef->ToString(); ++ v8::Handle js_str = SWIGV8_TO_STRING(valRef); + +- size_t len = js_str->Utf8Length() + 1; ++ size_t len = SWIGV8_UTF8_LENGTH(js_str) + 1; + char* cstr = new char[len]; +- js_str->WriteUtf8(cstr, len); ++ SWIGV8_WRITE_UTF8(js_str, cstr, len); + + if(alloc) *alloc = SWIG_NEWOBJ; + if(psize) *psize = len; +@@ -20,7 +20,7 @@ SWIG_AsCharPtrAndSize(v8::Handle valRef, char** cptr, size_t* psize, + return SWIG_OK; + } else { + if(valRef->IsObject()) { +- v8::Handle obj = valRef->ToObject(); ++ v8::Handle obj = SWIGV8_TO_OBJECT(valRef); + // try if the object is a wrapped char[] + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { diff --git a/native_client/swig_node_v12_0001-Move-from-v8-Handle-to-v8-Local.patch b/native_client/swig_node_v12_0001-Move-from-v8-Handle-to-v8-Local.patch new file mode 100644 index 0000000000..a860f29906 --- /dev/null +++ b/native_client/swig_node_v12_0001-Move-from-v8-Handle-to-v8-Local.patch @@ -0,0 +1,591 @@ +From cbec3f33bc1dbefc9833e721332b1ff46a801458 Mon Sep 17 00:00:00 2001 +From: Alexandre Lissy +Date: Thu, 25 Apr 2019 12:29:19 +0200 +Subject: [PATCH 1/3] Move from v8::Handle to v8::Local + +--- + Lib/javascript/v8/javascriptcode.swg | 22 ++++++------- + Lib/javascript/v8/javascriptcomplex.swg | 10 +++--- + Lib/javascript/v8/javascripthelpers.swg | 20 ++++++------ + Lib/javascript/v8/javascriptinit.swg | 4 +-- + Lib/javascript/v8/javascriptprimtypes.swg | 28 ++++++++--------- + Lib/javascript/v8/javascriptrun.swg | 38 +++++++++++------------ + Lib/javascript/v8/javascriptstrings.swg | 10 +++--- + Lib/javascript/v8/javascripttypemaps.swg | 2 +- + Tools/javascript/v8_shell.cxx | 18 +++++------ + 9 files changed, 76 insertions(+), 76 deletions(-) + +diff --git a/Lib/javascript/v8/javascriptcode.swg b/Lib/javascript/v8/javascriptcode.swg +index c4aaf3db0..86963c1ed 100644 +--- a/Lib/javascript/v8/javascriptcode.swg ++++ b/Lib/javascript/v8/javascriptcode.swg +@@ -11,7 +11,7 @@ + static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + +- v8::Handle self = args.Holder(); ++ v8::Local self = args.Holder(); + $jslocals + if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + $jscode +@@ -53,7 +53,7 @@ static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + OverloadErrorHandler errorHandler; +- v8::Handle self; ++ v8::Local self; + + // switch all cases by means of series of if-returns. + $jsdispatchcases +@@ -78,7 +78,7 @@ fail: + static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + +- v8::Handle self = args.Holder(); ++ v8::Local self = args.Holder(); + $jslocals + if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + $jscode +@@ -226,7 +226,7 @@ static SwigV8ReturnValue $jswrapper(v8::Local property, const SwigV8Pr + #endif + SWIGV8_HANDLESCOPE(); + +- v8::Handle jsresult; ++ v8::Local jsresult; + $jslocals + $jscode + SWIGV8_RETURN_INFO(jsresult, info); +@@ -271,7 +271,7 @@ fail: + static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + +- v8::Handle jsresult; ++ v8::Local jsresult; + $jslocals + if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); + +@@ -296,7 +296,7 @@ fail: + static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + +- v8::Handle jsresult; ++ v8::Local jsresult; + OverloadErrorHandler errorHandler; + $jscode + +@@ -320,7 +320,7 @@ static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler + { + SWIGV8_HANDLESCOPE(); + +- v8::Handle jsresult; ++ v8::Local jsresult; + $jslocals + $jscode + SWIGV8_RETURN(jsresult); +@@ -374,7 +374,7 @@ fail: + %fragment("jsv8_define_class_template", "templates") + %{ + /* Name: $jsmangledname, Type: $jsmangledtype, Dtor: $jsdtor */ +- v8::Handle $jsmangledname_class = SWIGV8_CreateClassTemplate("$jsmangledname"); ++ v8::Local $jsmangledname_class = SWIGV8_CreateClassTemplate("$jsmangledname"); + SWIGV8_SET_CLASS_TEMPL($jsmangledname_clientData.class_templ, $jsmangledname_class); + $jsmangledname_clientData.dtor = $jsdtor; + if (SWIGTYPE_$jsmangledtype->clientdata == 0) { +@@ -420,11 +420,11 @@ fail: + %fragment("jsv8_create_class_instance", "templates") + %{ + /* Class: $jsname ($jsmangledname) */ +- v8::Handle $jsmangledname_class_0 = SWIGV8_CreateClassTemplate("$jsname"); ++ v8::Local $jsmangledname_class_0 = SWIGV8_CreateClassTemplate("$jsname"); + $jsmangledname_class_0->SetCallHandler($jsctor); + $jsmangledname_class_0->Inherit($jsmangledname_class); + $jsmangledname_class_0->SetHiddenPrototype(true); +- v8::Handle $jsmangledname_obj = $jsmangledname_class_0->GetFunction(); ++ v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(); + %} + + /* ----------------------------------------------------------------------------- +@@ -444,7 +444,7 @@ fail: + * ----------------------------------------------------------------------------- */ + %fragment("jsv8_create_namespace", "templates") + %{ +- v8::Handle $jsmangledname_obj = SWIGV8_OBJECT_NEW(); ++ v8::Local $jsmangledname_obj = SWIGV8_OBJECT_NEW(); + %} + + /* ----------------------------------------------------------------------------- +diff --git a/Lib/javascript/v8/javascriptcomplex.swg b/Lib/javascript/v8/javascriptcomplex.swg +index d3b4aaffa..533e54813 100644 +--- a/Lib/javascript/v8/javascriptcomplex.swg ++++ b/Lib/javascript/v8/javascriptcomplex.swg +@@ -12,7 +12,7 @@ + %fragment(SWIG_From_frag(Type),"header", + fragment=SWIG_From_frag(double)) + { +-SWIGINTERNINLINE v8::Handle ++SWIGINTERNINLINE v8::Local + SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) + { + SWIGV8_HANDLESCOPE_ESC(); +@@ -32,12 +32,12 @@ SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) + fragment=SWIG_AsVal_frag(double)) + { + SWIGINTERN int +-SWIG_AsVal_dec(Type) (v8::Handle o, Type* val) ++SWIG_AsVal_dec(Type) (v8::Local o, Type* val) + { + SWIGV8_HANDLESCOPE(); + + if (o->IsArray()) { +- v8::Handle array = v8::Handle::Cast(o); ++ v8::Local array = v8::Local::Cast(o); + + if(array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); + double re, im; +@@ -74,12 +74,12 @@ SWIG_AsVal_dec(Type) (v8::Handle o, Type* val) + %fragment(SWIG_AsVal_frag(Type),"header", + fragment=SWIG_AsVal_frag(float)) { + SWIGINTERN int +-SWIG_AsVal_dec(Type) (v8::Handle o, Type* val) ++SWIG_AsVal_dec(Type) (v8::Local o, Type* val) + { + SWIGV8_HANDLESCOPE(); + + if (o->IsArray()) { +- v8::Handle array = v8::Handle::Cast(o); ++ v8::Local array = v8::Local::Cast(o); + + if(array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); + double re, im; +diff --git a/Lib/javascript/v8/javascripthelpers.swg b/Lib/javascript/v8/javascripthelpers.swg +index 80fbd7aa1..c610f5196 100644 +--- a/Lib/javascript/v8/javascripthelpers.swg ++++ b/Lib/javascript/v8/javascripthelpers.swg +@@ -21,19 +21,19 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfoVoid; + /** + * Creates a class template for a class with specified initialization function. + */ +-SWIGRUNTIME v8::Handle SWIGV8_CreateClassTemplate(const char* symbol) { ++SWIGRUNTIME v8::Local SWIGV8_CreateClassTemplate(const char* symbol) { + SWIGV8_HANDLESCOPE_ESC(); + + v8::Local class_templ = SWIGV8_FUNCTEMPLATE_NEW_VOID(); + class_templ->SetClassName(SWIGV8_SYMBOL_NEW(symbol)); + +- v8::Handle inst_templ = class_templ->InstanceTemplate(); ++ v8::Local inst_templ = class_templ->InstanceTemplate(); + inst_templ->SetInternalFieldCount(1); + +- v8::Handle equals_templ = class_templ->PrototypeTemplate(); ++ v8::Local equals_templ = class_templ->PrototypeTemplate(); + equals_templ->Set(SWIGV8_SYMBOL_NEW("equals"), SWIGV8_FUNCTEMPLATE_NEW(_SWIGV8_wrap_equals)); + +- v8::Handle cptr_templ = class_templ->PrototypeTemplate(); ++ v8::Local cptr_templ = class_templ->PrototypeTemplate(); + cptr_templ->Set(SWIGV8_SYMBOL_NEW("getCPtr"), SWIGV8_FUNCTEMPLATE_NEW(_wrap_getCPtr)); + + SWIGV8_ESCAPE(class_templ); +@@ -42,25 +42,25 @@ SWIGRUNTIME v8::Handle SWIGV8_CreateClassTemplate(const ch + /** + * Registers a class method with given name for a given class template. + */ +-SWIGRUNTIME void SWIGV8_AddMemberFunction(v8::Handle class_templ, const char* symbol, ++SWIGRUNTIME void SWIGV8_AddMemberFunction(v8::Local class_templ, const char* symbol, + SwigV8FunctionCallback _func) { +- v8::Handle proto_templ = class_templ->PrototypeTemplate(); ++ v8::Local proto_templ = class_templ->PrototypeTemplate(); + proto_templ->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)); + } + + /** + * Registers a class property with given name for a given class template. + */ +-SWIGRUNTIME void SWIGV8_AddMemberVariable(v8::Handle class_templ, const char* symbol, ++SWIGRUNTIME void SWIGV8_AddMemberVariable(v8::Local class_templ, const char* symbol, + SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { +- v8::Handle proto_templ = class_templ->InstanceTemplate(); ++ v8::Local proto_templ = class_templ->InstanceTemplate(); + proto_templ->SetAccessor(SWIGV8_SYMBOL_NEW(symbol), getter, setter); + } + + /** + * Registers a class method with given name for a given object. + */ +-SWIGRUNTIME void SWIGV8_AddStaticFunction(v8::Handle obj, const char* symbol, ++SWIGRUNTIME void SWIGV8_AddStaticFunction(v8::Local obj, const char* symbol, + const SwigV8FunctionCallback& _func) { + obj->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)->GetFunction()); + } +@@ -68,7 +68,7 @@ SWIGRUNTIME void SWIGV8_AddStaticFunction(v8::Handle obj, const char + /** + * Registers a class method with given name for a given object. + */ +-SWIGRUNTIME void SWIGV8_AddStaticVariable(v8::Handle obj, const char* symbol, ++SWIGRUNTIME void SWIGV8_AddStaticVariable(v8::Local obj, const char* symbol, + SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { + #if (V8_MAJOR_VERSION-0) < 5 + obj->SetAccessor(SWIGV8_SYMBOL_NEW(symbol), getter, setter); +diff --git a/Lib/javascript/v8/javascriptinit.swg b/Lib/javascript/v8/javascriptinit.swg +index 8faf2dd8e..450aa9c6d 100644 +--- a/Lib/javascript/v8/javascriptinit.swg ++++ b/Lib/javascript/v8/javascriptinit.swg +@@ -70,14 +70,14 @@ extern "C" + #if (NODE_MODULE_VERSION < 0x000C) + void SWIGV8_INIT (v8::Handle exports) + #else +-void SWIGV8_INIT (v8::Handle exports, v8::Handle /*module*/) ++void SWIGV8_INIT (v8::Local exports, v8::Local /*module*/) + #endif + { + SWIG_InitializeModule(static_cast(&exports)); + + SWIGV8_HANDLESCOPE(); + +- v8::Handle exports_obj = exports; ++ v8::Local exports_obj = exports; + %} + + +diff --git a/Lib/javascript/v8/javascriptprimtypes.swg b/Lib/javascript/v8/javascriptprimtypes.swg +index f76be983b..24f5daf7c 100644 +--- a/Lib/javascript/v8/javascriptprimtypes.swg ++++ b/Lib/javascript/v8/javascriptprimtypes.swg +@@ -6,7 +6,7 @@ + + %fragment(SWIG_From_frag(bool),"header") { + SWIGINTERNINLINE +-v8::Handle ++v8::Local + SWIG_From_dec(bool)(bool value) + { + return SWIGV8_BOOLEAN_NEW(value); +@@ -16,7 +16,7 @@ SWIG_From_dec(bool)(bool value) + %fragment(SWIG_AsVal_frag(bool),"header", + fragment=SWIG_AsVal_frag(long)) { + SWIGINTERN +-int SWIG_AsVal_dec(bool)(v8::Handle obj, bool *val) ++int SWIG_AsVal_dec(bool)(v8::Local obj, bool *val) + { + if(!obj->IsBoolean()) { + return SWIG_ERROR; +@@ -31,7 +31,7 @@ int SWIG_AsVal_dec(bool)(v8::Handle obj, bool *val) + + %fragment(SWIG_From_frag(int),"header") { + SWIGINTERNINLINE +-v8::Handle SWIG_From_dec(int)(int value) ++v8::Local SWIG_From_dec(int)(int value) + { + return SWIGV8_INT32_NEW(value); + } +@@ -39,7 +39,7 @@ v8::Handle SWIG_From_dec(int)(int value) + + %fragment(SWIG_AsVal_frag(int),"header") { + SWIGINTERN +-int SWIG_AsVal_dec(int)(v8::Handle valRef, int* val) ++int SWIG_AsVal_dec(int)(v8::Local valRef, int* val) + { + if (!valRef->IsNumber()) { + return SWIG_TypeError; +@@ -54,7 +54,7 @@ int SWIG_AsVal_dec(int)(v8::Handle valRef, int* val) + + %fragment(SWIG_From_frag(long),"header") { + SWIGINTERNINLINE +-v8::Handle SWIG_From_dec(long)(long value) ++v8::Local SWIG_From_dec(long)(long value) + { + return SWIGV8_NUMBER_NEW(value); + } +@@ -63,7 +63,7 @@ v8::Handle SWIG_From_dec(long)(long value) + %fragment(SWIG_AsVal_frag(long),"header", + fragment="SWIG_CanCastAsInteger") { + SWIGINTERN +-int SWIG_AsVal_dec(long)(v8::Handle obj, long* val) ++int SWIG_AsVal_dec(long)(v8::Local obj, long* val) + { + if (!obj->IsNumber()) { + return SWIG_TypeError; +@@ -79,7 +79,7 @@ int SWIG_AsVal_dec(long)(v8::Handle obj, long* val) + %fragment(SWIG_From_frag(unsigned long),"header", + fragment=SWIG_From_frag(long)) { + SWIGINTERNINLINE +-v8::Handle SWIG_From_dec(unsigned long)(unsigned long value) ++v8::Local SWIG_From_dec(unsigned long)(unsigned long value) + { + return (value > LONG_MAX) ? + SWIGV8_INTEGER_NEW_UNS(value) : SWIGV8_INTEGER_NEW(%numeric_cast(value,long)); +@@ -89,7 +89,7 @@ v8::Handle SWIG_From_dec(unsigned long)(unsigned long value) + %fragment(SWIG_AsVal_frag(unsigned long),"header", + fragment="SWIG_CanCastAsInteger") { + SWIGINTERN +-int SWIG_AsVal_dec(unsigned long)(v8::Handle obj, unsigned long *val) ++int SWIG_AsVal_dec(unsigned long)(v8::Local obj, unsigned long *val) + { + if(!obj->IsNumber()) { + return SWIG_TypeError; +@@ -115,7 +115,7 @@ int SWIG_AsVal_dec(unsigned long)(v8::Handle obj, unsigned long *val) + fragment="SWIG_LongLongAvailable") { + %#ifdef SWIG_LONG_LONG_AVAILABLE + SWIGINTERNINLINE +-v8::Handle SWIG_From_dec(long long)(long long value) ++v8::Local SWIG_From_dec(long long)(long long value) + { + return SWIGV8_NUMBER_NEW(value); + } +@@ -128,7 +128,7 @@ v8::Handle SWIG_From_dec(long long)(long long value) + fragment="SWIG_LongLongAvailable") { + %#ifdef SWIG_LONG_LONG_AVAILABLE + SWIGINTERN +-int SWIG_AsVal_dec(long long)(v8::Handle obj, long long* val) ++int SWIG_AsVal_dec(long long)(v8::Local obj, long long* val) + { + if (!obj->IsNumber()) { + return SWIG_TypeError; +@@ -148,7 +148,7 @@ int SWIG_AsVal_dec(long long)(v8::Handle obj, long long* val) + fragment="SWIG_LongLongAvailable") { + %#ifdef SWIG_LONG_LONG_AVAILABLE + SWIGINTERNINLINE +-v8::Handle SWIG_From_dec(unsigned long long)(unsigned long long value) ++v8::Local SWIG_From_dec(unsigned long long)(unsigned long long value) + { + return (value > LONG_MAX) ? + SWIGV8_INTEGER_NEW_UNS(value) : SWIGV8_INTEGER_NEW(%numeric_cast(value,long)); +@@ -162,7 +162,7 @@ v8::Handle SWIG_From_dec(unsigned long long)(unsigned long long value + fragment="SWIG_LongLongAvailable") { + %#ifdef SWIG_LONG_LONG_AVAILABLE + SWIGINTERN +-int SWIG_AsVal_dec(unsigned long long)(v8::Handle obj, unsigned long long *val) ++int SWIG_AsVal_dec(unsigned long long)(v8::Local obj, unsigned long long *val) + { + if(!obj->IsNumber()) { + return SWIG_TypeError; +@@ -185,7 +185,7 @@ int SWIG_AsVal_dec(unsigned long long)(v8::Handle obj, unsigned long + + %fragment(SWIG_From_frag(double),"header") { + SWIGINTERN +-v8::Handle SWIG_From_dec(double) (double val) ++v8::Local SWIG_From_dec(double) (double val) + { + return SWIGV8_NUMBER_NEW(val); + } +@@ -193,7 +193,7 @@ v8::Handle SWIG_From_dec(double) (double val) + + %fragment(SWIG_AsVal_frag(double),"header") { + SWIGINTERN +-int SWIG_AsVal_dec(double)(v8::Handle obj, double *val) ++int SWIG_AsVal_dec(double)(v8::Local obj, double *val) + { + if(!obj->IsNumber()) { + return SWIG_TypeError; +diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg +index 2452f4040..866cdb331 100644 +--- a/Lib/javascript/v8/javascriptrun.swg ++++ b/Lib/javascript/v8/javascriptrun.swg +@@ -163,7 +163,7 @@ public: + SWIGV8_THROW_EXCEPTION(err); + } + } +- v8::Handle err; ++ v8::Local err; + }; + + /* --------------------------------------------------------------------------- +@@ -228,13 +228,13 @@ public: + + SWIGRUNTIME v8::Persistent SWIGV8_SWIGTYPE_Proxy_class_templ; + +-SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle objRef, void **ptr, swig_type_info *info, int flags) { ++SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Local objRef, void **ptr, swig_type_info *info, int flags) { + SWIGV8_HANDLESCOPE(); + + if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; + + #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) +- v8::Handle cdataRef = objRef->GetInternalField(0); ++ v8::Local cdataRef = objRef->GetInternalField(0); + SWIGV8_Proxy *cdata = static_cast(v8::External::Unwrap(cdataRef)); + #else + SWIGV8_Proxy *cdata = static_cast(objRef->GetAlignedPointerFromInternalField(0)); +@@ -280,11 +280,11 @@ SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackInfo valRef, void **ptr) { ++SWIGRUNTIME int SWIG_V8_GetInstancePtr(v8::Local valRef, void **ptr) { + if(!valRef->IsObject()) { + return SWIG_TypeError; + } +- v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); ++ v8::Local objRef = SWIGV8_TO_OBJECT(valRef); + + if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; + +@@ -304,7 +304,7 @@ SWIGRUNTIME int SWIG_V8_GetInstancePtr(v8::Handle valRef, void **ptr) + return SWIG_OK; + } + +-SWIGRUNTIME void SWIGV8_SetPrivateData(v8::Handle obj, void *ptr, swig_type_info *info, int flags) { ++SWIGRUNTIME void SWIGV8_SetPrivateData(v8::Local obj, void *ptr, swig_type_info *info, int flags) { + SWIGV8_Proxy *cdata = new SWIGV8_Proxy(); + cdata->swigCObject = ptr; + cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; +@@ -367,7 +367,7 @@ SWIGRUNTIME void SWIGV8_SetPrivateData(v8::Handle obj, void *ptr, sw + + } + +-SWIGRUNTIME int SWIG_V8_ConvertPtr(v8::Handle valRef, void **ptr, swig_type_info *info, int flags) { ++SWIGRUNTIME int SWIG_V8_ConvertPtr(v8::Local valRef, void **ptr, swig_type_info *info, int flags) { + SWIGV8_HANDLESCOPE(); + + /* special case: JavaScript null => C NULL pointer */ +@@ -378,14 +378,14 @@ SWIGRUNTIME int SWIG_V8_ConvertPtr(v8::Handle valRef, void **ptr, swi + if(!valRef->IsObject()) { + return SWIG_TypeError; + } +- v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); ++ v8::Local objRef = SWIGV8_TO_OBJECT(valRef); + return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); + } + +-SWIGRUNTIME v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { ++SWIGRUNTIME v8::Local SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { + SWIGV8_HANDLESCOPE_ESC(); + +- v8::Handle class_templ; ++ v8::Local class_templ; + + if (ptr == NULL) { + #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) +@@ -433,7 +433,7 @@ SWIGRUNTIME v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_inf + SWIGRUNTIME SwigV8ReturnValue _SWIGV8_wrap_equals(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + +- v8::Handle jsresult; ++ v8::Local jsresult; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + bool result; +@@ -463,7 +463,7 @@ fail: + SWIGRUNTIME SwigV8ReturnValue _wrap_getCPtr(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + +- v8::Handle jsresult; ++ v8::Local jsresult; + void *arg1 = (void *) 0 ; + long result; + int res1; +@@ -502,10 +502,10 @@ public: + }; + + SWIGRUNTIMEINLINE +-int SwigV8Packed_Check(v8::Handle valRef) { ++int SwigV8Packed_Check(v8::Local valRef) { + SWIGV8_HANDLESCOPE(); + +- v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); ++ v8::Local objRef = SWIGV8_TO_OBJECT(valRef); + if(objRef->InternalFieldCount() < 1) return false; + #if (V8_MAJOR_VERSION-0) < 5 + v8::Handle flag = objRef->GetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__")); +@@ -519,13 +519,13 @@ int SwigV8Packed_Check(v8::Handle valRef) { + } + + SWIGRUNTIME +-swig_type_info *SwigV8Packed_UnpackData(v8::Handle valRef, void *ptr, size_t size) { ++swig_type_info *SwigV8Packed_UnpackData(v8::Local valRef, void *ptr, size_t size) { + if (SwigV8Packed_Check(valRef)) { + SWIGV8_HANDLESCOPE(); + + SwigV8PackedData *sobj; + +- v8::Handle objRef = SWIGV8_TO_OBJECT(valRef); ++ v8::Local objRef = SWIGV8_TO_OBJECT(valRef); + + #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) + v8::Handle cdataRef = objRef->GetInternalField(0); +@@ -542,7 +542,7 @@ swig_type_info *SwigV8Packed_UnpackData(v8::Handle valRef, void *ptr, + } + + SWIGRUNTIME +-int SWIGV8_ConvertPacked(v8::Handle valRef, void *ptr, size_t sz, swig_type_info *ty) { ++int SWIGV8_ConvertPacked(v8::Local valRef, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = SwigV8Packed_UnpackData(valRef, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { +@@ -590,7 +590,7 @@ SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackInfo SWIGV8_NewPackedObj(void *data, size_t size, swig_type_info *type) { ++v8::Local SWIGV8_NewPackedObj(void *data, size_t size, swig_type_info *type) { + SWIGV8_HANDLESCOPE_ESC(); + + SwigV8PackedData *cdata = new SwigV8PackedData(data, size, type); +@@ -657,7 +657,7 @@ SWIGRUNTIME + #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) + v8::Handle SWIGV8_AppendOutput(v8::Handle result, v8::Handle obj) { + #else +-v8::Handle SWIGV8_AppendOutput(v8::Local result, v8::Handle obj) { ++v8::Local SWIGV8_AppendOutput(v8::Local result, v8::Local obj) { + #endif + SWIGV8_HANDLESCOPE_ESC(); + +diff --git a/Lib/javascript/v8/javascriptstrings.swg b/Lib/javascript/v8/javascriptstrings.swg +index e767a6d66..61a937fa5 100644 +--- a/Lib/javascript/v8/javascriptstrings.swg ++++ b/Lib/javascript/v8/javascriptstrings.swg +@@ -4,10 +4,10 @@ + * ------------------------------------------------------------ */ + %fragment("SWIG_AsCharPtrAndSize", "header", fragment="SWIG_pchar_descriptor") { + SWIGINTERN int +-SWIG_AsCharPtrAndSize(v8::Handle valRef, char** cptr, size_t* psize, int *alloc) ++SWIG_AsCharPtrAndSize(v8::Local valRef, char** cptr, size_t* psize, int *alloc) + { + if(valRef->IsString()) { +- v8::Handle js_str = SWIGV8_TO_STRING(valRef); ++ v8::Local js_str = SWIGV8_TO_STRING(valRef); + + size_t len = SWIGV8_UTF8_LENGTH(js_str) + 1; + char* cstr = new char[len]; +@@ -20,7 +20,7 @@ SWIG_AsCharPtrAndSize(v8::Handle valRef, char** cptr, size_t* psize, + return SWIG_OK; + } else { + if(valRef->IsObject()) { +- v8::Handle obj = SWIGV8_TO_OBJECT(valRef); ++ v8::Local obj = SWIGV8_TO_OBJECT(valRef); + // try if the object is a wrapped char[] + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { +@@ -41,7 +41,7 @@ SWIG_AsCharPtrAndSize(v8::Handle valRef, char** cptr, size_t* psize, + } + + %fragment("SWIG_FromCharPtrAndSize","header",fragment="SWIG_pchar_descriptor") { +-SWIGINTERNINLINE v8::Handle ++SWIGINTERNINLINE v8::Local + SWIG_FromCharPtrAndSize(const char* carray, size_t size) + { + if (carray) { +@@ -49,7 +49,7 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) + // TODO: handle extra long strings + return SWIGV8_UNDEFINED(); + } else { +- v8::Handle js_str = SWIGV8_STRING_NEW2(carray, size); ++ v8::Local js_str = SWIGV8_STRING_NEW2(carray, size); + return js_str; + } + } else { +diff --git a/Lib/javascript/v8/javascripttypemaps.swg b/Lib/javascript/v8/javascripttypemaps.swg +index 4601698e0..fbe7849cd 100644 +--- a/Lib/javascript/v8/javascripttypemaps.swg ++++ b/Lib/javascript/v8/javascripttypemaps.swg +@@ -25,7 +25,7 @@ + + /* Javascript types */ + +-#define SWIG_Object v8::Handle ++#define SWIG_Object v8::Local + #define VOID_Object SWIGV8_UNDEFINED() + + /* Overload of the output/constant/exception/dirout handling */ +-- +2.20.1 + diff --git a/native_client/swig_node_v12_0002-Move-to-new-MaybeLocal-based-NewInstance.patch b/native_client/swig_node_v12_0002-Move-to-new-MaybeLocal-based-NewInstance.patch new file mode 100644 index 0000000000..a9775be9c1 --- /dev/null +++ b/native_client/swig_node_v12_0002-Move-to-new-MaybeLocal-based-NewInstance.patch @@ -0,0 +1,29 @@ +From d6901084c695117379991e59460a81ab37562eb5 Mon Sep 17 00:00:00 2001 +From: Alexandre Lissy +Date: Thu, 25 Apr 2019 12:43:09 +0200 +Subject: [PATCH 2/3] Move to new MaybeLocal based NewInstance() + +--- + Lib/javascript/v8/javascriptrun.swg | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg +index 866cdb331..3efe8783d 100644 +--- a/Lib/javascript/v8/javascriptrun.swg ++++ b/Lib/javascript/v8/javascriptrun.swg +@@ -412,8 +412,11 @@ SWIGRUNTIME v8::Local SWIG_V8_NewPointerObj(void *ptr, swig_type_info + } + #endif + +-// v8::Handle result = class_templ->InstanceTemplate()->NewInstance(); ++#if (NODE_MODULE_VERSION < 72) + v8::Local result = class_templ->InstanceTemplate()->NewInstance(); ++#else ++ v8::Local result = class_templ->InstanceTemplate()->NewInstance(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked(); ++#endif + SWIGV8_SetPrivateData(result, ptr, info, flags); + + SWIGV8_ESCAPE(result); +-- +2.20.1 + diff --git a/native_client/swig_node_v12_0003-Move-to-new-MaybeLocal-based-GetFunction.patch b/native_client/swig_node_v12_0003-Move-to-new-MaybeLocal-based-GetFunction.patch new file mode 100644 index 0000000000..18de5997c8 --- /dev/null +++ b/native_client/swig_node_v12_0003-Move-to-new-MaybeLocal-based-GetFunction.patch @@ -0,0 +1,45 @@ +From 4e6df9ce197f2bb9ff34a6b584038a7dc7241126 Mon Sep 17 00:00:00 2001 +From: Alexandre Lissy +Date: Thu, 25 Apr 2019 12:47:46 +0200 +Subject: [PATCH 3/3] Move to new MaybeLocal based GetFunction() + +--- + Lib/javascript/v8/javascriptcode.swg | 4 ++++ + Lib/javascript/v8/javascripthelpers.swg | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/Lib/javascript/v8/javascriptcode.swg b/Lib/javascript/v8/javascriptcode.swg +index 86963c1ed..a707750b1 100644 +--- a/Lib/javascript/v8/javascriptcode.swg ++++ b/Lib/javascript/v8/javascriptcode.swg +@@ -424,7 +424,11 @@ fail: + $jsmangledname_class_0->SetCallHandler($jsctor); + $jsmangledname_class_0->Inherit($jsmangledname_class); + $jsmangledname_class_0->SetHiddenPrototype(true); ++#if (NODE_MODULE_VERSION < 72) + v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(); ++#else ++ v8::Local $jsmangledname_obj = $jsmangledname_class_0->GetFunction(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked(); ++#endif + %} + + /* ----------------------------------------------------------------------------- +diff --git a/Lib/javascript/v8/javascripthelpers.swg b/Lib/javascript/v8/javascripthelpers.swg +index c610f5196..b0ecfafff 100644 +--- a/Lib/javascript/v8/javascripthelpers.swg ++++ b/Lib/javascript/v8/javascripthelpers.swg +@@ -62,7 +62,11 @@ SWIGRUNTIME void SWIGV8_AddMemberVariable(v8::Local class_ + */ + SWIGRUNTIME void SWIGV8_AddStaticFunction(v8::Local obj, const char* symbol, + const SwigV8FunctionCallback& _func) { ++#if (NODE_MODULE_VERSION < 72) + obj->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)->GetFunction()); ++#else ++ obj->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)->GetFunction(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked()); ++#endif + } + + /** +-- +2.20.1 + diff --git a/taskcluster/.shared.yml b/taskcluster/.shared.yml index a9cdfe0e55..7daf73ee86 100644 --- a/taskcluster/.shared.yml +++ b/taskcluster/.shared.yml @@ -24,6 +24,7 @@ nodejs: apt_pinning: '(echo "Package: nodejs" && echo "Pin: origin deb.nodesource.com" && echo "Pin-Priority: 999") > /etc/apt/preferences' prep_10: 'echo "deb http://deb.nodesource.com/node_10.x xenial main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' prep_11: 'echo "deb http://deb.nodesource.com/node_11.x xenial main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' + prep_12: 'echo "deb http://deb.nodesource.com/node_12.x xenial main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' packages_stretch: apt: 'nodejs sox' apt_pinning: '(echo "Package: nodejs" && echo "Pin: origin deb.nodesource.com" && echo "Pin-Priority: 999") > /etc/apt/preferences' @@ -35,6 +36,7 @@ nodejs: prep_9: 'echo "deb http://deb.nodesource.com/node_9.x stretch main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' prep_10: 'echo "deb http://deb.nodesource.com/node_10.x stretch main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' prep_11: 'echo "deb http://deb.nodesource.com/node_11.x stretch main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' + prep_12: 'echo "deb http://deb.nodesource.com/node_12.x stretch main" > /etc/apt/sources.list.d/nodesource.list && wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -' brew: # Using 'nvm' from homebrew results in installing v0.33.6 which seems to # suffer from a bug making it unable to work as of now: @@ -52,6 +54,7 @@ nodejs: prep_9: 'nvm install 9.11.2 && nvm use 9.11.2' prep_10: 'nvm install 10.12.0 && nvm use 10.12.0' prep_11: 'nvm install 11.0.0 && nvm use 11.0.0' + prep_12: 'nvm install 12.0.0 && nvm use 12.0.0' win: prep_4: '/usr/bin/wget.exe https://nodejs.org/dist/v4.9.1/node-v4.9.1-win-x64.zip && ""C:\Program Files\7-zip\7z.exe"" x -o$TASKCLUSTER_NODE_DIR -tzip -aoa node-v4.9.1-win-x64.zip && rm node-*.zip && export PATH=$TASKCLUSTER_TASK_DIR/bin/node-v4.9.1-win-x64/:$PATH' prep_6: '/usr/bin/wget.exe https://nodejs.org/dist/v6.14.4/node-v6.14.4-win-x64.zip && ""C:\Program Files\7-zip\7z.exe"" x -o$TASKCLUSTER_NODE_DIR -tzip -aoa node-v6.14.4-win-x64.zip && rm node-*.zip && export PATH=$TASKCLUSTER_TASK_DIR/bin/node-v6.14.4-win-x64/:$PATH' @@ -60,13 +63,14 @@ nodejs: prep_9: '/usr/bin/wget.exe https://nodejs.org/dist/v9.11.2/node-v9.11.2-win-x64.zip && ""C:\Program Files\7-zip\7z.exe"" x -o$TASKCLUSTER_NODE_DIR -tzip -aoa node-v9.11.2-win-x64.zip && rm node-*.zip && export PATH=$TASKCLUSTER_TASK_DIR/bin/node-v9.11.2-win-x64/:$PATH' prep_10: '/usr/bin/wget.exe https://nodejs.org/dist/v10.12.0/node-v10.12.0-win-x64.zip && ""C:\Program Files\7-zip\7z.exe"" x -o$TASKCLUSTER_NODE_DIR -tzip -aoa node-v10.12.0-win-x64.zip && rm node-*.zip && export PATH=$TASKCLUSTER_TASK_DIR/bin/node-v10.12.0-win-x64/:$PATH' prep_11: '/usr/bin/wget.exe https://nodejs.org/dist/v11.0.0/node-v11.0.0-win-x64.zip && ""C:\Program Files\7-zip\7z.exe"" x -o$TASKCLUSTER_NODE_DIR -tzip -aoa node-v11.0.0-win-x64.zip && rm node-*.zip && export PATH=$TASKCLUSTER_TASK_DIR/bin/node-v11.0.0-win-x64/:$PATH' + prep_12: '/usr/bin/wget.exe https://nodejs.org/dist/v12.0.0/node-v12.0.0-win-x64.zip && ""C:\Program Files\7-zip\7z.exe"" x -o$TASKCLUSTER_NODE_DIR -tzip -aoa node-v12.0.0-win-x64.zip && rm node-*.zip && export PATH=$TASKCLUSTER_TASK_DIR/bin/node-v12.0.0-win-x64/:$PATH' ## swig -javascript requires swig >= 3.0.7 (14.04 provides 2.0.11) ## force 3.0.10 for nodejs V8 API compatibility swig: packages: install_script: 'wget http://mirrors.kernel.org/ubuntu/pool/universe/s/swig/swig_3.0.12-1_amd64.deb -O /tmp/swig_3.0.12-1_amd64.deb && wget http://mirrors.kernel.org/ubuntu/pool/universe/s/swig/swig3.0_3.0.12-1_amd64.deb -O /tmp/swig3.0_3.0.12-1_amd64.deb && dpkg -i /tmp/swig_3.0.12-1_amd64.deb /tmp/swig3.0_3.0.12-1_amd64.deb' patch_nodejs: - linux: '(for patch_file in /home/build-user/DeepSpeech/ds/native_client/swig_node_v7x-v8x-v9x_*.patch; do patch -d /usr/share/swig3.0/ -p2 < $patch_file; done)' + linux: '(for patch_file in /home/build-user/DeepSpeech/ds/native_client/swig_node_v7x-v8x-v9x_*.patch /home/build-user/DeepSpeech/ds/native_client/swig_node_v10.12.patch /home/build-user/DeepSpeech/ds/native_client/swig_node_v12_*.patch ; do patch -d /usr/share/swig3.0/ -p2 < $patch_file; done)' # Test if we can reverse patch #2: # - if yes, likely we are in a good state, patch _0001 and _0002 have # been applied @@ -76,11 +80,23 @@ swig: # patch of _0001 would require the reverse patch of _0002 to be already # applied, and we don't want to. So just test that reversing _0002 in # dry-run. - osx: '(if ! patch -R -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 -s -f --dry-run < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v7x-v8x-v9x_0002.patch ; then + osx_v7v8v9: '(if ! patch -R -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 -s -f --dry-run < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v7x-v8x-v9x_0002.patch ; then patch -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v7x-v8x-v9x_0001.patch && patch -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v7x-v8x-v9x_0002.patch; else -echo "NO PATCH NEEDED"; +echo "NO NODEJS v7-v8-v9 PATCH NEEDED"; +fi)' + osx_v10_12: '(if ! patch -R -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 -s -f --dry-run < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v10.12.patch ; then +patch -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v10.12.patch; +else +echo "NO NODEJS v10.12 PATCH NEEDED"; +fi)' + osx_v12: '(if ! patch -R -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 -s -f --dry-run < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v12_0003-Move-to-new-MaybeLocal-based-GetFunction.patch ; then +patch -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v12_0001-Move-from-v8-Handle-to-v8-Local.patch && +patch -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v12_0002-Move-to-new-MaybeLocal-based-NewInstance.patch && +patch -d $TASKCLUSTER_TASK_DIR/homebrew/Cellar/swig/3.0.12/share/swig/3.0.12/ -p2 < $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v12_0003-Move-to-new-MaybeLocal-based-GetFunction.patch; +else +echo "NO NODEJS v12 PATCH NEEDED"; fi)' cpp: brew: diff --git a/taskcluster/darwin-opt-base.tyml b/taskcluster/darwin-opt-base.tyml index 5ffad79dc9..0cf039b10a 100644 --- a/taskcluster/darwin-opt-base.tyml +++ b/taskcluster/darwin-opt-base.tyml @@ -94,7 +94,9 @@ payload: ln -s $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/ $TASKCLUSTER_TASK_DIR/DeepSpeech/tf/native_client && cd $TASKCLUSTER_TASK_DIR && $TASKCLUSTER_TASK_DIR/DeepSpeech/tf/tc-brew.sh && - ${swig.patch_nodejs.osx} && + ${swig.patch_nodejs.osx_v7v8v9} && + ${swig.patch_nodejs.osx_v10_12} && + ${swig.patch_nodejs.osx_v12} && $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/${build.scripts.build} && $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/${build.scripts.package} ; export TASKCLUSTER_TASK_EXIT_CODE=$? && diff --git a/taskcluster/test-nodejs_12x-armbian-arm64-opt.yml b/taskcluster/test-nodejs_12x-armbian-arm64-opt.yml new file mode 100644 index 0000000000..b48690e4e0 --- /dev/null +++ b/taskcluster/test-nodejs_12x-armbian-arm64-opt.yml @@ -0,0 +1,13 @@ +build: + template_file: test-armbian-opt-base.tyml + dependencies: + - "node-package-cpu" + - "test-training_upstream-linux-amd64-py27mu-opt" + system_setup: + > + ${nodejs.packages_stretch.prep_12} && ${nodejs.packages_stretch.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_stretch.apt} + args: + tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/tc-node-tests.sh 12.x" + metadata: + name: "DeepSpeech ARMbian ARM64 Cortex-A53 CPU NodeJS 12.x tests" + description: "Testing DeepSpeech forARMbian ARM64 Cortex-A53 on NodeJS v12.x, CPU only, optimized version" diff --git a/taskcluster/test-nodejs_12x-darwin-amd64-opt.yml b/taskcluster/test-nodejs_12x-darwin-amd64-opt.yml new file mode 100644 index 0000000000..edc0236620 --- /dev/null +++ b/taskcluster/test-nodejs_12x-darwin-amd64-opt.yml @@ -0,0 +1,13 @@ +build: + template_file: test-darwin-opt-base.tyml + dependencies: + - "node-package-cpu" + - "test-training_upstream-linux-amd64-py27mu-opt" + system_setup: + > + ${nodejs.brew.setup} && ${nodejs.brew.prep_12} && ${nodejs.brew.env} + args: + tests_cmdline: "$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/tc-node-tests.sh 12.x" + metadata: + name: "DeepSpeech OSX AMD64 CPU NodeJS 12.x tests" + description: "Testing DeepSpeech for OSX/AMD64 on NodeJS v12.x, CPU only, optimized version" diff --git a/taskcluster/test-nodejs_12x-linux-amd64-opt.yml b/taskcluster/test-nodejs_12x-linux-amd64-opt.yml new file mode 100644 index 0000000000..bf33affcc8 --- /dev/null +++ b/taskcluster/test-nodejs_12x-linux-amd64-opt.yml @@ -0,0 +1,14 @@ +build: + template_file: test-linux-opt-base.tyml + docker_image: "ubuntu:16.04" + dependencies: + - "node-package-cpu" + - "test-training_upstream-linux-amd64-py27mu-opt" + system_setup: + > + ${nodejs.packages_xenial.prep_12} && ${nodejs.packages_xenial.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_xenial.apt} + args: + tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/tc-node-tests.sh 12.x" + metadata: + name: "DeepSpeech Linux AMD64 CPU NodeJS 12.x tests" + description: "Testing DeepSpeech for Linux/AMD64 on NodeJS v12.x, CPU only, optimized version" diff --git a/taskcluster/test-nodejs_12x-linux-amd64-prod_pbmodel-opt.yml b/taskcluster/test-nodejs_12x-linux-amd64-prod_pbmodel-opt.yml new file mode 100644 index 0000000000..d91754265f --- /dev/null +++ b/taskcluster/test-nodejs_12x-linux-amd64-prod_pbmodel-opt.yml @@ -0,0 +1,13 @@ +build: + template_file: test-linux-opt-base.tyml + docker_image: "ubuntu:16.04" + dependencies: + - "node-package-cpu" + system_setup: + > + ${nodejs.packages_xenial.prep_12} && ${nodejs.packages_xenial.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_xenial.apt} + args: + tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/tc-node-tests-prod.sh 12.x" + metadata: + name: "DeepSpeech Linux AMD64 CPU NodeJS 12.x prod tests" + description: "Testing DeepSpeech for Linux/AMD64 on NodeJS v12.x on prod model, CPU only, optimized version" diff --git a/taskcluster/test-nodejs_12x-raspbian-rpi3-opt.yml b/taskcluster/test-nodejs_12x-raspbian-rpi3-opt.yml new file mode 100644 index 0000000000..db6b234808 --- /dev/null +++ b/taskcluster/test-nodejs_12x-raspbian-rpi3-opt.yml @@ -0,0 +1,13 @@ +build: + template_file: test-raspbian-opt-base.tyml + dependencies: + - "node-package-cpu" + - "test-training_upstream-linux-amd64-py27mu-opt" + system_setup: + > + ${nodejs.packages_stretch.prep_12} && ${nodejs.packages_stretch.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_stretch.apt} + args: + tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/tc-node-tests.sh 12.x" + metadata: + name: "DeepSpeech Raspbian RPi3/ARMv7 CPU NodeJS 12.x tests" + description: "Testing DeepSpeech for Raspbian RPi3/ARMv7 on NodeJS v12.x, CPU only, optimized version" diff --git a/taskcluster/test-nodejs_12x-win-amd64-opt.yml b/taskcluster/test-nodejs_12x-win-amd64-opt.yml new file mode 100644 index 0000000000..86654ac4c8 --- /dev/null +++ b/taskcluster/test-nodejs_12x-win-amd64-opt.yml @@ -0,0 +1,13 @@ +build: + template_file: test-win-opt-base.tyml + dependencies: + - "node-package-cpu" + - "test-training_upstream-linux-amd64-py27mu-opt" + system_setup: + > + ${system.sox_win} && ${nodejs.win.prep_12} + args: + tests_cmdline: "${system.homedir.win}/DeepSpeech/ds/tc-node-tests.sh 12.x" + metadata: + name: "DeepSpeech Windows AMD64 CPU NodeJS 12.x tests" + description: "Testing DeepSpeech for Windows/AMD64 on NodeJS v12.x, CPU only, optimized version" diff --git a/taskcluster/win-opt-base.tyml b/taskcluster/win-opt-base.tyml index 59242d16af..485b719d43 100644 --- a/taskcluster/win-opt-base.tyml +++ b/taskcluster/win-opt-base.tyml @@ -66,7 +66,7 @@ payload: pacman --noconfirm -R bsdtar && pacman --noconfirm -S tar make && (pacman --noconfirm -S patch swig && - (for patch_file in $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v7x-v8x-v9x_*.patch; do patch -d /usr/share/swig/3.0.12/ -p2 < $patch_file; done) + (for patch_file in $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v7x-v8x-v9x_*.patch $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v10.12.patch $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/swig_node_v12_*.patch ; do patch -d /usr/share/swig/3.0.12/ -p2 < $patch_file; done) ) && $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/${build.scripts.build} && $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/${build.scripts.package} ; diff --git a/tc-tests-utils.sh b/tc-tests-utils.sh index 9d5255639e..575d25e513 100755 --- a/tc-tests-utils.sh +++ b/tc-tests-utils.sh @@ -56,7 +56,7 @@ model_name_mmap="$(basename -s ".pb" "${model_source}").pbmm" model_source_mmap="$(dirname "${model_source}")/${model_name_mmap}" SUPPORTED_PYTHON_VERSIONS=${SUPPORTED_PYTHON_VERSIONS:-2.7.15:ucs2 2.7.15:ucs4 3.4.9:ucs4 3.5.6:ucs4 3.6.7:ucs4 3.7.1:ucs4} -SUPPORTED_NODEJS_VERSIONS=${SUPPORTED_NODEJS_VERSIONS:-4.9.1 5.12.0 6.14.4 7.10.1 8.12.0 9.11.2 10.12.0 11.0.0} +SUPPORTED_NODEJS_VERSIONS=${SUPPORTED_NODEJS_VERSIONS:-4.9.1 5.12.0 6.14.4 7.10.1 8.12.0 9.11.2 10.12.0 11.0.0 12.0.0} SUPPORTED_ELECTRONJS_VERSIONS=${SUPPORTED_ELECTRONJS_VERSIONS:-1.6.18 1.7.16 1.8.8 2.0.18 3.0.16 3.1.8 4.0.3 4.1.4} strip() { From 348dd0e315aa52c13e0fe9d7883221c0ef4848e3 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Thu, 25 Apr 2019 13:49:17 +0200 Subject: [PATCH 2/2] Add ElectronJS v5.0.0 --- .../test-electronjs_v5.0-darwin-amd64-opt.yml | 13 +++++++++++++ .../test-electronjs_v5.0-linux-amd64-opt.yml | 14 ++++++++++++++ taskcluster/test-electronjs_v5.0-win-amd64-opt.yml | 13 +++++++++++++ tc-tests-utils.sh | 2 +- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 taskcluster/test-electronjs_v5.0-darwin-amd64-opt.yml create mode 100644 taskcluster/test-electronjs_v5.0-linux-amd64-opt.yml create mode 100644 taskcluster/test-electronjs_v5.0-win-amd64-opt.yml diff --git a/taskcluster/test-electronjs_v5.0-darwin-amd64-opt.yml b/taskcluster/test-electronjs_v5.0-darwin-amd64-opt.yml new file mode 100644 index 0000000000..8c0fc8c83e --- /dev/null +++ b/taskcluster/test-electronjs_v5.0-darwin-amd64-opt.yml @@ -0,0 +1,13 @@ +build: + template_file: test-darwin-opt-base.tyml + dependencies: + - "node-package-cpu" + - "test-training_upstream-linux-amd64-py27mu-opt" + system_setup: + > + ${nodejs.brew.setup} && ${nodejs.brew.prep_12} && ${nodejs.brew.env} + args: + tests_cmdline: "$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/tc-electron-tests.sh 12.x 5.0.0" + metadata: + name: "DeepSpeech OSX AMD64 CPU ElectronJS v5.0 tests" + description: "Testing DeepSpeech for OSX/AMD64 on ElectronJS v5.0, CPU only, optimized version" diff --git a/taskcluster/test-electronjs_v5.0-linux-amd64-opt.yml b/taskcluster/test-electronjs_v5.0-linux-amd64-opt.yml new file mode 100644 index 0000000000..a71bb54fe4 --- /dev/null +++ b/taskcluster/test-electronjs_v5.0-linux-amd64-opt.yml @@ -0,0 +1,14 @@ +build: + template_file: test-linux-opt-base.tyml + docker_image: "ubuntu:16.04" + dependencies: + - "node-package-cpu" + - "test-training_upstream-linux-amd64-py27mu-opt" + system_setup: + > + ${nodejs.packages_xenial.prep_12} && ${nodejs.packages_xenial.apt_pinning} && apt-get -qq update && apt-get -qq -y install ${nodejs.packages_xenial.apt} ${electronjs.packages_xenial.apt} + args: + tests_cmdline: "${system.homedir.linux}/DeepSpeech/ds/tc-electron-tests.sh 12.x 5.0.0" + metadata: + name: "DeepSpeech Linux AMD64 CPU ElectronJS v5.0 tests" + description: "Testing DeepSpeech for Linux/AMD64 on ElectronJS v5.0, CPU only, optimized version" diff --git a/taskcluster/test-electronjs_v5.0-win-amd64-opt.yml b/taskcluster/test-electronjs_v5.0-win-amd64-opt.yml new file mode 100644 index 0000000000..2524e22ea9 --- /dev/null +++ b/taskcluster/test-electronjs_v5.0-win-amd64-opt.yml @@ -0,0 +1,13 @@ +build: + template_file: test-win-opt-base.tyml + dependencies: + - "node-package-cpu" + - "test-training_upstream-linux-amd64-py27mu-opt" + system_setup: + > + ${system.sox_win} && ${nodejs.win.prep_12} + args: + tests_cmdline: "${system.homedir.win}/DeepSpeech/ds/tc-electron-tests.sh 12.x 5.0.0" + metadata: + name: "DeepSpeech Windows AMD64 CPU ElectronJS v5.0 tests" + description: "Testing DeepSpeech for Windows/AMD64 on ElectronJS v5.0, CPU only, optimized version" diff --git a/tc-tests-utils.sh b/tc-tests-utils.sh index 575d25e513..5f1d89b5c8 100755 --- a/tc-tests-utils.sh +++ b/tc-tests-utils.sh @@ -57,7 +57,7 @@ model_source_mmap="$(dirname "${model_source}")/${model_name_mmap}" SUPPORTED_PYTHON_VERSIONS=${SUPPORTED_PYTHON_VERSIONS:-2.7.15:ucs2 2.7.15:ucs4 3.4.9:ucs4 3.5.6:ucs4 3.6.7:ucs4 3.7.1:ucs4} SUPPORTED_NODEJS_VERSIONS=${SUPPORTED_NODEJS_VERSIONS:-4.9.1 5.12.0 6.14.4 7.10.1 8.12.0 9.11.2 10.12.0 11.0.0 12.0.0} -SUPPORTED_ELECTRONJS_VERSIONS=${SUPPORTED_ELECTRONJS_VERSIONS:-1.6.18 1.7.16 1.8.8 2.0.18 3.0.16 3.1.8 4.0.3 4.1.4} +SUPPORTED_ELECTRONJS_VERSIONS=${SUPPORTED_ELECTRONJS_VERSIONS:-1.6.18 1.7.16 1.8.8 2.0.18 3.0.16 3.1.8 4.0.3 4.1.4 5.0.0} strip() { echo "$(echo $1 | sed -e 's/^[[:space:]]+//' -e 's/[[:space:]]+$//')"