Skip to content

Enable Swift Package Manager by default on master channel - #152049

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
loic-sharma:spm_enable_on_master
Jul 24, 2024
Merged

Enable Swift Package Manager by default on master channel#152049
auto-submit[bot] merged 1 commit into
flutter:masterfrom
loic-sharma:spm_enable_on_master

Conversation

@loic-sharma

@loic-sharmaloic-sharma commented Jul 19, 2024

Copy link
Copy Markdown
Member

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-actionsgithub-actionsBot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 19, 2024
@loic-sharma
loic-sharmaforce-pushed the spm_enable_on_master branch 3 times, most recently from 07344b4 to 345aeabCompareJuly 19, 2024 23:17

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

Copy link
Copy Markdown
MemberAuthor

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',

@loic-sharmaloic-sharmaJul 23, 2024

Copy link
Copy Markdown
MemberAuthor

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.

try {
if (cocoapodsTransitiveFlutterDependency) {
section('Disable Swift Package Manager');
await app.disableSwiftPackageManager();

@loic-sharmaloic-sharmaJul 23, 2024

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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)

@loic-sharmaloic-sharmaJul 23, 2024

Copy link
Copy Markdown
MemberAuthor

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:

staticList<String> getExportedSymbols(String dwarfPath) {
finalProcessResult nm = processManager.runSync(
<String>[
'nm',
'--debug-syms', // nm docs: 'Show all symbols, even debugger only'
'--defined-only',
'--just-symbol-name',
dwarfPath,
'-arch',
'arm64',
],
);
finalString nmOutput = (nm.stdout asString).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-sharmaforce-pushed the spm_enable_on_master branch from 4037f2f to dd1762aCompareJuly 23, 2024 20:46
@loic-sharma
loic-sharma marked this pull request as ready for review July 23, 2024 21:38

@jmagmanjmagman left a comment

Copy link
Copy Markdown
Member

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-sharmaloic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 24, 2024
@auto-submit
auto-submitBot merged commit 08d8a7f into flutter:masterJul 24, 2024
@cbrackencbracken added the revert Autorevert PR (with "Reason for revert:" comment) label Jul 24, 2024
@cbracken

cbracken commented Jul 24, 2024

Copy link
Copy Markdown
Member

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-submitBot pushed a commit that referenced this pull request Jul 24, 2024
@auto-submitauto-submitBot removed the revert Autorevert PR (with "Reason for revert:" comment) label Jul 24, 2024
auto-submitBot 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
auto-submitBot 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
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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit ApptoolAffects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@loic-sharma@cbracken@jmagman