chore(shorebird_cli): remove --debug-linker flag from shorebird patch (#2067)
This commit is contained in:
@@ -286,8 +286,7 @@ class IosPatcher extends Patcher {
|
||||
required File releaseArtifact,
|
||||
}) async {
|
||||
final patch = File(_aotOutputPath);
|
||||
final dumpDebugInfo = argResults['debug-linker'] == true &&
|
||||
(await aotTools.isLinkDebugInfoSupported());
|
||||
final dumpDebugInfo = await aotTools.isLinkDebugInfoSupported();
|
||||
|
||||
if (!patch.existsSync()) {
|
||||
logger.err('Unable to find patch AOT file at ${patch.path}');
|
||||
@@ -312,9 +311,7 @@ class IosPatcher extends Patcher {
|
||||
final linkProgress = logger.progress('Linking AOT files');
|
||||
double? linkPercentage;
|
||||
try {
|
||||
final dumpDebugInfoDir =
|
||||
dumpDebugInfo ? Directory.systemTemp.createTempSync() : null;
|
||||
|
||||
final dumpDebugInfoDir = Directory.systemTemp.createTempSync();
|
||||
linkPercentage = await aotTools.link(
|
||||
base: releaseArtifact.path,
|
||||
patch: patch.path,
|
||||
@@ -323,10 +320,10 @@ class IosPatcher extends Patcher {
|
||||
outputPath: _vmcodeOutputPath,
|
||||
workingDirectory: buildDirectory.path,
|
||||
kernel: artifactManager.newestAppDill().path,
|
||||
dumpDebugInfoPath: dumpDebugInfoDir?.path,
|
||||
dumpDebugInfoPath: dumpDebugInfoDir.path,
|
||||
);
|
||||
|
||||
if (dumpDebugInfo && dumpDebugInfoDir != null) {
|
||||
if (dumpDebugInfo) {
|
||||
final debugInfoZip = await dumpDebugInfoDir.zipToTempFile();
|
||||
debugInfoZip.copySync(p.join('build', debugInfoFile.path));
|
||||
}
|
||||
|
||||
@@ -85,12 +85,6 @@ of the iOS app that is using this module.''',
|
||||
help: 'Codesign the application bundle (iOS only).',
|
||||
defaultsTo: true,
|
||||
)
|
||||
..addFlag(
|
||||
'debug-linker',
|
||||
defaultsTo: true,
|
||||
help: 'Collects linker diagnostic information to help troubleshoot low '
|
||||
'link percentages (iOS only.)',
|
||||
)
|
||||
..addFlag(
|
||||
'dry-run',
|
||||
abbr: 'n',
|
||||
@@ -299,9 +293,8 @@ NOTE: this is ${styleBold.wrap('not')} recommended. Asset changes cannot be incl
|
||||
'🟢 Track: ${lightCyan.wrap('Production')}',
|
||||
if (patcher.linkPercentage != null)
|
||||
'''🔗 Running ${lightCyan.wrap('${patcher.linkPercentage!.toStringAsFixed(1)}%')} on CPU''',
|
||||
if (results['debug-linker'] == true &&
|
||||
(patcher.linkPercentage != null &&
|
||||
patcher.linkPercentage! < Patcher.minLinkPercentage))
|
||||
if (patcher.linkPercentage != null &&
|
||||
patcher.linkPercentage! < Patcher.minLinkPercentage)
|
||||
'''🔍 Debug Info: ${lightCyan.wrap(patcher.debugInfoFile.path)}''',
|
||||
];
|
||||
|
||||
|
||||
@@ -128,6 +128,8 @@ void main() {
|
||||
|
||||
when(() => ios.exportOptionsPlistFromArgs(any())).thenReturn(File(''));
|
||||
|
||||
when(aotTools.isLinkDebugInfoSupported).thenAnswer((_) async => false);
|
||||
|
||||
patcher = IosPatcher(
|
||||
argResults: argResults,
|
||||
flavor: null,
|
||||
@@ -875,7 +877,6 @@ void main() {
|
||||
|
||||
group('when isLinkDebugInfoSupported', () {
|
||||
setUp(() {
|
||||
when(() => argResults['debug-linker']).thenReturn(true);
|
||||
when(
|
||||
aotTools.isLinkDebugInfoSupported,
|
||||
).thenAnswer((_) async => true);
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:shorebird_cli/src/code_push_client_wrapper.dart';
|
||||
import 'package:shorebird_cli/src/commands/patch/patch.dart';
|
||||
import 'package:shorebird_cli/src/config/config.dart';
|
||||
import 'package:shorebird_cli/src/deployment_track.dart';
|
||||
import 'package:shorebird_cli/src/executables/executables.dart';
|
||||
import 'package:shorebird_cli/src/logger.dart';
|
||||
import 'package:shorebird_cli/src/patch_diff_checker.dart';
|
||||
import 'package:shorebird_cli/src/platform/platform.dart';
|
||||
@@ -80,6 +81,7 @@ void main() {
|
||||
url: 'https://example.com/release.aab',
|
||||
);
|
||||
|
||||
late AotTools aotTools;
|
||||
late ArchiveDiffer archiveDiffer;
|
||||
late ArgResults argResults;
|
||||
late ArtifactBuilder artifactBuilder;
|
||||
@@ -99,6 +101,7 @@ void main() {
|
||||
return runScoped(
|
||||
body,
|
||||
values: {
|
||||
aotToolsRef.overrideWith(() => aotTools),
|
||||
artifactBuilderRef.overrideWith(() => artifactBuilder),
|
||||
artifactManagerRef.overrideWith(() => artifactManager),
|
||||
cacheRef.overrideWith(() => cache),
|
||||
@@ -126,6 +129,7 @@ void main() {
|
||||
tearDownAll(restoreExitFunction);
|
||||
|
||||
setUp(() {
|
||||
aotTools = MockAotTools();
|
||||
archiveDiffer = MockAndroidArchiveDiffer();
|
||||
argResults = MockArgResults();
|
||||
artifactBuilder = MockArtifactBuilder();
|
||||
@@ -139,12 +143,13 @@ void main() {
|
||||
shorebirdEnv = MockShorebirdEnv();
|
||||
shorebirdFlutter = MockShorebirdFlutter();
|
||||
|
||||
when(() => argResults['debug-linker']).thenReturn(false);
|
||||
when(() => argResults['dry-run']).thenReturn(false);
|
||||
when(() => argResults['platforms']).thenReturn(['android']);
|
||||
when(() => argResults['release-version']).thenReturn(releaseVersion);
|
||||
when(() => argResults.wasParsed(any())).thenReturn(true);
|
||||
|
||||
when(aotTools.isLinkDebugInfoSupported).thenAnswer((_) async => true);
|
||||
|
||||
when(
|
||||
() => artifactManager.downloadFile(any()),
|
||||
).thenAnswer((_) async => File(''));
|
||||
@@ -351,9 +356,11 @@ void main() {
|
||||
|
||||
group('when has link percentage', () {
|
||||
const linkPercentage = 42.1337;
|
||||
final debugInfoFile = File('debug-info.txt');
|
||||
|
||||
setUp(() {
|
||||
when(() => patcher.linkPercentage).thenReturn(linkPercentage);
|
||||
when(() => patcher.debugInfoFile).thenReturn(debugInfoFile);
|
||||
});
|
||||
|
||||
test('logs correct summary', () async {
|
||||
@@ -363,6 +370,7 @@ void main() {
|
||||
'''🕹️ Platform: ${lightCyan.wrap(patcher.releaseType.releasePlatform.name)} ${lightCyan.wrap('[arm32 (42 B)]')}''',
|
||||
'🟢 Track: ${lightCyan.wrap('Production')}',
|
||||
'''🔗 Running ${lightCyan.wrap('${patcher.linkPercentage!.toStringAsFixed(1)}%')} on CPU''',
|
||||
'''🔍 Debug Info: ${lightCyan.wrap(patcher.debugInfoFile.path)}''',
|
||||
];
|
||||
await expectLater(
|
||||
runWithOverrides(
|
||||
@@ -381,42 +389,6 @@ void main() {
|
||||
),
|
||||
).called(1);
|
||||
});
|
||||
|
||||
group('when has debug info', () {
|
||||
final debugInfoFile = File('debug-info.txt');
|
||||
|
||||
setUp(() {
|
||||
when(() => argResults['debug-linker']).thenReturn(true);
|
||||
when(() => patcher.debugInfoFile).thenReturn(debugInfoFile);
|
||||
});
|
||||
|
||||
test('logs correct summary', () async {
|
||||
final expectedSummary = [
|
||||
'''📱 App: ${lightCyan.wrap(appDisplayName)} ${lightCyan.wrap('($appId)')}''',
|
||||
'📦 Release Version: ${lightCyan.wrap(releaseVersion)}',
|
||||
'''🕹️ Platform: ${lightCyan.wrap(patcher.releaseType.releasePlatform.name)} ${lightCyan.wrap('[arm32 (42 B)]')}''',
|
||||
'🟢 Track: ${lightCyan.wrap('Production')}',
|
||||
'''🔗 Running ${lightCyan.wrap('${patcher.linkPercentage!.toStringAsFixed(1)}%')} on CPU''',
|
||||
'''🔍 Debug Info: ${lightCyan.wrap(patcher.debugInfoFile.path)}''',
|
||||
];
|
||||
await expectLater(
|
||||
runWithOverrides(
|
||||
() => command.confirmCreatePatch(
|
||||
app: appMetadata,
|
||||
releaseVersion: releaseVersion,
|
||||
patcher: patcher,
|
||||
patchArtifactBundles: patchArtifactBundles,
|
||||
),
|
||||
),
|
||||
completes,
|
||||
);
|
||||
verify(
|
||||
() => logger.info(
|
||||
any(that: contains(expectedSummary.join('\n'))),
|
||||
),
|
||||
).called(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user