-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
As part of work on release automation, we added a script called last_engine_commit.sh:
flutter/bin/internal/last_engine_commit.sh
Lines 6 to 29 in edf4758
| # Based on the current repository state, writes on stdout the last commit in the | |
| # git tree that edited either `DEPS` or any file in the `engine/` sub-folder, | |
| # which is used to ensure `bin/internal/engine.version` is set correctly. | |
| # | |
| # ---------------------------------- NOTE ---------------------------------- # | |
| # | |
| # Please keep the logic in this file consistent with the logic in the | |
| # `last_engine_commit.ps1` script in the same directory to ensure that Flutter | |
| # continues to work across all platforms! | |
| # | |
| # https://github.com/flutter/flutter/blob/main/docs/tool/Engine-artifacts.md. | |
| # | |
| # Want to test this script? | |
| # $ cd dev/tools | |
| # $ dart test test/last_engine_commit_test.dart | |
| # | |
| # -------------------------------------------------------------------------- # | |
| set -e | |
| FLUTTER_ROOT="$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")" | |
| git log -1 --pretty=format:%H -- "$(git rev-parse --show-toplevel)/DEPS" "$(git rev-parse --show-toplevel)/engine" |
The tl;dr is that we have a few validation steps (one in recipes, one in presubmit) that makes sure the contents of bin/internal/engine.version represent the last commit that "touched" the engine, if any. That "if any" is doing work, because it seems like, up until now, we've always had at least one engine cherrypick (yay Impeller on Android launch!). Now that (for 3.35) we don't have one, we'll be blocked from making a release because, technically, there have been no changes to the engine, and the last engine SHA is pre-branch, which is not valid (it's not a release build).
The script should be updated to reflect:
- If the engine has been changed since the branch cut, use that SHA
- Otherwise use the first SHA appears on the branch (i.e. that one that sets
bin/internal/release-candidate-branch.version)