|
Building
How to build and test the Dart project
Setting up your machineFollow the instructions in the PreparingYourMachine page. Building everythingFollow the steps in GettingTheSource to retrieve everything (use all.deps). You will end up with a tree that looks like this: dart/
client/
compiler/
corelib/
language/
runtime/
tools/
...Then, from the dart directory use the build.py script under tools/: $ cd dart $ ./tools/build.py --arch=ia32 We recommend that you use a local file system at least for the output of the builds. If your code is in some NFS partition, you can link the out directory to a local directory: $ cd dart/ $ mkdir -p /usr/local/dart-out/ $ ln -s -f /usr/local/dart-out/ out TestingAll tests are executed using the test.py script under tools/. You can run all tests as follows: $ ./tools/test.py --arch=ia32 --component=vm,frog,frogium You can run a specific test by specifying its full name or a prefix. For instance, the following runs only tests from the core libraries: $ ./tools/test.py --arch=ia32 --component=vm,frog,frogium corelib The following runs a single test: $ ./tools/test.py --arch=ia32 --component=vm,frog,frogium corelib/ListTest Troubleshooting and tips for browser tests
Some common problems you might get when running tests for the first time:
xvfb-run ./tools/test.py --arch=ia32 --component=frogium ... Building the standalone VMFollow the steps in GettingTheSource to retrieve the standalone VM (use standalone.deps). You will end up with a tree that looks like this: dart/
corelib/
language/
runtime/
standalone.deps/
tests/
third_party/
tools/Then, from the runtime directory use the build.py script under tools/: $ cd dart/runtime $ ../tools/build.py --arch=ia32 We recommend that you use a local file system at least for the output of the builds. TestingAll tests are executed using the test.py script under tools/. You can run all tests as follows from the runtime directory: $ ../tools/test.py --arch=ia32 --component=vm By default the build and test scripts select the debug binaries. You can build and test the release version of the VM by specifying --mode=release or both debug and release by specifying --mode=all on the respective build.py and test.py command lines. |
exciting, waiting.
I know this just came out today, but at some point can we PLEASE get a binary distribution? I don't want to spend 2 hours setting up a bunch of dependencies to check this out. Lower the barrier to entry.
It does not currently build with gcc 4.5, if you are on ubuntu, installing gcc 4.4 might work: sudo aptitude install gcc-4.4 g++-4.4 g++-4.4-multilib CXX=g++-4.4 CC=gcc-4.4 ./tools/build.py --arch=ia32
I encountered some java errors building on Lion:
http://pastie.org/2672433
Has anybody been able to build it?
This is the error I got on Lion....
$./tools/build.py --arch=ia32 xcodebuild -project dart.xcodeproj -target All -parallelizeTargets -configuration Debug_ia32 SYMROOT=/Developer/dart/dart/xcodebuild Build settings from command line: SYMROOT = /Developer/dart/dart/xcodebuild === BUILD AGGREGATE TARGET js2c OF PROJECT v8 WITH CONFIGURATION Debug_ia32 === Check dependencies PhaseScriptExecution "Action \"js2c\"" /Developer/dart/dart/xcodebuild/v8.build/Debug_ia32/js2c.build/Script-65883A0FF6CD34C4B88C9154.sh cd /Developer/dart/dart/third_party/v8/tools/gyp /bin/sh -c /Developer/dart/dart/xcodebuild/v8.build/Debug_ia32/js2c.build/Script-65883A0FF6CD34C4B88C9154.sh === BUILD NATIVE TARGET v8_base OF PROJECT v8 WITH CONFIGURATION Debug_ia32 === ** BUILD FAILED **http://batsuev.com/2011/10/building-google-dart-on-os-x-lion-with-xcode-4/ - solution for mysterious "BUILD FAILED" on Lion
I created a Linode Ubuntu LTS server and used the following modified commands to successfully get Dart installed. The Chromium information is out of date in the documentation here!
http://pastebin.com/NU8kn4AC
Building successfully on Ubuntu 11.10, thanks to the comments from jesper@jesperhansen.net above Make sure you have a jdk installed first. http://dartwatch.com/?p=20
Don't forget to take a look in the dart/editor/docs/README.txt for instructions on building and installing the eclipse ide plugin.
I had some trouble building the standalone VM on CentOS 5.7 and had to patch the gyp files:
Index: third_party/jscre/jscre.gypi =================================================================== --- third_party/jscre/jscre.gypi (revision 321) +++ third_party/jscre/jscre.gypi (working copy) @@ -4,7 +4,7 @@ # Needed for compilation with g++ 4.5. 'conditions': [ [ 'OS=="linux"', { 'variables' : { - 'common_gcc_warning_flags': [ '-Wno-conversion-null', ], }, } ], + 'common_gcc_warning_flags': [ ], }, } ], ], 'includes': [ '../../../tools/gyp/xcode.gypi', Index: dart-runtime.gyp =================================================================== --- dart-runtime.gyp (revision 321) +++ dart-runtime.gyp (working copy) @@ -3,6 +3,9 @@ # BSD-style license that can be found in the LICENSE file. { + 'target_defaults': { + 'cflags!' : [ '-Werror', ], + }, 'includes': [ 'vm/vm.gypi', 'bin/bin.gypi',Then I regenerated the project files before attempting to build again:
After the build completed I was able to run the hello world example successfully:
when i try to run the test, i am getting bellow message. however build BUILD SUCCEEDED for me in previous steps
./tools/test.py --arch=ia32,dartc,chromium Traceback (most recent call last):
Exception: Can't find command /Developer/dart/client/tests/drt/DumpRenderTree?.app/Contents/MacOS/DumpRenderTree? (Did you build first? Are you running in the correct directory?)=== BUILD NATIVE TARGET libdart_vm OF PROJECT dart-runtime WITH CONFIGURATION Debug_x64 === CompileC /devel/dart/xcodebuild/dart-runtime.build/Debug_x64/libdart_vm.build/Objects-normal/x86_64/assert.o vm/assert.cc normal x86_64 c++ com.apple.compilers.gcc.4_2 cd /devel/dart/runtime setenv LANG en_US.US-ASCII /Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fno-exceptions -fno-rtti -O0 -Werror -Wnon-virtual-dtor -DDEBUG -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -gdwarf-2 -fvisibility=hidden -fvisibility-inlines-hidden -iquote /devel/dart/xcodebuild/dart-runtime.build/Debug_x64/libdart_vm.build/dart_vm-generated-files.hmap -I/devel/dart/xcodebuild/dart-runtime.build/Debug_x64/libdart_vm.build/dart_vm-own-target-headers.hmap -I/devel/dart/xcodebuild/dart-runtime.build/Debug_x64/libdart_vm.build/dart_vm-all-target-headers.hmap -iquote /devel/dart/xcodebuild/dart-runtime.build/Debug_x64/libdart_vm.build/dart_vm-project-headers.hmap -I/devel/dart/xcodebuild/Debug_x64/include -I. -I/devel/dart/xcodebuild/dart-runtime.build/Debug_x64/libdart_vm.build/DerivedSources/x86_64 -I/devel/dart/xcodebuild/dart-runtime.build/Debug_x64/libdart_vm.build/DerivedSources -Wall -Wextra -Wno-unused-parameter -Wall -Wextra -Wno-unused-parameter -Wtrigraphs -Wall -Wextra -Wno-unused-parameter -Wall -Wextra -Wno-unused-parameter -Wtrigraphs -F/devel/dart/xcodebuild/Debug_x64 -c /devel/dart/runtime/vm/assert.cc -o /devel/dart/xcodebuild/dart-runtime.build/Debug_x64/libdart_vm.build/Objects-normal/x86_64/assert.o ** BUILD FAILED **Hello! Trying to build dart on a MBP5,3 with Lion. I followed the link posted above for solving the SDK problem in 10.7, and now I find myself with the issue that the build script is trying to use the iOS 5 beta SDK version of macosx10.6.
Is there any way to tell it to look for the correct one? I tried dissecting the build.py script but my python-fu is pretty nonexistant :(
Here's the verbose output of the build.py run
~/src/google/dart % ./tools/build.py --arch=x64 --verbose R1 - 2011-10-11 02:58:58 - triforce xcodebuild -sdk macosx10.6 -project dart.xcodeproj -target All -parallelizeTargets -configuration Debug_x64 SYMROOT=/Users/nico/src/google/dart/xcodebuild Build settings from command line: SDKROOT = macosx10.6 SYMROOT = /Users/nico/src/google/dart/xcodebuild === BUILD AGGREGATE TARGET js2c OF PROJECT v8 WITH CONFIGURATION Debug_x64 === Check dependencies 2011-10-11 02:59:04.701 xcodebuild[12883:1d03] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 127 returned from shell command: /Developer5/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer5/SDKs/MacOSX10.6.sdk -x c++ -c /dev/null 2>&1" UserInfo=0x4024a4600 {NSLocalizedDescription=Non-zero exit code 127 returned from shell command: /Developer5/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer5/SDKs/MacOSX10.6.sdk -x c++ -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory} 2011-10-11 02:59:04.701 xcodebuild[12883:1d03] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c++'. Compiler: /Developer5/usr/bin/gcc-4.2 Reason: /Developer5/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer5/SDKs/MacOSX10.6.sdk -x c++ -c /dev/null 2>&1 === BUILD NATIVE TARGET v8_base OF PROJECT v8 WITH CONFIGURATION Debug_x64 === Check dependencies 2011-10-11 02:59:04.840 xcodebuild[12883:3c03] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 127 returned from shell command: /Developer5/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer5/SDKs/MacOSX10.6.sdk -x c -c /dev/null 2>&1" UserInfo=0x400183fa0 {NSLocalizedDescription=Non-zero exit code 127 returned from shell command: /Developer5/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer5/SDKs/MacOSX10.6.sdk -x c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory} 2011-10-11 02:59:04.841 xcodebuild[12883:3c03] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c'. Compiler: /Developer5/usr/bin/gcc-4.2 Reason: /Developer5/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer5/SDKs/MacOSX10.6.sdk -x c -c /dev/null 2>&1 Unsupported compiler 'GCC 4.2' selected for architecture 'x86_64' === BUILD AGGREGATE TARGET d8_js2c OF PROJECT d8 WITH CONFIGURATION Debug_x64 === === BUILD NATIVE TARGET v8_nosnapshot OF PROJECT v8 WITH CONFIGURATION Debug_x64 === ** BUILD FAILED ** The following build commands failed: Check dependencies (1 failure) BUILD FAILEDAny ideas? Thanks!
For Lion and xcode 4 use this: http://batsuev.com/2011/10/building-google-dart-on-os-x-lion-with-xcode-4/
krheb...They mention the DumpRenderTree? issue and the fix. More clearly, it is that you need these fonts:
sudo apt-get install apache2 wdiff php5-cgi ttf-indic-fonts \
+1 for binary distro, I want to play with it but don't really want to build it myself!
I tried to build in Ubuntu 11.10 following this guild http://dartwatch.com/index.php/2011/10/setting-up-a-dart-build-environment-on-xubuntu-11-04/
but install-build-deps.sh does not support 11.10, I go ahead and do the build anyway and get the following error. Do I have to run this script?
I also do sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib export CXX=g++-4.4 CC=gcc-4.4
Any idea?
./tools/build.py --arch=ia32 make -j 2 BUILDTYPE=Debug_ia32 all
third_party/v8/src/ia32/cpu-ia32.cc: In static member function ‘static void v8::internal::CPU::FlushICache(void, size_t)’: third_party/v8/src/ia32/cpu-ia32.cc:70:3: error: variable ‘qzz_res’ set but not used [-Werror=unused-but-set-variable] third_party/v8/src/ia32/full-codegen-ia32.cc: In member function ‘virtual void v8::internal::FullCodeGenerator?::VisitCompareOperation?(v8::internal::CompareOperation?)’: third_party/v8/src/ia32/full-codegen-ia32.cc:4085:12: error: variable ‘strict’ set but not used [-Werror=unused-but-set-variable] cc1plus: all warnings being treated as errorsmake: [out/Debug_ia32/obj.host/v8_base/third_party/v8/src/ia32/cpu-ia32.o] Error 1 make: Waiting for unfinished jobs.... cc1plus: all warnings being treated as errors
make: [out/Debug_ia32/obj.host/v8_base/third_party/v8/src/ia32/full-codegen-ia32.o] Error 1 BUILD FAILED
Just wanted to say I've successfully build dart on Debian Unstable. Can't wait to get playing around with it.
After I do this Workaround: Remove -Werror from dart/tools/gyp/configurations_make.gypi I can be able to build dart.
Again I am using Kubuntu 11.10 32 bit, and just follow the instructions to build dart. I also build it using gcc-4.6 which comes with 11.10, this time, and works.
I have successfully built the dart standalone VM on Ubuntu 11.04 using gcc-4.5. I ran all tests with success. I had to install g++-multilib and openssl-dev.
I have successfully build art VM on Ubuntu 10.10 using gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5).
./tools/test.py --arch=ia32,dartc
test passed.
./tools/test.py --arch=ia32,dartc,chromium
Failed.
" Exception: Can't find command /Developer/dart/client/tests/drt/DumpRenderTree??.app/Contents/MacOS/DumpRenderTree?? (Did you build first? Are you running in the correct directory?)"
Do I need to checkout the whole Chromium?
Follow the link to fix the DumpRenderTree? issue: http://dartwatch.com/index.php/2011/10/setting-up-a-dart-build-environment-on-xubuntu-11-04/
Specificly need the oauth2 id by following the web link generated from this: dart/third_party/gsutil/20110627/gsutil config
I put my instructions for building Dart on 64-bit Debian testing here: https://gist.github.com/1289466
The single most important thing is -- you DON'T need all those crazy dependencies from Chromium, this install-build-deps.sh script is totally unnecessary!
Running Ubuntu 11.10, installing g++-multilib seemed to make it build after install-build-deps.sh kept crashing.
Running Ubuntu 11.04, failed to build Dart x64...
If your build is failing for Ubuntu try: http://code.google.com/p/dart/issues/detail?id=162#c9
(If your getting the "full-codegen-ia32.o? Error 1 BUILD FAILED" error)
Binary distro for Windows please. Can't get this to build without errors.
openssl missed under windows
Trying to run ./tools/test.py --arch=ia32 --component=vm,dartc,chromium from inside dart folder on mac os lion.
Couple of warnings and Traceback and then Exception: Can't find command /dart/client/tests/drt/DumpRenderTree?.app/Contents/MacOS/DumpRenderTree? (Did you build first? Are you running in the correct directory?)
Any solution for this please ???
The 99% can't compile the Dart VM. Google, work faster and let us in! :)
Trying to run the build.py on my win32 machine and get: WindowsError?: 3? The system cannot find the path specified
What dependencies have I missed?