Skip to content

Enable Swift Package Manager by default on master channel #152049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Jul 19, 2024

Changes:

  1. Enables Swift Package Manager by default on the main/master channel
  2. Fixes tests that fail if Swift Package Manager is enabled

Corresponding docs change: flutter/website#10938

Addresses #151567

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 19, 2024
@loic-sharma loic-sharma force-pushed the spm_enable_on_master branch 3 times, most recently from 07344b4 to 345aeab Compare July 19, 2024 23:17
@@ -939,15 +939,6 @@ Future<void> _checkStatic(String pathToLibrary) async {
}
}

Future<String> _dylibSymbols(String pathToDylib) {
return eval('nm', <String>[
'-g',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-g is an alias for --extern-only, description: Display only global (external) symbols.

final String symbolTable = await eval(
'nm',
<String> [
'-gU',
Copy link
Member Author

@loic-sharma loic-sharma Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-U's description: Don't display undefined symbols. This isn't strictly necessary, it reduces the output of nm.

@@ -77,6 +77,11 @@ class PluginTest {
final _FlutterProject app = await _FlutterProject.create(tempDir, options, buildTarget,
name: 'plugintestapp', template: 'app', environment: appCreateEnvironment);
try {
if (cocoapodsTransitiveFlutterDependency) {
section('Disable Swift Package Manager');
await app.disableSwiftPackageManager();
Copy link
Member Author

@loic-sharma loic-sharma Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We update the build settings of pods that depend on the Flutter framework (including transitive dependencies). This test only makes sense for CocoaPods, so we need to ensure we use CocoaPods. (We don't mutate the build settings of Swift packages, and Swift packages never depend on the Flutter framework)

For more context, see: #125610

));
final bool swiftPackageManagerEnabled = generatedSwiftManifest.existsSync();

if (!swiftPackageManagerEnabled) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend reviewing this diff with whitespace disabled: https://github.com/flutter/flutter/pull/152049/files?diff=split&w=1

image

// Runner binary.
final bool helloDynamic = outputPluginFrameworkBinary.existsSync();
final bool helloStatic = AppleTestUtils
.getExportedSymbols(outputRunnerBinary.path)
Copy link
Member Author

@loic-sharma loic-sharma Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppleTestUtils.getExportedSymbols is flutter_tools's helper for nm:

static List<String> getExportedSymbols(String dwarfPath) {
final ProcessResult nm = processManager.runSync(
<String>[
'nm',
'--debug-syms', // nm docs: 'Show all symbols, even debugger only'
'--defined-only',
'--just-symbol-name',
dwarfPath,
'-arch',
'arm64',
],
);
final String nmOutput = (nm.stdout as String).trim();
return nmOutput.isEmpty ? const <String>[] : nmOutput.split('\n');
}
}

This is effectively the same thing as the dumpSymbolTable helper I added to the devicelab package. AFAICT we don't share code between the tool and devicelab (I suspect this is intentional).

@loic-sharma loic-sharma force-pushed the spm_enable_on_master branch from 4037f2f to dd1762a Compare July 23, 2024 20:46
@loic-sharma loic-sharma marked this pull request as ready for review July 23, 2024 21:38
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for figuring out the nm details. LGTM!

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 24, 2024
@auto-submit auto-submit bot merged commit 08d8a7f into flutter:master Jul 24, 2024
135 checks passed
@cbracken cbracken added the revert Autorevert PR (with "Reason for revert:" comment) label Jul 24, 2024
@cbracken
Copy link
Member

cbracken commented Jul 24, 2024

Reason for revert: iOS builds failing in post-submit

  • Mac_ios integration_ui_ios_keyboard_resize
  • Mac_ios native_assets_ios
  • Mac_ios route_test_ios
  • Mac_ios very_long_picture_scrolling_perf_ios__e2e_summary
  • Mac_ios platform_channels_benchmarks_ios
  • Mac_ios rrect_blur_perf_ios__timeline_summary
  • Mac_ios complex_layout_scroll_perf_ios__timeline_summary
  • Mac_ios new_gallery_skia_ios__transition_perf
  • Mac_ios platform_views_scroll_perf_non_intersecting_impeller_ios__timeline_summary
  • Mac_x64 plugin_lint_mac
  • Mac_arm64 plugin_lint_mac

auto-submit bot pushed a commit that referenced this pull request Jul 24, 2024
@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Jul 24, 2024
auto-submit bot added a commit that referenced this pull request Jul 24, 2024
…152049)" (#152243)

Reverts: #152049
Initiated by: cbracken
Reason for reverting: iOS builds failing in post-submit
Original PR Author: loic-sharma

Reviewed By: {jmagman}

This change reverts the following previous change:
Changes:

1. Enables Swift Package Manager by default on the main/master channel
2. Fixes tests that fail if Swift Package Manager is enabled

Corresponding docs change: flutter/website#10938

Addresses #151567
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
auto-submit bot pushed a commit that referenced this pull request Jul 26, 2024
#152049 was reverted as it broke several post-submit tests. This relands the test fixes in #152049 without enabling Swift Package Manager on the master channel. 

This change is split into two commits:

1. dd1762a - The changes in #152049
1. 00fdcfb - Undoes the changes that enabled Swift Package Manager on the master channel

Part of #151567
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 27, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 27, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 28, 2024
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…2049)

Changes:

1. Enables Swift Package Manager by default on the main/master channel
2. Fixes tests that fail if Swift Package Manager is enabled

Corresponding docs change: flutter/website#10938

Addresses flutter#151567
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…lutter#152049)" (flutter#152243)

Reverts: flutter#152049
Initiated by: cbracken
Reason for reverting: iOS builds failing in post-submit
Original PR Author: loic-sharma

Reviewed By: {jmagman}

This change reverts the following previous change:
Changes:

1. Enables Swift Package Manager by default on the main/master channel
2. Fixes tests that fail if Swift Package Manager is enabled

Corresponding docs change: flutter/website#10938

Addresses flutter#151567
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…152267)

flutter#152049 was reverted as it broke several post-submit tests. This relands the test fixes in flutter#152049 without enabling Swift Package Manager on the master channel. 

This change is split into two commits:

1. flutter@dd1762a - The changes in flutter#152049
1. flutter@00fdcfb - Undoes the changes that enabled Swift Package Manager on the master channel

Part of flutter#151567
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…2049)

Changes:

1. Enables Swift Package Manager by default on the main/master channel
2. Fixes tests that fail if Swift Package Manager is enabled

Corresponding docs change: flutter/website#10938

Addresses flutter#151567
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…lutter#152049)" (flutter#152243)

Reverts: flutter#152049
Initiated by: cbracken
Reason for reverting: iOS builds failing in post-submit
Original PR Author: loic-sharma

Reviewed By: {jmagman}

This change reverts the following previous change:
Changes:

1. Enables Swift Package Manager by default on the main/master channel
2. Fixes tests that fail if Swift Package Manager is enabled

Corresponding docs change: flutter/website#10938

Addresses flutter#151567
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…152267)

flutter#152049 was reverted as it broke several post-submit tests. This relands the test fixes in flutter#152049 without enabling Swift Package Manager on the master channel. 

This change is split into two commits:

1. flutter@dd1762a - The changes in flutter#152049
1. flutter@00fdcfb - Undoes the changes that enabled Swift Package Manager on the master channel

Part of flutter#151567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants