This project is read-only.

Another Mono support question

Jan 28, 2015 at 11:01 AM
After trying different ways to use the mono version, I defaulted to just try to get the prebuilt V8.Net.Console.exe sample running on my Mac:

_MacBook-Air:~ user$ mono /Users/user/Documents/V8/V8.Net.Console.exe
Missing method System.AppDomain::add_FirstChanceException(EventHandler`1<FirstChanceExceptionEventArgs>) in assembly /Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.5/mscorlib.dll, referenced in assembly /Users/user/Documents/V8/V8.Net.Console.exe

Unhandled Exception:
System.MissingMethodException: Method not found: 'System.AppDomain.add_FirstChanceException'.
[ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method not found: 'System.AppDomain.add_FirstChanceException'._

I read somewhere that the Linux version was stable and the OSx version was "in progress". So perhaps I should not expect this to work on a Mac yet. If this is the case, how far in the future are you with the OSx support? (if you don't mind me asking ;) )

Thank you,
Mikael
Jan 28, 2015 at 12:18 PM
Edited Jan 29, 2015 at 1:03 PM
Hi Mikael,
first of all what I can see from your command mono /Users/user/Documents/V8/V8.Net.Console.exe this should not work, because of how Mono on *nix loads libraries. If you want it to execute like this you have to execute mono V8.Net.Console.exe or LD_LIBRARY_PATH="Users/user/Documents/V8/" mono Users/user/Documents/V8/V8.Net.Console.exe. Then you should at least get the same exception then I'm on a Yoesemite 10.10 machine. The progress does not stuck, because I'm intend to use V8dotnet on Win/*nix platforms, but I cant specify a date when it will be ready to use. At least the build process is running which should be a starting point to investigate further.

Your exception should not happen on OSX nor on Linux because Mono has no implementation of FirstChanceException event.
So this indicates that you have the wrong dll's executed on OSX. Keep in mind that mono is only available with x86 on Osx so native libraries need to be build for x86 while Linux can run x64 too.

If you want to investigate further on OSX do the following:
Install dependencies:
xcode-select --install
Install Xcode IDE
Build:
git clone  git@github.com:chrisber/v8dotnet.git
cd v8dotnet
git checkout -B development-mono
export TRAVIS_OS_NAME=osx
./build_V8_Net.sh --default ia32.debug 2  
//ignore nugget error
cp Build/ia32.debug/makefiles/out/Default/libV8_Net_Proxy.dylib BuildResult/Debug
cd BuildResult/Debug
mono V8.Net.Console.exe 
If you need further guidance to get the build script up and running lets discuss this shortly at Gitter


Note that Linux nor OSX is considered stable rather then Experimental
Marked as answer by wmmihaa on 2/5/2015 at 10:09 PM
Feb 2, 2015 at 7:30 AM
Thank you for the help.
It might be obvious that I'm not a Mac/Linux guy. I've tried to follow the instructions but I end up getting a build error. After running the build command (./build_V8_Net.sh --default ia32.debug 2), I get an error saying:
fatal error: 'stdio.h' file not found
(I've attached the log)

BTW, I'm fine posting this question on codeplex/github, but witch one would you prefer?

Cheers
Mikael


Feb 2, 2015 at 10:12 AM
Mikaels-MacBook-Air:v8dotnet mikael$ ./build_V8_Net.sh --default ia32.debug 2
Export Mac defines
+++ Build V8 Javascript Engine +++ 
+++ Init V8 Submodule +++ 
+++ Building V8 \n
    Version 3.29.40 (based on bleeding_edge revision r23628)\n
    commit 21d700eedcdd6570eff22ece724b63a5eefe78cb\n
    make builddeps -j 2 +++ 
svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \
        --revision 1831
Checked out revision 1831.
if svn info third_party/icu 2>&1 | grep -q icu46 ; then \
      svn switch --force \
          https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \
          third_party/icu --revision 277999 ; \
    else \
      svn checkout --force \
          https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \
          third_party/icu --revision 277999 ; \
    fi
Checked out revision 277999.
svn checkout --force http://googletest.googlecode.com/svn/trunk \
        testing/gtest --revision 692
^[Checked out revision 692.
svn checkout --force http://googlemock.googlecode.com/svn/trunk \
        testing/gmock --revision 485

Fetching external item into 'testing/gmock/gtest'
Checked out external at revision 692.

Checked out revision 485.
+++ make ia32.debug library=shared gdbjit=on -j 2 +++ 
PYTHONPATH="/Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/tools/generate_shim_headers:/Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/build::/Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/build/gyp/pylib:" \
    GYP_GENERATORS=make \
    build/gyp/gyp --generator-output="out" build/all.gyp \
                  -Ibuild/standalone.gypi --depth=. \
                  -Dv8_target_arch=ia32 \
                   \
                   \
                  -S.ia32.debug  -Dcomponent=shared_library -Dv8_enable_backtrace=1 -Dv8_enable_i18n_support=0 -Darm_fpu=default -Darm_float_abi=default
  CXX(target) /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/accessors.o
  CXX(target) /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/allocation.o
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: i386-apple-darwin14.1.0
Thread model: posix
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: i386-apple-darwin14.1.0
Thread model: posix
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple i386-apple-macosx10.10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name allocation.cc -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -target-cpu yonah -target-linker-version 136 -v -g -coverage-file /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/allocation.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.2 -dependency-file /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/.deps//Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/allocation.o.d.raw -MT /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/allocation.o -isysroot / -D V8_TARGET_ARCH_IA32 -D ENABLE_GDB_JIT_INTERFACE -D V8_DEPRECATION_WARNINGS -D BUILDING_V8_SHARED -D V8_SHARED -D ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -D ENABLE_DISASSEMBLER -D V8_ENABLE_CHECKS -D OBJECT_PRINT -D VERIFY_HEAP -D DEBUG -D ENABLE_EXTRA_CHECKS -D ENABLE_HANDLE_ZAPPING -I ../. -fmodule-cache-path /var/folders/b2/mp02zk950ygf84wtj_80l0cr0000gn/T/clang-module-cache -stdlib=libc++ -O0 -Werror -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -fdeprecated-macro -fdebug-compilation-dir /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8 -ferror-limit  "19/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang "-fmessage-length  191 -cc1-fvisibility  -triplehidden  i386-apple-macosx10.10.0-fvisibility-inlines-hidden  -emit-obj-stack-protector  -mrelax-all1  -disable-free-mstackrealign  -disable-llvm-verifier-fblocks  -main-file-name-fno-rtti  accessors.cc-fno-threadsafe-statics  -pic-level-fobjc-runtime=macosx-fragile-10.10.0  2-fobjc-default-synthesize-properties  -mdisable-fp-elim-fdiagnostics-show-option  -relaxed-aliasing-fcolor-diagnostics  -masm-verbose-o  -target-cpu /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/allocation.oyonah  -x-target-linker-version  136 -v -g -coverage-file /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/accessors.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.2 -dependency-file /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/.deps//Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/accessors.o.d.raw -MT /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/accessors.o -isysroot / -D V8_TARGET_ARCH_IA32 -D ENABLE_GDB_JIT_INTERFACE -D V8_DEPRECATION_WARNINGS -D BUILDING_V8_SHARED -D V8_SHARED -D ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -D ENABLE_DISASSEMBLER -D V8_ENABLE_CHECKS -D OBJECT_PRINT -D VERIFY_HEAP -D DEBUG -D ENABLE_EXTRA_CHECKS -D ENABLE_HANDLE_ZAPPING -I ../. -fmodule-cache-path /var/folders/b2/mp02zk950ygf84wtj_80l0cr0000gn/T/clang-module-cache -stdlib=libc++ -O0 -Werror -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -fdeprecated-macro -fdebug-compilation-dir /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8 -ferror-limit 19 -fmessage-length 191 -fvisibility hidden -fvisibility-inlines-hidden -stack-protector 1 -mstackrealign -fblocks -fno-rtti -fno-threadsafe-statics -fobjc-runtime=macosx-fragile-10.10.0 -fobjc-default-synthesize-properties -fdiagnostics-show-option -fcolor-diagnostics -o /Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/accessors.o -x c++ ../src/allocation.cc
c++ ../src/accessors.cc
clang -cc1 version 4.2 based upon LLVM 3.2svn default target x86_64-apple-darwin14.1.0
clang -cc1 version 4.2 based upon LLVM 3.2svn default target x86_64-apple-darwin14.1.0
ignoring nonexistent directory "/usr/include/c++/v1"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/include/c++/v1"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 ../.
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.2/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
#include "..." search starts here:
#include <...> search starts here:
 ../.
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.2/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
In file included from ../src/allocation.cc:5:
In file included from .././src/allocation.h:8:
In file included from .././src/globals.h:8:
.././include/v8stdint.h:11:10: fatal error: 'stdio.h' file not found
In file included from ../src/accessors.cc:5:
In file included from .././src/v8.h:29:
In file included from .././include/v8.h:18:
.././include/v8stdint.h:11:10: fatal error: 'stdio.h' file not found
#include <stdio.h>#include <stdio.h>

         ^         ^

1 error generated.
make[1]: *** [/Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/allocation.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [/Users/mikael/Documents/v8dotnet/Source/V8.NET-Proxy/V8/out/ia32.debug/obj.target/v8_base/src/accessors.o] Error 1
make: *** [ia32.debug] Error 2
+++ make ia32.debug library=shared Build V8 Javascript Engine +++ 
+++ Build V8.Net native Proxy ia32.debug +++ 
+++ Create Directories BuildResult/{Debug,Release} +++ 
+++ Build V8.Net native proxy (libV8_Net_Proxy.so ) +++ 
make: *** No rule to make target `../../../Source/V8.NET-Proxy/V8/out/ia32.debug/libv8.dylib', needed by `out/Default/../../libv8.dylib'.  Stop.
2
+++ make V8.Net Proxy for ia32.debug successfull +++ 
+++ Copy libV8_Net_Proxy.so failed +++ 
Mikaels-MacBook-Air:v8dotnet mikael$
Feb 4, 2015 at 8:01 AM
chrisber01, Do you have any idea to why this issue?
Feb 5, 2015 at 9:54 AM
Edited Feb 5, 2015 at 1:37 PM
Hi mikael,

what I can tell is that the script is not able to build v8 itself.If it cannot find stdio.h means that with your c++11 installation must be somethig wrong. Could it be that some installation is missing. Did you install Xcode 6 IDE? V8 uses gyp as project generator and gyp depends on OSX on the Xcode IDE.
The script build_V8_Net.sh executes the following commands to build v8 which is documented here BuildingWithGYP.

The commands to execute manually are:
    export CXX="`which clang++`       -v -std=c++11 -stdlib=libc++"
    export CC="`which clang`          -v "
    export CPP="`which clang`      -E -v "
    export LINK="`which clang++`      -v -std=c++11 -stdlib=libc++"
    export CXX_host="`which clang++`  -v "
    export CC_host="`which clang`     -v "
    export CPP_host="`which clang` -E -v "
    export LINK_host="`which clang++` -v "
    export GYP_DEFINES="clang=1  mac_deployment_target=10.10"

cd Source/V8.NET-Proxy/V8

make builddeps -j 2
make  ia32.debug library=shared -j 2  snapshot=yes i18nsupport=off
Maybe you have to change mac_deployment_target=10.10 to your System Identifier if you are not on yosemite 10.10.
Marked as answer by wmmihaa on 2/5/2015 at 10:09 PM
Feb 5, 2015 at 9:25 PM
Re-installed XCode... It all compiled - AWESOME!

Didn't have time to go through the output from the console (seamed to be a few exceptions), but at least I have a start point. I might get back to you, but for now - Thank you so much.