e8ecb3bc08
The Dart SDK may change incompatibly and require a corresponding update to the Flutter Engine when Flutter Enginer rolls its Dart SDK. The flutter targets on Golem uses a 3-way HEAD of the Dart SDK, the Flutter Engine, and the Flutter Framework, meaning that it needs to apply the corresponding update to the Flutter Engine immediately. Otherwise the Flutter targets will be broken and not successfully run benchmarks until the next Flutter roll. This change lets the Dart SDK make incompatible changes that affects the Flutter Engine by checking in the corresponding patch into the Dart SDK along with the incompatible change. The build step will determine what the latest roll is by looking up which Dart SDK Hash the Flutter Engine has pinned. If a patch exists for that hash, then that patch is applied to the Flutter Engine. For instance, if the Flutter Engine commit ab12 has pinned the Dart SDK commit cd34, then it the patch tools/patches/flutter-engine/cd34.patch is applied. Once the Flutter Engine rolls its Dart Engine, usually by applying an equivalent patch, the roll commit will start refering to an non-existent patch and the HEADs will be built together pristine again. Finally cd32.patch can be removed from new versions of the Dart SDK. The tools/patches/flutter-engine/apply.sh script is applies such patches in 3-way HEAD builds. The create.sh script is meant to be used by developers when making incompatible changes to the Dart SDK that affects the Flutter Engine. The top level tools/3xhead_flutter_hooks.sh script is meant to be used by the CI as forward compatibility if additional hooks are added in the future. Change-Id: Ibf8e125b26dac319ba1c5302c003d7668155336a Reviewed-on: https://dart-review.googlesource.com/64684 Reviewed-by: Martin Kustermann <kustermann@google.com>
31 lines
1.3 KiB
Bash
Executable File
31 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
#
|
|
# This script produces a patch to the Flutter Engine from the local uncommitted
|
|
# changes in the current engine checkout. It is named after the Dart SDK
|
|
# revision the engine is currently pinned to. It's meant to be consumed by the
|
|
# apply.sh script next to this script. Any existing patches are removed, as they
|
|
# are assumed to not be relevant anymore. If there are no uncommited changes in
|
|
# the local engine checkout, then no patch is produced.
|
|
#
|
|
# Usage: src/third_party/dart/tools/patches/flutter-engine/create.sh
|
|
# (run inside the root of a flutter engine checkout)
|
|
|
|
set -e
|
|
if [ ! -e src/third_party/dart ]; then
|
|
echo "$0: error: "\
|
|
"This script must be run from the root of a flutter engine checkout" >&2
|
|
exit 1
|
|
fi
|
|
pinned_dart_sdk=$(grep -E "'dart_revision':.*" src/flutter/DEPS |
|
|
sed -E "s/.*'([^']*)',/\1/")
|
|
patch=src/third_party/dart/tools/patches/flutter-engine/$pinned_dart_sdk.patch
|
|
rm -f src/third_party/dart/tools/patches/flutter-engine/*.patch
|
|
(cd src/flutter && git diff) > $patch
|
|
if [ ! -s $patch ]; then
|
|
rm $patch
|
|
fi
|