Skip to content

Commit 4d060ae

Browse files
auto-submit[bot]auto-submit[bot]
andauthored
Reverts "[flutter_tools] Add --no-codesign support for macOS build (flutter#169034)" (flutter#172878)
<!-- start_original_pr_link --> Reverts: flutter#169034 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: vashworth <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: failing in post-submit https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8708074284638575793/+/u/run_test.dart_for_analyze_shard_and_subshard_None/stdout <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: knopp <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {bkonyi, vashworth} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: Unlike iOS, the macOS build currently does not support `--no-codesign` option to skip signing of application bundle. Having this option is useful for situation where the code-signing step is happens separately after the bundle is built (i.e. on CI). ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
1 parent 3ac59c9 commit 4d060ae

File tree

3 files changed

+0
-67
lines changed

3 files changed

+0
-67
lines changed

packages/flutter_tools/lib/src/commands/build_macos.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class BuildMacosCommand extends BuildSubCommand {
2525
'This can be used in CI/CD process that create an archive to avoid '
2626
'performing duplicate work.',
2727
);
28-
argParser.addFlag('codesign', defaultsTo: true, help: 'Codesign the application bundle.');
2928
}
3029

3130
@override
@@ -47,8 +46,6 @@ class BuildMacosCommand extends BuildSubCommand {
4746

4847
bool get configOnly => boolArg('config-only');
4948

50-
bool get shouldCodesign => boolArg('codesign');
51-
5249
@override
5350
Future<FlutterCommandResult> runCommand() async {
5451
final BuildInfo buildInfo = await getBuildInfo();
@@ -60,9 +57,6 @@ class BuildMacosCommand extends BuildSubCommand {
6057
if (!supported) {
6158
throwToolExit('"build macos" only supported on macOS hosts.');
6259
}
63-
if (!shouldCodesign) {
64-
globals.printStatus('Warning: Building with codesigning disabled.');
65-
}
6660
await buildMacOS(
6761
flutterProject: project,
6862
buildInfo: buildInfo,
@@ -76,7 +70,6 @@ class BuildMacosCommand extends BuildSubCommand {
7670
analytics: analytics,
7771
),
7872
usingCISystem: usingCISystem,
79-
codesign: shouldCodesign,
8073
);
8174
return FlutterCommandResult.success();
8275
}

packages/flutter_tools/lib/src/macos/build_macos.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ Future<void> buildMacOS({
7272
bool configOnly = false,
7373
SizeAnalyzer? sizeAnalyzer,
7474
bool usingCISystem = false,
75-
bool codesign = true,
7675
}) async {
7776
final Directory? xcodeWorkspace = flutterProject.macos.xcodeWorkspace;
7877
if (xcodeWorkspace == null) {
@@ -225,11 +224,6 @@ Future<void> buildMacOS({
225224
if (disabledSandboxEntitlementFile != null)
226225
'CODE_SIGN_ENTITLEMENTS=${disabledSandboxEntitlementFile.path}',
227226
...environmentVariablesAsXcodeBuildSettings(globals.platform),
228-
if (!codesign) ...<String>[
229-
'CODE_SIGNING_ALLOWED=NO',
230-
'CODE_SIGNING_REQUIRED=NO',
231-
'CODE_SIGNING_IDENTITY=""',
232-
],
233227
],
234228
trace: true,
235229
stdoutErrorMatcher: verboseLogging ? null : _filteredOutput,

packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,58 +1010,4 @@ STDERR STUFF
10101010
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_x64),
10111011
},
10121012
);
1013-
1014-
testUsingContext(
1015-
'macos build --no-codesign skips codesigning',
1016-
() async {
1017-
final BuildCommand command = BuildCommand(
1018-
androidSdk: FakeAndroidSdk(),
1019-
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
1020-
logger: logger,
1021-
fileSystem: fileSystem,
1022-
osUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64),
1023-
);
1024-
fakeProcessManager.addCommands(<FakeCommand>[
1025-
const FakeCommand(
1026-
command: <String>[
1027-
'/usr/bin/env',
1028-
'xcrun',
1029-
'xcodebuild',
1030-
'-workspace',
1031-
'/macos/Runner.xcworkspace',
1032-
'-configuration',
1033-
'Release',
1034-
'-scheme',
1035-
'Runner',
1036-
'-derivedDataPath',
1037-
'/build/macos',
1038-
'-destination',
1039-
'generic/platform=macOS',
1040-
'OBJROOT=/build/macos/Build/Intermediates.noindex',
1041-
'SYMROOT=/build/macos/Build/Products',
1042-
'-quiet',
1043-
'COMPILER_INDEX_STORE_ENABLE=NO',
1044-
'CODE_SIGNING_ALLOWED=NO',
1045-
'CODE_SIGNING_REQUIRED=NO',
1046-
'CODE_SIGNING_IDENTITY=""',
1047-
],
1048-
),
1049-
]);
1050-
createMinimalMockProjectFiles();
1051-
1052-
await createTestCommandRunner(
1053-
command,
1054-
).run(const <String>['build', 'macos', '--no-pub', '--no-codesign']);
1055-
expect(fakeProcessManager, hasNoRemainingExpectations);
1056-
expect(logger.statusText, contains('Warning: Building with codesigning disabled.'));
1057-
},
1058-
overrides: <Type, Generator>{
1059-
FileSystem: () => fileSystem,
1060-
Logger: () => logger,
1061-
ProcessManager: () => fakeProcessManager,
1062-
Pub: ThrowingPub.new,
1063-
Platform: () => macosPlatform,
1064-
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64),
1065-
},
1066-
);
10671013
}

0 commit comments

Comments
 (0)