Flutter is a series of connected repositories. Within each repository there are files (normally named DEPS
) which determine which version of the other repositories the repository currently works with.
The three relevant repositories for this document are:
This document describes how to update the version of the Dart SDK that the Engine uses, and then update the version of the Engine that Flutter uses, so that Flutter gets the latest Dart.
The Flutter repo does not use a DEPS
file and gclient
for its dependencies. Instead, the Flutter Engine version is in flutter/bin/internal/engine.version
.
Dart is now automatically rolled into the Flutter engine repository on a regular basis. See Autorollers for more information.
The dart_roll_helper.py
script automates a large number of the Dart SDK roll steps, including:
gclient sync
The following environment variables can be set instead of being passed as arguments:
$FLUTTER_HOME
: the absolute path to the ‘flutter’ directory$ENGINE_HOME
: the absolute path to the ‘engine/src’ directory$DART_SDK_HOME
: the absolute path to the root of a Dart SDK projectThese paths are required for the tool to work.
Ensure your repository is in a clean state, as gclient sync
may delete files.
To do a roll, run the following command (if the environment variables described above are not set, --REPO-home
flags should be provided for each repository):
python $ENGINE_HOME/tools/dart/dart_roll_helper.py --create-commit $TARGET_SDK_HASH
If the script completes without errors, move on to step 10 in the next section to complete the roll.
dart_revision
in DEPS to your selected revision. Invoke gclient sync
in the src directory to ensure versions corresponding to the DEPS file are synced up.engine/src/tools/dart/create_updated_flutter_deps.py
script. In case script complains that dart dependency was removed, remove entry from flutter DEPS file manually. If the list of library source files or patch files is modified, update the file libraries.yaml and regenerate the corresponding json file.gclient sync
in the src directory to ensure versions corresponding to the DEPS file are synced up.#!/bin/bash -e set -ex cd ~/engine/src flutter/tools/gn --goma --runtime-mode=debug flutter/tools/gn --goma --runtime-mode=profile flutter/tools/gn --goma --runtime-mode=release flutter/tools/gn --goma --android --runtime-mode=debug flutter/tools/gn --goma --android --runtime-mode=profile flutter/tools/gn --goma --android --runtime-mode=release cd out find . -mindepth 1 -maxdepth 1 -type d | xargs -n 1 sh -c 'ninja -C $0 -j1000 || exit 255'
--local-engine
and --local-engine-host
options (see The flutter tool) against the Flutter Gallery app.cd $FLUTTER_HOME/examples/flutter_gallery flutter run --release --local-engine=android_release --local-engine-host=host_release flutter run --local-engine=android_debug_unopt --local-engine-host=host_debug_unopt flutter test --local-engine=host_debug --local-engine-host=host_debug
In the debug version of flutter, run flutter_gallery and do a hot-reload and hot-restart of the app and ensure they both work.
cd $FLUTTER_HOME/packages/flutter flutter test --local-engine=host_debug --local-engine-host=host_debug
See Running a Flutter app with a local engine for more information.
Make sure your path contains engine/src/third_party/dart/tools/sdks/dart-sdk/bin
, run the script flutter/ci/licenses.sh
in the src directory, update flutter/ci/licenses_golden/licenses_third_party
by copying out/license_script_output/licenses_third_party
into it. Include this change in your pull request. If any licenses changed, make sure to also update the actual LICENSE
file.
It is useful to include the output of git log --oneline <old revision>...<new revision>
(executed in the Dart SDK repository) in the commit message.
git push origin <your_roll_branch_name>
Get a code review of the pull request done, check to make sure the flutter engine build bot is green and merge the pull request.
Wait for the flutter engine build bot to build your change and go green.
Once the bot cycles green, the Autorollers will roll the engine into the flutter/flutter repo. When this happens, monitor the flutter build bots. If there is a failure, revert the Dart roll in flutter/engine, debug the problem and fix it or file a P0 issue against Dart. Please monitor the flutter benchmarks dashboard and if any regressions are noticed please file P0 issues for all regressions and revert the Dart roll. The next roll is blocked until these issues/regressions are fixed.
When you are done please update the spreadsheet at http://go/dart-flutter-rolls with the git hash of the Dart revision that was rolled into the flutter engine. This hash will be used for rolling Dart into Google's internal code repository and would be picked as a potential candidate for a dev release. Also make sure you send an email to the next person on the list and make sure the person acknowledges picking up the roll baton.