rogchap / v8go

Execute JavaScript from Go
https://rogchap.com/v8go
BSD 3-Clause "New" or "Revised" License
3.2k stars 214 forks source link

libv8.a bundled with v0.3.0 doesn't work with golang Docker image #53

Closed neptoess closed 3 years ago

neptoess commented 3 years ago

Testing with a very basic main.go

package main

import "rogchap.com/v8go"

func main() {
    if _, err := v8go.NewIsolate(); err != nil {
        panic(err)
    }
}

And the following Dockerfile

FROM golang:1.15

WORKDIR /go/src/v8
COPY . .
RUN go run main.go

I get this from docker build .

Sending build context to Docker daemon  75.76MB
Step 1/4 : FROM golang:1.15
 ---> 05c8f6d2538a
Step 2/4 : WORKDIR /go/src/v8
 ---> Using cache
 ---> 70761780e417
Step 3/4 : COPY . .
 ---> 96c01a616e96
Step 4/4 : RUN go run main.go
 ---> Running in f434a5b958aa
# rogchap.com/v8go
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(isolate.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::Counters, std::allocator<v8::internal::Counters>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
isolate.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal8CountersESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal8CountersESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(isolate.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::metrics::Recorder, std::allocator<v8::internal::metrics::Recorder>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
isolate.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal7metrics8RecorderESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal7metrics8RecorderESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(objects.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::GlobalWasmCodeRef, std::allocator<v8::internal::wasm::GlobalWasmCodeRef>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
objects.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm17GlobalWasmCodeRefESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm17GlobalWasmCodeRefESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(wasm-code-manager.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::OwnedVector<unsigned char const>, std::allocator<v8::internal::OwnedVector<unsigned char const> >, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
wasm-code-manager.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal11OwnedVectorIKhEESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal11OwnedVectorIKhEESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(wasm-code-manager.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::(anonymous namespace)::NativeModuleWireBytesStorage, std::allocator<v8::internal::wasm::(anonymous namespace)::NativeModuleWireBytesStorage>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
wasm-code-manager.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm12_GLOBAL__N_128NativeModuleWireBytesStorageESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(wasm-engine.o):wasm-engine.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm10WasmEngineESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm10WasmEngineESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): more undefined references to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)' follow
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(typer.o): in function `v8::internal::compiler::Typer::Visitor::UpdateType(v8::internal::compiler::Node*, v8::internal::compiler::Type)':
typer.cc:(.text._ZN2v88internal8compiler5Typer7Visitor10UpdateTypeEPNS1_4NodeENS1_4TypeE[_ZN2v88internal8compiler5Typer7Visitor10UpdateTypeEPNS1_4NodeENS1_4TypeE]+0xd9): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::CheckNotTyped(v8::internal::compiler::Node*)':
verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor13CheckNotTypedEPNS1_4NodeE[_ZN2v88internal8compiler8Verifier7Visitor13CheckNotTypedEPNS1_4NodeE]+0x4f): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::CheckOutput(v8::internal::compiler::Node*, v8::internal::compiler::Node*, int, char const*)':
verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor11CheckOutputEPNS1_4NodeES5_iPKc[_ZN2v88internal8compiler8Verifier7Visitor11CheckOutputEPNS1_4NodeES5_iPKc]+0x5e): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::CheckTypeIs(v8::internal::compiler::Node*, v8::internal::compiler::Type)':
verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor11CheckTypeIsEPNS1_4NodeENS1_4TypeE[_ZN2v88internal8compiler8Verifier7Visitor11CheckTypeIsEPNS1_4NodeENS1_4TypeE]+0x79): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::CheckValueInputIs(v8::internal::compiler::Node*, int, v8::internal::compiler::Type)':
verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor17CheckValueInputIsEPNS1_4NodeEiNS1_4TypeE[_ZN2v88internal8compiler8Verifier7Visitor17CheckValueInputIsEPNS1_4NodeEiNS1_4TypeE]+0x11e): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::JSToWasmWrapperCompilationUnit, std::allocator<v8::internal::wasm::JSToWasmWrapperCompilationUnit>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm30JSToWasmWrapperCompilationUnitESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm30JSToWasmWrapperCompilationUnitESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::(anonymous namespace)::BackgroundCompileToken, std::allocator<v8::internal::wasm::(anonymous namespace)::BackgroundCompileToken>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm12_GLOBAL__N_122BackgroundCompileTokenESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<std::atomic<int>, std::allocator<std::atomic<int> >, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceISt6atomicIiESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceISt6atomicIiESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<v8::base::Semaphore, std::allocator<v8::base::Semaphore>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v84base9SemaphoreESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v84base9SemaphoreESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(streaming-decoder.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::AsyncStreamingDecoder::SectionBuffer, std::allocator<v8::internal::wasm::AsyncStreamingDecoder::SectionBuffer>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
streaming-decoder.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm21AsyncStreamingDecoder13SectionBufferESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm21AsyncStreamingDecoder13SectionBufferESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::MachineGraphVerifier::Run(v8::internal::compiler::Graph*, v8::internal::compiler::Schedule const*, v8::internal::compiler::Linkage*, bool, char const*, v8::internal::Zone*)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler20MachineGraphVerifier3RunEPNS1_5GraphEPKNS1_8ScheduleEPNS1_7LinkageEbPKcPNS0_4ZoneE+0x12f7): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt64Op(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi+0xd3): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi+0x178): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputRepresentationIs(v8::internal::compiler::Node const*, int, v8::internal::MachineRepresentation)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker31CheckValueInputRepresentationIsEPKNS1_4NodeEiNS0_21MachineRepresentationE+0xf5): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputIsCompressedOrTagged(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker35CheckValueInputIsCompressedOrTaggedEPKNS1_4NodeEi+0xf5): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputIsTagged(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker23CheckValueInputIsTaggedEPKNS1_4NodeEi+0xf5): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForFloat64Op(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker27CheckValueInputForFloat64OpEPKNS1_4NodeEi+0xf2): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputIsTaggedOrPointer(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker32CheckValueInputIsTaggedOrPointerEPKNS1_4NodeEi+0xf5): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt32Op(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi+0xcf): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o):machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi+0x137): more undefined references to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' follow
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultJobState, std::allocator<v8::platform::DefaultJobState>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform15DefaultJobStateESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform15DefaultJobStateESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultWorkerThreadsTaskRunner, std::allocator<v8::platform::DefaultWorkerThreadsTaskRunner>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform30DefaultWorkerThreadsTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform30DefaultWorkerThreadsTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultForegroundTaskRunner, std::allocator<v8::platform::DefaultForegroundTaskRunner>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform27DefaultForegroundTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform27DefaultForegroundTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
collect2: error: ld returned 1 exit status
The command '/bin/sh -c go run main.go' returned a non-zero code: 2

Replacing the deps folder with the one from v0.2.0 works.

Also, after a go mod vendor, I need to copy the deps folder manually. This can be solved by including a .go file with a dummy variable in deps and each of its subdirectories, like this https://github.com/confluentinc/confluent-kafka-go/blob/master/kafka/librdkafka/librdkafka.go

rogchap commented 3 years ago

I tested this (without vendoring) and confirm the same error 😞 Interesting that the CI tests still pass on the github action linux machine 🤔 Will take a closer look to see what I can find.

neptoess commented 3 years ago

@rogchap I noticed the GitHub Action build is using clang++ on Ubuntu, while cgo uses g++, and the golang Docker Hub image is based on Debian. I would think everything should be compatible, but it appears that’s not the case.

rogchap commented 3 years ago

@neptoess There must have been some linker issues introduced to clang somewhere recently! 😞 I built v8 locally with g++ and it now runs fine on Docker/Debian.

neptoess commented 3 years ago

@rogchap can we get a newer tag, e.g. v0.3.1, so we can get the updated static build when using go modules?

rogchap commented 3 years ago

Sorry for the delay @neptoess. Was hoping to get #59 finished before the next version release. But with the holidays, have not finished it yet. Are you able to wait a "little" longer, or is this a blocker for you?

neptoess commented 3 years ago

A little longer is fine

rogchap commented 3 years ago

@neptoess This has been released in v0.4.0: https://github.com/rogchap/v8go/releases/tag/v0.4.0

YangChuanMakeSense commented 3 years ago

@rogchap hello, I compiled v8go on debian 8, it seems failed image

Do I need to compile v8 on debian 8 and refer to myself compiled libv8.a?

rogchap commented 3 years ago

Hmmm 🤔 should work without compiling yourself. Are you using master branch rather than a regular release of v8go?

kuoruan commented 3 years ago

@robfig This error reappear after the merge of #102

The commit 6941971d1ef4e72fd4461c57ef3b21fdbba22007 changes the libv8.a for Linux x86_64

kuoruan commented 3 years ago

@cleiner Could you please have a look about this?

neptoess commented 3 years ago

@kuoruan When I re-run the example program shown in the original issue with v0.5.1, I get no errors. Can you please open a new issue (feel free to reference this one in it) with details about what you're trying to build / run and the exact output you're seeing?

EDIT: Running against the latest commit in master does indeed cause the error to return. My best guess is that this can be fixed by rebuilding deps/linux_x86_64/libv8.a (or at least reverting the one that was committed in @cleiner 's PR)

#7 113.6 go: downloading rogchap.com/v8go v0.5.2-0.20210410040105-4c18ca58a475
#7 125.7 # rogchap.com/v8go
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(objects.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::GlobalWasmCodeRef, std::allocator<v8::internal::wasm::GlobalWasmCodeRef>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 objects.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm17GlobalWasmCodeRefESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm17GlobalWasmCodeRefESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(wasm-engine.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::OperationsBarrier, std::allocator<v8::internal::OperationsBarrier>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 wasm-engine.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal17OperationsBarrierESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal17OperationsBarrierESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(wasm-engine.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::WasmEngine, std::allocator<v8::internal::wasm::WasmEngine>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 wasm-engine.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm10WasmEngineESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm10WasmEngineESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(streaming-decoder.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::AsyncStreamingDecoder::SectionBuffer, std::allocator<v8::internal::wasm::AsyncStreamingDecoder::SectionBuffer>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 streaming-decoder.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm21AsyncStreamingDecoder13SectionBufferESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm21AsyncStreamingDecoder13SectionBufferESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(marker.o): in function `std::_Sp_counted_ptr_inplace<bool, std::allocator<bool>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 marker.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIbSaIbELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIbSaIbELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'

#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(isolate.o):isolate.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal8CountersESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal8CountersESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): more undefined references to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)' follow
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::Check(v8::internal::compiler::Node*, v8::internal::compiler::AllNodes const&)':
#7 125.7 verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor5CheckEPNS1_4NodeERKNS1_8AllNodesE+0x4e7): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor5CheckEPNS1_4NodeERKNS1_8AllNodesE+0x89d): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor5CheckEPNS1_4NodeERKNS1_8AllNodesE+0xd1c): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(cpp-heap.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::(anonymous namespace)::CppgcPlatformAdapter, std::allocator<v8::internal::(anonymous namespace)::CppgcPlatformAdapter>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 cpp-heap.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal12_GLOBAL__N_120CppgcPlatformAdapterESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<v8::base::Semaphore, std::allocator<v8::base::Semaphore>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v84base9SemaphoreESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v84base9SemaphoreESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::JSToWasmWrapperCompilationUnit, std::allocator<v8::internal::wasm::JSToWasmWrapperCompilationUnit>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm30JSToWasmWrapperCompilationUnitESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm30JSToWasmWrapperCompilationUnitESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputRepresentationIs(v8::internal::compiler::Node const*, int, v8::internal::MachineRepresentation) [clone .isra.0] [clone .constprop.1]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker31CheckValueInputRepresentationIsEPKNS1_4NodeEiNS0_21MachineRepresentationE.isra.0.constprop.1+0xc3): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt32Op(v8::internal::compiler::Node const*, int) [clone .isra.0] [clone .constprop.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi.isra.0.constprop.0+0xbf): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi.isra.0.constprop.0+0x14f): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt64Op(v8::internal::compiler::Node const*, int) [clone .isra.0] [clone .constprop.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi.isra.0.constprop.0+0xbf): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi.isra.0.constprop.0+0x14e): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputIsCompressedOrTagged(v8::internal::compiler::Node const*, int) [clone .isra.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker35CheckValueInputIsCompressedOrTaggedEPKNS1_4NodeEi.isra.0+0xc8): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' #7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o):machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker23CheckValueInputIsTaggedEPKNS1_4NodeEi.isra.0+0xf3): more undefined references to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' follow
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputRepresentationIs(v8::internal::compiler::Node const*, int, v8::internal::MachineRepresentation) [clone .isra.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker31CheckValueInputRepresentationIsEPKNS1_4NodeEiNS0_21MachineRepresentationE.isra.0+0xfd): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt32Op(v8::internal::compiler::Node const*, int) [clone .isra.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi.isra.0+0xf0): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi.isra.0+0x1ca): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt64Op(v8::internal::compiler::Node const*, int) [clone .isra.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi.isra.0+0xd0): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi.isra.0+0x15f): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::Run() [clone .constprop.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x1c2): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x485): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x699): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x8ae): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0xb6f): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x112a): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x1942): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x1a66): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(memory-optimizer.o): in function `v8::internal::compiler::(anonymous namespace)::WriteBarrierAssertFailed(v8::internal::compiler::Node*, v8::internal::compiler::Node*, char const*, v8::internal::Zone*)':
#7 125.7 memory-optimizer.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_124WriteBarrierAssertFailedEPNS1_4NodeES4_PKcPNS0_4ZoneE+0x46): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(representation-change.o): in function `v8::internal::compiler::RepresentationChanger::TypeError(v8::internal::compiler::Node*, v8::internal::MachineRepresentation, v8::internal::compiler::Type, v8::internal::MachineRepresentation)':
#7 125.7 representation-change.cc:(.text._ZN2v88internal8compiler21RepresentationChanger9TypeErrorEPNS1_4NodeENS0_21MachineRepresentationENS1_4TypeES5_+0x71): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: representation-change.cc:(.text._ZN2v88internal8compiler21RepresentationChanger9TypeErrorEPNS1_4NodeENS0_21MachineRepresentationENS1_4TypeES5_+0xbd): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultJobState, std::allocator<v8::platform::DefaultJobState>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform15DefaultJobStateESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform15DefaultJobStateESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultWorkerThreadsTaskRunner, std::allocator<v8::platform::DefaultWorkerThreadsTaskRunner>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform30DefaultWorkerThreadsTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform30DefaultWorkerThreadsTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultForegroundTaskRunner, std::allocator<v8::platform::DefaultForegroundTaskRunner>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform27DefaultForegroundTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform27DefaultForegroundTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 collect2: error: ld returned 1 exit status
------
executor failed running [/bin/sh -c go get rogchap.com/v8go@4c18ca58a475cc2375ac7e3ace8513ba21525b28 && go run  main.go]: exit code: 2
cleiner commented 3 years ago

@neptoess I assume it's caused by exclude_unwind_tables being applied for all platforms. I'll look into it tomorrow.

cleiner commented 3 years ago

@kuoruan After some investigation it turns out that the github action runner for ubuntu-latest was changed from 18.04 to 20.04 between #87 (i.e. the last known good version) and #102. 18.04 uses GCC 7 by default, 20.04 GCC 9 and the golang image has GCC 8. While GCC 8 can link against the lib built with GCC 7, it won't work if the lib is built with GCC 9. There's an issue to update the golang base image which would probably fix this. The other option would be to change v8go's build to explicitly use ubuntu-18.04 for now. @rogchap, any thoughts?

rogchap commented 3 years ago

Nice find @cleiner.

No issues with using 18.04 explicitly; probably better in the long run to avoid similar future updates.

I can action this and kickoff a re-build of the binary

kuoruan commented 3 years ago

Hi @rogchap Can we also update the lib version to 8.9.255.25, there are some bug fix since 8.9.255.20

Mistic92 commented 1 year ago

I have issues building with ko and distroless. I'm getting like everything is undefined.

./main.go:32:14: undefined: v8go.NewIsolate
./main.go:34:17: undefined: v8go.NewObjectTemplate
./main.go:36:18: undefined: v8go.NewFunctionTemplate
./main.go:36:59: undefined: v8go.FunctionCallbackInfo
./main.go:36:87: undefined: v8go.Value
./main.go:40:23: undefined: v8go.NewPromiseResolver
./main.go:45:19: undefined: v8go.NewValue
./main.go:50:36: undefined: v8go.ReadOnly
./main.go:52:14: undefined: v8go.NewContext
./main.go:79:27: undefined: v8go.Pending

It's also not working when using just distroless image example Dockerfile https://github.com/GoogleContainerTools/distroless/blob/main/examples/go/Dockerfile

 => ERROR [build 7/7] RUN CGO_ENABLED=0 go build -o /go/bin/app                                                                                                                                                                                           3.1s
------
 > [build 7/7] RUN CGO_ENABLED=0 go build -o /go/bin/app:

#13 3.016 ./main.go:32:14: undefined: v8go.NewIsolate
#13 3.016 ./main.go:34:17: undefined: v8go.NewObjectTemplate
#13 3.016 ./main.go:36:18: undefined: v8go.NewFunctionTemplate
#13 3.016 ./main.go:36:59: undefined: v8go.FunctionCallbackInfo
#13 3.016 ./main.go:36:87: undefined: v8go.Value
#13 3.016 ./main.go:40:23: undefined: v8go.NewPromiseResolver
#13 3.016 ./main.go:45:19: undefined: v8go.NewValue
#13 3.016 ./main.go:50:36: undefined: v8go.ReadOnly
#13 3.016 ./main.go:52:14: undefined: v8go.NewContext
#13 3.016 ./main.go:79:27: undefined: v8go.Pending
#13 3.016 ./main.go:79:27: too many errors
------
executor failed running [/bin/sh -c CGO_ENABLED=0 go build -o /go/bin/app]: exit code: 2
neptoess commented 1 year ago

@Mistic92 you have CGO_ENABLED=0. That won’t work, as cgo is needed to link libv8.a