commit | 39888ed007879ec273ed45d7609211af843c83d7 | [log] [tgz] |
---|---|---|
author | Ian Fischer <iansf@google.com> | Mon Jun 08 17:23:49 2015 -0700 |
committer | Ian Fischer <iansf@google.com> | Mon Jun 08 17:23:49 2015 -0700 |
tree | eaab6678efb1738ea962b21ac73a53dee688e096 | |
parent | d1bf4e9e9a8f38031653a4042873b677e7a3cddb [diff] |
Don’t claim success in GLSurface::InitializeOneOffInternal if the requested implementation type is unknown. R=abarth@chromium.org, jamesr@chromium.org BUG= Review URL: https://codereview.chromium.org/1165893002
Mojo is an effort to extract a common platform out of Chrome's renderer and plugin processes that can support multiple types of sandboxed content, such as HTML, Pepper, or NaCl.
The instructions below only need to be done once. Note that a simple “git clone” command is not sufficient to build the source code because this repo uses the gclient command from depot_tools to manage most third party dependencies.
$ fetch mojo # append --target_os=android to include Android build support. $ cd src # Or install-build-deps-android.sh if you plan to build for Android. $ ./build/install-build-deps.sh $ mojo/tools/mojob.py gn
The “fetch mojo” command does the following:
install-build-deps.sh
installs any packages needed to build, then mojo/tools/mojob.py gn
runs gn args
and configures the build directory, out/Debug.
If the fetch command fails, you will need to delete the src directory and start over.
If you configured your set-up for Linux and now wish to build for Android, edit the .gclient
file in your root Mojo directory (the parent directory to src.) and add this line at the end of the file:
target_os = [u'android',u'linux']
Bring in Android-specific build dependencies:
$ build/install-build-deps-android.sh
Pull down all of the packages with this command:
$ gclient sync
Build Mojo for Linux by running:
$ ninja -C out/Debug -j 10
(If you are a Googler, see the section at the end of this document for faster builds.)
You can also use the mojob.py script for building. This script automatically calls ninja and sets -j to an appropriate value based on whether Goma is present. You cannot specify a target name with this script.
mojo/tools/mojob.py gn mojo/tools/mojob.py build
Run a demo:
out/Debug/mojo_shell mojo:spinning_cube
Run the tests:
mojo/tools/mojob.py test
Create a release build:
mojo/tools/mojob.py gn --release mojo/tools/mojob.py build --release mojo/tools/mojob.py test --release
To build for Android, first make sure that your checkout is configured to build for Android. After that you can use the mojob script as follows:
$ mojo/tools/mojob.py gn --android $ mojo/tools/mojob.py build --android
The result will be in out/android_Debug. If you see javac compile errors, make sure you have an up-to-date JDK
You can update your checkout like this. The order is important. You must do the git pull
first because gclient sync
is dependent on the current revision.
# Fetch changes from upstream and rebase the current branch on top $ git pull --rebase # Update all modules as directed by the DEPS file $ gclient sync
You do not need to rerun gn gen out/Debug
or mojo/tools/mojob.py gn
. Ninja will do so automatically as needed.
With git you should make all your changes in a local branch. Once your change is committed, you can delete this branch.
Create a local branch named “mywork” and make changes to it.
cd src git new-branch mywork vi ...
Commit your change locally. (this doesn't commit your change to the SVN or Git server)
git commit -a
Fix your source code formatting.
$ git cl format
Upload your change for review.
$ git cl upload
Respond to review comments.
See Contributing code for more detailed git instructions, including how to update your CL when you get review comments. There's a short tutorial that might be helpful to try before making your first change: C++ in Chromium 101.
To land a change after receiving LGTM:
$ git cl land
Don't break the build! Waterfall is here: http://build.chromium.org/p/client.mojo/waterfall
Because the dart analyzer is a bit slow, we don't run it unless the user specifically asks for it. To run the dart analyzer against the list of dart targets in the toplevel BUILD.gn file, run:
$ mojo/tools/mojob.py dartcheck
If you're a Googler, you can use Goma, a distributed compiler service for open-source projects such as Chrome and Android. The instructions below assume that Goma is installed in the default location (~/goma).
To enable Goma, update your “args.gn” file. Open the file in your editor with this command:
$ gn args out/Debug
Add this line to the end of the file:
use_goma = true
After you close the editor, the gn args
command will automatically run `gn gen out/Debug`` again.
Now you can dramatically increase the number of parallel tasks:
$ ninja -C out/Debug -j 1000
source build/android/envsetup.sh
mojo/tools/mojob.py build --android
mojo/tools/mojo_shell.py --android mojo:spinning_cube
If this fails and prints:
error: closed error: closed
... then you may not have a new enough build of Android on your device. You need L (Lollipop) or later.
adb logcat | ./tools/android_stack_parser/stack
Build the mojo target as described under link.
Run Mojo Shell:
./out/Debug/mojo_shell mojo:spinning_cube
cd out/Debug python -m SimpleHTTPServer 4444 & ./mojo_shell --origin=http://127.0.0.1:4444 --disable-cache mojo:spinning_cube