Commit 8709813a authored by Stevie Strickland's avatar Stevie Strickland Committed by Martin Kustermann

Remove unused --packages argument to gen_snapshot. (#28334)

This command line argument has already been removed in the main
Dart repository, so building flutter with the latest dart fails.

This time, also update the tests to avoid the checks for a package
path on snapshot generation.
parent 1e5992a3
...@@ -46,13 +46,11 @@ class GenSnapshot { ...@@ -46,13 +46,11 @@ class GenSnapshot {
Future<int> run({ Future<int> run({
@required SnapshotType snapshotType, @required SnapshotType snapshotType,
@required String packagesPath,
IOSArch iosArch, IOSArch iosArch,
Iterable<String> additionalArgs = const <String>[], Iterable<String> additionalArgs = const <String>[],
}) { }) {
final List<String> args = <String>[ final List<String> args = <String>[
'--causal_async_stacks', '--causal_async_stacks',
'--packages=$packagesPath',
]..addAll(additionalArgs); ]..addAll(additionalArgs);
final String snapshotterPath = getSnapshotterPath(snapshotType); final String snapshotterPath = getSnapshotterPath(snapshotType);
...@@ -193,7 +191,6 @@ class AOTSnapshotter { ...@@ -193,7 +191,6 @@ class AOTSnapshotter {
final SnapshotType snapshotType = SnapshotType(platform, buildMode); final SnapshotType snapshotType = SnapshotType(platform, buildMode);
final int genSnapshotExitCode = await genSnapshot.run( final int genSnapshotExitCode = await genSnapshot.run(
snapshotType: snapshotType, snapshotType: snapshotType,
packagesPath: packageMap.packagesPath,
additionalArgs: genSnapshotArgs, additionalArgs: genSnapshotArgs,
iosArch: iosArch, iosArch: iosArch,
); );
...@@ -537,7 +534,6 @@ class JITSnapshotter { ...@@ -537,7 +534,6 @@ class JITSnapshotter {
final SnapshotType snapshotType = SnapshotType(platform, buildMode); final SnapshotType snapshotType = SnapshotType(platform, buildMode);
final int genSnapshotExitCode = await genSnapshot.run( final int genSnapshotExitCode = await genSnapshot.run(
snapshotType: snapshotType, snapshotType: snapshotType,
packagesPath: packagesPath,
additionalArgs: genSnapshotArgs, additionalArgs: genSnapshotArgs,
); );
if (genSnapshotExitCode != 0) { if (genSnapshotExitCode != 0) {
......
...@@ -35,7 +35,6 @@ class _FakeGenSnapshot implements GenSnapshot { ...@@ -35,7 +35,6 @@ class _FakeGenSnapshot implements GenSnapshot {
Map<String, String> outputs = <String, String>{}; Map<String, String> outputs = <String, String>{};
int _callCount = 0; int _callCount = 0;
SnapshotType _snapshotType; SnapshotType _snapshotType;
String _packagesPath;
String _depfilePath; String _depfilePath;
List<String> _additionalArgs; List<String> _additionalArgs;
...@@ -43,8 +42,6 @@ class _FakeGenSnapshot implements GenSnapshot { ...@@ -43,8 +42,6 @@ class _FakeGenSnapshot implements GenSnapshot {
SnapshotType get snapshotType => _snapshotType; SnapshotType get snapshotType => _snapshotType;
String get packagesPath => _packagesPath;
String get depfilePath => _depfilePath; String get depfilePath => _depfilePath;
List<String> get additionalArgs => _additionalArgs; List<String> get additionalArgs => _additionalArgs;
...@@ -52,14 +49,12 @@ class _FakeGenSnapshot implements GenSnapshot { ...@@ -52,14 +49,12 @@ class _FakeGenSnapshot implements GenSnapshot {
@override @override
Future<int> run({ Future<int> run({
SnapshotType snapshotType, SnapshotType snapshotType,
String packagesPath,
String depfilePath, String depfilePath,
IOSArch iosArch, IOSArch iosArch,
Iterable<String> additionalArgs = const <String>[], Iterable<String> additionalArgs = const <String>[],
}) async { }) async {
_callCount += 1; _callCount += 1;
_snapshotType = snapshotType; _snapshotType = snapshotType;
_packagesPath = packagesPath;
_depfilePath = depfilePath; _depfilePath = depfilePath;
_additionalArgs = additionalArgs.toList(); _additionalArgs = additionalArgs.toList();
...@@ -190,7 +185,6 @@ void main() { ...@@ -190,7 +185,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.ios); expect(genSnapshot.snapshotType.platform, TargetPlatform.ios);
expect(genSnapshot.snapshotType.mode, BuildMode.profile); expect(genSnapshot.snapshotType.mode, BuildMode.profile);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-aot-assembly', '--snapshot_kind=app-aot-assembly',
...@@ -229,7 +223,6 @@ void main() { ...@@ -229,7 +223,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.ios); expect(genSnapshot.snapshotType.platform, TargetPlatform.ios);
expect(genSnapshot.snapshotType.mode, BuildMode.profile); expect(genSnapshot.snapshotType.mode, BuildMode.profile);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-aot-assembly', '--snapshot_kind=app-aot-assembly',
...@@ -268,7 +261,6 @@ void main() { ...@@ -268,7 +261,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
expect(genSnapshot.snapshotType.mode, BuildMode.profile); expect(genSnapshot.snapshotType.mode, BuildMode.profile);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-aot-blobs', '--snapshot_kind=app-aot-blobs',
...@@ -312,7 +304,6 @@ void main() { ...@@ -312,7 +304,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64);
expect(genSnapshot.snapshotType.mode, BuildMode.profile); expect(genSnapshot.snapshotType.mode, BuildMode.profile);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-aot-blobs', '--snapshot_kind=app-aot-blobs',
...@@ -352,7 +343,6 @@ void main() { ...@@ -352,7 +343,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.ios); expect(genSnapshot.snapshotType.platform, TargetPlatform.ios);
expect(genSnapshot.snapshotType.mode, BuildMode.release); expect(genSnapshot.snapshotType.mode, BuildMode.release);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-aot-assembly', '--snapshot_kind=app-aot-assembly',
...@@ -391,7 +381,6 @@ void main() { ...@@ -391,7 +381,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.ios); expect(genSnapshot.snapshotType.platform, TargetPlatform.ios);
expect(genSnapshot.snapshotType.mode, BuildMode.release); expect(genSnapshot.snapshotType.mode, BuildMode.release);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-aot-assembly', '--snapshot_kind=app-aot-assembly',
...@@ -448,7 +437,6 @@ void main() { ...@@ -448,7 +437,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
expect(genSnapshot.snapshotType.mode, BuildMode.release); expect(genSnapshot.snapshotType.mode, BuildMode.release);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-aot-blobs', '--snapshot_kind=app-aot-blobs',
...@@ -492,7 +480,6 @@ void main() { ...@@ -492,7 +480,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64);
expect(genSnapshot.snapshotType.mode, BuildMode.release); expect(genSnapshot.snapshotType.mode, BuildMode.release);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-aot-blobs', '--snapshot_kind=app-aot-blobs',
...@@ -581,7 +568,6 @@ void main() { ...@@ -581,7 +568,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
expect(genSnapshot.snapshotType.mode, BuildMode.debug); expect(genSnapshot.snapshotType.mode, BuildMode.debug);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--enable_asserts', '--enable_asserts',
...@@ -622,7 +608,6 @@ void main() { ...@@ -622,7 +608,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64);
expect(genSnapshot.snapshotType.mode, BuildMode.debug); expect(genSnapshot.snapshotType.mode, BuildMode.debug);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--enable_asserts', '--enable_asserts',
...@@ -674,7 +659,6 @@ void main() { ...@@ -674,7 +659,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
expect(genSnapshot.snapshotType.mode, BuildMode.profile); expect(genSnapshot.snapshotType.mode, BuildMode.profile);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-jit', '--snapshot_kind=app-jit',
...@@ -714,7 +698,6 @@ void main() { ...@@ -714,7 +698,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64);
expect(genSnapshot.snapshotType.mode, BuildMode.profile); expect(genSnapshot.snapshotType.mode, BuildMode.profile);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-jit', '--snapshot_kind=app-jit',
...@@ -765,7 +748,6 @@ void main() { ...@@ -765,7 +748,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
expect(genSnapshot.snapshotType.mode, BuildMode.release); expect(genSnapshot.snapshotType.mode, BuildMode.release);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-jit', '--snapshot_kind=app-jit',
...@@ -805,7 +787,6 @@ void main() { ...@@ -805,7 +787,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64);
expect(genSnapshot.snapshotType.mode, BuildMode.release); expect(genSnapshot.snapshotType.mode, BuildMode.release);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-jit', '--snapshot_kind=app-jit',
...@@ -860,7 +841,6 @@ void main() { ...@@ -860,7 +841,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
expect(genSnapshot.snapshotType.mode, BuildMode.release); expect(genSnapshot.snapshotType.mode, BuildMode.release);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-jit', '--snapshot_kind=app-jit',
...@@ -917,7 +897,6 @@ void main() { ...@@ -917,7 +897,6 @@ void main() {
expect(genSnapshot.callCount, 1); expect(genSnapshot.callCount, 1);
expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm); expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
expect(genSnapshot.snapshotType.mode, BuildMode.release); expect(genSnapshot.snapshotType.mode, BuildMode.release);
expect(genSnapshot.packagesPath, '.packages');
expect(genSnapshot.additionalArgs, <String>[ expect(genSnapshot.additionalArgs, <String>[
'--deterministic', '--deterministic',
'--snapshot_kind=app-jit', '--snapshot_kind=app-jit',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment