tensor5/arch-atom

Electron 1.3

Closed this issue · 8 comments

Electron 1.3 is available in the electron-1.3, however there are some major issues with Atom.

The first one is that the native NodeGit module doesn't compile with the new V8 api (see nodegit/nodegit#1089). This can be solved by disabling it, which btw is also done upstream for a different reason (see atom/atom#12159). We ported atom/atom#12167 for this purpose.

The second issue is the oniguruma native module, a dependency of first-mate, which fails to load. This can be solved by upgrading to the latest version (I believe this is the relevant commit).

The last and currently unsolved issue is the marker-index module, which also fails to load:

$ electron --app=out/Atom/resources/app/
App load time: 1033ms


#
# Fatal error in ../../v8/src/api.cc, line 1027
# Check failed: !value_obj->IsJSReceiver() || value_obj->IsTemplateInfo().
#

==== C stack trace ===============================

 1: V8_Fatal
 2: 0x7f6937a8e5de
 3: MarkerIndexWrapper::Init(v8::Local<v8::Object>, v8::Local<v8::Object>)
 4: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&)
 5: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&))
 6: 0x7f6937af5748
 7: 0x7f6937af75c2
 8: 0x3091a6a08ba7
Failed to get crash dump id.
Report Id: 
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

Thanks for investigating this.

Here is a related issue:
nwjs/nw.js#5142
And the solution:
greenheartgames/greenworks@8ade752
So apparently we need to replace these Set() functions with something else:
https://github.com/atom/marker-index/blob/master/src/native/marker-index-wrapper.cc#L21

Maybe updating nan dependency of marker-index could help:
https://github.com/atom/marker-index/blob/master/package.json#L39
nodejs/nan@b9083cf

Or maybe try this patch. I didn't build Electron 1.3 myself, so I can't test it yet.

I have built Electron 1.3.1 (instead of the 1.3.0 provided by this repo) by copying the electron-1.3 branch's Electron src files to my arch-atom repo. I also copied the changes to Atom to my repo and built a package from it. Unfortunately, however, this Atom build wouldn't run correctly. Starting caused this crash:
screenshot from 2016-07-28 10-52-07

Electron itself launches without problem.

@City-busz thanks for your feedback.

I tried your patch, and I get this error:

  CXX(target) Release/obj.target/marker_index/src/native/iterator.o
  CXX(target) Release/obj.target/marker_index/src/native/marker-index-wrapper.o
../src/native/marker-index-wrapper.cc: In static member function ‘static bool MarkerIndexWrapper::IsFinite(v8::Local<v8::Integer>)’:
../src/native/marker-index-wrapper.cc:128:92: warning: ‘v8::Local<v8::Value> v8::Object::CallAsFunction(v8::Local<v8::Value>, int, v8::Local<v8::Value>*)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     Local<Value> result = Nan::New(is_finite_function)->CallAsFunction(Nan::Null(), 1, argv);
                                                                                            ^
In file included from /home/nicola/.node-gyp/iojs-1.3.0/deps/v8/include/v8.h:25:0,
                 from /home/nicola/.node-gyp/iojs-1.3.0/src/node.h:42,
                 from ../node_modules/nan/nan.h:47,
                 from ../src/native/marker-index-wrapper.cc:2:
/home/nicola/.node-gyp/iojs-1.3.0/deps/v8/include/v8.h:2984:30: note: declared here
                 Local<Value> CallAsFunction(Local<Value> recv, int argc,
                              ^
/home/nicola/.node-gyp/iojs-1.3.0/deps/v8/include/v8config.h:333:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from /home/nicola/.node-gyp/iojs-1.3.0/src/node.h:42:0,
                 from ../node_modules/nan/nan.h:47,
                 from ../src/native/marker-index-wrapper.cc:2:
/home/nicola/.node-gyp/iojs-1.3.0/deps/v8/include/v8.h: In instantiation of ‘v8::Local<T>::Local(v8::Local<S>) [with S = v8::FunctionTemplate; T = v8::Value]’:
../src/native/marker-index-wrapper.cc:62:36:   required from here
/home/nicola/.node-gyp/iojs-1.3.0/deps/v8/include/v8.h:188:37: error: cannot convert ‘v8::FunctionTemplate*’ to ‘v8::Value* volatile’ in assignment
     *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/nicola/.node-gyp/iojs-1.3.0/deps/v8/include/v8.h:229:5: note: in expansion of macro ‘TYPE_CHECK’
     TYPE_CHECK(T, S);
     ^~~~~~~~~~

I will look at it in more detail later.

Btw, you may already know this, if you want to test an individual native module you can install it (with apm or by setting the appropriate electron environment) then open and electron console with electron -i and require it. This will show you if it loads correctly or crashes.

@City-busz

I fixed your patch, now it compiles and loads.

Atom now works with 1.3, you guys can try the last commit.

I noticed a bug where files in the tree-view that have been modified, first appear colored as they should, but if I bring the window in background and foreground again, they lose the color. This must be the nodegit patch.

Other than that, it runs fine.

In fact, the git status highlight problem in tree-view is also present in Atom 1.9, and oddly enough it's not been reported yet.

Btw, I'll release the Electron 1.3.x package tomorrow.