hide symbols from spotlight (#37217)
This commit is contained in:
@@ -257,9 +257,12 @@ class AOTSnapshotter {
|
||||
printError('Failed to link AOT snapshot. Linker terminated with exit code ${compileResult.exitCode}');
|
||||
return linkResult;
|
||||
}
|
||||
// See https://github.com/flutter/flutter/issues/22560
|
||||
// These have to be placed in a .noindex folder to prevent Xcode from
|
||||
// using Spotlight to find them and potentially attach the wrong ones.
|
||||
final RunResult dsymResult = await xcode.dsymutil(<String>[
|
||||
appLib,
|
||||
'-o', fs.path.join(outputPath, 'App.framework.dSYM'),
|
||||
'-o', fs.path.join(outputPath, 'App.framework.dSYM.noindex'),
|
||||
]);
|
||||
if (dsymResult.exitCode != 0) {
|
||||
printError('Failed to extract dSYM out of dynamic lib');
|
||||
|
||||
@@ -149,12 +149,12 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
|
||||
'-create',
|
||||
'-output', fs.path.join(outputPath, 'App.framework', 'App'),
|
||||
]);
|
||||
final Iterable<String> dSYMs = iosBuilds.values.map<String>((String outputDir) => fs.path.join(outputDir, 'App.framework.dSYM'));
|
||||
fs.directory(fs.path.join(outputPath, 'App.framework.dSYM', 'Contents', 'Resources', 'DWARF'))..createSync(recursive: true);
|
||||
final Iterable<String> dSYMs = iosBuilds.values.map<String>((String outputDir) => fs.path.join(outputDir, 'App.framework.dSYM.noindex'));
|
||||
fs.directory(fs.path.join(outputPath, 'App.framework.dSYM.noindex', 'Contents', 'Resources', 'DWARF'))..createSync(recursive: true);
|
||||
await runCheckedAsync(<String>[
|
||||
'lipo',
|
||||
'-create',
|
||||
'-output', fs.path.join(outputPath, 'App.framework.dSYM', 'Contents', 'Resources', 'DWARF', 'App'),
|
||||
'-output', fs.path.join(outputPath, 'App.framework.dSYM.noindex', 'Contents', 'Resources', 'DWARF', 'App'),
|
||||
...dSYMs.map((String path) => fs.path.join(path, 'Contents', 'Resources', 'DWARF', 'App'))
|
||||
]);
|
||||
} else {
|
||||
|
||||
@@ -210,7 +210,11 @@ void main() {
|
||||
|
||||
verify(xcode.cc(argThat(contains('-fembed-bitcode')))).called(1);
|
||||
verify(xcode.clang(argThat(contains('-fembed-bitcode')))).called(1);
|
||||
verify(xcode.dsymutil(any)).called(1);
|
||||
verify(xcode.dsymutil(<String>[
|
||||
'build/foo/App.framework/App',
|
||||
'-o',
|
||||
'build/foo/App.framework.dSYM.noindex',
|
||||
])).called(1);
|
||||
|
||||
final File assemblyFile = fs.file(assembly);
|
||||
final File assemblyBitcodeFile = fs.file('$assembly.bitcode');
|
||||
|
||||
Reference in New Issue
Block a user