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

Javascript plugin does not compile with v8 version 3.30.33.16 #360

Open
flashcode opened this Issue Mar 15, 2015 · 8 comments

Comments

Projects
None yet
4 participants
@flashcode
Copy link
Member

flashcode commented Mar 15, 2015

The javascript fails to compile with v8 version 3.30.33.16 and weechat v1.1-151-g9f15851, on Arch Linux:

[ 70%] Building CXX object src/plugins/javascript/CMakeFiles/javascript.dir/weechat-js.o
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp: In function ‘void weechat_js_hashtable_map_cb(void*, t_hashtable*, const char*, const char*)’:
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:94:17: error: ‘New’ is not a member of ‘v8::String’
     (*obj)->Set(String::New(key), String::New(value));
                 ^
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:94:35: error: ‘New’ is not a member of ‘v8::String’
     (*obj)->Set(String::New(key), String::New(value));
                                   ^
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp: In function ‘v8::Handle<v8::Object> weechat_js_hashtable_to_object(t_hashtable*)’:
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:104:38: error: no matching function for call to ‘v8::Object::New()’
     Handle<Object> obj = Object::New();
                                      ^
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:104:38: note: candidate is:
In file included from /home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.h:24:0,
                 from /home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:33:
/usr/include/v8.h:2609:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
   static Local<Object> New(Isolate* isolate);
                        ^
/usr/include/v8.h:2609:24: note:   candidate expects 1 argument, 0 provided
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp: In function ‘void* weechat_js_exec(t_plugin_script*, int, const char*, const char*, void**)’:
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:196:32: error: ‘New’ is not a member of ‘v8::String’
                     argv2[i] = v8::String::New((const char *)argv[i]);
                                ^
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:199:66: error: no matching function for call to ‘v8::Integer::New(int&)’
                     argv2[i] = v8::Integer::New(*((int *)argv[i]));
                                                                  ^
/home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:199:66: note: candidate is:
In file included from /home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.h:24:0,
                 from /home/flashcode/src/weechat/dev/src/plugins/javascript/weechat-js.cpp:33:
/usr/include/v8.h:2224:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
   static Local<Integer> New(Isolate* isolate, int32_t value);
                         ^
/usr/include/v8.h:2224:25: note:   candidate expects 2 arguments, 1 provided
src/plugins/javascript/CMakeFiles/javascript.dir/build.make:54: recipe for target 'src/plugins/javascript/CMakeFiles/javascript.dir/weechat-js.o' failed
make[2]: *** [src/plugins/javascript/CMakeFiles/javascript.dir/weechat-js.o] Error 1
CMakeFiles/Makefile2:1557: recipe for target 'src/plugins/javascript/CMakeFiles/javascript.dir/all' failed
make[1]: *** [src/plugins/javascript/CMakeFiles/javascript.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

This is caused by API changes in v8.
Since there's no version in v8 headers, so it's hard to support multiple version of v8 at same time.

@flashcode flashcode added the bug label Mar 15, 2015

@flashcode flashcode self-assigned this Mar 15, 2015

@flashcode

This comment has been minimized.

Copy link
Member Author

flashcode commented Mar 15, 2015

It looks like the deprecated functions in API have been removed in v8 version 3.24.4.
So WeeChat currently only supports v8 <= 3.24.3.

flashcode added a commit that referenced this issue Mar 15, 2015

@flashcode

This comment has been minimized.

Copy link
Member Author

flashcode commented Mar 18, 2015

Supporting multiple versions of v8 seems hard, since the version is not exported in headers (it is only since a few days, but not for old releases).

@stfnm

This comment has been minimized.

Copy link
Contributor

stfnm commented Apr 22, 2015

The following commit seems to be the first one in v8 to introduce version information as an include header: v8/v8@9dac60a

So I guess WeeChat could support v8 versions >= 4.3.0 and <= 3.24.3 (implicitly as the "no version information" fallback).

Of course this would leave some versions in between which will remain unsupported forever but I suppose that's still better than only supporting those old versions forever.

@flashcode

This comment has been minimized.

Copy link
Member Author

flashcode commented Apr 25, 2015

@stfnm: yes you're right, I'll do that.

@flashcode flashcode added this to the 1.3 milestone Apr 25, 2015

@flashcode flashcode modified the milestones: 1.3, 1.4 Aug 14, 2015

@flashcode flashcode modified the milestones: 1.5, 1.4 Jan 3, 2016

@flashcode flashcode removed this from the 1.5 milestone Apr 13, 2016

@asm89

This comment has been minimized.

Copy link

asm89 commented Jan 16, 2017

@flashcode I was trying to get javascript support working on macOS. The default v8 version installed by homebrew is currently v8: stable 5.1.281.47. Are you still looking into supporting newer versions of v8?

@flashcode

This comment has been minimized.

Copy link
Member Author

flashcode commented Jan 18, 2017

@asm89: yes it is still planned.
I don't have lot of free time to work on that, so help is welcome, but I'll implement that in future anyway when I'll have some time.

@gpavinteractiv

This comment has been minimized.

Copy link

gpavinteractiv commented Sep 27, 2017

Build fails on fedora 26 due to this bug

@flashcode

This comment has been minimized.

Copy link
Member Author

flashcode commented Sep 27, 2017

If needed, you can disable the javascript plugin with this cmake option: -DENABLE_JAVASCRIPT=OFF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.