commit | d0a90874515dbe4d1bb4b057c9276afc5a191d4d | [log] [tgz] |
---|---|---|
author | btolsch <btolsch@chromium.org> | Mon Jun 24 14:21:47 2019 -0700 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Jun 24 22:44:58 2019 +0000 |
tree | a5e74bd22347e5424c94f8b81424710b2a442227 | |
parent | ec3536128760270c7f99610e84507a4a8fa7692d [diff] |
Change chromium bots to trigger on chromium tree Originally, we planned to have the chromium fyi bots only run for each new openscreen commit, but against chromium HEAD. The checked-in gclient config for the chromium recipe isn't intended for that though, as it was copied from v8's config. This results in the bots not finding a valid repo URL when they are triggered. I believe the two ways to fix this are: 1. Trigger on the chromium tree instead, so the bot is technically getting a chromium trigger, but then openscreen is set to HEAD by the current config in //s/s/r/chromium/gclient_config.py. 2. Change the config in //s/s/r/chromium/gclient_config.py to rewrite the gclient solution for the current trigger. It's unclear how to do this at the moment. This change takes approach 1 since, in addition to being easier, it has the added benefit of tracking our compile status in chromium without openscreen even changing. Bug: 951615 Change-Id: Ib34ffdf0ffb1f8abd5205b53348c93d8ba066194 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1674390 Reviewed-by: Max Yakimakha <yakimakha@chromium.org> Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
The openscreen library implements the Open Screen Protocol. Information about the protocol and its specification can be found on GitHub.
openscreen library dependencies are managed using gclient
, from the depot_tools repo.
To get gclient, run the following command in your terminal:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
Then add the depot_tools
folder to your PATH
environment variable.
Note that openscreen does not use other features of depot_tools
like repo
or drover
. However, some git-cl
functions do work, like git cl try
, git cl lint
and git cl upload.
From the parent directory of where you want the openscreen checkout, configure gclient
and check out openscreen with the following commands:
gclient config https://chromium.googlesource.com/openscreen gclient sync
Now, you should have openscreen/
repository checked out, with all dependencies checked out to their appropriate revisions.
To update your local checkout from the openscreen master repository, just run
git pull
gclient sync
This will rebase any local commits on the remote top-of-tree, and update any dependencies that have changed.
The following tools are required for building:
gn
clang-format
ninja
(GitHub releases)clang-format
is only used for presubmit checks and optionally used on generated code from the CDDL tool. A copy of clang-format
can be downloaded to the repository root by running ./tools/install-build-tools.sh
.
gn
will be installed in //buildtools/<platform>/
automatically by DEPS.
You also need to ensure that you have the compiler toolchain dependencies. Currently, both Linux and Mac OS X build configurations use clang by default.
On Linux, the build will automatically download the Clang compiler from the Google storage cache, the same way that Chromium does it.
Ensure that libstdc++ 8 is installed, as clang depends on the system instance of it. On Debian flavors, you can run:
sudo apt-get install libstdc++-8-dev
On Mac OS X, the build will use the clang provided by XCode, which must be installed.
Setting the gn
argument “is_gcc=true” on Linux enables building using gcc instead. Note that g++ must be installed.
gn gen out/Default --args="is_gcc=true"
Setting the gn
argument “is_debug=true” enables debug build.
gn gen out/Default --args="is_debug=true"
To install debug information for libstdc++ 8 on Debian flavors, you can run:
sudo apt-get install libstdc++6-8-dbg
Running gn args
opens an editor that allows to create a list of arguments passed to every invocation of gn gen
.
gn args out/Default
The following commands will build a sample executable and run it.
mkdir out/Default gn gen out/Default # Creates the build directory and necessary ninja files ninja -C out/Default demo # Builds the executable with ninja ./out/Default/demo # Runs the executable
The -C
argument to ninja
works just like it does for GNU Make: it specifies the working directory for the build. So the same could be done as follows:
./gn gen out/Default cd out/Default ninja ./demo
After editing a file, only ninja
needs to be rerun, not gn
. If you have edited a BUILD.gn
file, ninja
will re-run gn
for you.
For details on running demo
, see its README.md.
Running ninja -C out/Default gn_all
will build all non-test targets in the repository.
gn ls --type=executable out/Default/
will list all of the executable targets that can be built.
If you want to customize the build further, you can run gn args out/Default
to pull up an editor for build flags. gn args --list out/Default
prints all of the build flags available.
ninja -C out/Default unittests ./out/Default/unittests
openscreen uses LUCI builders to monitor the build and test health of the library. Current builders include:
Name | Arch | OS | Toolchain | Build | Notes |
---|---|---|---|---|---|
linux64_debug | x86-64 | Linux Ubuntu 17.04 | clang | debug | ASAN enabled |
linux64_debug_gcc | x86-64 | Linux Ubuntu 17.04 | gcc | debug | ASAN enabled |
mac_debug | x86-64 | Mac OS X/Xcode | clang | debug | |
chromium_linux64_debug | x86-64 | Linux Ubuntu 17.04 | clang | debug | built within chromium |
chromium_mac_debug | x86-64 | Mac OS X/Xcode | clang | debug | built within chromium |
You can run a patch through the try job queue (which tests it on all builders) using git cl try
, or through Gerrit (details below).
openscreen library code should follow the Open Screen Library Style Guide.
openscreen uses Chromium Gerrit for patch management and code review (for better or worse).
The following sections contain some tips about dealing with Gerrit for code reviews, specifically when pushing patches for review, getting patches reviewed, and committing patches.
The git cl
tool handles details of interacting with Gerrit (the Chromium code review tool) and is recommended for pushing patches for review. Once you have committed changes locally, simply run:
git cl upload
This will run our PRESUBMIT.sh
script to check style, and if it passes, a new code review will be posted on chromium-review.googlesource.com
.
If you make additional commits to your local branch, then running git cl upload
again in the same branch will merge those commits into the ongoing review as a new patchset.
It's simplest to create a local git branch for each patch you want reviewed separately. git cl
keeps track of review status separately for each local branch.
If conflicting commits have been landed in the repository for a patch in review, Gerrit will flag the patch as having a merge conflict. In that case, use the instructions above to rebase your commits on top-of-tree and upload a new patchset with the merge conflicts resolved.
Clicking the CQ DRY RUN
button (also, confusingly, labeled COMMIT QUEUE +1
) will run the current patchset through all LUCI builders and report the results. It is always a good idea get a green tryjob on a patch before sending it for review to avoid extra back-and-forth.
You can also run git cl try
from the commandline to submit a tryjob.
Send your patch to one or more committers in the COMMITTERS file for code review. All patches must receive at least one LGTM by a committer before it can be submitted.
After your patch has received one or more LGTM commit it by clicking the SUBMIT
button (or, confusingly, COMMIT QUEUE +2
) in Gerrit. This will run your patch through the builders again before committing to the main openscreen repository.
Currently, openscreen is also built in Chromium, with some build differences. The files that are built are determined by the following build variables:
build_with_chromium
: true
when building as part of a Chromium checkout, false
otherwise. Set by //build_overrides/build.gni
.use_mdns_responder
: true
by default, false
when build_with_chromium
is true
. Controls whether the default mDNSResponder mDNS implementation is used. Set by //build/config/services.gni
.use_chromium_quic
: true
by default, false
when build_with_chromium
is true
. Controls whether the Chromium QUIC implementation clone is used. Set by //build/config/services.gni
.