[msbuild] Improve logic to clean up app bundle for unwanted files. - #15080
Merged
rolfbjarne merged 2 commits intoMay 30, 2022
Merged
Conversation
The current directory at launch is the root directory of the app bundle. This means that any files written to the current directory when an app is executed, will be placed there. This becomes a problem when the app is rebuilt (and resigned), because a valid macOS app bundle doesn't have any files in the root directory of the app bundle, so signing fails. We have logic to automatically crash crash reports from the app bundle, but it turns out this is a more common problem with other types of files (and folders), so improve the logic a bit: * Add support for setting a property to automatically clean up everything from an app bundle we don't think should be there (which is anything not in a Contents/ subdirectory). * Use the same property to add support for disabling any cleaning (we already clean mono's crash reports by default). * Improve detection of unwanted files to include directories inside the app bundle, not only files. Ref: dotnet/maui#7353
emaf
approved these changes
May 20, 2022
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Therzok
reviewed
May 20, 2022
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
Collaborator
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
Collaborator
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌Failed tests are:
Pipeline on Agent |
Collaborator
📋 [PR Build] API Diff 📋API diff (for current PR)ℹ️ API Diff (from PR only) (please review changes) .NETXamarin vs .NETAPI diff (vs stable)✅ API Diff from stable .NETXamarin vs .NETGenerator diff✅ Generator Diff (no change) Pipeline on Agent XAMBOT-1105.Monterey' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current directory at launch is the root directory of the app bundle. This
means that any files written to the current directory when an app is executed,
will be placed there. This becomes a problem when the app is rebuilt (and
resigned), because a valid macOS app bundle doesn't have any files in the root
directory of the app bundle, so signing fails.
We have logic to automatically crash crash reports from the app bundle, but it
turns out this is a more common problem with other types of files (and
folders), so improve the logic a bit:
an app bundle we don't think should be there (which is anything not in a
Contents/ subdirectory).
clean mono's crash reports by default).
bundle, not only files.
Ref: dotnet/maui#7353