I was looking into using dart on Beaglebone Black and decided it would be useful to share with others what I found.
After a some build hacks and patches I found a minimal working solution for Beaglebone Black with Debian ARMhf. A few important notes before going down the road of building dart for ARM. The dart-sdk
is not fully supported and pub currently might not work. The . The only supported ARM architectures are the ones that have ARMv7 with VFP. Don’t spin your wheels trying to target any architecutre that is not dartanalyzer
might not workARMv7
with VFP (minimum at the moment ARMv7-A
) unless you plan on implementing the routines needed in the runtime arm assembler. If you do plan on implementing them, well thats just pure awesome!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Download Ubuntu 12.04.3 LTS
Download the desktop iso to install on VirtualBox.
Install on VirtualBox
I work mostly on mac so Ubuntu installed on VirtualBox was needed to help with cross compiling and flashing of uSD cards.
Update the packages
Just to be safe update any Ubuntu packages before installing the development software.
Install basic packages
I typically use the git overlay on subversion when working with the dart repo. The java jre/jdk is required for building the dart_analyzer which does not work in the sdk.
1 2 |
|
Install the chrome build and arm dependencies
Checkout the latest build tools scripts. The following scripts prep your system with any packages needed for building dart.
1 2 3 4 5 6 7 |
|
Install addtional libraries
The following libraries are needed for building dart but might not be included from the chrome build tool scripts.
1 2 |
|
Install depot-tools
depot-tools is required for hacking out the dart source code.
1 2 3 |
|
Checkout the dart code base
You dont need to include --username <YOUR USERNAME>
unless you plan on creating a CL for review.
1 2 3 4 5 6 7 |
|
Patch the gyp and version files
A git patch can be found here 7725354, that patches the build scripts to support building the dart-sdk
for ARM. Patching the VERSION
file was done in an attempt to get pub working. At the moment its not required. If not done then an old version number is baked into the dartvm. This patch also modifies which dartvm creates the snapshots for pub
, dart2js
and a wrapper util. Patch creates the requirement of having to build the dartvm for x64 before building the dart-sdk
for ARM. The dart build scripts have a funky dependency of wanting to use the dartvm target to create the snapshot files. Which in this case wont work since our dartvm is an ARM target being built on x64.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
Build the dart-sdk
Building of the dart-sdk
for ARM target is a two stop process. First build x64 so we can use that dartvm to generate the snapshot files. Then the second step is running the create_sdk
build for ARM. When the build is finished the out/ReleaseARM/dart-sdk
should contain a full dart-sdk
build. Keep in mind this does build the dartanalyzer
but it may not work on ARM.
1 2 3 4 5 |
|
Tarball the sdk
Package up the dart-sdk
as a tarball to distribute.
1 2 |
|
Install Debian Wheezy 7.2 Hard Float Minimal Image on Beaglebone Black
In virtualbox with a uSD card at /dev/sdX
the following will download an image and write to the uSD card. Updated images can be found at armhf
1 2 |
|
Then insert the uSD card into the Beaglebone Black and boot the image by holding down the boot switch and powering on.
Write the booted image to the eMMC.
1
|
|
Power down and remove the uSD card.
Update glibc on the BeagleBone Black
Updating glibc is required cause the version of glibc installed from the chromium build scripts is greater then the one shipped with Wheezy 7.2. The following commands update glibc.
1 2 3 4 5 6 7 8 |
|
Copy over dart-sdk
From virtual box copy over the tarball to Beaglebone Black running debian.
1
|
|
After the tarball is copied, uncompress and add to your PATH
.
1 2 3 4 |
|
Known issues at the moment
Pub does not work, issue could be followed at 15383. I was testing this out while staying at a hotel so some proxy settings might of been blocking or tripping up pub.
Feedback
If you have a better way of running dart on Beagleblone Black I would love to hear it! Please contact me on g+ and lets discuss.
Update on dartanalyzer
dartanalyzer
will work after installing the default-jre
on Beaglebone Black.
1
|
|
Addtional resources
- dart_bleeding contains some scripts I typically use for this entire process.
- PreparingYourMachine resources for preping your machine to build from source
- GettingTheSource getting the source code documentation