nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.81k stars 1.38k forks source link

Arch Linux - chromium-pickle@0.1.4 node-gyp failed #26

Closed mbilker closed 9 years ago

mbilker commented 9 years ago

I attempted to build this package on Arch Linux (my daily desktop) without success. The installation fails to compile the native code associated with chromium-pickle@0.1.4, which hasn't been updated since January and uses an old version of v8. This causes this error to be thrown when running script/bootstrap after a fresh clone:

Node: v4.1.1
npm: v3.3.5

---> Installing N1 build tools
     This goes inside the `build` folder and runs `npm install`
     It will use the system `npm` to bootstrap our own N1 npm.
     Our build tools (like Grunt) need to be compiled against Node via `npm`.
     Everything else needs to be compiled against Chromium with `apm`.

     $ npm --userconfig=/home/mbilker/src/n1/.npmrc install --loglevel error --cwd=/home/mbilker/src/n1/build --ignoreStdout=true 

In file included from ../../native-mate/vendor/src/native_mate/converter.h:13:0,
                 from ../../native-mate/vendor/src/native_mate/arguments.h:10,
                 from ../../native-mate/vendor/src/native_mate/arguments.cc:5:
../../native-mate/header_redirect/v8/include/v8.h:2:35: fatal error: ../deps/v8/include/v8.h: No such file or directory
compilation terminated.
make: *** [Release/obj.target/native_mate/../native-mate/vendor/src/native_mate/arguments.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.2.2-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mbilker/src/n1/build/node_modules/chromium-pickle
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Linux 4.2.2-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "--userconfig=/home/mbilker/src/n1/.npmrc" "install" "--loglevel" "error"
npm ERR! node v4.1.1
npm ERR! npm  v3.3.5
npm ERR! code ELIFECYCLE

npm ERR! chromium-pickle@0.1.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the chromium-pickle@0.1.4 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the chromium-pickle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls chromium-pickle
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/mbilker/src/n1/build/npm-debug.log
mbilker commented 9 years ago

Forgot to mention, my efforts to update chromium-pickle and its dependency native-mate ended with casting errors with Local vs. Isolate contexts.

> chromium-pickle@0.1.4 install /home/mbilker/node-chromium-pickle
> node-gyp rebuild

make: Entering directory '/home/mbilker/node-chromium-pickle/build'
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/arguments.o
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/converter.o
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/dictionary.o
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/function_template.o
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/locker.o
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/object_template_builder.o
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/persistent_dictionary.o
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/try_catch.o
  CXX(target) Release/obj.target/native_mate/node_modules/native-mate/vendor/src/native_mate/wrappable.o
  AR(target) Release/obj.target/node_modules/native-mate/native_mate.a
  COPY Release/native_mate.a
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/atomicops_internals_x86_gcc.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/bind_helpers.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/callback_helpers.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/callback_internal.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/memory/ref_counted.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/memory/weak_ptr.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/strings/string_piece.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/strings/string_util.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/strings/string_util_constants.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/strings/stringprintf.o
  CC(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/third_party/dynamic_annotations/dynamic_annotations.o
  CXX(target) Release/obj.target/base/node_modules/native-mate/vendor/base-minimal/src/base/threading/thread_collision_warner.o
  AR(target) Release/obj.target/node_modules/native-mate/vendor/base-minimal/base.a
  COPY Release/base.a
  CXX(target) Release/obj.target/pickle/src/main.o
  CXX(target) Release/obj.target/pickle/src/pickle.o
  CXX(target) Release/obj.target/pickle/src/pickle_iterator_wrapper.o
  CXX(target) Release/obj.target/pickle/src/pickle_wrapper.o
../src/pickle_wrapper.cc: In member function ‘v8::Handle<v8::Value> PickleWrapper::GetData(v8::Isolate*) const’:
../src/pickle_wrapper.cc:39:61: error: no matching function for call to ‘New(v8::Isolate*&, const char*, size_t)’
       isolate, reinterpret_cast<const char*>(data()), size());
                                                             ^
In file included from ../src/pickle_wrapper.cc:8:0:
/home/mbilker/.node-gyp/4.1.1/include/node/node_buffer.h:31:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/mbilker/.node-gyp/4.1.1/include/node/node_buffer.h:31:40: note:   conversion of argument 3 would be ill-formed:
../src/pickle_wrapper.cc:39:59: error: invalid conversion from ‘size_t {aka long unsigned int}’ to ‘node::encoding’ [-fpermissive]
       isolate, reinterpret_cast<const char*>(data()), size());
                                                           ^
In file included from ../src/pickle_wrapper.cc:8:0:
/home/mbilker/.node-gyp/4.1.1/include/node/node_buffer.h:43:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/mbilker/.node-gyp/4.1.1/include/node/node_buffer.h:43:40: note:   conversion of argument 2 would be ill-formed:
../src/pickle_wrapper.cc:39:61: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
       isolate, reinterpret_cast<const char*>(data()), size());
                                                             ^
pickle.target.mk:106: recipe for target 'Release/obj.target/pickle/src/pickle_wrapper.o' failed
make: *** [Release/obj.target/pickle/src/pickle_wrapper.o] Error 1
make: Leaving directory '/home/mbilker/node-chromium-pickle/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.2.2-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mbilker/node-chromium-pickle
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
gardner commented 9 years ago

I ran into the same thing. If you look in some of the other issues, you'll find that Nylas currently only builds with node v0.10.x due to the version of electron they are building against. You can control which specific versions of node are on your machine using nvm which you can download here: https://github.com/creationix/nvm

gaborbernat commented 9 years ago

anyone wants to create a package on AUR for this? :)

niklaszantner commented 9 years ago

jep AUR package would be very nice!

gaborbernat commented 9 years ago

would be interested in helping :+1: although no invite yet :+1:

yuvadm commented 9 years ago

I've already started working on a basic PKGBUILD, here are some things that need to happen there:

shibumi commented 9 years ago

@yuvadm do you want to share your PKGBUILD? so we could work together on it or you create a gist or a repo for it.

yuvadm commented 9 years ago

@shibumi sure, here's what I have so far https://github.com/yuvadm/archlinux-packages/blob/master/aur-wip/n1-git/PKGBUILD

This is the output I get right now, haven't debugged further just yet:

==> Starting build()...
v0.10.32 is already installed.
Now using node v0.10.32 (npm v1.4.28)
Now using node v0.10.32 (npm v1.4.28)
Node: v0.10.32
npm: v1.4.28

---> Installing N1 build tools
     This goes inside the `build` folder and runs `npm install`
     It will use the system `npm` to bootstrap our own N1 npm.
     Our build tools (like Grunt) need to be compiled against Node via `npm`.
     Everything else needs to be compiled against Chromium with `apm`.

     $ npm --userconfig=/home/yuval/dev/aur4/n1-git/src/N1/.npmrc install --loglevel error --cwd=/home/yuval/dev/aur4/n1-git/src/N1/build --ignoreStdout=true

---> Installing apm
     This installs apm via N1's `npm`
     We use this local apm copy to install all N1 dependencies & packages

     $ /home/yuval/dev/aur4/n1-git/src/N1/build/node_modules/.bin/npm --userconfig=/home/yuval/dev/aur4/n1-git/src/N1/.npmrc install --loglevel error --cwd=/home/yuval/dev/aur4/n1-git/src/N1/apm --ignoreStdout=true

/bin/sh: /home/yuval/dev/aur4/n1-git/src/N1/build/node_modules/.bin/npm: No such file or directory
==> ERROR: A failure occurred in build().
    Aborting...

Feel free to fork/PR

shibumi commented 9 years ago

@yuvadm we should determine all npm packages. Installing packages besides the packaging system is dangerous and against the Archlinux Developer Guidelines. this will be a dependency hell.

This are the dependencies just for the npm stuff

    "6to5-core": "^3.5",
    "asar": "^0.5.0",
    "async": "^0.9",
    "atom-keymap": "^5.1",
    "aws-sdk": "2.1.28",
    "bluebird": "^2.9",
    "classnames": "1.2.1",
    "clear-cut": "0.4.0",
    "coffee-react": "^2.0.0",
    "coffee-script": "1.9.0",
    "coffeestack": "^1.1",
    "color": "^0.7.3",
    "delegato": "^1",
    "emissary": "^1.3.1",
    "event-kit": "^1.0.2",
    "fs-plus": "^2.3.2",
    "fstream": "0.1.24",
    "fuzzaldrin": "^2.1",
    "git-utils": "^3.0.0",
    "grim": "1.1.0",
    "guid": "0.0.10",
    "inflection": "^1.7",
    "jasmine-json": "~0.0",
    "jasmine-tagged": "^1.1.2",
    "jquery": "^2.1.1",
    "juice": "^1.4",
    "less-cache": "0.21",
    "marked": "^0.3",
    "mixpanel": "0.0.20",
    "mkdirp": "^0.5",
    "moment": "^2.8",
    "moment-timezone": "^0.3",
    "nslog": "^2.0.0",
    "node-uuid": "^1.4",
    "optimist": "0.4.0",
    "pathwatcher": "^4.4.0",
    "property-accessors": "^1",
    "q": "^1.0.1",
    "raven": "0.7.2",
    "react": "^0.13.2",
    "react-atom-fork": "^0.11.5",
    "react-hot-api": "0.4.5",
    "reactionary-atom-fork": "^1.0.0",
    "reflux": "0.1.13",
    "request": "^2.53",
    "request-progress": "^0.3",
    "runas": "^2.0",
    "sanitize-html": "^1.9",
    "scandal": "2.0.0",
    "scoped-property-store": "^0.16.2",
    "scrollbar-style": "^2.0",
    "season": "^5.1",
    "semver": "^4.2",
    "serializable": "^1",
    "service-hub": "^0.2.0",
    "space-pen": "3.8.2",
    "spellchecker": "2.2.1",
    "stacktrace-parser": "^0.1",
    "temp": "^0.8",
    "text-buffer": "^4.1",
    "theorist": "^1.0",
    "underscore": "^1.8",
    "underscore.string": "^3.0",
    "vm-compatibility-layer": "0.1.0"

these are the deps that I extracted out of the official N1 .deb package:

git, gconf2, gconf-service, libgtk2.0-0, libudev0 | libudev1, libgcrypt11, libnotify4, libxtst6, libnss3, python, gvfs-bin, xdg-utils

You see... this package is not packageable... the developers should generate a docker image. this would be the best solution for it.

yuvadm commented 9 years ago

@shibumi who said anything about installing the dependencies system-wide? For now they're only collected into the build dir node_modules. Probably the wise choice in this case is to throw it all into /opt/N1 and symlink the final binary into /usr/bin.

Requiring docker for this is even more ridiculous.

This isn't the first bloated package I've seen, and it's certainly manageable. Of course creating an n1-bin AUR package would also be a good idea, but this is what we have right now.

shibumi commented 9 years ago

@yuvadm Sorry. Just for my mind:" Do we need the node_modules only for the build process? Or do you we need the modules after installation, too?" could some N1-Developer answer this question. Maybe @gardner ? If I understand you right @yuvadm we need the modules only for the build process and generating the binary in this case ignore my last post. Sorry. But in any other case this could be complicated.

yuvadm commented 9 years ago

@shibumi even if the node modules are required at runtime, you still don't have to install them system-wide under /usr. It's perfectly valid to store them in /opt/N1/node_modules, just as you would use any node_module directory in any other project.

shibumi commented 9 years ago

@yuvadm yep but not installing them system-wide is bloated. nobody want's several applications and every application brings his own deps.. this is bloated.

gardner commented 9 years ago

@shibumi I am not a Nylas developer. I am just interested in the project. :) You will need all of the dependencies that are listed in the package.json under the dependecies section. The dependencies for building are listed under devDependencies in package.json. I am unfamiliar with arch linux package rules but installing the dependencies system-wide seems like a bad idea to me. Some of the npm packages may rely on system packages which it appears that you have already found.

mbilker commented 9 years ago

@shibumi look at how the Atom Editor works on Arch Linux. This app hasn't completely caught up to Atom yet, but Atom appears to package all of its runtime dependencies in /usr/share/atom/resources/app.asar (69 MiB). While that is a lot, it doesn't include any packages from the build directory.

mbilker commented 9 years ago

I wrote some patches to get N1 to build on node 4.1.2 and npm 3.3.5. Available at https://github.com/mbilker/N1/tree/node-v4

gaborbernat commented 9 years ago

can confirm that it works ;)

On Oct 7 2015, at 6:08 am, mbilker <notifications@github.com> wrote:

I wrote some patches to get N1 to build on node 4.1.2 and npm 3.3.5. Available at mbilker/N1


Reply to this email directly or view it on GitHub.

shibumi commented 9 years ago

@mbilker awesome. I will check it out. Btw there is one thing that I don't understand what has N1 todo with Atom?

Wikunia commented 9 years ago

@shibumi they are both using Electron ;)

shibumi commented 9 years ago

I installed it now without errors. Here is the output of it when I run it the first time.. there are maybe some problems to solve:

[31411:1007/181541:ERROR:browser_main_loop.cc(173)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
Streaming log data to /tmp/edgehill-31411.log
[31411:1007/181543:INFO:audio_manager_pulse.cc(258)] Failed to connect to the context.  Error: Connection refused
[31411:1007/181551:WARNING:accelerator_util.cc(185)] Invalid accelerator token: command
[31411:1007/181551:WARNING:accelerator_util.cc(185)] Invalid accelerator token: command
[31411:1007/181551:WARNING:accelerator_util.cc(185)] Invalid accelerator token: command
[31411:1007/181551:WARNING:accelerator_util.cc(185)] Invalid accelerator token: command
[31461:1007/181551:INFO:renderer_main.cc(200)] Renderer process started
Checking for updates...
App load time: 9314ms
[31411:1007/181600:INFO:CONSOLE(103)] "Streaming log data to /tmp/edgehill-31411.31461.log", source: /home/user/export/archlinux/n1-git/src/N1/src/error-reporter.js (103)
[31411:1007/181619:INFO:CONSOLE(214)] "NylasAPI: config.cson does not contain an environment value. Defaulting to `production`.", source: /home/user/export/archlinux/n1-git/src/N1/src/flux/nylas-api.coffee (214)
[31411:1007/181626:WARNING:accelerator_util.cc(185)] Invalid accelerator token: command
[31411:1007/181629:INFO:CONSOLE(79)] "Window load time: 35842ms", source: file:///home/user/export/archlinux/n1-git/src/N1/static/index.js (79)
[31411:1007/181629:WARNING:accelerator_util.cc(185)] Invalid accelerator token: command
[31461:1007/181802:WARNING:channel.cc(549)] Failed to send message to ack remove remote endpoint (local ID 1, remote ID 1)
[31461:1007/181802:WARNING:channel.cc(549)] Failed to send message to ack remove remote endpoint (local ID 2147483648, remote ID 2)

I also need a N1 Invite code for more tests. My PKGBUILD looks like this so far:

https://gist.github.com/34ef1b00dd37fd78efd6

I am currently only starting it under the src tree.. my plan is to move the src tree to /opt/

EDIT: changed gist url

mbilker commented 9 years ago

49 merged my branch into master. My branch is no longer relevant.

shibumi commented 9 years ago

@mbilker merged into master of your repository or in the master of the official N1 Repository?

jacobmischka commented 9 years ago

N1 master, click the #49 link.