Skip to content

Commit

Permalink
Do not sign macos bundles
Browse files Browse the repository at this point in the history
Summary: It's not required to sign macOS test bundles because they don't run on a simulator, an operation that takes a lot of time.

Reviewed By: lawrencelomax, sandeepkumarpani888, jbardini

Differential Revision: D29481622

fbshipit-source-id: 20b1cb4f6d013c786c1532148a53319b83193cfd
  • Loading branch information
fgasperij authored and facebook-github-bot committed Jul 8, 2021
1 parent c9171bb commit d92d36b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions FBControlCore/Codesigning/FBCodesignProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ + (NSRegularExpression *)cdHashRegex
}
id<FBControlCoreLogger> logger = self.logger;
[logger logFormat:@"Signing bundle %@ with identity %@", bundlePath, self.identityName];

return [[[[[[[FBTaskBuilder
withLaunchPath:@"/usr/bin/codesign" arguments:@[@"-s", self.identityName, @"-f", bundlePath]]
withNoUnacceptableStatusCodes]
Expand Down
7 changes: 7 additions & 0 deletions FBControlCore/Management/FBiOSTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ extern FBiOSTargetStateString const FBiOSTargetStateStringUnknown;
*/
- (NSComparisonResult)compare:(id<FBiOSTarget>)target;

/**
If the target's bundle needs to be codesigned or not.
@return if it needs to be signed or not.
*/
- (BOOL)requiresBundlesToBeSigned;

/**
Env var replacements
Expand Down
5 changes: 5 additions & 0 deletions FBControlCoreTests/Doubles/FBiOSTargetDouble.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,9 @@ - (NSComparisonResult)compare:(id<FBiOSTarget>)target
return [FBFuture futureWithError:[[FBControlCoreError describe:@"Unimplemented"] build]];
}

- (BOOL) requiresBundlesToBeSigned
{
return NO;
}

@end
4 changes: 4 additions & 0 deletions FBDeviceControl/Management/FBDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ - (NSComparisonResult)compare:(id<FBiOSTarget>)target
return NSDictionary.dictionary;
}

- (BOOL) requiresBundlesToBeSigned {
return YES;
}

#pragma mark NSObject

- (NSString *)description
Expand Down
4 changes: 4 additions & 0 deletions FBSimulatorControl/Management/FBSimulator.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ - (NSComparisonResult)compare:(id<FBiOSTarget>)target
};
}

- (BOOL) requiresBundlesToBeSigned {
return YES;
}

#pragma mark Properties

- (FBControlCoreProductFamily)productFamily
Expand Down
3 changes: 3 additions & 0 deletions XCTestBootstrap/MacStrategies/FBMacDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ - (nonnull NSString *)consoleString
@synthesize containerApplication;
@synthesize deviceType;

- (BOOL) requiresBundlesToBeSigned {
return NO;
}

+ (nonnull instancetype)commandsWithTarget:(nonnull id<FBiOSTarget>)target
{
Expand Down
2 changes: 1 addition & 1 deletion idb_companion/Utility/FBIDBStorageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ - (BOOL)checkArchitecture:(FBBundleDescriptor *)bundle error:(NSError **)error
[self.logger logFormat:@"Persisted %@", bundle.identifier];

FBInstalledArtifact *artifact = [[FBInstalledArtifact alloc] initWithName:bundle.identifier uuid:bundle.binary.uuid];
if (!self.relocateLibraries) {
if (!self.relocateLibraries || ![self.target requiresBundlesToBeSigned]) {
return [FBFuture futureWithResult:artifact];
}
bundle = [FBBundleDescriptor bundleFromPath:destinationBundlePath.path error:&error];
Expand Down

0 comments on commit d92d36b

Please sign in to comment.