Skip to content

Commit 3122358

Browse files
authored
Always update swift package dependencies (flutter#190886)
We originally added the `-skipPackageUpdates` flag when doing `xcodebuild` commands that didn't impact the build (like `xcodebuild -list`) so try to improve performance. However, I suspect this causes packages not to resolve properly during those commands. This PR removed the `-skipPackageUpdates` flag. Speculative fix for flutter#188265. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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
1 parent db3ac02 commit 3122358

8 files changed

Lines changed: 15 additions & 28 deletions

File tree

‎packages/flutter_tools/lib/src/ios/mac.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ Future<XcodeBuildResult> buildXcodeProject({
303303
.fetchDependenciesAndGenerateXcodebuildArgs(
304304
app.project,
305305
globals.fs.directory(buildDirectoryPath),
306-
skipPackageUpdatesAndValidation: false,
306+
skipPackageValidation: false,
307307
);
308308
final buildCommands = <String>[...xcodebuildCommandArgs, '-configuration', configuration];
309309

‎packages/flutter_tools/lib/src/ios/xcodeproj.dart‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class XcodeProjectInterpreter {
189189
Future<List<String>> fetchDependenciesAndGenerateXcodebuildArgs(
190190
XcodeBasedProject xcodeProject,
191191
Directory buildDirectory, {
192-
bool skipPackageUpdatesAndValidation = true,
192+
bool skipPackageValidation = true,
193193
}) async {
194194
// All `xcodebuild` project commands will download and resolve Swift packages.
195195
// We should always prefetch Swift packages before running any `xcodebuild` project command
@@ -198,7 +198,7 @@ class XcodeProjectInterpreter {
198198

199199
return _xcodebuildProjectCommandArguments(
200200
buildDirectory,
201-
skipPackageUpdatesAndValidation: skipPackageUpdatesAndValidation,
201+
skipPackageValidation: skipPackageValidation,
202202
);
203203
}
204204

@@ -209,20 +209,19 @@ class XcodeProjectInterpreter {
209209

210210
/// Returns a list of required arguments for the `xcodebuild` Xcode project command.
211211
///
212-
/// When [skipPackageUpdatesAndValidation] is true, it uses arguments to attempt skipping any
213-
/// Swift package updates and validation.
212+
/// When [skipPackageValidation] is true, it uses arguments to attempt skipping any Swift
213+
/// package validation.
214214
List<String> _xcodebuildProjectCommandArguments(
215215
Directory buildDirectory, {
216-
bool skipPackageUpdatesAndValidation = true,
216+
bool skipPackageValidation = true,
217217
}) {
218218
final String cachePath = swiftPackageCachePath(buildDirectory);
219219
return <String>[
220220
...xcrunCommand(),
221221
'xcodebuild',
222222
'-clonedSourcePackagesDirPath',
223223
cachePath,
224-
if (skipPackageUpdatesAndValidation) ...<String>[
225-
'-skipPackageUpdates',
224+
if (skipPackageValidation) ...<String>[
226225
'-skipPackagePluginValidation',
227226
'-skipPackageSignatureValidation',
228227
],
@@ -395,9 +394,9 @@ class XcodeProjectInterpreter {
395394
await xcodeProject.prefetchSwiftPackages(
396395
xcodebuildProjectCommandArguments: _xcodebuildProjectCommandArguments(
397396
buildDirectory,
398-
// skipPackageUpdatesAndValidation should be false so that when subsequent xcodebuild
397+
// skipPackageValidation should be false so that when subsequent xcodebuild
399398
// commands run, packages should already be resolved, downloaded, updated, and validated.
400-
skipPackageUpdatesAndValidation: false,
399+
skipPackageValidation: false,
401400
),
402401
processUtils: _processUtils,
403402
logger: _logger,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Future<void> buildMacOS({
278278
.fetchDependenciesAndGenerateXcodebuildArgs(
279279
flutterProject.macos,
280280
globals.fs.directory(buildDirectoryPath),
281-
skipPackageUpdatesAndValidation: false,
281+
skipPackageValidation: false,
282282
);
283283
result = await globals.processUtils.stream(
284284
<String>[

‎packages/flutter_tools/lib/src/macos/xcode.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,11 @@ class Xcode {
235235
Future<List<String>> fetchDependenciesAndGenerateXcodebuildArgs(
236236
XcodeBasedProject xcodeProject,
237237
Directory buildDirectory, {
238-
bool skipPackageUpdatesAndValidation = true,
238+
bool skipPackageValidation = true,
239239
}) async => _xcodeProjectInterpreter.fetchDependenciesAndGenerateXcodebuildArgs(
240240
xcodeProject,
241241
buildDirectory,
242-
skipPackageUpdatesAndValidation: skipPackageUpdatesAndValidation,
242+
skipPackageValidation: skipPackageValidation,
243243
);
244244

245245
Future<RunResult> cc(List<String> args) => _run('cc', args);

‎packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ class FakeXcodeProjectInterpreter extends Fake implements XcodeProjectInterprete
15441544
Future<List<String>> fetchDependenciesAndGenerateXcodebuildArgs(
15451545
XcodeBasedProject xcodeProject,
15461546
Directory buildDirectory, {
1547-
bool skipPackageUpdatesAndValidation = true,
1547+
bool skipPackageValidation = true,
15481548
}) async {
15491549
return <String>['xcrun', 'xcodebuild'];
15501550
}

‎packages/flutter_tools/test/general.shard/ios/mac_test.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ class FakeXcodeProjectInterpreter extends Fake implements XcodeProjectInterprete
13331333
Future<List<String>> fetchDependenciesAndGenerateXcodebuildArgs(
13341334
XcodeBasedProject xcodeProject,
13351335
Directory buildDirectory, {
1336-
bool skipPackageUpdatesAndValidation = true,
1336+
bool skipPackageValidation = true,
13371337
}) async {
13381338
return <String>['xcrun', 'xcodebuild'];
13391339
}

‎packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ void main() {
279279
'xcodebuild',
280280
'-clonedSourcePackagesDirPath',
281281
'/build/ios/SourcePackages',
282-
'-skipPackageUpdates',
283282
'-skipPackagePluginValidation',
284283
'-skipPackageSignatureValidation',
285284
'-project',
@@ -325,7 +324,6 @@ void main() {
325324
'xcodebuild',
326325
'-clonedSourcePackagesDirPath',
327326
'/build/ios/SourcePackages',
328-
'-skipPackageUpdates',
329327
'-skipPackagePluginValidation',
330328
'-skipPackageSignatureValidation',
331329
'-project',
@@ -371,7 +369,6 @@ void main() {
371369
'xcodebuild',
372370
'-clonedSourcePackagesDirPath',
373371
'/build/ios/SourcePackages',
374-
'-skipPackageUpdates',
375372
'-skipPackagePluginValidation',
376373
'-skipPackageSignatureValidation',
377374
'-project',
@@ -417,7 +414,6 @@ void main() {
417414
'xcodebuild',
418415
'-clonedSourcePackagesDirPath',
419416
'/build/ios/SourcePackages',
420-
'-skipPackageUpdates',
421417
'-skipPackagePluginValidation',
422418
'-skipPackageSignatureValidation',
423419
'-project',
@@ -463,7 +459,6 @@ void main() {
463459
'xcodebuild',
464460
'-clonedSourcePackagesDirPath',
465461
'/build/ios/SourcePackages',
466-
'-skipPackageUpdates',
467462
'-skipPackagePluginValidation',
468463
'-skipPackageSignatureValidation',
469464
'-project',
@@ -507,7 +502,6 @@ void main() {
507502
'xcodebuild',
508503
'-clonedSourcePackagesDirPath',
509504
'/build/ios/SourcePackages',
510-
'-skipPackageUpdates',
511505
'-skipPackagePluginValidation',
512506
'-skipPackageSignatureValidation',
513507
'-project',
@@ -559,7 +553,6 @@ void main() {
559553
'xcodebuild',
560554
'-clonedSourcePackagesDirPath',
561555
'/build/macos/SourcePackages',
562-
'-skipPackageUpdates',
563556
'-skipPackagePluginValidation',
564557
'-skipPackageSignatureValidation',
565558
'-project',
@@ -605,7 +598,6 @@ void main() {
605598
'xcodebuild',
606599
'-clonedSourcePackagesDirPath',
607600
'/build/ios/SourcePackages',
608-
'-skipPackageUpdates',
609601
'-skipPackagePluginValidation',
610602
'-skipPackageSignatureValidation',
611603
'-workspace',
@@ -644,7 +636,6 @@ void main() {
644636
'xcodebuild',
645637
'-clonedSourcePackagesDirPath',
646638
'/build/ios/SourcePackages',
647-
'-skipPackageUpdates',
648639
'-skipPackagePluginValidation',
649640
'-skipPackageSignatureValidation',
650641
'-list',
@@ -688,7 +679,6 @@ void main() {
688679
'xcodebuild',
689680
'-clonedSourcePackagesDirPath',
690681
'/build/ios/SourcePackages',
691-
'-skipPackageUpdates',
692682
'-skipPackagePluginValidation',
693683
'-skipPackageSignatureValidation',
694684
'-list',
@@ -734,7 +724,6 @@ void main() {
734724
'xcodebuild',
735725
'-clonedSourcePackagesDirPath',
736726
'/build/ios/SourcePackages',
737-
'-skipPackageUpdates',
738727
'-skipPackagePluginValidation',
739728
'-skipPackageSignatureValidation',
740729
'-list',
@@ -838,7 +827,6 @@ Information about project "Runner":
838827
'xcodebuild',
839828
'-clonedSourcePackagesDirPath',
840829
'/build/ios/SourcePackages',
841-
'-skipPackageUpdates',
842830
'-skipPackagePluginValidation',
843831
'-skipPackageSignatureValidation',
844832
'-list',

‎packages/flutter_tools/test/src/context.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
413413
Future<List<String>> fetchDependenciesAndGenerateXcodebuildArgs(
414414
XcodeBasedProject xcodeProject,
415415
Directory buildDirectory, {
416-
bool skipPackageUpdatesAndValidation = true,
416+
bool skipPackageValidation = true,
417417
}) async {
418418
return <String>['xcrun', 'xcodebuild'];
419419
}

0 commit comments

Comments
 (0)