Fix iOS xattr removal to clear all extended attributes#180355
Fix iOS xattr removal to clear all extended attributes#180355auto-submit[bot] merged 19 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request addresses an iOS code signing failure by changing the xattr command to remove all extended attributes recursively, instead of just com.apple.FinderInfo. The change is well-documented and consistently applied across the implementation and related tests. My only suggestion is to consider renaming the removeFinderExtendedAttributes function to better reflect its new, broader functionality.
jmagman
left a comment
There was a problem hiding this comment.
Introduced in #123896.
Probably safe to delete all extended attributes. @vashworth do you have any concerns?
| const xattrCommand = FakeCommand( | ||
| command: <String>['xattr', '-r', '-d', 'com.apple.FinderInfo', '/'], | ||
| command: <String>['xattr', '-cr', '/'], | ||
| ); |
There was a problem hiding this comment.
The analyzer is suggesting:
- const xattrCommand = FakeCommand(
- command: <String>['xattr', '-cr', '/'],
- );
+ const xattrCommand = FakeCommand(command: <String>['xattr', '-cr', '/']);To fix, run `dart format packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart packages/flutter_tools/test/general.shard/ios/mac_test.dart`
|
The analyzer is failing due to incorrectly formatted files. To fix, run: |
There was a problem hiding this comment.
Introduced in #123896.
Probably safe to delete all extended attributes. @vashworth do you have any concerns?
I agree.
LGTM once formatting is fixed.
|
Reason for revert: this broke post-submit |
…)" This reverts commit f004160.
)" (#180709) <!-- start_original_pr_link --> Reverts: #180355 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: jmagman <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: this broke post-submit <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: Saqib198 <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {vashworth, jmagman} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: Fixed iOS code signing failures caused by extended attributes like com.apple.provenance. Problem: On macOS 15+ with Xcode 26.1+, iOS builds fail during code signing with: resource fork, Finder information, or similar detritus not allowed This happens because com.apple.provenance (added by cloud storage services, Finder, or file downloads) was not being removed - only com.apple.FinderInfo was cleared. Fix: Changed xattr -r -d com.apple.FinderInfo to xattr -cr to remove ALL extended attributes recursively. Fixes #180351 Pre-launch Checklist - I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - I read the [Tree Hygiene] wiki page, which explains my responsibilities. - I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - I signed the [CLA]. - I listed at least one issue that this PR fixes in the description above. - I updated/added relevant documentation (doc comments with ///). - I added new tests to check the change I am making, or this PR is [test-exempt]. - I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - All existing and new tests are passing. <!-- end_revert_body --> The error: ``` Could not delete `/opt/s/w/ir/x/w/rc/tmpxc3h1o2b/flutter sdk/dev/integration_tests/flavors/build/ios/Debug Paid-iphoneos/Flutter` because it was not created by the build system and it is not a subfolder of derived data. note: To mark this directory as deletable by the build system, run `xattr -w com.apple.xcode.CreatedByBuildSystem true '/opt/s/w/ir/x/w/rc/tmpxc3h1o2b/flutter sdk/dev/integration_tests/flavors/build/ios/Debug Paid-iphoneos/Flutter'` when it is created. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8693206125415137281/+/u/run_flavors_test_ios/stdout Co-authored-by: auto-submit[bot] <[email protected]>
Roll Flutter from 01d37bc to 73769a2 (65 revisions) flutter/flutter@01d37bc...73769a2 2026-01-10 [email protected] Roll Dart SDK from 5e855c2bb3ef to 87fbfd5381b6 (1 revision) (flutter/flutter#180800) 2026-01-10 [email protected] Roll Skia from b2b109f0e980 to f39cc645b1dd (2 revisions) (flutter/flutter#180796) 2026-01-10 [email protected] Roll Dart SDK from b7963905e6a2 to 5e855c2bb3ef (2 revisions) (flutter/flutter#180794) 2026-01-10 [email protected] Make sure that a CupertinoTabScaffold doesn't crash in 0x0 environment (flutter/flutter#179824) 2026-01-10 [email protected] Roll Dart SDK from d25ad331b7ea to b7963905e6a2 (2 revisions) (flutter/flutter#180783) 2026-01-10 [email protected] Make sure that a Container doesn't crash in 0x0 environment (flutter/flutter#180350) 2026-01-10 [email protected] Make sure that an Expansible doesn't crash in 0x0 environment (flutter/flutter#180478) 2026-01-10 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Enabled some disabled impeller fragment shader dart tests (#180759)" (flutter/flutter#180785) 2026-01-09 [email protected] Merge `widget_tester_leaks_free_test.dart` into `widget_tester_test.dart` (flutter/flutter#180600) 2026-01-09 [email protected] fix: there are no riscv fuchsia artifacts (flutter/flutter#180779) 2026-01-09 [email protected] Roll Skia from 7386219151e6 to b2b109f0e980 (1 revision) (flutter/flutter#180771) 2026-01-09 [email protected] Re-prioritize pipeline compile jobs and perform them eagerly instead of waiting. (flutter/flutter#180022) 2026-01-09 [email protected] Enabled some disabled impeller fragment shader dart tests (flutter/flutter#180759) 2026-01-09 [email protected] Roll Fuchsia Linux SDK from rxeg-6UB678HKJ4UQ... to 83Favz_zzMzdVuOHg... (flutter/flutter#180765) 2026-01-09 [email protected] [A11y ] Add `clearSemantics`in table (flutter/flutter#180665) 2026-01-09 [email protected] Update CODEOWNERS to remove chinmaygarde. (flutter/flutter#180703) 2026-01-09 [email protected] [ Tool ] Add support for linux riscv64 architecture (flutter/flutter#178711) 2026-01-09 [email protected] Roll Skia from e9b3264ade0c to 7386219151e6 (12 revisions) (flutter/flutter#180754) 2026-01-09 [email protected] Roll Dart SDK from fe2ba2c5dd50 to d25ad331b7ea (10 revisions) (flutter/flutter#180741) 2026-01-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Unpin google_mobile_ads (#180573)" (flutter/flutter#180761) 2026-01-09 [email protected] Fix typo in dropdown_menu.dart (flutter/flutter#180172) 2026-01-09 [email protected] Roll Packages from 039a026 to 51fe1d9 (1 revision) (flutter/flutter#180742) 2026-01-09 [email protected] Unpin google_mobile_ads (flutter/flutter#180573) 2026-01-09 [email protected] Update flutter changelog for 3.38.6 (flutter/flutter#180708) 2026-01-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix iOS xattr removal to clear all extended attributes (#180355)" (flutter/flutter#180709) 2026-01-08 [email protected] Make sure that an EditableText doesn't crash in 0x0 environment (flutter/flutter#180457) 2026-01-08 [email protected] Implementation of tooltip windows for win32 (flutter/flutter#179147) 2026-01-08 [email protected] [web] Don't serve files outside of project (flutter/flutter#180699) 2026-01-08 [email protected] Roll Skia from 837be28dd218 to e9b3264ade0c (1 revision) (flutter/flutter#180702) 2026-01-08 [email protected] Add new motion accessibility features to iOS. (flutter/flutter#178102) 2026-01-08 [email protected] Fix iOS xattr removal to clear all extended attributes (flutter/flutter#180355) 2026-01-08 [email protected] [ Widget Preview ] Move widget_preview_scaffold tests to `dev/integration_tests/widget_preview_scaffold` (flutter/flutter#180658) 2026-01-08 [email protected] De-interleaves engine dart test output (flutter/flutter#180651) 2026-01-08 [email protected] [web] Fix SemanticsService.announce not working inside dialogs (flutter/flutter#179958) 2026-01-08 [email protected] Roll Skia from 42233226ac56 to 837be28dd218 (2 revisions) (flutter/flutter#180693) 2026-01-08 [email protected] Roll Dart SDK to 3.11.0-296.2.beta (flutter/flutter#180685) 2026-01-08 [email protected] Improve code quality in `AndroidTouchProcessorTest.java` (flutter/flutter#180583) 2026-01-08 [email protected] Revert "Reverts "[reland] Unify canvas creation and Surface code in S…kwasm and CanvasKit (#179473)" (#180152)" (flutter/flutter#180610) 2026-01-08 [email protected] Roll Skia from a0c407bce408 to 42233226ac56 (4 revisions) (flutter/flutter#180688) 2026-01-08 [email protected] [ Tool ] Fix flake in overall_experience_test.dart (flutter/flutter#180655) 2026-01-08 [email protected] Roll Packages from 9705815 to 039a026 (6 revisions) (flutter/flutter#180684) 2026-01-08 [email protected] flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing (flutter/flutter#177888) 2026-01-08 [email protected] Roll Skia from 58837e160874 to a0c407bce408 (2 revisions) (flutter/flutter#180679) 2026-01-08 [email protected] Roll Skia from 1e3266fdba86 to 58837e160874 (1 revision) (flutter/flutter#180677) 2026-01-08 [email protected] Roll Skia from 3c47ea10638f to 1e3266fdba86 (4 revisions) (flutter/flutter#180675) 2026-01-08 [email protected] Roll Fuchsia Linux SDK from dTvN_JVSCfGFRasvH... to rxeg-6UB678HKJ4UQ... (flutter/flutter#180673) ...
Roll Flutter from 01d37bc to 73769a2 (65 revisions) flutter/flutter@01d37bc...73769a2 2026-01-10 [email protected] Roll Dart SDK from 5e855c2bb3ef to 87fbfd5381b6 (1 revision) (flutter/flutter#180800) 2026-01-10 [email protected] Roll Skia from b2b109f0e980 to f39cc645b1dd (2 revisions) (flutter/flutter#180796) 2026-01-10 [email protected] Roll Dart SDK from b7963905e6a2 to 5e855c2bb3ef (2 revisions) (flutter/flutter#180794) 2026-01-10 [email protected] Make sure that a CupertinoTabScaffold doesn't crash in 0x0 environment (flutter/flutter#179824) 2026-01-10 [email protected] Roll Dart SDK from d25ad331b7ea to b7963905e6a2 (2 revisions) (flutter/flutter#180783) 2026-01-10 [email protected] Make sure that a Container doesn't crash in 0x0 environment (flutter/flutter#180350) 2026-01-10 [email protected] Make sure that an Expansible doesn't crash in 0x0 environment (flutter/flutter#180478) 2026-01-10 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Enabled some disabled impeller fragment shader dart tests (#180759)" (flutter/flutter#180785) 2026-01-09 [email protected] Merge `widget_tester_leaks_free_test.dart` into `widget_tester_test.dart` (flutter/flutter#180600) 2026-01-09 [email protected] fix: there are no riscv fuchsia artifacts (flutter/flutter#180779) 2026-01-09 [email protected] Roll Skia from 7386219151e6 to b2b109f0e980 (1 revision) (flutter/flutter#180771) 2026-01-09 [email protected] Re-prioritize pipeline compile jobs and perform them eagerly instead of waiting. (flutter/flutter#180022) 2026-01-09 [email protected] Enabled some disabled impeller fragment shader dart tests (flutter/flutter#180759) 2026-01-09 [email protected] Roll Fuchsia Linux SDK from rxeg-6UB678HKJ4UQ... to 83Favz_zzMzdVuOHg... (flutter/flutter#180765) 2026-01-09 [email protected] [A11y ] Add `clearSemantics`in table (flutter/flutter#180665) 2026-01-09 [email protected] Update CODEOWNERS to remove chinmaygarde. (flutter/flutter#180703) 2026-01-09 [email protected] [ Tool ] Add support for linux riscv64 architecture (flutter/flutter#178711) 2026-01-09 [email protected] Roll Skia from e9b3264ade0c to 7386219151e6 (12 revisions) (flutter/flutter#180754) 2026-01-09 [email protected] Roll Dart SDK from fe2ba2c5dd50 to d25ad331b7ea (10 revisions) (flutter/flutter#180741) 2026-01-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Unpin google_mobile_ads (#180573)" (flutter/flutter#180761) 2026-01-09 [email protected] Fix typo in dropdown_menu.dart (flutter/flutter#180172) 2026-01-09 [email protected] Roll Packages from 039a026 to 51fe1d9 (1 revision) (flutter/flutter#180742) 2026-01-09 [email protected] Unpin google_mobile_ads (flutter/flutter#180573) 2026-01-09 [email protected] Update flutter changelog for 3.38.6 (flutter/flutter#180708) 2026-01-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix iOS xattr removal to clear all extended attributes (#180355)" (flutter/flutter#180709) 2026-01-08 [email protected] Make sure that an EditableText doesn't crash in 0x0 environment (flutter/flutter#180457) 2026-01-08 [email protected] Implementation of tooltip windows for win32 (flutter/flutter#179147) 2026-01-08 [email protected] [web] Don't serve files outside of project (flutter/flutter#180699) 2026-01-08 [email protected] Roll Skia from 837be28dd218 to e9b3264ade0c (1 revision) (flutter/flutter#180702) 2026-01-08 [email protected] Add new motion accessibility features to iOS. (flutter/flutter#178102) 2026-01-08 [email protected] Fix iOS xattr removal to clear all extended attributes (flutter/flutter#180355) 2026-01-08 [email protected] [ Widget Preview ] Move widget_preview_scaffold tests to `dev/integration_tests/widget_preview_scaffold` (flutter/flutter#180658) 2026-01-08 [email protected] De-interleaves engine dart test output (flutter/flutter#180651) 2026-01-08 [email protected] [web] Fix SemanticsService.announce not working inside dialogs (flutter/flutter#179958) 2026-01-08 [email protected] Roll Skia from 42233226ac56 to 837be28dd218 (2 revisions) (flutter/flutter#180693) 2026-01-08 [email protected] Roll Dart SDK to 3.11.0-296.2.beta (flutter/flutter#180685) 2026-01-08 [email protected] Improve code quality in `AndroidTouchProcessorTest.java` (flutter/flutter#180583) 2026-01-08 [email protected] Revert "Reverts "[reland] Unify canvas creation and Surface code in S…kwasm and CanvasKit (#179473)" (#180152)" (flutter/flutter#180610) 2026-01-08 [email protected] Roll Skia from a0c407bce408 to 42233226ac56 (4 revisions) (flutter/flutter#180688) 2026-01-08 [email protected] [ Tool ] Fix flake in overall_experience_test.dart (flutter/flutter#180655) 2026-01-08 [email protected] Roll Packages from 9705815 to 039a026 (6 revisions) (flutter/flutter#180684) 2026-01-08 [email protected] flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing (flutter/flutter#177888) 2026-01-08 [email protected] Roll Skia from 58837e160874 to a0c407bce408 (2 revisions) (flutter/flutter#180679) 2026-01-08 [email protected] Roll Skia from 1e3266fdba86 to 58837e160874 (1 revision) (flutter/flutter#180677) 2026-01-08 [email protected] Roll Skia from 3c47ea10638f to 1e3266fdba86 (4 revisions) (flutter/flutter#180675) 2026-01-08 [email protected] Roll Fuchsia Linux SDK from dTvN_JVSCfGFRasvH... to rxeg-6UB678HKJ4UQ... (flutter/flutter#180673) ...
## Summary Fixes #180351 by removing only the specific extended attributes that cause iOS code signing failures, while preserving Xcode-required metadata. ## Changes - Updated `removeExtendedAttributes` to remove only: - `com.apple.FinderInfo` - `com.apple.provenance` - Preserves `com.apple.xcode.CreatedByBuildSystem`, which Xcode relies on for build directory management - Updated all related tests to expect two targeted `xattr -r -d` invocations ## Why The previous approach in #180355 used `xattr -cr`, which removed **all** extended attributes. This unintentionally deleted `com.apple.xcode.CreatedByBuildSystem`, causing Xcode post-submit failures related to build directory ownership. This change applies the minimal fix needed to resolve the code signing issue without breaking Xcode behavior. ## Testing - [x] Code formatted with `dart format` - [x] `flutter analyze` passes - [x] Updated and passing iOS build and signing-related tests Addresses feedback from @jmagman --------- Co-authored-by: Navaron Bracke <[email protected]> Co-authored-by: Elijah Okoroh <[email protected]>
…180710) ## Summary Fixes flutter#180351 by removing only the specific extended attributes that cause iOS code signing failures, while preserving Xcode-required metadata. ## Changes - Updated `removeExtendedAttributes` to remove only: - `com.apple.FinderInfo` - `com.apple.provenance` - Preserves `com.apple.xcode.CreatedByBuildSystem`, which Xcode relies on for build directory management - Updated all related tests to expect two targeted `xattr -r -d` invocations ## Why The previous approach in flutter#180355 used `xattr -cr`, which removed **all** extended attributes. This unintentionally deleted `com.apple.xcode.CreatedByBuildSystem`, causing Xcode post-submit failures related to build directory ownership. This change applies the minimal fix needed to resolve the code signing issue without breaking Xcode behavior. ## Testing - [x] Code formatted with `dart format` - [x] `flutter analyze` passes - [x] Updated and passing iOS build and signing-related tests Addresses feedback from @jmagman --------- Co-authored-by: Navaron Bracke <[email protected]> Co-authored-by: Elijah Okoroh <[email protected]>
Fixed iOS code signing failures caused by extended attributes like com.apple.provenance.
Problem: On macOS 15+ with Xcode 26.1+, iOS builds fail during code signing with:
resource fork, Finder information, or similar detritus not allowed
This happens because com.apple.provenance (added by cloud storage services, Finder, or file downloads) was not being removed - only com.apple.FinderInfo was cleared.
Fix: Changed xattr -r -d com.apple.FinderInfo to xattr -cr to remove ALL extended attributes recursively.
Fixes #180351
Pre-launch Checklist