Skip Menu |

This queue is for tickets about the JavaScript-V8 CPAN distribution.

Report information
The Basics
Id: 86583
Status: open
Priority: 0/
Queue: JavaScript-V8

People
Owner: Nobody in particular
Requestors: kstarsinic [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Build fails against v8 3.18.5
Date: Sun, 30 Jun 2013 12:34:15 -0400
To: bug-JavaScript-V8 [...] rt.cpan.org
From: Kurt Starsinic <kstarsinic [...] gmail.com>
Couldn't build JavaScript::V8 against v8 3.18.5, due to API changes in V8. This is the error: g++ -c -I. -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3 -DVERSION=\"0.07\" -DXS_VERSION=\"0.07\" "-I/usr/local/Cellar/rock-runtime-perl516/5.16.3/lib/perl5/CORE" V8Context.cpp V8Context.cpp: In constructor ‘ObjectData::ObjectData(V8Context*, v8::Handle<v8::Object>, SV*)’: V8Context.cpp:140: warning: ‘New’ is deprecated (declared at /usr/local/include/v8.h:4871) V8Context.cpp: In destructor ‘virtual ObjectData::~ObjectData()’: V8Context.cpp:152: warning: ‘Dispose’ is deprecated (declared at /usr/local/include/v8.h:4935) V8Context.cpp: In constructor ‘PerlObjectData::PerlObjectData(V8Context*, v8::Handle<v8::Object>, SV*)’: V8Context.cpp:166: warning: ‘MakeWeak’ is deprecated (declared at /usr/local/include/v8.h:4952) V8Context.cpp: In constructor ‘PerlFunctionData::PerlFunctionData(V8Context*, SV*)’: V8Context.cpp:238: error: ‘Wrap’ is not a member of ‘v8::External’ V8Context.cpp: In static member function ‘static v8::Handle<v8::Value> PerlFunctionData::v8invoke(const v8::Arguments&)’: V8Context.cpp:247: error: ‘Unwrap’ is not a member of ‘v8::External’ V8Context.cpp: In constructor ‘V8Context::V8Context(int, const char*, bool, const char*)’: V8Context.cpp:327: warning: ‘New’ is deprecated (declared at /usr/local/include/v8.h:4871) V8Context.cpp:329: warning: ‘New’ is deprecated (declared at /usr/local/include/v8.h:4871) V8Context.cpp: In member function ‘void V8Context::register_object(ObjectData*)’: V8Context.cpp:336: error: ‘Wrap’ is not a member of ‘v8::External’ V8Context.cpp: In destructor ‘V8Context::~V8Context()’: V8Context.cpp:353: warning: ‘Dispose’ is deprecated (declared at /usr/local/include/v8.h:4935) V8Context.cpp:355: warning: ‘Dispose’ is deprecated (declared at /usr/local/include/v8.h:4935) V8Context.cpp: In member function ‘SV* V8Context::seen_v8(v8::Handle<v8::Object>)’: V8Context.cpp:492: error: ‘Unwrap’ is not a member of ‘v8::External’ V8Context.cpp: In member function ‘v8::Handle<v8::Object> V8Context::get_prototype(SV*)’: V8Context.cpp:585: warning: ‘New’ is deprecated (declared at /usr/local/include/v8.h:4871) make: *** [V8Context.o] Error 1 This is a minimal patch that passes all tests (we still have warnings about deprecated functions): diff V8Context.cpp.orig ~/V8Context.cpp 19a20,22 Show quoted text
> static Local<Value> ExternalWrap(void* value) { return
External::New(value); } // External::Wrap Show quoted text
> static void* ExternalUnwrap(Handle<v8::Value> obj) { return
External::Cast(*obj)->Value(); } // External::Unwrap Show quoted text
>
238c241 < &External::Wrap(this) --- Show quoted text
> &ExternalWrap(this)
247c250 < PerlFunctionData* data = static_cast<PerlFunctionData*>(External::Unwrap(args[0])); --- Show quoted text
> PerlFunctionData* data =
static_cast<PerlFunctionData*>(ExternalUnwrap(args[0])); 336c339 < data->object->SetHiddenValue(string_wrap, External::Wrap(data)); --- Show quoted text
> data->object->SetHiddenValue(string_wrap, ExternalWrap(data));
492c495 < ObjectData* data = (ObjectData*)External::Unwrap(wrap); --- Show quoted text
> ObjectData* data = (ObjectData*)ExternalUnwrap(wrap);
Summary of my perl5 (revision 5 version 16 subversion 3) configuration: Platform: osname=darwin, osvers=12.3.0, archname=darwin-thread-multi-2level uname='darwin kurts-mac-mini.local 12.3.0 darwin kernel version 12.3.0: sun jan 6 22:37:10 pst 2013; root:xnu-2050.22.13~1release_x86_64 x86_64 ' config_args='-des -Dprefix=/usr/local/Cellar/rock-runtime-perl516/5.16.3 -Dvendorprefix=/usr/local/Cellar/rock-runtime-perl516/5.16.3 -Dsiteprefix=/usr/local/Cellar/rock-runtime-perl516/5.16.3/local -Dsitelib=/usr/local/Cellar/rock-runtime-perl516/5.16.3/local/share/perl5 -Dsitearch=/usr/local/Cellar/rock-runtime-perl516/5.16.3/local/lib/perl5 -Dprivlib=/usr/local/Cellar/rock-runtime-perl516/5.16.3/share/perl5 -Dvendorlib=/usr/local/Cellar/rock-runtime-perl516/5.16.3/share/perl5 -Darchlib=/usr/local/Cellar/rock-runtime-perl516/5.16.3/lib/perl5 -Dvendorarch=/usr/local/Cellar/rock-runtime-perl516/5.16.3/lib/perl5/vendor_perl -Darchname=darwin-thread-multi-2level -Dman3ext=3pm -Dusethreads -Duseithreads -Duselargefiles -Duseperl' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include', optimize='-O3', cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-lgdbm -ldbm -ldb -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under darwin Compiled at Jun 10 2013 13:34:47 %ENV: PERL5LIB="/Volumes/HFS-CS/Projects/shutterstock/shutterstock-www/lib:/Volumes/HFS-CS/Projects/shutterstock/shutterstock-www/lib/perl5/darwin-thread-multi-2level:/Volumes/HFS-CS/Projects/shutterstock/shutterstock-www/local/lib/perl5" PERLBREW_BASHRC_VERSION="0.63" PERLBREW_HOME="/Users/kstar/.perlbrew" PERLBREW_MANPATH="/Users/kstar/perl5/perlbrew/perls/perl-5.19.0/man" PERLBREW_PATH="/Users/kstar/perl5/perlbrew/bin:/Users/kstar/perl5/perlbrew/perls/perl-5.19.0/bin" PERLBREW_PERL="perl-5.19.0" PERLBREW_ROOT="/Users/kstar/perl5/perlbrew" PERLBREW_VERSION="0.63" @INC: /Volumes/HFS-CS/Projects/shutterstock/shutterstock-www/lib /Volumes/HFS-CS/Projects/shutterstock/shutterstock-www/lib/perl5/darwin-thread-multi-2level /Volumes/HFS-CS/Projects/shutterstock/shutterstock-www/local/lib/perl5/darwin-thread-multi-2level /Volumes/HFS-CS/Projects/shutterstock/shutterstock-www/local/lib/perl5 /usr/local/Cellar/rock-runtime-perl516/5.16.3/local/lib/perl5 /usr/local/Cellar/rock-runtime-perl516/5.16.3/local/share/perl5 /usr/local/Cellar/rock-runtime-perl516/5.16.3/lib/perl5/vendor_perl /usr/local/Cellar/rock-runtime-perl516/5.16.3/share/perl5 /usr/local/Cellar/rock-runtime-perl516/5.16.3/lib/perl5 /usr/local/Cellar/rock-runtime-perl516/5.16.3/share/perl5 . - Kurt
Thanks for this! Slightly belatedly. External::New now only operates if there is a first argument, an "Isolate". Do you feel like taking a crack at figuring how that works, and making a PR? The unit tests in v8 aren't really helping.
As an update: this explains the core concepts, and has links to a "hello world" that demonstrates: https://v8.dev/docs/embed