Fix trimmed library test assemblies missing from app bundles on tvOS#126988
Open
kotlarmilos wants to merge 1 commit intodotnet:mainfrom
Open
Fix trimmed library test assemblies missing from app bundles on tvOS#126988kotlarmilos wants to merge 1 commit intodotnet:mainfrom
kotlarmilos wants to merge 1 commit intodotnet:mainfrom
Conversation
PR dotnet#125673 changed Microsoft.NET.ILLink.targets to skip creating the TrimmerRootAssembly item for Library-output projects. The RootEntireIntermediateAssembly target in tests.mobile.targets relied on that item existing so it could update its RootMode metadata from EntryPoint to 'all'. Since the item no longer exists for Library projects, the metadata update is a no-op and the test assembly is left unrooted. ILLink then trims it entirely, causing all Release library tests on tvOS (both CoreCLR and Mono) to fail with: 'Test libs were not found (*.Tests.dll was not found in ...)' Fix by using Remove+Include to unconditionally create the TrimmerRootAssembly item with RootMode='all', regardless of whether the SDK already created one. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes tvOS Release library test app bundles losing trimmed test assemblies by ensuring the test project’s intermediate assembly is always rooted for ILLink when the project output is not an executable.
Changes:
- Update
RootEntireIntermediateAssemblyto unconditionally (re)create theTrimmerRootAssemblyitem withRootMode=allviaRemove+Include. - Adjust the surrounding comment to explain why the SDK no longer provides the item for
OutputType=Library.
Member
Author
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Apr 16, 2026
Open
sbomer
approved these changes
Apr 16, 2026
| The SDK settings root only the entry point by default. These targets are used not only for standard | ||
| console apps, but also for test projects without an entry point. --> | ||
| The SDK no longer creates a TrimmerRootAssembly item for Library projects (see | ||
| Microsoft.NET.ILLink.targets), so update the metadata if the item exists and |
Member
There was a problem hiding this comment.
nit: the comment seems inaccurate since this is removing the update
This was referenced Apr 16, 2026
This was referenced Apr 16, 2026
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.
Summary
PR #125673 changed
Microsoft.NET.ILLink.targetsto skip creating theTrimmerRootAssemblyitem for Library-output projects. TheRootEntireIntermediateAssemblytarget ineng/testing/tests.mobile.targetsrelied on that item existing so it could update itsRootModemetadata fromEntryPointtoall.Since the item no longer exists for Library projects, the metadata update is a no-op and the test assembly is left unrooted. ILLink trims it entirely, causing all Release library tests on tvOS (both CoreCLR and Mono) to fail with:
Fix
Change
RootEntireIntermediateAssemblyto useRemove+Includeinstead of metadata update, so the item is unconditionally created withRootMode=allregardless of whether the SDK already created one.cc @sbomer