-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Cleanup, and little improvement for aggressive trimming #46587
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
Conversation
- The `ConfigureTrimming` target adds xunit assemblies explicitly, and
sets `TriggerRootAssembly` too.
- Looking at the files being linked, some issues noticed:
- Multiple copies of xunit assemblies, from various locations are
included. Eg. from `System.Buffer.Tests`, `WasmTestRunner`, and
from the nuget
- `WasmTestRunner` is explicitly added as `TriggerRootAssembly`, but
it is also passed as an arg for linking, `-p link ...`
- `xunit.runner.json` is incorrectly added to the files to be linked
- Instead:
- all the files to be published are already in
`ResolvedFileToPublish` after `AddTestRunnersToPublishedFiles` target
- so, we mark everything for linking,
- *except*:
- main test assembly
- and the test runner assembly
- This way we are explicitly specifying which assemblies to link,
and which ones to `copy`
- This reduces the size:
- 3.1M to 2.6M `artifacts/bin/System.Buffers.Tests/net6.0-Release/browser-wasm/AppBundle/managed/`
- 46M to 31M `artifacts/bin/System.Buffers.Tests/net6.0-Release/browser-wasm/AppBundle/publish/`
|
Tagging subscribers to 'arch-wasm': @lewing Issue Details
|
|
Tagging subscribers to this area: @safern, @ViktorHofer Issue Details
|
mdh1418
left a comment
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.
Thanks! Looks good to me.
steveisok
left a comment
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.
Excellent! Thanks for trimming even more.
lewing
left a comment
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
ConfigureTrimmingtarget adds xunit assemblies explicitly, andsets
TriggerRootAssemblytoo.Looking at the files being linked, some issues noticed:
included. Eg. from
System.Buffer.Tests,WasmTestRunner, andfrom the nuget
WasmTestRunneris explicitly added asTriggerRootAssembly, butit is also passed as an arg for linking,
-p link ...xunit.runner.jsonis incorrectly added to the files to be linkedInstead:
all the files to be published are already in
ResolvedFileToPublishafterAddTestRunnersToPublishedFilestargetso, we mark everything for linking,
except the main test assembly
Also, we use the test runner as a root
This way we are explicitly specifying which assemblies to link,
and which ones to
copyThis reduces the size:
artifacts/bin/System.Buffers.Tests/net6.0-Release/browser-wasm/AppBundle/managed/artifacts/bin/System.Buffers.Tests/net6.0-Release/browser-wasm/AppBundle/publish/