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.
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
[msbuild] Add ILStrip'ing for net6 applications. Fixes #11445. #12563
[msbuild] Add ILStrip'ing for net6 applications. Fixes #11445. #12563
Changes from 6 commits
b4bad89
87c5c96
fb4fef5
7b355ed
0f13eb3
cf78956
aea669e
cce0c87
80bc6f1
1c30a7f
8abf282
40b0985
c96c815
2a07c73
2d922d5
0ac7fbf
bca5bc3
de175fd
7be9298
1e02818
ffa97b9
1922f7d
7d5cdda
53a7a38
7a9e22e
a027e74
f215ae8
ca0cab7
f5c2845
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing the SessionId parameter and the IsMacEnabled condition, so when building from Windows this will only be executed on Windows. Like this:
xamarin-macios/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets
Line 364 in 74b161a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When building from Windows this won't be executed remotely because it's missing the SessionId property. Does this need to be executed on a Mac? Do we own this task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runtime team owns it: https://github.com/dotnet/runtime/pull/57359/files
And yes, this has to be executed on the Mac (it happens after the AOT compiler has executed, but before we sign the final .app)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this won't work then, for executing a task remotely we need to add the SessionId property and the logic to execute it remotely based on that value. We had the same problem with ILLink, and we ended up inheriting from the original task to add support for remoting it, see https://github.com/xamarin/xamarin-macios/blob/main/msbuild/Xamarin.iOS.Tasks/Tasks/ILLink.cs and https://github.com/xamarin/xamarin-macios/blob/main/msbuild/Xamarin.iOS.Tasks.Core/Tasks/ILLinkBase.cs. The base class is adding input and output properties for all the files that need to be copied to the Mac and the output ones that need to be created on Windows. I'm not sure if there's a better way for doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emaf I think @chamons can try to implement this but can you help us testing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking a stab at this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dalexsoto I'll be out next week, but @mauroa should be able to help with any questions. Please keep in mind he has many things in his plate already, but he'll try to test this from Windows once the changes are ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:
nostring
->nostrip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task should take
EnableAssemblyILStripping
as input as well, otherwise it won't be possible for users to override the default by settingEnableAssemblyILStripping
to something.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is correct.
I hacked up a test project: https://gist.github.com/chamons/abe82c128d909df53a1780c792394dab to check
In it, I invoke ParseBundlerArguments with some _BundlerArguments and EnableAssemblyILStripping preset. I print before and after, and I don't think it overrides (with 0f13eb3).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on ^?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convince mostly. Writing out log is almost free, and being able to test sim was nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Target
strip-dotnet:
can also be removed now :)and the README updated to document how to preserve the IL for analysis (it's already done for legacy)