{"action":"created","issue":{"url":"https://api.github.com/repos/electron-userland/electron-packager/issues/520","repository_url":"https://api.github.com/repos/electron-userland/electron-packager","labels_url":"https://api.github.com/repos/electron-userland/electron-packager/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/electron-userland/electron-packager/issues/520/comments","events_url":"https://api.github.com/repos/electron-userland/electron-packager/issues/520/events","html_url":"https://github.com/electron-userland/electron-packager/issues/520","id":186331312,"number":520,"title":"Issues with packaged native modules (On windows/osx, not linux)","user":{"login":"robogen","id":13003316,"avatar_url":"https://avatars.githubusercontent.com/u/13003316?v=3","gravatar_id":"","url":"https://api.github.com/users/robogen","html_url":"https://github.com/robogen","followers_url":"https://api.github.com/users/robogen/followers","following_url":"https://api.github.com/users/robogen/following{/other_user}","gists_url":"https://api.github.com/users/robogen/gists{/gist_id}","starred_url":"https://api.github.com/users/robogen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robogen/subscriptions","organizations_url":"https://api.github.com/users/robogen/orgs","repos_url":"https://api.github.com/users/robogen/repos","events_url":"https://api.github.com/users/robogen/events{/privacy}","received_events_url":"https://api.github.com/users/robogen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-31T16:32:24Z","updated_at":"2016-11-01T02:19:09Z","closed_at":null,"body":"A current package I'm working on requires the use of native packaging. One of the features of it is that it collects information about local disk usage (using [diskusage](https://github.com/jduncanator/node-diskusage)) to inform the user as they download data. Two of the dependencies of the diskusage package ([ref](https://github.com/TooTallNate/ref) and [ffi](https://github.com/node-ffi/node-ffi)) are native modules and require compiling and by default don't work without using electron-rebuild.\r\n\r\nIf I perform an 'npm run' in my app directory, the application runs perfectly fine with no complaints on OSX/Windows/Linux. However, after running electron-packager, it only works on Linux. For Windows/OSX it breaks as soon as it attempts to access the ref package. It complains with a message of \"expected module 50, got 49\" but I'm not 100% on where it's getting those numbers.\r\n\r\nUsing node version 6.9.1\r\n\r\n**Console output when you run electron-packager with the environment variable `DEBUG=electron-packager`. Please include the stack trace if one exists.**\r\n\r\n```\r\nNothing other than 'Wrote new app to <directory>'\r\n```\r\n\r\n**What command line arguments are you passing? Alternatively, if you are using the API, what\r\nparameters are you passing to the `packager()` function?**\r\n\r\n```\r\nnode ./node_modules/electron-packager/cli.js ./ <appname> --platform=win32 --arch=all --out ../packageWin/ --version 1.4.3 --overwrite --icon ./icons/<appname>\r\n```\r\n\r\n**Please provide either a failing minimal testcase (with a link to the code) or detailed steps to\r\nreproduce your problem.**\r\n\r\nin the same folder where my 'app' directory is I have a 'postinstall.js' script with the content of \r\n\r\n```\r\n#!/usr/bin/env node\r\nvar exec = require('child_process').exec;\r\n\r\nexec('./node_modules/.bin/electron-rebuild -w ffi',\r\n    function(error,stdout,stderr){\r\n    \r\n    });\r\n\r\nexec('./node_modules/.bin/electron-rebuild -w ref',\r\n    function(error,stdout,stderr){\r\n    \r\n    });\r\n```\r\n\r\nWith slight modification on Windows, so it uses electron-rebuild.cmd and strong paths instead. After running an npm install, the app installs fine with no errors and runs fine after 'npm run' no matter what (in terms of no packages crashing). Once I run the aforementioned packing command, I can launch and run the application and be fine on Linux, but on Win32/OSX I'm only fine until I open the page with the require('diskusage') command in it. As soon as it hits that line, bindings.js shows the 'expected 50, got 49' error.\r\n\r\nAs a side note, I'm building the Linux package on a Linux machine, Windows on Windows(7), and OSX on OSX."},"comment":{"url":"https://api.github.com/repos/electron-userland/electron-packager/issues/comments/257474404","html_url":"https://github.com/electron-userland/electron-packager/issues/520#issuecomment-257474404","issue_url":"https://api.github.com/repos/electron-userland/electron-packager/issues/520","id":257474404,"user":{"login":"robogen","id":13003316,"avatar_url":"https://avatars.githubusercontent.com/u/13003316?v=3","gravatar_id":"","url":"https://api.github.com/users/robogen","html_url":"https://github.com/robogen","followers_url":"https://api.github.com/users/robogen/followers","following_url":"https://api.github.com/users/robogen/following{/other_user}","gists_url":"https://api.github.com/users/robogen/gists{/gist_id}","starred_url":"https://api.github.com/users/robogen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robogen/subscriptions","organizations_url":"https://api.github.com/users/robogen/orgs","repos_url":"https://api.github.com/users/robogen/repos","events_url":"https://api.github.com/users/robogen/events{/privacy}","received_events_url":"https://api.github.com/users/robogen/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T02:19:09Z","updated_at":"2016-11-01T02:19:09Z","body":"@MarshallOfSound Yes, the output seems to indicate they're properly rebuilding. With the -w flag this is the output (produced on Windows)\r\n```\r\nffiout:\r\n> ref@1.3.2 install C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref\r\n> node-gyp rebuild\r\n\r\n\r\nrefout:\r\n> ffi@2.2.0 install C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\r\n> node-gyp rebuild\r\n\r\n\r\nrefout:\r\nC:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi>if\r\nrefout: not defined npm_config_node_gyp (node \"C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\npm\\bin\\node-gyp-bin\\\\..\\..\\node_modules\\node-gyp\\bin\\node-gyp.js\" rebuild )  else (node \"\" rebuild )\r\n\r\nffiout:\r\n\r\nffiout: C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref>if not defined npm_config_node_gyp (node \"C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\npm\\bin\\node-gyp-bin\\\\..\\..\\node_modules\\node-gyp\\bin\\node-gyp.js\" rebuild )  else (node \"\" rebuild )\r\n\r\nrefout: Building the projects in this solution one at a time. To enable parallel build, please add the \"/m\" switch.\r\n\r\nffiout: Building the projects in this solution one at a time. To enable parallel build, please add the \"/m\" switch.\r\n\r\nrefout:   Building assembly file ..\\..\\..\\deps\\libffi\\src\\x86\\win64.asm\r\n\r\nffiout:   binding.cc\r\n\r\nffiout:   win_delay_load_hook.cc\r\n\r\nrefout:    Assembling: ..\\..\\..\\deps\\libffi\\src\\x86\\win64.asm\r\n\r\nrefout:   prep_cif.c\r\n\r\nrefout:   types.c\r\n\r\nrefout:   raw_api.c\r\n\r\nrefout:   java_raw_api.c\r\n\r\nrefout:   closures.c\r\n\r\nrefout:   ffi.c\r\n\r\nrefout:   win_delay_load_hook.cc\r\n\r\nrefout:   ffi.vcxproj -> C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\Release\\\\libffi.lib\r\n\r\nrefout:   ffi.cc\r\n\r\nrefout:   callback_info.cc\r\n  threaded_callback_invokation.cc\r\n\r\nrefout:   win32-dlfcn.cc\r\n\r\nrefout:   win_delay_load_hook.cc\r\n\r\nffiout: ..\\src\\binding.cc(643): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref\\build\\binding.vcxproj]\r\n\r\nffiout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n\r\nffiout: ..\\src\\binding.cc(644): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref\\build\\binding.vcxproj]\r\n\r\nffiout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n\r\nffiout:      Creating library C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref\\build\\Release\\binding.lib and object C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref\\build\\Release\\binding.exp\r\n\r\nffiout:   Generating code\r\n\r\nrefout: ..\\src\\ffi.cc(111): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\ffi_bindings.vcxproj]\r\n\r\nrefout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n..\\src\\ffi.cc(114): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\ffi_bindings.vcxproj]\r\n\r\nrefout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n\r\nrefout: ..\\src\\ffi.cc(123): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\ffi_bindings.vcxproj]\r\n\r\nrefout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n\r\nrefout: ..\\src\\ffi.cc(124): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\ffi_bindings.vcxproj]\r\n\r\nrefout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n\r\nrefout: ..\\src\\ffi.cc(125): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\ffi_bindings.vcxproj]\r\n\r\nrefout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n\r\nrefout: ..\\src\\ffi.cc(126): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\ffi_bindings.vcxproj]\r\n\r\nrefout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n\r\nrefout: ..\\src\\ffi.cc(132): warning C4996: 'v8::Object::ForceSet': was declared deprecated [C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\ffi_bindings.vcxproj]\r\n\r\nrefout:   C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\electron-rebuild\\lib\\headers\\.node-gyp\\iojs-1.3.8\\deps\\v8\\include\\v8.h(2687): note: see declaration of 'v8::Object::ForceSet'\r\n\r\nffiout:   Finished generating code\r\n\r\nffiout:   binding.vcxproj -> C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref\\build\\Release\\\\binding.node\r\n\r\nffiout:   binding.vcxproj -> C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref\\build\\Release\\binding.pdb (Full PDB)\r\n\r\nffiout: ref@1.3.2 C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ref\r\n\r\nrefout:      Creating library C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\Release\\ffi_bindings.lib and object C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\Release\\ffi_bindings.exp\r\n\r\nrefout:   Generating code\r\n\r\nrefout:   Finished generating code\r\n\r\nrefout:   ffi_bindings.vcxproj -> C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\Release\\\\ffi_bindings.node\r\n\r\nrefout:   ffi_bindings.vcxproj -> C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\\build\\Release\\ffi_bindings.pdb (Full PDB)\r\n\r\nrefout: ffi@2.2.0 C:\\Users\\<user>\\Documents\\GitHub\\<app>\\<app>\\node_modules\\ffi\r\n```\r\n\r\nI'll try removing the -w and seeing if that makes the difference."}}
{"actor":{"display_login":"robogen"}}