Files
sdk/tools/bots/flutter/analyze_flutter.sh
T
Alexander Thomas cb94390c63 [infra] Improve efficiency of cloning the Flutter repositories
Sometimes the flutter-analyze builder is flaky because cloning Flutter
exhausts the "short term ls-remote rate limit". "--single-branch"
reduces how many remotes need to be fetched.

Also in this CL:
* Use dart.googlesource.com.
* Apply the same changes to the flutter-frontend builder.

Error example:
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8894556948308224672/+/steps/analyze_flutter/0/stdout

Change-Id: I50df781a652602c7dd1b40b938c558b04bd3f86f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127642
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-12-09 17:50:04 +00:00

35 lines
932 B
Bash
Executable File

#!/usr/bin/env bash
# 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.
# Runs flutter's analyzer related tests with a locally built SDK.
set -e
checkout=$(pwd)
dart=$checkout/out/ReleaseX64/dart-sdk/bin/dart
sdk=$checkout/out/ReleaseX64/dart-sdk
tmpdir=$(mktemp -d)
cleanup() {
rm -rf "$tmpdir"
}
trap cleanup EXIT HUP INT QUIT TERM PIPE
cd "$tmpdir"
git clone --single-branch -vv \
https://dart.googlesource.com/external/github.com/flutter/flutter
cd flutter
bin/flutter config --no-analytics
pinned_dart_sdk=$(cat bin/cache/dart-sdk/revision)
patch=$checkout/tools/patches/flutter-engine/${pinned_dart_sdk}.flutter.patch
if [ -e "$patch" ]; then
git apply $patch
fi
bin/flutter update-packages
$dart --enable-asserts dev/bots/analyze.dart --dart-sdk $sdk