Remove Finder extended attributes in build target before code signing iOS frameworks (#123896)

Remove Finder extended attributes in build target before code signing iOS frameworks
This commit is contained in:
Jenn Magder
2023-04-13 19:26:15 -07:00
committed by GitHub
parent 3bc07c1cef
commit 44fe615c5c
3 changed files with 81 additions and 18 deletions

View File

@@ -104,6 +104,13 @@ void main() {
'-o',
appFrameworkPath,
]),
FakeCommand(command: <String>[
'xattr',
'-r',
'-d',
'com.apple.FinderInfo',
appFrameworkPath,
]),
FakeCommand(command: <String>[
'codesign',
'--force',
@@ -141,6 +148,13 @@ void main() {
'-o',
appFrameworkPath,
]),
FakeCommand(command: <String>[
'xattr',
'-r',
'-d',
'com.apple.FinderInfo',
appFrameworkPath,
]),
FakeCommand(command: <String>[
'codesign',
'--force',
@@ -195,7 +209,14 @@ void main() {
final Directory frameworkDirectory = environment.outputDir.childDirectory('App.framework');
final File frameworkDirectoryBinary = frameworkDirectory.childFile('App');
processManager.addCommand(
processManager.addCommands(<FakeCommand>[
FakeCommand(command: <String>[
'xattr',
'-r',
'-d',
'com.apple.FinderInfo',
frameworkDirectoryBinary.path,
]),
FakeCommand(command: <String>[
'codesign',
'--force',
@@ -204,7 +225,7 @@ void main() {
'--timestamp=none',
frameworkDirectoryBinary.path,
]),
);
]);
await const DebugIosApplicationBundle().build(environment);
expect(processManager, hasNoRemainingExpectations);
@@ -267,6 +288,13 @@ void main() {
'--include=/',
'--include=/./shader_lib',
]),
FakeCommand(command: <String>[
'xattr',
'-r',
'-d',
'com.apple.FinderInfo',
frameworkDirectoryBinary.path,
]),
FakeCommand(command: <String>[
'codesign',
'--force',
@@ -323,7 +351,14 @@ void main() {
final Directory frameworkDirectory = environment.outputDir.childDirectory('App.framework');
final File frameworkDirectoryBinary = frameworkDirectory.childFile('App');
processManager.addCommand(
processManager.addCommands(<FakeCommand>[
FakeCommand(command: <String>[
'xattr',
'-r',
'-d',
'com.apple.FinderInfo',
frameworkDirectoryBinary.path,
]),
FakeCommand(command: <String>[
'codesign',
'--force',
@@ -331,7 +366,7 @@ void main() {
'ABC123',
frameworkDirectoryBinary.path,
]),
);
]);
await const ReleaseIosApplicationBundle().build(environment);
expect(processManager, hasNoRemainingExpectations);
@@ -371,7 +406,14 @@ void main() {
final Directory frameworkDirectory = environment.outputDir.childDirectory('App.framework');
final File frameworkDirectoryBinary = frameworkDirectory.childFile('App');
processManager.addCommand(
processManager.addCommands(<FakeCommand>[
FakeCommand(command: <String>[
'xattr',
'-r',
'-d',
'com.apple.FinderInfo',
frameworkDirectoryBinary.path,
]),
FakeCommand(command: <String>[
'codesign',
'--force',
@@ -379,7 +421,7 @@ void main() {
'-',
frameworkDirectoryBinary.path,
]),
);
]);
await const ReleaseIosApplicationBundle().build(environment);
expect(usage.events, contains(const TestUsageEvent('assemble', 'ios-archive', label: 'success')));
@@ -466,6 +508,7 @@ void main() {
late FakeCommand copyPhysicalFrameworkCommand;
late FakeCommand lipoCommandNonFatResult;
late FakeCommand lipoVerifyArm64Command;
late FakeCommand xattrCommand;
late FakeCommand adHocCodesignCommand;
setUp(() {
@@ -495,6 +538,14 @@ void main() {
'arm64',
]);
xattrCommand = FakeCommand(command: <String>[
'xattr',
'-r',
'-d',
'com.apple.FinderInfo',
binary.path,
]);
adHocCodesignCommand = FakeCommand(command: <String>[
'codesign',
'--force',
@@ -538,6 +589,7 @@ void main() {
'-verify_arch',
'x86_64',
]),
xattrCommand,
adHocCodesignCommand,
]);
await const DebugUnpackIOS().build(environment);
@@ -684,6 +736,7 @@ void main() {
copyPhysicalFrameworkCommand,
lipoCommandNonFatResult,
lipoVerifyArm64Command,
xattrCommand,
adHocCodesignCommand,
]);
await const DebugUnpackIOS().build(environment);
@@ -733,6 +786,7 @@ void main() {
'armv7',
binary.path,
]),
xattrCommand,
adHocCodesignCommand,
]);
@@ -810,6 +864,7 @@ void main() {
copyPhysicalFrameworkCommand,
lipoCommandNonFatResult,
lipoVerifyArm64Command,
xattrCommand,
adHocCodesignCommand,
]);
await const DebugUnpackIOS().build(environment);
@@ -838,6 +893,7 @@ void main() {
copyPhysicalFrameworkCommand,
lipoCommandNonFatResult,
lipoVerifyArm64Command,
xattrCommand,
FakeCommand(command: <String>[
'codesign',
'--force',
@@ -885,6 +941,7 @@ void main() {
copyPhysicalFrameworkCommand,
lipoCommandNonFatResult,
lipoVerifyArm64Command,
xattrCommand,
FakeCommand(command: <String>[
'codesign',
'--force',