From 45099ec7b26ea457fe0291d6cca561c44f588377 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 7 Apr 2023 10:41:28 -0700 Subject: [PATCH] chore(artifact_proxy): add shorebirdtech/engine@7aa5c44764e to mappings (#268) --- packages/artifact_proxy/lib/config.dart | 85 +++++++--------- scripts/bootstrap.sh | 6 +- scripts/build_engine.sh | 127 ------------------------ 3 files changed, 38 insertions(+), 180 deletions(-) delete mode 100755 scripts/build_engine.sh diff --git a/packages/artifact_proxy/lib/config.dart b/packages/artifact_proxy/lib/config.dart index 0928e8a54..7f1a7ddcd 100644 --- a/packages/artifact_proxy/lib/config.dart +++ b/packages/artifact_proxy/lib/config.dart @@ -8,62 +8,51 @@ const config = ProxyConfig( }, ); +// On the assumption artifact layouts don't change very often for Flutter. +// ignore: camel_case_types +class _EngineMapping3_7 extends EngineMapping { + const _EngineMapping3_7({ + required super.flutterEngineRevision, + }) : super( + shorebirdStorageBucket: 'download.shorebird.dev', + shorebirdArtifactOverrides: const { + // artifacts.zip + r'flutter_infra_release/flutter/$engine/android-arm-64-release/artifacts.zip', + r'flutter_infra_release/flutter/$engine/android-arm-release/artifacts.zip', + r'flutter_infra_release/flutter/$engine/android-x64-release/artifacts.zip', + + // embedding release + r'download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-$engine/flutter_embedding_release-1.0.0-$engine.pom', + r'download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-$engine/flutter_embedding_release-1.0.0-$engine.jar', + + // arm64_v8a release + r'download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-$engine/arm64_v8a_release-1.0.0-$engine.pom', + r'download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-$engine/arm64_v8a_release-1.0.0-$engine.jar', + + // armeabi_v7a release + r'download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-$engine/armeabi_v7a_release-1.0.0-$engine.pom', + r'download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-$engine/armeabi_v7a_release-1.0.0-$engine.jar', + + // x86_64 release + r'download.flutter.io/io/flutter/x86_64_release/1.0.0-$engine/x86_64_release-1.0.0-$engine.pom', + r'download.flutter.io/io/flutter/x86_64_release/1.0.0-$engine/x86_64_release-1.0.0-$engine.jar', + }, + ); +} + /// Flutter 3.7.10 const flutter_3_7_10 = { - '978a56f2d97f9ce24a2b6bc22c9bbceaaba0343c': EngineMapping( + '978a56f2d97f9ce24a2b6bc22c9bbceaaba0343c': _EngineMapping3_7( + flutterEngineRevision: 'ec975089acb540fc60752606a3d3ba809dd1528b', + ), + '7aa5c44764e10722d188ece75819f7d10f5269a3': _EngineMapping3_7( flutterEngineRevision: 'ec975089acb540fc60752606a3d3ba809dd1528b', - shorebirdStorageBucket: 'download.shorebird.dev', - shorebirdArtifactOverrides: { - // artifacts.zip - r'flutter_infra_release/flutter/$engine/android-arm-64-release/artifacts.zip', - r'flutter_infra_release/flutter/$engine/android-arm-release/artifacts.zip', - r'flutter_infra_release/flutter/$engine/android-x64-release/artifacts.zip', - - // embedding release - r'download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-$engine/flutter_embedding_release-1.0.0-$engine.pom', - r'download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-$engine/flutter_embedding_release-1.0.0-$engine.jar', - - // arm64_v8a release - r'download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-$engine/arm64_v8a_release-1.0.0-$engine.pom', - r'download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-$engine/arm64_v8a_release-1.0.0-$engine.jar', - - // armeabi_v7a release - r'download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-$engine/armeabi_v7a_release-1.0.0-$engine.pom', - r'download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-$engine/armeabi_v7a_release-1.0.0-$engine.jar', - - // x86_64 release - r'download.flutter.io/io/flutter/x86_64_release/1.0.0-$engine/x86_64_release-1.0.0-$engine.pom', - r'download.flutter.io/io/flutter/x86_64_release/1.0.0-$engine/x86_64_release-1.0.0-$engine.jar', - }, ), }; /// Flutter 3.7.8 const flutter_3_7_8 = { - '79f4c5321a581f580a9bda01ec372cbf4a53aa53': EngineMapping( + '79f4c5321a581f580a9bda01ec372cbf4a53aa53': _EngineMapping3_7( flutterEngineRevision: '9aa7816315095c86410527932918c718cb35e7d6', - shorebirdStorageBucket: 'download.shorebird.dev', - shorebirdArtifactOverrides: { - // artifacts.zip - r'flutter_infra_release/flutter/$engine/android-arm-64-release/artifacts.zip', - r'flutter_infra_release/flutter/$engine/android-arm-release/artifacts.zip', - r'flutter_infra_release/flutter/$engine/android-x64-release/artifacts.zip', - - // embedding release - r'download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-$engine/flutter_embedding_release-1.0.0-$engine.pom', - r'download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-$engine/flutter_embedding_release-1.0.0-$engine.jar', - - // arm64_v8a release - r'download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-$engine/arm64_v8a_release-1.0.0-$engine.pom', - r'download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-$engine/arm64_v8a_release-1.0.0-$engine.jar', - - // armeabi_v7a release - r'download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-$engine/armeabi_v7a_release-1.0.0-$engine.pom', - r'download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-$engine/armeabi_v7a_release-1.0.0-$engine.jar', - - // x86_64 release - r'download.flutter.io/io/flutter/x86_64_release/1.0.0-$engine/x86_64_release-1.0.0-$engine.pom', - r'download.flutter.io/io/flutter/x86_64_release/1.0.0-$engine/x86_64_release-1.0.0-$engine.jar', - }, ), }; diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 1e47d1377..0bbedb4e2 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -8,8 +8,4 @@ # Fetch dart dependencies dart pub global activate very_good_cli very_good --analytics=false -very_good packages get -r ./packages - -# And the rust side -cd updater -cargo check \ No newline at end of file +very_good packages get -r ./packages \ No newline at end of file diff --git a/scripts/build_engine.sh b/scripts/build_engine.sh deleted file mode 100755 index 9988c58cf..000000000 --- a/scripts/build_engine.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/sh -e - -# Given a path to a Flutter engine, generate a shorebird version of it. -# This is done by removing all the files that are not needed for the -# Flutter engine to run. -# Currently, only the android arm64 release version of the engine is supported. -# -# Usage: -# ./build_engine - -# The path to the shorebird checkout. -SHOREBIRD_PATH=$(dirname $(dirname $(realpath $0))) - -# The path to the Flutter engine. -ENGINE_PATH=$(realpath $1) - -# The path where the shorebird engine will be generated. -OUTPUT_PATH=$2 - -if [[ "$OUTPUT_PATH" = /* ]] -then - : # Absolute path -else - : - echo "Output path must be absolute" - exit 1 -fi - -echo "Building engine from $ENGINE_PATH to $OUTPUT_PATH" - -# Assume cargo-ndk is already installed: -# cargo install cargo-ndk - -# Assume the toolchains are already installed -# rustup target add \ -# aarch64-linux-android \ -# armv7-linux-androideabi \ -# x86_64-linux-android \ -# i686-linux-android - -# Build the Rust library. -cd $SHOREBIRD_PATH/updater/library -# Build both the arm64 and armv7 versions of the library. -cargo ndk \ - --target aarch64-linux-android \ - --target armv7-linux-androideabi \ - build --release - -# We assume the engine has symlinks set up for now (we should not rely on this). - -# Build the patch tool. -cd $SHOREBIRD_PATH/updater/patch -cargo build --release - -# Build the engine -cd $ENGINE_PATH - -# Build the engine in release mode for android arm64. -./src/flutter/tools/gn --android --android-cpu=arm64 --runtime-mode=release --no-goma -ninja -C ./src/out/android_release_arm64 - -# Build the the host_release output. -./src/flutter/tools/gn --runtime-mode=release --no-goma -ninja -C ./src/out/host_release - -# List of all files to keep. -KEEP_FILES=( - "out/android_release_arm64/libflutter.so" - "out/android_release_arm64/arm64_v8a_release.pom" - "out/android_release_arm64/flutter_embedding_release.jar" - "out/android_release_arm64/flutter_patched_sdk/platform_strong.dill" - "out/android_release_arm64/clang_arm64/impellerc" - "out/android_release_arm64/clang_arm64/gen_snapshot_arm64" - "out/android_release_arm64/clang_arm64/gen_snapshot" - "out/android_release_arm64/arm64_v8a_release.jar" - "out/android_release_arm64/flutter_embedding_release.pom" - "out/android_release_arm64/flutter_embedding_release.maven-metadata.xml" - "out/android_release_arm64/flutter_embedding_release-sources.jar" - "out/android_release_arm64/arm64_v8a_release.maven-metadata.xml" - "out/host_release/gen/const_finder.dart.snapshot" - "out/host_release/font-subset" - "flutter/prebuilts/macos-x64/dart-sdk/LICENSE" - "flutter/prebuilts/macos-x64/dart-sdk/bin/dartaotruntime" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/analysis_server.dart.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/kernel-service.dart.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/gen_kernel.dart.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/dartdevc.dart.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/dart2js.dart.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/dartdev.dart.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/kernel_worker.dart.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/dartdev.dill" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/frontend_server.dart.snapshot" - # "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/dart2wasm_product.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/snapshots/dds.dart.snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/bin/dart" - "flutter/prebuilts/macos-x64/dart-sdk/bin/utils/gen_snapshot" - "flutter/prebuilts/macos-x64/dart-sdk/README" - "flutter/prebuilts/macos-x64/dart-sdk/version" - "flutter/prebuilts/macos-x64/dart-sdk/revision" -) - -cd - - -TEMP_DIR=`mktemp -d` - -# Copy all files to temp directory. -for file in "${KEEP_FILES[@]}" -do - mkdir -p $TEMP_DIR/$(dirname $file) - cp -r $ENGINE_PATH/src/$file $TEMP_DIR/$file -done - -cp $SHOREBIRD_PATH/updater/target/release/patch $TEMP_DIR/patch - -cd $TEMP_DIR - -# Zip the output. -zip -r -X engine.zip * - -cd - - -# Create the output directory. -mkdir -p $OUTPUT_PATH -cp $TEMP_DIR/engine.zip $OUTPUT_PATH/engine.zip - -# Clean up. -rm -rf $TEMP_DIR