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

Not compatible with electron / electron-rebuild (due to execSync?) #1

Closed
jacobq opened this issue Feb 13, 2018 · 3 comments
Closed

Comments

@jacobq
Copy link

jacobq commented Feb 13, 2018

  1. npm init an empty project
  2. npm install --save-dev electron-rebuild electron-prebuilt-compile
  3. electron-rebuild (✔ Rebuild Complete)
  4. npm install --save distributions-lognormal-pdf
  5. electron-rebuild (✖ Rebuild Failed)
$ node -v; npm -v; uname -a
v8.9.4
5.6.0
Linux fractal 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux

$ npm ls execSync
pdf-test@0.0.0 /home/user/tmp/pdf-test
└─┬ distributions-lognormal-pdf@0.0.1
  └─┬ codecov@1.0.1
    └── execSync@1.0.2 

$ cat package.json
{
  "name": "pdf-test",
  "version": "0.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "distributions-lognormal-pdf": "0.0.1"
  },
  "devDependencies": {
    "electron-prebuilt-compile": "^1.7.11",
    "electron-rebuild": "^1.7.3"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

$ electron-rebuild node_modules/distributions-lognormal-pdf
✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.9.4 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/user/tmp/pdf-test/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/user/tmp/pdf-test/node_modules/execSync/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/user/tmp/pdf-test/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/user/.electron-gyp/.node-gyp/iojs-1.8.2',
gyp info spawn args   '-Dnode_gyp_dir=/home/user/tmp/pdf-test/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/user/tmp/pdf-test/node_modules/execSync',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/user/tmp/pdf-test/node_modules/execSync/build'
  CXX(target) Release/obj.target/shell/src/shell.o
../src/shell.cpp:138:26: error: ‘Arguments’ does not name a type
 Handle<Value> Exec(const Arguments& args) {
                          ^~~~~~~~~
../src/shell.cpp: In function ‘v8::Handle<v8::Value> Exec(const int&)’:
../src/shell.cpp:139:17: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
     HandleScope scope;
                 ^~~~~
In file included from /home/user/.electron-gyp/.node-gyp/iojs-1.8.2/src/node.h:63:0,
                 from ../src/shell.cpp:1:
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:873:13: note: declared protected here
   V8_INLINE HandleScope() {}
             ^~~~~~~~~~~
../src/shell.cpp:141:14: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
     if (args.Length() < 1) {
              ^~~~~~
../src/shell.cpp:143:34: error: ‘New’ is not a member of ‘v8::String’
             Exception::TypeError(String::New("First argument must be a string"))
                                  ^~~~~~
../src/shell.cpp:144:9: error: ‘ThrowException’ was not declared in this scope
         );
         ^
../src/shell.cpp:147:31: error: invalid types ‘const int[int]’ for array subscript
     Local<String> str = args[0]->ToString();
                               ^
../src/shell.cpp:151:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Integer::New(result));
                  ^~~~~
../src/shell.cpp:151:43: error: no matching function for call to ‘v8::Integer::New(int&)’
     return scope.Close(Integer::New(result));
                                           ^
In file included from /home/user/.electron-gyp/.node-gyp/iojs-1.8.2/src/node.h:63:0,
                 from ../src/shell.cpp:1:
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:2861:25: note: candidate: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
   static Local<Integer> New(Isolate* isolate, int32_t value);
                         ^~~
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:2861:25: note:   candidate expects 2 arguments, 1 provided
../src/shell.cpp: In function ‘void RegisterModule(v8::Handle<v8::Object>)’:
../src/shell.cpp:155:17: error: ‘NewSymbol’ is not a member of ‘v8::String’
     target->Set(String::NewSymbol("exec"),
                 ^~~~~~
../src/shell.cpp:156:39: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
             FunctionTemplate::New(Exec)->GetFunction());
                                       ^
In file included from /home/user/.electron-gyp/.node-gyp/iojs-1.8.2/src/node.h:63:0,
                 from ../src/shell.cpp:1:
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:5278:34: note: candidate: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Local<v8::Value>, v8::Local<v8::Signature>, int, v8::ConstructorBehavior)
   static Local<FunctionTemplate> New(
                                  ^~~
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:5278:34: note:   no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&) {aka v8::Local<v8::Value>(const int&)}’ to ‘v8::Isolate*’
shell.target.mk:93: recipe for target 'Release/obj.target/shell/src/shell.o' failed
make: Leaving directory '/home/user/tmp/pdf-test/node_modules/execSync/build'
make: *** [Release/obj.target/shell/src/shell.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/user/tmp/pdf-test/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.9.0-5-amd64
gyp ERR! command "/home/user/.nvm/versions/node/v8.9.4/bin/node" "/home/user/tmp/pdf-test/node_modules/.bin/node-gyp" "rebuild" "--target=1.8.2" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd /home/user/tmp/pdf-test/node_modules/execSync
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

Failed with exit code: 1

Error: gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.9.4 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/user/tmp/pdf-test/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/user/tmp/pdf-test/node_modules/execSync/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/user/tmp/pdf-test/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/user/.electron-gyp/.node-gyp/iojs-1.8.2',
gyp info spawn args   '-Dnode_gyp_dir=/home/user/tmp/pdf-test/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/<(target_arch)/iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/user/tmp/pdf-test/node_modules/execSync',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/user/tmp/pdf-test/node_modules/execSync/build'
  CXX(target) Release/obj.target/shell/src/shell.o
../src/shell.cpp:138:26: error: ‘Arguments’ does not name a type
 Handle<Value> Exec(const Arguments& args) {
                          ^~~~~~~~~
../src/shell.cpp: In function ‘v8::Handle<v8::Value> Exec(const int&)’:
../src/shell.cpp:139:17: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
     HandleScope scope;
                 ^~~~~
In file included from /home/user/.electron-gyp/.node-gyp/iojs-1.8.2/src/node.h:63:0,
                 from ../src/shell.cpp:1:
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:873:13: note: declared protected here
   V8_INLINE HandleScope() {}
             ^~~~~~~~~~~
../src/shell.cpp:141:14: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
     if (args.Length() < 1) {
              ^~~~~~
../src/shell.cpp:143:34: error: ‘New’ is not a member of ‘v8::String’
             Exception::TypeError(String::New("First argument must be a string"))
                                  ^~~~~~
../src/shell.cpp:144:9: error: ‘ThrowException’ was not declared in this scope
         );
         ^
../src/shell.cpp:147:31: error: invalid types ‘const int[int]’ for array subscript
     Local<String> str = args[0]->ToString();
                               ^
../src/shell.cpp:151:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
     return scope.Close(Integer::New(result));
                  ^~~~~
../src/shell.cpp:151:43: error: no matching function for call to ‘v8::Integer::New(int&)’
     return scope.Close(Integer::New(result));
                                           ^
In file included from /home/user/.electron-gyp/.node-gyp/iojs-1.8.2/src/node.h:63:0,
                 from ../src/shell.cpp:1:
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:2861:25: note: candidate: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
   static Local<Integer> New(Isolate* isolate, int32_t value);
                         ^~~
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:2861:25: note:   candidate expects 2 arguments, 1 provided
../src/shell.cpp: In function ‘void RegisterModule(v8::Handle<v8::Object>)’:
../src/shell.cpp:155:17: error: ‘NewSymbol’ is not a member of ‘v8::String’
     target->Set(String::NewSymbol("exec"),
                 ^~~~~~
../src/shell.cpp:156:39: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
             FunctionTemplate::New(Exec)->GetFunction());
                                       ^
In file included from /home/user/.electron-gyp/.node-gyp/iojs-1.8.2/src/node.h:63:0,
                 from ../src/shell.cpp:1:
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:5278:34: note: candidate: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Local<v8::Value>, v8::Local<v8::Signature>, int, v8::ConstructorBehavior)
   static Local<FunctionTemplate> New(
                                  ^~~
/home/user/.electron-gyp/.node-gyp/iojs-1.8.2/deps/v8/include/v8.h:5278:34: note:   no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&) {aka v8::Local<v8::Value>(const int&)}’ to ‘v8::Isolate*’
shell.target.mk:93: recipe for target 'Release/obj.target/shell/src/shell.o' failed
make: Leaving directory '/home/user/tmp/pdf-test/node_modules/execSync/build'
make: *** [Release/obj.target/shell/src/shell.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/user/tmp/pdf-test/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.9.0-5-amd64
gyp ERR! command "/home/user/.nvm/versions/node/v8.9.4/bin/node" "/home/user/tmp/pdf-test/node_modules/.bin/node-gyp" "rebuild" "--target=1.8.2" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd /home/user/tmp/pdf-test/node_modules/execSync
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

Failed with exit code: 1
    at SafeSubscriber._error (/home/user/tmp/pdf-test/node_modules/spawn-rx/lib/src/index.js:277:84)
    at SafeSubscriber.__tryOrUnsub (/home/user/tmp/pdf-test/node_modules/rxjs/Subscriber.js:239:16)
    at SafeSubscriber.error (/home/user/tmp/pdf-test/node_modules/rxjs/Subscriber.js:198:26)
    at Subscriber._error (/home/user/tmp/pdf-test/node_modules/rxjs/Subscriber.js:129:26)
    at Subscriber.error (/home/user/tmp/pdf-test/node_modules/rxjs/Subscriber.js:103:18)
    at MapSubscriber.Subscriber._error (/home/user/tmp/pdf-test/node_modules/rxjs/Subscriber.js:129:26)
    at MapSubscriber.Subscriber.error (/home/user/tmp/pdf-test/node_modules/rxjs/Subscriber.js:103:18)
    at SafeSubscriber._next (/home/user/tmp/pdf-test/node_modules/spawn-rx/lib/src/index.js:251:65)
    at SafeSubscriber.__tryOrUnsub (/home/user/tmp/pdf-test/node_modules/rxjs/Subscriber.js:239:16)
    at SafeSubscriber.next (/home/user/tmp/pdf-test/node_modules/rxjs/Subscriber.js:186:22)

@jacobq
Copy link
Author

jacobq commented Feb 13, 2018

Possibly related to mgutz/execSync#20 or mgutz/execSync#27

@Planeshifter
Copy link
Contributor

Since codecov (and subsequently execSync) are not actually needed to use this package, I have moved it to the devDependencies and published a new version of the package to npm. Please let me know if everything works now.

@jacobq
Copy link
Author

jacobq commented Feb 13, 2018

@Planeshifter Thanks, indeed, it does work now! (using "distributions-lognormal-pdf": "0.0.2")

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

No branches or pull requests

2 participants