Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tooling): remove wdio-mocha-framework dependency due to node 12 error #1570

Closed
wants to merge 3 commits into from

Conversation

gannons
Copy link
Contributor

@gannons gannons commented Mar 18, 2020

Pull Request Template

Description

Seeing a build issue with Node 12

gannons@Shanes-MacBook-Pro webex-js-sdk % npm install

> fibers@3.1.1 install /Users/gannons/Development/webex-js-sdk/node_modules/fibers
> node build.js || nodejs build.js

  CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:68:2: error: no template named 'Handle'
        Handle<String> NewLatin1String(Isolate* isolate, const char* string) {
        ^
../src/fibers.cc:69:10: error: no viable conversion from returned value of type 'Local<v8::String>' to function return type 'int'
                return String::NewFromOneByte(isolate, (const uint8_t*)string, NewStringType::kNormal).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:72:2: error: no template named 'Handle'
        Handle<String> NewLatin1Symbol(Isolate* isolate, const char* string) {
        ^
../src/fibers.cc:73:10: error: no viable conversion from returned value of type 'Local<v8::String>' to function return type 'int'
                return String::NewFromOneByte(isolate, (const uint8_t*)string, NewStringType::kNormal).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:94:2: error: no template named 'Handle'
        Handle<Object> NewInstance(Isolate* isolate, Local<Function> fn, int argc, Local<Value> argv[]) {
        ^
../src/fibers.cc:95:10: error: no viable conversion from returned value of type 'Local<v8::Object>' to function return type 'int'
                return fn->NewInstance(isolate->GetCurrentContext(), argc, argv).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:104:2: error: no template named 'Handle'
        Handle<Number> ToNumber(Local<Value> value) {

Seems to be caused by the wdio-mocha-framework dependency. It relies on wdio-sync which relies on fibers. The fibers dependency has a known issue with Node 12. That has been addressed in the latest version (4.0.1).

But it seems unlikely the wdio-mocha-framework project will be updated to consume it as it has been archived on github. Scanning through the packages directory I can see no references to wdio-mocha-framework.

In the history the last update of this dependency was 3 months ago by @taymoork2. Before that the dependency was introduced 3 years ago.

From, a very brief, look it seems this dependency is not used. However I'm not super confident about that. Hoping the PR tests will flush out any actual dependencies that I missed.

Update: It seems my local build was not very reliable. It had failed to compile mmmagic and did not complain about it until I ran some service tests. Upgraded the version of mmmagic to resolve the issue with a fresh npm install. Errors I was getting before

> mmmagic@0.4.6 install /Users/gannons/Development/webex-js-sdk/node_modules/mmmagic
> node-gyp rebuild

  CC(target) Release/obj.target/libmagic/deps/libmagic/src/apprentice.o
  ......
  CC(target) Release/obj.target/libmagic/deps/libmagic/src/readcdf.o
  CC(target) Release/obj.target/libmagic/deps/libmagic/src/readelf.o
  CC(target) Release/obj.target/libmagic/deps/libmagic/src/softmagic.o
  LIBTOOL-STATIC Release/magic.a
  CC(target) Release/obj.target/libpcre/deps/libmagic/pcre/pcre_byte_order.o
  .....
  LIBTOOL-STATIC Release/pcre.a
  CXX(target) Release/obj.target/magic/src/binding.o
../src/binding.cc:345:28: error: no template named 'Handle'
    static void Initialize(Handle<Object> target) {
                           ^
../src/binding.cc:83:45: error: too few arguments to function call, single argument 'context' was not specified
          magic_flags = args[1]->Int32Value();
                        ~~~~~~~~~~~~~~~~~~~ ^
/Users/gannons/Library/Caches/node-gyp/12.16.0/include/node/v8.h:2709:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/gannons/Library/Caches/node-gyp/12.16.0/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/binding.cc:91:42: error: no matching member function for call to 'ToString'
          String::Utf8Value str(args[0]->ToString());
                                ~~~~~~~~~^~~~~~~~
/Users/gannons/Library/Caches/node-gyp/12.16.0/include/node/v8.h:2668:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/gannons/Library/Caches/node-gyp/12.16.0/include/node/v8.h:2684:31: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
../src/binding.cc:94:45: error: too few arguments to function call, single argument 'context' was not specified
          magic_flags = args[0]->Int32Value();
                        ~~~~~~~~~~~~~~~~~~~ ^
/Users/gannons/Library/Caches/node-gyp/12.16.0/include/node/v8.h:2709:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/gannons/Library/Caches/node-gyp/12.16.0/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/binding.cc:95:52: error: no matching member function for call to 'BooleanValue'
        else if (args[0]->IsBoolean() && !args[0]->BooleanValue()) {

Fixes # (issue)

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Test Coverage

I ran a local build with Node v12.16.0.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@gannons
Copy link
Contributor Author

gannons commented Mar 18, 2020

Oh well

WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
ERROR: Couldn't load "wdio-mocha-framework" framework. You need to install it with `$ npm install wdio-mocha-framework`!
Error: Cannot find module 'wdio-mocha-framework'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Runner.initialiseFramework (/home/circleci/webex-js-sdk/node_modules/webdriverio/build/lib/runner.js:531:24)
    at Runner._callee$ (/home/circleci/webex-js-sdk/node_modules/webdriverio/build/lib/runner.js:101:55)
    at tryCatch (/home/circleci/webex-js-sdk/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/circleci/webex-js-sdk/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/home/circleci/webex-js-sdk/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/home/circleci/webex-js-sdk/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)

    at Runner.initialiseFramework (/home/circleci/webex-js-sdk/node_modules/webdriverio/build/lib/runner.js:537:23)
    at Runner._callee$ (/home/circleci/webex-js-sdk/node_modules/webdriverio/build/lib/runner.js:101:55)
    at tryCatch (/home/circleci/webex-js-sdk/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/circleci/webex-js-sdk/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/home/circleci/webex-js-sdk/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/home/circleci/webex-js-sdk/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/circleci/webex-js-sdk/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
    at process._tickCallback (internal/process/next_tick.js:68:7)

@gannons gannons closed this Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant