Commit a8fbe02a authored by Dan Field's avatar Dan Field Committed by Jenn Magder

hide symbols from spotlight (#37217)

parent 7eb09a84
...@@ -257,9 +257,12 @@ class AOTSnapshotter { ...@@ -257,9 +257,12 @@ class AOTSnapshotter {
printError('Failed to link AOT snapshot. Linker terminated with exit code ${compileResult.exitCode}'); printError('Failed to link AOT snapshot. Linker terminated with exit code ${compileResult.exitCode}');
return linkResult; 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>[ final RunResult dsymResult = await xcode.dsymutil(<String>[
appLib, appLib,
'-o', fs.path.join(outputPath, 'App.framework.dSYM'), '-o', fs.path.join(outputPath, 'App.framework.dSYM.noindex'),
]); ]);
if (dsymResult.exitCode != 0) { if (dsymResult.exitCode != 0) {
printError('Failed to extract dSYM out of dynamic lib'); printError('Failed to extract dSYM out of dynamic lib');
......
...@@ -149,12 +149,12 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen ...@@ -149,12 +149,12 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
'-create', '-create',
'-output', fs.path.join(outputPath, 'App.framework', 'App'), '-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')); 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', 'Contents', 'Resources', 'DWARF'))..createSync(recursive: true); fs.directory(fs.path.join(outputPath, 'App.framework.dSYM.noindex', 'Contents', 'Resources', 'DWARF'))..createSync(recursive: true);
await runCheckedAsync(<String>[ await runCheckedAsync(<String>[
'lipo', 'lipo',
'-create', '-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')) ...dSYMs.map((String path) => fs.path.join(path, 'Contents', 'Resources', 'DWARF', 'App'))
]); ]);
} else { } else {
......
...@@ -210,7 +210,11 @@ void main() { ...@@ -210,7 +210,11 @@ void main() {
verify(xcode.cc(argThat(contains('-fembed-bitcode')))).called(1); verify(xcode.cc(argThat(contains('-fembed-bitcode')))).called(1);
verify(xcode.clang(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 assemblyFile = fs.file(assembly);
final File assemblyBitcodeFile = fs.file('$assembly.bitcode'); final File assemblyBitcodeFile = fs.file('$assembly.bitcode');
......
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