augustoroman / v8

A Go API for the V8 javascript engine.
MIT License
395 stars 78 forks source link

broken install steps for 6.9.427.19 #39

Open tobowers opened 5 years ago

tobowers commented 5 years ago

I followed the install steps on OSX 10.14 (couldn't get the gem to install, so I went the source install).

6.7.288.46.1 fails because it needs a single digit sdk for xcode (see: https://github.com/Homebrew/homebrew-core/issues/31616 )

Using 6.9.427.19 fails with the following (after symlinking):

# github.com/augustoroman/v8
Undefined symbols for architecture x86_64:
  "v8::internal::Builtins::Generate_ArrayForEach(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_TestHelperPlus1(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_TestHelperPlus2(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_ArraySpliceTorque(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_TypedArrayQuickSort(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_TypedArrayPrototypeSort(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetInt8(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetInt8(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_GenericBuiltinTest5ATSmi(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetInt16(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetInt32(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetUint8(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetInt16(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetInt32(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetUint8(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetBuffer(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetUint16(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetUint32(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetUint16(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetUint32(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetFloat32(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetFloat64(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetFloat32(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetFloat64(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_ArrayForEachLoopContinuation(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetBigInt64(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetBigInt64(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetBigUint64(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeSetBigUint64(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetByteLength(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_DataViewPrototypeGetByteOffset(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement16ATFixedInt8Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement17ATFixedInt16Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement17ATFixedInt32Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement17ATFixedUint8Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement16ATFixedInt8Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement18ATFixedUint16Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement18ATFixedUint32Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement17ATFixedInt16Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement17ATFixedInt32Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement17ATFixedUint8Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_ArrayForEachLoopLazyDeoptContinuation(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement19ATFixedFloat32Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement19ATFixedFloat64Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement18ATFixedUint16Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement18ATFixedUint32Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_ArrayForEachLoopEagerDeoptContinuation(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement20ATFixedBigInt64Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement19ATFixedFloat32Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement19ATFixedFloat64Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement21ATFixedBigUint64Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement20ATFixedBigInt64Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement21ATFixedBigUint64Array(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_GenericBuiltinTest22UT12ATHeapObject5ATSmi(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_LoadFixedElement24ATFixedUint8ClampedArray(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
  "v8::internal::Builtins::Generate_StoreFixedElement24ATFixedUint8ClampedArray(v8::internal::compiler::CodeAssemblerState*)", referenced from:
      v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal(v8::internal::Isolate*) in libv8_initializers.a(setup-builtins-internal.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FAIL    github.com/augustoroman/v8 [build failed]
tobowers commented 5 years ago

the 6.7 gems fail too, but it does appear the 6.3 versions do work following the prebuilt

lacombar commented 5 years ago

5465aa4fd3f4894abcfe3054bccc95de3f22feeb should fix the build for 6.7.288.

lacombar commented 5 years ago

btw, I looked at building with 7.0.x but there was a bunch of API change which will require change to the bridge. Given the v8 folks are at 7.4 right now, I'll build it and jump to that version directly.

tobowers commented 5 years ago

Oh that will be awesome!

lacombar commented 5 years ago

I fixed most of the API deprecation (short of snapshots, which are still broken) against V8 7.4. Hopefully, I'll get some time to run some test tomorrow.

Code available in my fork... https://github.com/aerilon/v8/commits/build

tobowers commented 5 years ago

hmm - didn't build https://gist.github.com/tobowers/be6edb7149e389c173f8c4f8de5e42fc but I think it might be a paths thing with symlink.sh

tobowers commented 5 years ago

so the path is wrong, but when I fix that then I get a:

10:45 ~/code/go/src/github.com/augustoroman/v8 (new-ver) $ go test
# github.com/augustoroman/v8
ld: library not found for -lv8_monolith
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FAIL    github.com/augustoroman/v8 [build failed]

It looks like the build instructions do not produce a libv8_monolith file, maybe there was a tweak?

UPDATE: found the v8_monolithic=true flag

tobowers commented 5 years ago

@lacombar after getting the monolith to build, fixing up the LD flags import and commenting out anything referencing snapshot in the tests - I got the following segfault:

https://gist.github.com/tobowers/2de0a6182f0fc4a00cf496c7360b1e65

lacombar commented 5 years ago

@tobowers tests should be fixed now, short of some time/date timezone issue and the snapshot stuff. In the future, would you mind moving comments related to my branch on my repo, not to hijack this issue ? I'm not sure of @augustoroman intend with this repo in the future.

lacombar commented 5 years ago

@augustoroman speaking of which, do you intend to only follow the stable rubygem's v8 binary release (the latest beta is already nearly 6 month old!), or do you intend to support the latest versions (in which case I can open a PR to get that support in) ?

jacksontj commented 5 years ago

I get a similar looking stack of symbol errors when trying to run with v8 7.2.502.28 -- presumably the same 7.x compatibility issues mentioned in https://github.com/augustoroman/v8/issues/39#issuecomment-458460258 -- are there any plans for supporting the newer version?

lacombar commented 5 years ago

@jacksontj could you try my branch ? the only trick is that you will need to build v8 on your own, but it's not overly complicated.

jacksontj commented 5 years ago

@lacombar sure, I actually have a build I made already. What branch should I be using?

lacombar commented 5 years ago

cf https://github.com/augustoroman/v8/issues/39#issuecomment-459275270

jacksontj commented 5 years ago

hmm, my local build didn't seem to work:. I'm building using the docker instructions, I have made some modifications to get it working for the newer version -- https://github.com/jacksontj/v8/tree/v8build/docker-v8-lib

Output when run:

$ go test
# github.com/augustoroman/v8
/usr/bin/ld: cannot find -lv8_monolith
collect2: error: ld returned 1 exit status

I already added that monolith flag, any ideas?

jacksontj commented 5 years ago

After some more digging (and updating my branches) seems that I was missing another monolith flag, and your fork changed the include path. It now seems to build (and my tests for my usecase pass), but I'm having issues with snapshots now (they seem entirely broken? To be clear, I'm not getting the behavior I expect, but it is not segfault-ing as it was before)-- which seems maybe expected since you have it disabled in your fork? If so, any ideas on how to get those working? Or any pointers on what the problem is?

@lacombar

lacombar commented 5 years ago

Yes, the old V8 snapshot API has been deprecated. I didn't have the time yet to sort out the new API.

jacksontj commented 5 years ago

@lacombar I'll start taking a look then -- but the rest of it all seems to work. Are these changes going to be merged in? Or is this the beginnings of a fork?

lacombar commented 5 years ago

@jacksontj it depends entirely on @augustoroman

tobowers commented 5 years ago

@augustoroman do you have any comments on this issue?

augustoroman commented 5 years ago

Sorry for the delay. I'd prefer that this repo follow the latest v8 and not be constrained by the ruby gems. I don't have much time to invest in keeping this up to date, but I'll do what I can. I can also add collaborators for someone interested in helping to maintain this library.

jacksontj commented 5 years ago

@augustoroman sounds like @lacombar and myself at least are interested :)

base698 commented 4 years ago

@augustoroman What is your contact information? I have some questions about consulting on this if you'd be open to it and have time. My email is: justin.thomas1@gmail.com

Cheers