flutter/packages/flutter_tools/test/general.shard/base
Chris Bracken c219bf73fc
[tools] Make SnapshotType.platform non-nullable (#146958)
When performing artifact lookups for `Artifact.genSnapshot` for macOS desktop builds, a `TargetPlatform` is used to determine the name of the tool, typically `gen_snapshot_$TARGET_ARCH`. Formerly, this tool was always named `gen_snapshot`.

The astute reader may ask "but Chris, didn't we support TWO target architectures on iOS and therefore need TWO `gen_snapshot` binaries?" Yes, we did support both armv7 and arm64 target architectures on iOS. But no, we didn't initially have two `gen_snapshot` binaries. We did *build* two `gen_snapshots`:
   * A 32-bit x86 binary that emitted armv7 AOT code
   * A 64-bit x64 binary that emitted arm64 AOT code 

At the time, the bitness of the `gen_snapshot` tool needed to match the bitness of the target architecture, and to avoid having to do a lot of work plumbing through suffixed `gen_snapshot` names, the author of that work (who, as evidenced by this patch, is still paying for his code crimes) elected to "cleverly" lipo the two together into a single multi-architecture macOS binary still named `gen_snapshot`. See: https://github.com/flutter/engine/pull/4948

This was later remediated over the course of several patches, including:
   * https://github.com/flutter/engine/pull/10430
   * https://github.com/flutter/engine/pull/22818
   * https://github.com/flutter/flutter/pull/37445 

However, there were still cases (notably `--local-engine` workflows in the tool) where we weren't computing the target platform and thus referenced the generic `gen_snapshot` tool.
See: https://github.com/flutter/flutter/issues/38933
Fixed in: https://github.com/flutter/engine/pull/28345

The test removed in this PR, which ensured that null `SnapshotType.platform` was supported was introduced in https://github.com/flutter/flutter/pull/11924 as a followup to https://github.com/flutter/flutter/pull/11820 when the snapshotting logic was originally extracted to the `GenSnapshot` class, and most invocations still passed a null target platform.

Since there are no longer any cases where `TargetPlatform` isn't passed when looking up `Artifact.genSnapshot`, we can safely make the platform non-nullable and remove the test.

This is pre-factoring towards the removal of the generic `gen_snapshot` artifact from the macOS host binaries (which are currently unused since we never pass a null `TargetPlatform`), which is pre-factoring towards the goal of building `gen_snapshot` binaries with an arm64 host architecture, and eliminate the need to use Rosetta during iOS and macOS Flutter builds.

Part of: https://github.com/flutter/flutter/issues/101138
Umbrella issue: https://github.com/flutter/flutter/issues/103386
Umbrella issue: https://github.com/flutter/flutter/issues/69157

No new tests since the behaviour is enforced by the compiler.
2024-04-18 16:34:06 +00:00
..
analyze_size_test.dart Clean up lint ignores (#144229) 2024-02-27 23:21:03 +00:00
async_guard_test.dart fixes to anticipate next Dart linter release (#127211) 2023-05-19 21:27:24 +00:00
bot_detector_test.dart [flutter_tools] fix null check in crash reporter (#80382) 2021-04-13 14:04:25 -07:00
build_test.dart [tools] Make SnapshotType.platform non-nullable (#146958) 2024-04-18 16:34:06 +00:00
command_help_test.dart Support disabling animations in the CLI (#132239) 2023-08-23 03:35:22 +00:00
common_test.dart use throwsXxx instead of throwsA(isA<Xxx>()) (#82328) 2021-05-12 09:59:02 -07:00
context_test.dart use throwsA (#82238) 2021-05-11 10:19:01 -07:00
deferred_component_test.dart [reland] Support conditional bundling of assets based on --flavor (#139834) 2023-12-14 05:30:10 +00:00
error_handling_io_test.dart [flutter_tools] handle FileSystemException trying to delete temp directory from core_devices.dart (#140415) 2023-12-20 00:08:54 +00:00
file_system_test.dart Update copyDirectory to allow links to not be followed (#144040) 2024-02-26 16:07:22 +00:00
fingerprint_test.dart Only run pod install on the first iOS build (#108205) 2022-07-26 19:39:06 +00:00
io_test.dart Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
logger_test.dart Reduce animations further when --no-cli-animations is set. (#133598) 2023-11-16 21:05:22 +00:00
multi_root_file_system_test.dart Add MultiRootFileSystem to better support using --filesystem-root. (#82991) 2021-05-24 22:04:02 -07:00
net_test.dart Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
os_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
os_utils_test.dart Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
platform_test.dart Convert some general.shard base tests to null safety (#79985) 2021-04-08 14:55:19 -07:00
process_test.dart [flutter_tools] ensure processUtils reports exit code in ProcessExceptions (#136672) 2023-10-30 19:51:26 +00:00
signals_test.dart [flutter_tools] Run ShutdownHooks when handling signals (#134590) 2023-09-13 13:05:29 -07:00
task_queue_test.dart [flutter_tools] Replace Future.catchError() with Future.then(onError: ...) (#120637) 2023-02-15 19:03:00 +00:00
terminal_test.dart Disable single character mode in the terminal when exiting flutter_tools (#146534) 2024-04-10 23:54:42 +00:00
user_messages_test.dart Fix the message strings for xcodeMissing and xcodeIncomplete (#117922) 2023-01-04 02:48:00 +00:00