Skip to content

Commit 85f14e0

Browse files
[CP-beta]Always update swift package dependencies (#191513)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request) Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request. ### Issue Link: What is the link to the issue this cherry-pick is addressing? #188265 ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping of production apps (the app crashes on launch). This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick. iOS or macOS builds may fail when Swift Package Manager is enabled. ### Changelog Description: Explain this cherry pick: * In one line that is accessible to most Flutter developers. * That describes the state prior to the fix. * That includes which platforms are impacted. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples. < Replace with changelog description here > [flutter/188265] When building for iOS or macOS with Swift Package Manager enabled, swift package dependencies may fail to resolve due to no version matching requirements. ### Workaround: Is there a workaround for this issue? Disable SwiftPM: `flutter config --no-enable-swift-package-manager` ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? The error is not reproducible so the fix is speculative.
1 parent e84caf7 commit 85f14e0

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)