Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(759)

Issue 10823209: Add support for building the Dart VM for Android OS. (Closed)

Created:
8 years, 4 months ago by jackpal
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add support for building the Dart VM for Android OS. The Android target OS is based upon the existing Linux target OS. The existing _linux source files have been copied to create corresponding _android source files. The copies have been modified as needed to adapt to differences between the Linux platform and the Android platform. Currently the dart vm binary builds on Linux and runs on x86 Android, Simple test scripts execute correctly, but no formal testing has been done. The process for building the Dart VM for Android will be documented on the Dart wiki. BUG= Committed: https://code.google.com/p/dart/source/detail?r=11547

Patch Set 1 #

Total comments: 30

Patch Set 2 : Incorporate review feedback from cshapiro #

Total comments: 11

Patch Set 3 : Address cshapiro's review comments, pass 2 #

Total comments: 10

Patch Set 4 : Fix Directory::CreateTemp("") to work on Android. Also fix platform_test.dart to know about Android… #

Total comments: 20

Patch Set 5 : Respond to feedback from ahe, cshapiro, efortuna, and Søren Gjesse #

Patch Set 6 : Nicer-to-use android build system. #

Patch Set 7 : Removed unused script tools/android/envsetup.sh #

Total comments: 10

Patch Set 8 : Update for efortuna feedback. #

Patch Set 9 : Android binaries are now built into a separate directory from host binaries. #

Patch Set 10 : build.py learned --os all option to build for both host and android. #

Total comments: 32
Unified diffs Side-by-side diffs Delta from patch set Stats (+999 lines, -132 lines) Patch
A runtime/tools/android_finder.py View 1 2 3 4 5 6 7 1 chunk +368 lines, -0 lines 32 comments Download
M runtime/tools/create_snapshot_bin.py View 1 2 3 4 5 6 7 5 chunks +38 lines, -43 lines 0 comments Download
M runtime/tools/utils.py View 1 2 3 4 5 6 7 2 chunks +115 lines, -5 lines 0 comments Download
M runtime/vm/vm.gypi View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M tools/build.py View 1 2 3 4 5 6 7 8 9 5 chunks +226 lines, -72 lines 0 comments Download
M tools/clean_output_directory.py View 1 2 3 4 5 6 7 8 9 3 chunks +29 lines, -8 lines 0 comments Download
M tools/gyp/configurations.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A tools/gyp/configurations_android.gypi View 1 2 3 4 5 1 chunk +203 lines, -0 lines 0 comments Download
M tools/utils.py View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -4 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
jackpal
Here's my change to add support for building the Dart VM for Android OS. The ...
8 years, 4 months ago (2012-08-07 20:09:59 UTC) #1
jackpal
Sorry, somehow the Google Docs link for the build instructions doesn't seem to work. Trying ...
8 years, 4 months ago (2012-08-07 20:21:02 UTC) #2
cshapiro
https://chromiumcodereview.appspot.com/10823209/diff/1/runtime/bin/directory_android.cc File runtime/bin/directory_android.cc (left): https://chromiumcodereview.appspot.com/10823209/diff/1/runtime/bin/directory_android.cc#oldcode417 runtime/bin/directory_android.cc:417: Definitions are separated by 2 spaces. You should probably ...
8 years, 4 months ago (2012-08-07 20:56:54 UTC) #3
jackpal
https://chromiumcodereview.appspot.com/10823209/diff/1/runtime/bin/directory_android.cc File runtime/bin/directory_android.cc (left): https://chromiumcodereview.appspot.com/10823209/diff/1/runtime/bin/directory_android.cc#oldcode417 runtime/bin/directory_android.cc:417: On 2012/08/07 20:56:54, cshapiro wrote: > Definitions are separated ...
8 years, 4 months ago (2012-08-07 21:43:25 UTC) #4
cshapiro
These should be my last set of comments. Minor stuff only. Aside from this everything ...
8 years, 4 months ago (2012-08-07 22:39:39 UTC) #5
jackpal
https://chromiumcodereview.appspot.com/10823209/diff/1/runtime/vm/virtual_memory_android.cc File runtime/vm/virtual_memory_android.cc (right): https://chromiumcodereview.appspot.com/10823209/diff/1/runtime/vm/virtual_memory_android.cc#newcode29 runtime/vm/virtual_memory_android.cc:29: void* address = mmap(NULL, size, PROT_NONE, On 2012/08/07 22:39:39, ...
8 years, 4 months ago (2012-08-08 00:26:19 UTC) #6
Emily Fortuna
just a few initial comments. I haven't finished going through all the files just yet. ...
8 years, 4 months ago (2012-08-08 01:28:37 UTC) #7
Emily Fortuna
https://chromiumcodereview.appspot.com/10823209/diff/2003/runtime/tools/create_snapshot_bin.py File runtime/tools/create_snapshot_bin.py (right): https://chromiumcodereview.appspot.com/10823209/diff/2003/runtime/tools/create_snapshot_bin.py#newcode47 runtime/tools/create_snapshot_bin.py:47: On 2012/08/08 01:28:37, Emily Fortuna wrote: > extra newline ...
8 years, 4 months ago (2012-08-08 01:33:47 UTC) #8
cshapiro
https://chromiumcodereview.appspot.com/10823209/diff/2003/runtime/vm/virtual_memory_android.cc File runtime/vm/virtual_memory_android.cc (right): https://chromiumcodereview.appspot.com/10823209/diff/2003/runtime/vm/virtual_memory_android.cc#newcode29 runtime/vm/virtual_memory_android.cc:29: // TODO(4480): use ashmem instead of anonymous memory I ...
8 years, 4 months ago (2012-08-08 02:57:42 UTC) #9
Søren Gjesse
Have you tried to see if the toolset setting can be moved to some central ...
8 years, 4 months ago (2012-08-08 11:35:56 UTC) #10
jackpal
The document "Cross Compiling the Dart VM for Android" has been renamed "Building Dart VM ...
8 years, 4 months ago (2012-08-08 18:42:04 UTC) #11
ahe
Hi Jack, GYP is painful. Could you schedule a VC with me where we can ...
8 years, 4 months ago (2012-08-08 19:09:58 UTC) #12
ahe
Hi Jack, GYP is painful. Could you schedule a VC with me where we can ...
8 years, 4 months ago (2012-08-08 19:09:58 UTC) #13
jackpal
Responding to efortuna's comments.... https://chromiumcodereview.appspot.com/10823209/diff/2003/runtime/tools/create_snapshot_bin.py File runtime/tools/create_snapshot_bin.py (right): https://chromiumcodereview.appspot.com/10823209/diff/2003/runtime/tools/create_snapshot_bin.py#newcode47 runtime/tools/create_snapshot_bin.py:47: On 2012/08/08 01:33:47, Emily Fortuna ...
8 years, 4 months ago (2012-08-08 23:06:45 UTC) #14
jackpal
https://chromiumcodereview.appspot.com/10823209/diff/6004/dart.gyp File dart.gyp (right): https://chromiumcodereview.appspot.com/10823209/diff/6004/dart.gyp#newcode25 dart.gyp:25: ['dart_want_separate_host_toolset==1', { On 2012/08/08 19:09:58, ahe wrote: > Looks ...
8 years, 4 months ago (2012-08-09 01:09:48 UTC) #15
jackpal
At Peter Ahe's suggestion I am going to split this CL into a few smaller ...
8 years, 4 months ago (2012-08-09 15:35:10 UTC) #16
jackpal
Did I say 2 CLs? I ment 6. Here they are: 10830247 Filter out _android.(cc|h) ...
8 years, 4 months ago (2012-08-09 18:35:08 UTC) #17
jackpal
I have reopened this change. Sorry for the confusion. This change now contains everything we ...
8 years, 3 months ago (2012-08-28 02:51:42 UTC) #18
jackpal
I've updated the build instructions, they are much simpler: https://docs.google.com/document/d/1qoInKSJLdxDEz2GR85ruM4Sa51vAm1TsMJ8T0WIa1JI/edit I am happy that there ...
8 years, 3 months ago (2012-08-28 03:10:53 UTC) #19
Søren Gjesse
LGTM! I like the simplicity of building for Android. I have one comment regarding the ...
8 years, 3 months ago (2012-08-28 08:13:40 UTC) #20
Emily Fortuna
+1 to what Søren says about a separate build target. https://chromiumcodereview.appspot.com/10823209/diff/19001/runtime/tools/android_finder.py File runtime/tools/android_finder.py (right): https://chromiumcodereview.appspot.com/10823209/diff/19001/runtime/tools/android_finder.py#newcode300 ...
8 years, 3 months ago (2012-08-28 16:49:14 UTC) #21
Emily Fortuna
+1 to what Søren says about a separate build target. https://chromiumcodereview.appspot.com/10823209/diff/19001/runtime/tools/android_finder.py File runtime/tools/android_finder.py (right): https://chromiumcodereview.appspot.com/10823209/diff/19001/runtime/tools/android_finder.py#newcode300 ...
8 years, 3 months ago (2012-08-28 16:49:14 UTC) #22
jackpal
I've fixed the errors Emily found. https://chromiumcodereview.appspot.com/10823209/diff/19001/runtime/tools/android_finder.py File runtime/tools/android_finder.py (right): https://chromiumcodereview.appspot.com/10823209/diff/19001/runtime/tools/android_finder.py#newcode300 runtime/tools/android_finder.py:300: os.environ['PATH'] = ':'.join([os.environ['PATH'], ...
8 years, 3 months ago (2012-08-28 20:15:20 UTC) #23
jackpal
I've updated this patch to build the Android dart binaries into a separate directory from ...
8 years, 3 months ago (2012-08-29 02:49:21 UTC) #24
Søren Gjesse
LGTM, thanks for addressing into the output directory issue.
8 years, 3 months ago (2012-08-29 06:24:07 UTC) #25
ahe
Better late than never, I hope. I'm taking this in bits. First, here is a ...
8 years, 3 months ago (2012-08-30 10:24:10 UTC) #26
jackpal
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_finder.py File runtime/tools/android_finder.py (right): http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_finder.py#newcode8 runtime/tools/android_finder.py:8: Find an Android device with a given ABI On ...
8 years, 3 months ago (2012-08-30 18:25:20 UTC) #27
jackpal
8 years, 3 months ago (2012-08-30 18:35:50 UTC) #28
On 2012/08/30 18:25:20, jackpal wrote:
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> File runtime/tools/android_finder.py (right):
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:8: Find an Android device with a given ABI
> On 2012/08/30 10:24:10, ahe wrote:
> > Missing period.
> 
> Done.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:10: The name of the Android device is printed
to
> stdout
> On 2012/08/30 10:24:10, ahe wrote:
> > Missing period.
> 
> Done.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:33: help="Desired ABI. armeabi-v7a or x86")
> On 2012/08/30 10:24:10, ahe wrote:
> > Missing period.
> 
> Done.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:55: sys.stderr.write('--abi not specified\n')
> Interesting! I read on stack overflow that one benefit of using print >>
> sys.stderr is that the print statement performs automatic coercion of the
> arguments to strings. I'll think about using it instead of sys.stderr.write in
> the future.
> 
> On 2012/08/30 10:24:10, ahe wrote:
> > FYI: I just discovered this alternative:
> > 
> > print >> sys.stderr, '--abi not specified.'
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:64: Return list of (id-num, id-key, type,
> description)
> On 2012/08/30 10:24:10, ahe wrote:
> > Missing period.
> 
> Done.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:85: ["android", "list", "sdk", "-a", "-e"]))
> On 2012/08/30 10:24:10, ahe wrote:
> > I assume you already checked that there is no "machine readable" output from
> > this command?
> 
> Yeah, unfortunately the "android" tool wasn't designed with an eye towards
being
> easy to script.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:89: """key is (id-key, type,
> description-prefix)"""
> On 2012/08/30 10:24:10, ahe wrote:
> > If you want symbolic names instead of indexing, I think you can write:
> > 
> > (id_key, type, description_prefix) = key
> 
> Done.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:90: for package in packages:
> On 2012/08/30 10:24:10, ahe wrote:
> > And here I think you can write this:
> > 
> > for (i, t, d) in packages:
> 
> Well, I want to return the package in line 93, so I think it's better to keep
> line 90 the way it is now.
> 
> But I'll add a destructuring assignment to make lines 91 and 92 clearer.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:110: sys.stderr.write('Checking Android SDK
> package %s...\n' % str(entry))
> On 2012/08/30 10:24:10, ahe wrote:
> > Why is verbose output written to stderr?
> 
> To avoid polluting stdout, which is where we return the name of the
environment
> we've found.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:113: return out.find('\nInstalling
Archives:\n')
> >= 0
> On 2012/08/30 10:24:10, ahe wrote:
> > return '\nInstalling Archives:\n' in out
> 
> Sweet!
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:141: 
> On 2012/08/30 10:24:10, ahe wrote:
> > Missing newline.
> 
> Done.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:215: def dumpenv(map):
> On 2012/08/30 10:24:10, ahe wrote:
> > Inconsistent name.
> 
> Oops! - this is unused debugging code, I'll remove it entirely.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:311: 
> On 2012/08/30 10:24:10, ahe wrote:
> > Missing newline.
> 
> Done.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:317: if device is None:
> On 2012/08/30 10:24:10, ahe wrote:
> > if not device:
> 
> Done.
> 
>
http://codereview.chromium.org/10823209/diff/25004/runtime/tools/android_find...
> runtime/tools/android_finder.py:360: except Exception as e:
> On 2012/08/30 10:24:10, ahe wrote:
> > I think this is problematic. It also catches, for example, SyntaxError.
> > 
> > I'm aware that we're following PEP-8, not Google's style guide. However, I
> think
> > Google's style guide offers some great advice on how to use exceptions in
> > Python:
> > http://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Exceptions
> > 
> > In short: define your own exception class and raise that instead of
Exception.
> 
> Done.

I'm going to address Peter Ahe's latest feedback in a separate CL:

https://chromiumcodereview.appspot.com/10916021

Powered by Google App Engine
This is Rietveld 408576698