[net6] Fix ILStrip'ed apps to actually work again - #13098
Merged
Conversation
- In a late minute change to the ILStrip PR (dotnet#12563) a change to support XVS support broke execution of Apps that were stripped - Applications were broken because none of the stripped assemblies were actually copied into the bundle - However, the tests still passed, because all assemblies that were there had no IL (zero assemblies total) Now why did this happen? - The stripped assemblies were changed to return via an msbuild Output Element - Output Element can return an Property or ItemGroup, depending if you use the PropertyName or ItemName attributes - Unfortunately I used PropertyName, when I expected an ItemGroup. So I silently had a property created instead. - Thus zero items were added to the list of files to copy into the bundle - Which was undetected as the test did not confirm files were copied in, and manual tests were not run so late into the PR (3 weeks after PR was opened) How was it fixed? - Correctly using ItemName on Output created a valid item group to reference - However, that still failed with an absurdly confusing error: PATH/Microsoft.NET.Publish.targets(277,5): error MSB3024: Could not copy the file FILE to the destination file PATH, because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles. - After a splunking through netcore targets, I found the metadata on these assemblies references really matters. Without it, they are not processed correctly at all. - Thus, I updated ILStripBase to clone the existing metadata when changing the original assembly reference to the stripped path - Finally, I corrected the test to assert that required files are copied in. I also manually ran our device test.
tj-devel709
approved these changes
Oct 22, 2021
Collaborator
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffView dotnet API diffView dotnet legacy API diffGitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results1 tests failed, 131 tests passed.Failed tests
Pipeline on Agent XAMBOT-1100.BigSur' |
filipnavara
approved these changes
Oct 24, 2021
rolfbjarne
approved these changes
Oct 25, 2021
dalexsoto
approved these changes
Oct 25, 2021
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Contributor
Author
|
Test failure was good old https://github.com/xamarin/maccore/issues/2443 |
emaf
approved these changes
Oct 25, 2021
Member
|
/sudo backport release/6.0.1xx-preview10 |
Collaborator
|
Backport Job to branch release/6.0.1xx-preview10 Created! The magic is happening here |
Collaborator
|
Hooray! Backport succeeded! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5367047 for more details. |
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.
Fixes: #13094
Now why did this happen?
How was it fixed?