dart-sdk/tools/3xhead_flutter_hooks.sh
Jonas Termansen e8ecb3bc08 Support incompatible Dart SDK changes with patches to the Flutter Engine.
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>
2018-07-12 15:47:16 +00:00

22 lines
846 B
Bash

#!/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.
#
# After you have checked out a flutter engine with the latest framework and the
# latest dart sdk, run this script to apply workarounds to the source code. It
# may patch up the source code so the three HEADs work together correctly.
#
# Usage: src/third_party/dart/tools/3xhead_flutter_hooks.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
# Apply patches to the Flutter Engine if needed.
src/third_party/dart/tools/patches/flutter-engine/apply.sh