Skip to content
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

Remove hardcoded non trimmable assemblies in oob.proj #72171

Merged
merged 3 commits into from
Jul 14, 2022

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Jul 14, 2022

Fixes #72166

Use the TargetPathWithTargetPlatformMoniker to flow through the IsTrimmable property that is set by projects and use that for illink validation assembly selection.

Validated that the inputs to the task are the same as before (except for System.Composition.AttributedModel and System.Composition.Runtime which were incorrectly excluded). If because of a code refactoring, the IsTrimmable property wouldn't flow anymore to consuming repositories, the ILLink task would fail because it would get a zero item collection input (tried that out locally).

List of trimmable out-of-band assemblies Microsoft.Bcl.AsyncInterfaces\Debug\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll Microsoft.Extensions.Caching.Abstractions\Debug\net7.0\Microsoft.Extensions.Caching.Abstractions.dll Microsoft.Extensions.Caching.Memory\Debug\net7.0\Microsoft.Extensions.Caching.Memory.dll Microsoft.Extensions.Configuration.Abstractions\Debug\net7.0\Microsoft.Extensions.Configuration.Abstractions.dll Microsoft.Extensions.Configuration.Binder\Debug\net7.0\Microsoft.Extensions.Configuration.Binder.dll Microsoft.Extensions.Configuration.CommandLine\Debug\net7.0\Microsoft.Extensions.Configuration.CommandLine.dll Microsoft.Extensions.Configuration.EnvironmentVariables\Debug\net7.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll Microsoft.Extensions.Configuration.FileExtensions\Debug\net7.0\Microsoft.Extensions.Configuration.FileExtensions.dll Microsoft.Extensions.Configuration.Ini\Debug\net7.0\Microsoft.Extensions.Configuration.Ini.dll Microsoft.Extensions.Configuration.Json\Debug\net7.0\Microsoft.Extensions.Configuration.Json.dll Microsoft.Extensions.Configuration.UserSecrets\Debug\net7.0\Microsoft.Extensions.Configuration.UserSecrets.dll Microsoft.Extensions.Configuration.Xml\Debug\net7.0\Microsoft.Extensions.Configuration.Xml.dll Microsoft.Extensions.Configuration\Debug\net7.0\Microsoft.Extensions.Configuration.dll Microsoft.Extensions.DependencyInjection.Abstractions\Debug\net7.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll Microsoft.Extensions.DependencyInjection\Debug\net7.0\Microsoft.Extensions.DependencyInjection.dll Microsoft.Extensions.DependencyModel\Debug\net7.0\Microsoft.Extensions.DependencyModel.dll Microsoft.Extensions.FileProviders.Abstractions\Debug\net7.0\Microsoft.Extensions.FileProviders.Abstractions.dll Microsoft.Extensions.FileProviders.Composite\Debug\net7.0\Microsoft.Extensions.FileProviders.Composite.dll Microsoft.Extensions.FileProviders.Physical\Debug\net7.0\Microsoft.Extensions.FileProviders.Physical.dll Microsoft.Extensions.FileSystemGlobbing\Debug\net7.0\Microsoft.Extensions.FileSystemGlobbing.dll Microsoft.Extensions.Hosting.Abstractions\Debug\net7.0\Microsoft.Extensions.Hosting.Abstractions.dll Microsoft.Extensions.Hosting.Systemd\Debug\net7.0\Microsoft.Extensions.Hosting.Systemd.dll Microsoft.Extensions.Hosting.WindowsServices\Debug\net7.0\Microsoft.Extensions.Hosting.WindowsServices.dll Microsoft.Extensions.Hosting\Debug\net7.0\Microsoft.Extensions.Hosting.dll Microsoft.Extensions.Http\Debug\net7.0\Microsoft.Extensions.Http.dll Microsoft.Extensions.Logging.Abstractions\Debug\net7.0\Microsoft.Extensions.Logging.Abstractions.dll Microsoft.Extensions.Logging.Configuration\Debug\net7.0\Microsoft.Extensions.Logging.Configuration.dll Microsoft.Extensions.Logging.Console\Debug\net7.0\Microsoft.Extensions.Logging.Console.dll Microsoft.Extensions.Logging.Debug\Debug\net7.0\Microsoft.Extensions.Logging.Debug.dll Microsoft.Extensions.Logging.EventLog\Debug\net7.0\Microsoft.Extensions.Logging.EventLog.dll Microsoft.Extensions.Logging.EventSource\Debug\net7.0\Microsoft.Extensions.Logging.EventSource.dll Microsoft.Extensions.Logging.TraceSource\Debug\net7.0\Microsoft.Extensions.Logging.TraceSource.dll Microsoft.Extensions.Logging\Debug\net7.0\Microsoft.Extensions.Logging.dll Microsoft.Extensions.Options.ConfigurationExtensions\Debug\net7.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll Microsoft.Extensions.Options.DataAnnotations\Debug\net7.0\Microsoft.Extensions.Options.DataAnnotations.dll Microsoft.Extensions.Options\Debug\net7.0\Microsoft.Extensions.Options.dll Microsoft.Extensions.Primitives\Debug\net7.0\Microsoft.Extensions.Primitives.dll System.Composition.AttributedModel\Debug\net7.0\System.Composition.AttributedModel.dll System.Composition.Runtime\Debug\net7.0\System.Composition.Runtime.dll System.Formats.Cbor\Debug\net7.0\System.Formats.Cbor.dll System.IO.Hashing\Debug\net7.0\System.IO.Hashing.dll System.IO.Packaging\Debug\net7.0\System.IO.Packaging.dll System.IO.Pipelines\Debug\net7.0\System.IO.Pipelines.dll System.Memory.Data\Debug\net7.0\System.Memory.Data.dll System.Numerics.Tensors\Debug\net7.0\System.Numerics.Tensors.dll System.Reflection.Context\Debug\net7.0\System.Reflection.Context.dll System.Reflection.MetadataLoadContext\Debug\net7.0\System.Reflection.MetadataLoadContext.dll System.Resources.Extensions\Debug\net7.0\System.Resources.Extensions.dll System.Security.Cryptography.Cose\Debug\net7.0\System.Security.Cryptography.Cose.dll System.Security.Cryptography.Xml\Debug\net7.0\System.Security.Cryptography.Xml.dll System.Security.Permissions\Debug\net7.0\System.Security.Permissions.dll System.ServiceModel.Syndication\Debug\net7.0\System.ServiceModel.Syndication.dll System.Threading.RateLimiting\Debug\net7.0\System.Threading.RateLimiting.dll Microsoft.Win32.Registry.AccessControl\Debug\net7.0-windows\Microsoft.Win32.Registry.AccessControl.dll Microsoft.Win32.SystemEvents\Debug\net7.0-windows\Microsoft.Win32.SystemEvents.dll System.Data.Odbc\Debug\net7.0-windows\System.Data.Odbc.dll System.Data.OleDb\Debug\net7.0-windows\System.Data.OleDb.dll System.Diagnostics.EventLog\Debug\net7.0-windows\System.Diagnostics.EventLog.dll System.Diagnostics.PerformanceCounter\Debug\net7.0-windows\System.Diagnostics.PerformanceCounter.dll System.DirectoryServices.AccountManagement\Debug\net7.0-windows\System.DirectoryServices.AccountManagement.dll System.DirectoryServices.Protocols\Debug\net7.0-windows\System.DirectoryServices.Protocols.dll System.DirectoryServices\Debug\net7.0-windows\System.DirectoryServices.dll System.Drawing.Common\Debug\net7.0-windows\System.Drawing.Common.dll System.IO.Ports\Debug\net7.0-windows\System.IO.Ports.dll System.Management\Debug\net7.0-windows\System.Management.dll System.Net.Http.WinHttpHandler\Debug\net7.0-windows\System.Net.Http.WinHttpHandler.dll System.Runtime.Caching\Debug\net7.0-windows\System.Runtime.Caching.dll System.Security.Cryptography.Pkcs\Debug\net7.0-windows\System.Security.Cryptography.Pkcs.dll System.Security.Cryptography.ProtectedData\Debug\net7.0-windows\System.Security.Cryptography.ProtectedData.dll System.ServiceProcess.ServiceController\Debug\net7.0-windows\System.ServiceProcess.ServiceController.dll System.Threading.AccessControl\Debug\net7.0-windows\System.Threading.AccessControl.dll System.Windows.Extensions\Debug\net7.0-windows\System.Windows.Extensions.dll
List of assemblies passed in as references (sfx + non trimmable) Microsoft.Extensions.DependencyInjection.Specification.Tests\Debug\net7.0\Microsoft.Extensions.DependencyInjection.Specification.Tests.dll System.CodeDom\Debug\net7.0\System.CodeDom.dll System.ComponentModel.Composition.Registration\Debug\net7.0\System.ComponentModel.Composition.Registration.dll System.ComponentModel.Composition\Debug\net7.0\System.ComponentModel.Composition.dll System.Composition.Convention\Debug\net7.0\System.Composition.Convention.dll System.Composition.Hosting\Debug\net7.0\System.Composition.Hosting.dll System.Composition.TypedParts\Debug\net7.0\System.Composition.TypedParts.dll System.Configuration.ConfigurationManager\Debug\net7.0\System.Configuration.ConfigurationManager.dll System.Speech\Debug\net7.0-windows\System.Speech.dll Microsoft.CSharp\Debug\net7.0-windows\Microsoft.CSharp.dll Microsoft.VisualBasic.Core\Debug\net7.0-windows\Microsoft.VisualBasic.Core.dll Microsoft.Win32.Registry\Debug\net7.0-windows\Microsoft.Win32.Registry.dll System.Console\Debug\net7.0-windows\System.Console.dll System.Diagnostics.FileVersionInfo\Debug\net7.0-windows\System.Diagnostics.FileVersionInfo.dll System.Diagnostics.Process\Debug\net7.0-windows\System.Diagnostics.Process.dll System.Drawing.Primitives\Debug\net7.0-windows\System.Drawing.Primitives.dll System.Formats.Tar\Debug\net7.0-windows\System.Formats.Tar.dll System.IO.Compression.Brotli\Debug\net7.0-windows\System.IO.Compression.Brotli.dll System.IO.Compression.ZipFile\Debug\net7.0-windows\System.IO.Compression.ZipFile.dll System.IO.Compression\Debug\net7.0-windows\System.IO.Compression.dll System.IO.FileSystem.AccessControl\Debug\net7.0-windows\System.IO.FileSystem.AccessControl.dll System.IO.FileSystem.DriveInfo\Debug\net7.0-windows\System.IO.FileSystem.DriveInfo.dll System.IO.FileSystem.Watcher\Debug\net7.0-windows\System.IO.FileSystem.Watcher.dll System.IO.IsolatedStorage\Debug\net7.0-windows\System.IO.IsolatedStorage.dll System.IO.MemoryMappedFiles\Debug\net7.0-windows\System.IO.MemoryMappedFiles.dll System.IO.Pipes.AccessControl\Debug\net7.0-windows\System.IO.Pipes.AccessControl.dll System.IO.Pipes\Debug\net7.0-windows\System.IO.Pipes.dll System.Net.HttpListener\Debug\net7.0-windows\System.Net.HttpListener.dll System.Net.Http\Debug\net7.0-windows\System.Net.Http.dll System.Net.Mail\Debug\net7.0-windows\System.Net.Mail.dll System.Net.NameResolution\Debug\net7.0-windows\System.Net.NameResolution.dll System.Net.NetworkInformation\Debug\net7.0-windows\System.Net.NetworkInformation.dll System.Net.Ping\Debug\net7.0-windows\System.Net.Ping.dll System.Net.Primitives\Debug\net7.0-windows\System.Net.Primitives.dll System.Net.Quic\Debug\net7.0-windows\System.Net.Quic.dll System.Net.Requests\Debug\net7.0-windows\System.Net.Requests.dll System.Net.Security\Debug\net7.0-windows\System.Net.Security.dll System.Net.Sockets\Debug\net7.0-windows\System.Net.Sockets.dll System.Net.WebSockets\Debug\net7.0-windows\System.Net.WebSockets.dll System.Private.Xml\Debug\net7.0-windows\System.Private.Xml.dll System.Security.AccessControl\Debug\net7.0-windows\System.Security.AccessControl.dll System.Security.Cryptography\Debug\net7.0-windows\System.Security.Cryptography.dll System.Security.Principal.Windows\Debug\net7.0-windows\System.Security.Principal.Windows.dll System.Text.Encoding.CodePages\Debug\net7.0-windows\System.Text.Encoding.CodePages.dll Microsoft.Win32.Primitives\Debug\net7.0\Microsoft.Win32.Primitives.dll System.AppContext\Debug\net7.0\System.AppContext.dll System.Buffers\Debug\net7.0\System.Buffers.dll System.Collections.Concurrent\Debug\net7.0\System.Collections.Concurrent.dll System.Collections.NonGeneric\Debug\net7.0\System.Collections.NonGeneric.dll System.Collections.Specialized\Debug\net7.0\System.Collections.Specialized.dll System.Collections\Debug\net7.0\System.Collections.dll System.ComponentModel.Annotations\Debug\net7.0\System.ComponentModel.Annotations.dll System.ComponentModel.EventBasedAsync\Debug\net7.0\System.ComponentModel.EventBasedAsync.dll System.ComponentModel.Primitives\Debug\net7.0\System.ComponentModel.Primitives.dll System.ComponentModel.TypeConverter\Debug\net7.0\System.ComponentModel.TypeConverter.dll System.ComponentModel\Debug\net7.0\System.ComponentModel.dll System.Data.Common\Debug\net7.0\System.Data.Common.dll System.Data.DataSetExtensions\Debug\net7.0\System.Data.DataSetExtensions.dll System.Diagnostics.Contracts\Debug\net7.0\System.Diagnostics.Contracts.dll System.Diagnostics.Debug\Debug\net7.0\System.Diagnostics.Debug.dll System.Diagnostics.StackTrace\Debug\net7.0\System.Diagnostics.StackTrace.dll System.Diagnostics.TextWriterTraceListener\Debug\net7.0\System.Diagnostics.TextWriterTraceListener.dll System.Diagnostics.Tools\Debug\net7.0\System.Diagnostics.Tools.dll System.Diagnostics.TraceSource\Debug\net7.0\System.Diagnostics.TraceSource.dll System.Diagnostics.Tracing\Debug\net7.0\System.Diagnostics.Tracing.dll System.Dynamic.Runtime\Debug\net7.0\System.Dynamic.Runtime.dll System.Globalization.Calendars\Debug\net7.0\System.Globalization.Calendars.dll System.Globalization.Extensions\Debug\net7.0\System.Globalization.Extensions.dll System.Globalization\Debug\net7.0\System.Globalization.dll System.IO.FileSystem.Primitives\Debug\net7.0\System.IO.FileSystem.Primitives.dll System.IO.FileSystem\Debug\net7.0\System.IO.FileSystem.dll System.IO.UnmanagedMemoryStream\Debug\net7.0\System.IO.UnmanagedMemoryStream.dll System.IO\Debug\net7.0\System.IO.dll System.Linq.Parallel\Debug\net7.0\System.Linq.Parallel.dll System.Linq.Queryable\Debug\net7.0\System.Linq.Queryable.dll System.Memory\Debug\net7.0\System.Memory.dll System.Net.ServicePoint\Debug\net7.0\System.Net.ServicePoint.dll System.Net.WebHeaderCollection\Debug\net7.0\System.Net.WebHeaderCollection.dll System.Numerics.Vectors\Debug\net7.0\System.Numerics.Vectors.dll System.ObjectModel\Debug\net7.0\System.ObjectModel.dll System.Private.DataContractSerialization\Debug\net7.0\System.Private.DataContractSerialization.dll System.Private.Uri\Debug\net7.0\System.Private.Uri.dll System.Private.Xml.Linq\Debug\net7.0\System.Private.Xml.Linq.dll System.Reflection.DispatchProxy\Debug\net7.0\System.Reflection.DispatchProxy.dll System.Reflection.Emit.ILGeneration\Debug\net7.0\System.Reflection.Emit.ILGeneration.dll System.Reflection.Emit.Lightweight\Debug\net7.0\System.Reflection.Emit.Lightweight.dll System.Reflection.Emit\Debug\net7.0\System.Reflection.Emit.dll System.Reflection.Extensions\Debug\net7.0\System.Reflection.Extensions.dll System.Reflection.Primitives\Debug\net7.0\System.Reflection.Primitives.dll System.Reflection.TypeExtensions\Debug\net7.0\System.Reflection.TypeExtensions.dll System.Reflection\Debug\net7.0\System.Reflection.dll System.Resources.Reader\Debug\net7.0\System.Resources.Reader.dll System.Resources.ResourceManager\Debug\net7.0\System.Resources.ResourceManager.dll System.Resources.Writer\Debug\net7.0\System.Resources.Writer.dll System.Runtime.CompilerServices.Unsafe\Debug\net7.0\System.Runtime.CompilerServices.Unsafe.dll System.Runtime.CompilerServices.VisualC\Debug\net7.0\System.Runtime.CompilerServices.VisualC.dll System.Runtime.Extensions\Debug\net7.0\System.Runtime.Extensions.dll System.Runtime.Handles\Debug\net7.0\System.Runtime.Handles.dll System.Runtime.InteropServices.RuntimeInformation\Debug\net7.0\System.Runtime.InteropServices.RuntimeInformation.dll System.Runtime.InteropServices\Debug\net7.0\System.Runtime.InteropServices.dll System.Runtime.Intrinsics\Debug\net7.0\System.Runtime.Intrinsics.dll System.Runtime.Loader\Debug\net7.0\System.Runtime.Loader.dll System.Runtime.Numerics\Debug\net7.0\System.Runtime.Numerics.dll System.Runtime.Serialization.Json\Debug\net7.0\System.Runtime.Serialization.Json.dll System.Runtime.Serialization.Primitives\Debug\net7.0\System.Runtime.Serialization.Primitives.dll System.Runtime.Serialization.Xml\Debug\net7.0\System.Runtime.Serialization.Xml.dll System.Runtime\Debug\net7.0\System.Runtime.dll System.Security.Claims\Debug\net7.0\System.Security.Claims.dll System.Security.Cryptography.Algorithms\Debug\net7.0\System.Security.Cryptography.Algorithms.dll System.Security.Cryptography.Cng\Debug\net7.0\System.Security.Cryptography.Cng.dll System.Security.Cryptography.Csp\Debug\net7.0\System.Security.Cryptography.Csp.dll System.Security.Cryptography.Encoding\Debug\net7.0\System.Security.Cryptography.Encoding.dll System.Security.Cryptography.OpenSsl\Debug\net7.0\System.Security.Cryptography.OpenSsl.dll System.Security.Cryptography.Primitives\Debug\net7.0\System.Security.Cryptography.Primitives.dll System.Security.Cryptography.X509Certificates\Debug\net7.0\System.Security.Cryptography.X509Certificates.dll System.Security.Principal\Debug\net7.0\System.Security.Principal.dll System.Security.SecureString\Debug\net7.0\System.Security.SecureString.dll System.Text.Encoding.Extensions\Debug\net7.0\System.Text.Encoding.Extensions.dll System.Text.Encoding\Debug\net7.0\System.Text.Encoding.dll System.Text.RegularExpressions\Debug\net7.0\System.Text.RegularExpressions.dll System.Threading.Overlapped\Debug\net7.0\System.Threading.Overlapped.dll System.Threading.Tasks.Extensions\Debug\net7.0\System.Threading.Tasks.Extensions.dll System.Threading.Tasks.Parallel\Debug\net7.0\System.Threading.Tasks.Parallel.dll System.Threading.Tasks\Debug\net7.0\System.Threading.Tasks.dll System.Threading.ThreadPool\Debug\net7.0\System.Threading.ThreadPool.dll System.Threading.Thread\Debug\net7.0\System.Threading.Thread.dll System.Threading.Timer\Debug\net7.0\System.Threading.Timer.dll System.Threading\Debug\net7.0\System.Threading.dll System.Transactions.Local\Debug\net7.0\System.Transactions.Local.dll System.ValueTuple\Debug\net7.0\System.ValueTuple.dll System.Web.HttpUtility\Debug\net7.0\System.Web.HttpUtility.dll System.Xml.ReaderWriter\Debug\net7.0\System.Xml.ReaderWriter.dll System.Xml.XDocument\Debug\net7.0\System.Xml.XDocument.dll System.Xml.XmlDocument\Debug\net7.0\System.Xml.XmlDocument.dll System.Xml.XmlSerializer\Debug\net7.0\System.Xml.XmlSerializer.dll System.Xml.XPath.XDocument\Debug\net7.0\System.Xml.XPath.XDocument.dll System.Xml.XPath\Debug\net7.0\System.Xml.XPath.dll coreclr\windows.x64.Debug\IL\System.Private.CoreLib.dll System.Collections.Immutable\Debug\net7.0\System.Collections.Immutable.dll System.Diagnostics.DiagnosticSource\Debug\net7.0\System.Diagnostics.DiagnosticSource.dll System.Formats.Asn1\Debug\net7.0\System.Formats.Asn1.dll System.Linq.Expressions\Debug\net7.0\System.Linq.Expressions.dll System.Linq\Debug\net7.0\System.Linq.dll System.Net.Http.Json\Debug\net7.0\System.Net.Http.Json.dll System.Net.WebClient\Debug\net7.0\System.Net.WebClient.dll System.Net.WebProxy\Debug\net7.0\System.Net.WebProxy.dll System.Net.WebSockets.Client\Debug\net7.0\System.Net.WebSockets.Client.dll System.Reflection.Metadata\Debug\net7.0\System.Reflection.Metadata.dll System.Runtime.InteropServices.JavaScript\Debug\net7.0\System.Runtime.InteropServices.JavaScript.dll System.Runtime.Serialization.Formatters\Debug\net7.0\System.Runtime.Serialization.Formatters.dll System.Text.Encodings.Web\Debug\net7.0\System.Text.Encodings.Web.dll System.Text.Json\Debug\net7.0\System.Text.Json.dll System.Threading.Channels\Debug\net7.0\System.Threading.Channels.dll System.Threading.Tasks.Dataflow\Debug\net7.0\System.Threading.Tasks.Dataflow.dll Microsoft.VisualBasic\Debug\net7.0-windows\Microsoft.VisualBasic.dll mscorlib\Debug\net7.0-windows\mscorlib.dll netstandard\Debug\net7.0-windows\netstandard.dll System.ComponentModel.DataAnnotations\Debug\net7.0-windows\System.ComponentModel.DataAnnotations.dll System.Configuration\Debug\net7.0-windows\System.Configuration.dll System.Core\Debug\net7.0-windows\System.Core.dll System\Debug\net7.0-windows\System.dll System.Data\Debug\net7.0-windows\System.Data.dll System.Drawing\Debug\net7.0-windows\System.Drawing.dll System.IO.Compression.FileSystem\Debug\net7.0-windows\System.IO.Compression.FileSystem.dll System.Net\Debug\net7.0-windows\System.Net.dll System.Numerics\Debug\net7.0-windows\System.Numerics.dll System.Runtime.Serialization\Debug\net7.0-windows\System.Runtime.Serialization.dll System.Security\Debug\net7.0-windows\System.Security.dll System.ServiceModel.Web\Debug\net7.0-windows\System.ServiceModel.Web.dll System.ServiceProcess\Debug\net7.0-windows\System.ServiceProcess.dll System.Transactions\Debug\net7.0-windows\System.Transactions.dll System.Web\Debug\net7.0-windows\System.Web.dll System.Windows\Debug\net7.0-windows\System.Windows.dll System.Xml\Debug\net7.0-windows\System.Xml.dll System.Xml.Linq\Debug\net7.0-windows\System.Xml.Linq.dll System.Xml.Serialization\Debug\net7.0-windows\System.Xml.Serialization.dll WindowsBase\Debug\net7.0-windows\WindowsBase.dll

Fixes #72166

Use the `TargetPathWithTargetPlatformMoniker` to flow through the IsTrimmable property that is set by projects and use that for illink validation assembly selection.
@ViktorHofer ViktorHofer self-assigned this Jul 14, 2022
@ghost ghost added the linkable-framework Issues associated with delivering a linker friendly framework label Jul 14, 2022
@ghost
Copy link

ghost commented Jul 14, 2022

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #72166

Use the TargetPathWithTargetPlatformMoniker to flow through the IsTrimmable property that is set by projects and use that for illink validation assembly selection.

Validated that the inputs to the task are the same as before (except for System.Composition.AttributedModel and System.Composition.Runtime which were incorrectly excluded). If because of a code refactoring, the IsTrimmable property wouldn't flow anymore to consuming repositories, the ILLink task would fail because it would get a zero item collection input (tried that out locally).

List of trimmable out-of-band assemblies Microsoft.Bcl.AsyncInterfaces\Debug\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll Microsoft.Extensions.Caching.Abstractions\Debug\net7.0\Microsoft.Extensions.Caching.Abstractions.dll Microsoft.Extensions.Caching.Memory\Debug\net7.0\Microsoft.Extensions.Caching.Memory.dll Microsoft.Extensions.Configuration.Abstractions\Debug\net7.0\Microsoft.Extensions.Configuration.Abstractions.dll Microsoft.Extensions.Configuration.Binder\Debug\net7.0\Microsoft.Extensions.Configuration.Binder.dll Microsoft.Extensions.Configuration.CommandLine\Debug\net7.0\Microsoft.Extensions.Configuration.CommandLine.dll Microsoft.Extensions.Configuration.EnvironmentVariables\Debug\net7.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll Microsoft.Extensions.Configuration.FileExtensions\Debug\net7.0\Microsoft.Extensions.Configuration.FileExtensions.dll Microsoft.Extensions.Configuration.Ini\Debug\net7.0\Microsoft.Extensions.Configuration.Ini.dll Microsoft.Extensions.Configuration.Json\Debug\net7.0\Microsoft.Extensions.Configuration.Json.dll Microsoft.Extensions.Configuration.UserSecrets\Debug\net7.0\Microsoft.Extensions.Configuration.UserSecrets.dll Microsoft.Extensions.Configuration.Xml\Debug\net7.0\Microsoft.Extensions.Configuration.Xml.dll Microsoft.Extensions.Configuration\Debug\net7.0\Microsoft.Extensions.Configuration.dll Microsoft.Extensions.DependencyInjection.Abstractions\Debug\net7.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll Microsoft.Extensions.DependencyInjection\Debug\net7.0\Microsoft.Extensions.DependencyInjection.dll Microsoft.Extensions.DependencyModel\Debug\net7.0\Microsoft.Extensions.DependencyModel.dll Microsoft.Extensions.FileProviders.Abstractions\Debug\net7.0\Microsoft.Extensions.FileProviders.Abstractions.dll Microsoft.Extensions.FileProviders.Composite\Debug\net7.0\Microsoft.Extensions.FileProviders.Composite.dll Microsoft.Extensions.FileProviders.Physical\Debug\net7.0\Microsoft.Extensions.FileProviders.Physical.dll Microsoft.Extensions.FileSystemGlobbing\Debug\net7.0\Microsoft.Extensions.FileSystemGlobbing.dll Microsoft.Extensions.Hosting.Abstractions\Debug\net7.0\Microsoft.Extensions.Hosting.Abstractions.dll Microsoft.Extensions.Hosting.Systemd\Debug\net7.0\Microsoft.Extensions.Hosting.Systemd.dll Microsoft.Extensions.Hosting.WindowsServices\Debug\net7.0\Microsoft.Extensions.Hosting.WindowsServices.dll Microsoft.Extensions.Hosting\Debug\net7.0\Microsoft.Extensions.Hosting.dll Microsoft.Extensions.Http\Debug\net7.0\Microsoft.Extensions.Http.dll Microsoft.Extensions.Logging.Abstractions\Debug\net7.0\Microsoft.Extensions.Logging.Abstractions.dll Microsoft.Extensions.Logging.Configuration\Debug\net7.0\Microsoft.Extensions.Logging.Configuration.dll Microsoft.Extensions.Logging.Console\Debug\net7.0\Microsoft.Extensions.Logging.Console.dll Microsoft.Extensions.Logging.Debug\Debug\net7.0\Microsoft.Extensions.Logging.Debug.dll Microsoft.Extensions.Logging.EventLog\Debug\net7.0\Microsoft.Extensions.Logging.EventLog.dll Microsoft.Extensions.Logging.EventSource\Debug\net7.0\Microsoft.Extensions.Logging.EventSource.dll Microsoft.Extensions.Logging.TraceSource\Debug\net7.0\Microsoft.Extensions.Logging.TraceSource.dll Microsoft.Extensions.Logging\Debug\net7.0\Microsoft.Extensions.Logging.dll Microsoft.Extensions.Options.ConfigurationExtensions\Debug\net7.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll Microsoft.Extensions.Options.DataAnnotations\Debug\net7.0\Microsoft.Extensions.Options.DataAnnotations.dll Microsoft.Extensions.Options\Debug\net7.0\Microsoft.Extensions.Options.dll Microsoft.Extensions.Primitives\Debug\net7.0\Microsoft.Extensions.Primitives.dll System.Composition.AttributedModel\Debug\net7.0\System.Composition.AttributedModel.dll System.Composition.Runtime\Debug\net7.0\System.Composition.Runtime.dll System.Formats.Cbor\Debug\net7.0\System.Formats.Cbor.dll System.IO.Hashing\Debug\net7.0\System.IO.Hashing.dll System.IO.Packaging\Debug\net7.0\System.IO.Packaging.dll System.IO.Pipelines\Debug\net7.0\System.IO.Pipelines.dll System.Memory.Data\Debug\net7.0\System.Memory.Data.dll System.Numerics.Tensors\Debug\net7.0\System.Numerics.Tensors.dll System.Reflection.Context\Debug\net7.0\System.Reflection.Context.dll System.Reflection.MetadataLoadContext\Debug\net7.0\System.Reflection.MetadataLoadContext.dll System.Resources.Extensions\Debug\net7.0\System.Resources.Extensions.dll System.Security.Cryptography.Cose\Debug\net7.0\System.Security.Cryptography.Cose.dll System.Security.Cryptography.Xml\Debug\net7.0\System.Security.Cryptography.Xml.dll System.Security.Permissions\Debug\net7.0\System.Security.Permissions.dll System.ServiceModel.Syndication\Debug\net7.0\System.ServiceModel.Syndication.dll System.Threading.RateLimiting\Debug\net7.0\System.Threading.RateLimiting.dll Microsoft.Win32.Registry.AccessControl\Debug\net7.0-windows\Microsoft.Win32.Registry.AccessControl.dll Microsoft.Win32.SystemEvents\Debug\net7.0-windows\Microsoft.Win32.SystemEvents.dll System.Data.Odbc\Debug\net7.0-windows\System.Data.Odbc.dll System.Data.OleDb\Debug\net7.0-windows\System.Data.OleDb.dll System.Diagnostics.EventLog\Debug\net7.0-windows\System.Diagnostics.EventLog.dll System.Diagnostics.PerformanceCounter\Debug\net7.0-windows\System.Diagnostics.PerformanceCounter.dll System.DirectoryServices.AccountManagement\Debug\net7.0-windows\System.DirectoryServices.AccountManagement.dll System.DirectoryServices.Protocols\Debug\net7.0-windows\System.DirectoryServices.Protocols.dll System.DirectoryServices\Debug\net7.0-windows\System.DirectoryServices.dll System.Drawing.Common\Debug\net7.0-windows\System.Drawing.Common.dll System.IO.Ports\Debug\net7.0-windows\System.IO.Ports.dll System.Management\Debug\net7.0-windows\System.Management.dll System.Net.Http.WinHttpHandler\Debug\net7.0-windows\System.Net.Http.WinHttpHandler.dll System.Runtime.Caching\Debug\net7.0-windows\System.Runtime.Caching.dll System.Security.Cryptography.Pkcs\Debug\net7.0-windows\System.Security.Cryptography.Pkcs.dll System.Security.Cryptography.ProtectedData\Debug\net7.0-windows\System.Security.Cryptography.ProtectedData.dll System.ServiceProcess.ServiceController\Debug\net7.0-windows\System.ServiceProcess.ServiceController.dll System.Threading.AccessControl\Debug\net7.0-windows\System.Threading.AccessControl.dll System.Windows.Extensions\Debug\net7.0-windows\System.Windows.Extensions.dll
List of assemblies passed in as references (sfx + non trimmable) Microsoft.Extensions.DependencyInjection.Specification.Tests\Debug\net7.0\Microsoft.Extensions.DependencyInjection.Specification.Tests.dll System.CodeDom\Debug\net7.0\System.CodeDom.dll System.ComponentModel.Composition.Registration\Debug\net7.0\System.ComponentModel.Composition.Registration.dll System.ComponentModel.Composition\Debug\net7.0\System.ComponentModel.Composition.dll System.Composition.Convention\Debug\net7.0\System.Composition.Convention.dll System.Composition.Hosting\Debug\net7.0\System.Composition.Hosting.dll System.Composition.TypedParts\Debug\net7.0\System.Composition.TypedParts.dll System.Configuration.ConfigurationManager\Debug\net7.0\System.Configuration.ConfigurationManager.dll System.Speech\Debug\net7.0-windows\System.Speech.dll Microsoft.CSharp\Debug\net7.0-windows\Microsoft.CSharp.dll Microsoft.VisualBasic.Core\Debug\net7.0-windows\Microsoft.VisualBasic.Core.dll Microsoft.Win32.Registry\Debug\net7.0-windows\Microsoft.Win32.Registry.dll System.Console\Debug\net7.0-windows\System.Console.dll System.Diagnostics.FileVersionInfo\Debug\net7.0-windows\System.Diagnostics.FileVersionInfo.dll System.Diagnostics.Process\Debug\net7.0-windows\System.Diagnostics.Process.dll System.Drawing.Primitives\Debug\net7.0-windows\System.Drawing.Primitives.dll System.Formats.Tar\Debug\net7.0-windows\System.Formats.Tar.dll System.IO.Compression.Brotli\Debug\net7.0-windows\System.IO.Compression.Brotli.dll System.IO.Compression.ZipFile\Debug\net7.0-windows\System.IO.Compression.ZipFile.dll System.IO.Compression\Debug\net7.0-windows\System.IO.Compression.dll System.IO.FileSystem.AccessControl\Debug\net7.0-windows\System.IO.FileSystem.AccessControl.dll System.IO.FileSystem.DriveInfo\Debug\net7.0-windows\System.IO.FileSystem.DriveInfo.dll System.IO.FileSystem.Watcher\Debug\net7.0-windows\System.IO.FileSystem.Watcher.dll System.IO.IsolatedStorage\Debug\net7.0-windows\System.IO.IsolatedStorage.dll System.IO.MemoryMappedFiles\Debug\net7.0-windows\System.IO.MemoryMappedFiles.dll System.IO.Pipes.AccessControl\Debug\net7.0-windows\System.IO.Pipes.AccessControl.dll System.IO.Pipes\Debug\net7.0-windows\System.IO.Pipes.dll System.Net.HttpListener\Debug\net7.0-windows\System.Net.HttpListener.dll System.Net.Http\Debug\net7.0-windows\System.Net.Http.dll System.Net.Mail\Debug\net7.0-windows\System.Net.Mail.dll System.Net.NameResolution\Debug\net7.0-windows\System.Net.NameResolution.dll System.Net.NetworkInformation\Debug\net7.0-windows\System.Net.NetworkInformation.dll System.Net.Ping\Debug\net7.0-windows\System.Net.Ping.dll System.Net.Primitives\Debug\net7.0-windows\System.Net.Primitives.dll System.Net.Quic\Debug\net7.0-windows\System.Net.Quic.dll System.Net.Requests\Debug\net7.0-windows\System.Net.Requests.dll System.Net.Security\Debug\net7.0-windows\System.Net.Security.dll System.Net.Sockets\Debug\net7.0-windows\System.Net.Sockets.dll System.Net.WebSockets\Debug\net7.0-windows\System.Net.WebSockets.dll System.Private.Xml\Debug\net7.0-windows\System.Private.Xml.dll System.Security.AccessControl\Debug\net7.0-windows\System.Security.AccessControl.dll System.Security.Cryptography\Debug\net7.0-windows\System.Security.Cryptography.dll System.Security.Principal.Windows\Debug\net7.0-windows\System.Security.Principal.Windows.dll System.Text.Encoding.CodePages\Debug\net7.0-windows\System.Text.Encoding.CodePages.dll Microsoft.Win32.Primitives\Debug\net7.0\Microsoft.Win32.Primitives.dll System.AppContext\Debug\net7.0\System.AppContext.dll System.Buffers\Debug\net7.0\System.Buffers.dll System.Collections.Concurrent\Debug\net7.0\System.Collections.Concurrent.dll System.Collections.NonGeneric\Debug\net7.0\System.Collections.NonGeneric.dll System.Collections.Specialized\Debug\net7.0\System.Collections.Specialized.dll System.Collections\Debug\net7.0\System.Collections.dll System.ComponentModel.Annotations\Debug\net7.0\System.ComponentModel.Annotations.dll System.ComponentModel.EventBasedAsync\Debug\net7.0\System.ComponentModel.EventBasedAsync.dll System.ComponentModel.Primitives\Debug\net7.0\System.ComponentModel.Primitives.dll System.ComponentModel.TypeConverter\Debug\net7.0\System.ComponentModel.TypeConverter.dll System.ComponentModel\Debug\net7.0\System.ComponentModel.dll System.Data.Common\Debug\net7.0\System.Data.Common.dll System.Data.DataSetExtensions\Debug\net7.0\System.Data.DataSetExtensions.dll System.Diagnostics.Contracts\Debug\net7.0\System.Diagnostics.Contracts.dll System.Diagnostics.Debug\Debug\net7.0\System.Diagnostics.Debug.dll System.Diagnostics.StackTrace\Debug\net7.0\System.Diagnostics.StackTrace.dll System.Diagnostics.TextWriterTraceListener\Debug\net7.0\System.Diagnostics.TextWriterTraceListener.dll System.Diagnostics.Tools\Debug\net7.0\System.Diagnostics.Tools.dll System.Diagnostics.TraceSource\Debug\net7.0\System.Diagnostics.TraceSource.dll System.Diagnostics.Tracing\Debug\net7.0\System.Diagnostics.Tracing.dll System.Dynamic.Runtime\Debug\net7.0\System.Dynamic.Runtime.dll System.Globalization.Calendars\Debug\net7.0\System.Globalization.Calendars.dll System.Globalization.Extensions\Debug\net7.0\System.Globalization.Extensions.dll System.Globalization\Debug\net7.0\System.Globalization.dll System.IO.FileSystem.Primitives\Debug\net7.0\System.IO.FileSystem.Primitives.dll System.IO.FileSystem\Debug\net7.0\System.IO.FileSystem.dll System.IO.UnmanagedMemoryStream\Debug\net7.0\System.IO.UnmanagedMemoryStream.dll System.IO\Debug\net7.0\System.IO.dll System.Linq.Parallel\Debug\net7.0\System.Linq.Parallel.dll System.Linq.Queryable\Debug\net7.0\System.Linq.Queryable.dll System.Memory\Debug\net7.0\System.Memory.dll System.Net.ServicePoint\Debug\net7.0\System.Net.ServicePoint.dll System.Net.WebHeaderCollection\Debug\net7.0\System.Net.WebHeaderCollection.dll System.Numerics.Vectors\Debug\net7.0\System.Numerics.Vectors.dll System.ObjectModel\Debug\net7.0\System.ObjectModel.dll System.Private.DataContractSerialization\Debug\net7.0\System.Private.DataContractSerialization.dll System.Private.Uri\Debug\net7.0\System.Private.Uri.dll System.Private.Xml.Linq\Debug\net7.0\System.Private.Xml.Linq.dll System.Reflection.DispatchProxy\Debug\net7.0\System.Reflection.DispatchProxy.dll System.Reflection.Emit.ILGeneration\Debug\net7.0\System.Reflection.Emit.ILGeneration.dll System.Reflection.Emit.Lightweight\Debug\net7.0\System.Reflection.Emit.Lightweight.dll System.Reflection.Emit\Debug\net7.0\System.Reflection.Emit.dll System.Reflection.Extensions\Debug\net7.0\System.Reflection.Extensions.dll System.Reflection.Primitives\Debug\net7.0\System.Reflection.Primitives.dll System.Reflection.TypeExtensions\Debug\net7.0\System.Reflection.TypeExtensions.dll System.Reflection\Debug\net7.0\System.Reflection.dll System.Resources.Reader\Debug\net7.0\System.Resources.Reader.dll System.Resources.ResourceManager\Debug\net7.0\System.Resources.ResourceManager.dll System.Resources.Writer\Debug\net7.0\System.Resources.Writer.dll System.Runtime.CompilerServices.Unsafe\Debug\net7.0\System.Runtime.CompilerServices.Unsafe.dll System.Runtime.CompilerServices.VisualC\Debug\net7.0\System.Runtime.CompilerServices.VisualC.dll System.Runtime.Extensions\Debug\net7.0\System.Runtime.Extensions.dll System.Runtime.Handles\Debug\net7.0\System.Runtime.Handles.dll System.Runtime.InteropServices.RuntimeInformation\Debug\net7.0\System.Runtime.InteropServices.RuntimeInformation.dll System.Runtime.InteropServices\Debug\net7.0\System.Runtime.InteropServices.dll System.Runtime.Intrinsics\Debug\net7.0\System.Runtime.Intrinsics.dll System.Runtime.Loader\Debug\net7.0\System.Runtime.Loader.dll System.Runtime.Numerics\Debug\net7.0\System.Runtime.Numerics.dll System.Runtime.Serialization.Json\Debug\net7.0\System.Runtime.Serialization.Json.dll System.Runtime.Serialization.Primitives\Debug\net7.0\System.Runtime.Serialization.Primitives.dll System.Runtime.Serialization.Xml\Debug\net7.0\System.Runtime.Serialization.Xml.dll System.Runtime\Debug\net7.0\System.Runtime.dll System.Security.Claims\Debug\net7.0\System.Security.Claims.dll System.Security.Cryptography.Algorithms\Debug\net7.0\System.Security.Cryptography.Algorithms.dll System.Security.Cryptography.Cng\Debug\net7.0\System.Security.Cryptography.Cng.dll System.Security.Cryptography.Csp\Debug\net7.0\System.Security.Cryptography.Csp.dll System.Security.Cryptography.Encoding\Debug\net7.0\System.Security.Cryptography.Encoding.dll System.Security.Cryptography.OpenSsl\Debug\net7.0\System.Security.Cryptography.OpenSsl.dll System.Security.Cryptography.Primitives\Debug\net7.0\System.Security.Cryptography.Primitives.dll System.Security.Cryptography.X509Certificates\Debug\net7.0\System.Security.Cryptography.X509Certificates.dll System.Security.Principal\Debug\net7.0\System.Security.Principal.dll System.Security.SecureString\Debug\net7.0\System.Security.SecureString.dll System.Text.Encoding.Extensions\Debug\net7.0\System.Text.Encoding.Extensions.dll System.Text.Encoding\Debug\net7.0\System.Text.Encoding.dll System.Text.RegularExpressions\Debug\net7.0\System.Text.RegularExpressions.dll System.Threading.Overlapped\Debug\net7.0\System.Threading.Overlapped.dll System.Threading.Tasks.Extensions\Debug\net7.0\System.Threading.Tasks.Extensions.dll System.Threading.Tasks.Parallel\Debug\net7.0\System.Threading.Tasks.Parallel.dll System.Threading.Tasks\Debug\net7.0\System.Threading.Tasks.dll System.Threading.ThreadPool\Debug\net7.0\System.Threading.ThreadPool.dll System.Threading.Thread\Debug\net7.0\System.Threading.Thread.dll System.Threading.Timer\Debug\net7.0\System.Threading.Timer.dll System.Threading\Debug\net7.0\System.Threading.dll System.Transactions.Local\Debug\net7.0\System.Transactions.Local.dll System.ValueTuple\Debug\net7.0\System.ValueTuple.dll System.Web.HttpUtility\Debug\net7.0\System.Web.HttpUtility.dll System.Xml.ReaderWriter\Debug\net7.0\System.Xml.ReaderWriter.dll System.Xml.XDocument\Debug\net7.0\System.Xml.XDocument.dll System.Xml.XmlDocument\Debug\net7.0\System.Xml.XmlDocument.dll System.Xml.XmlSerializer\Debug\net7.0\System.Xml.XmlSerializer.dll System.Xml.XPath.XDocument\Debug\net7.0\System.Xml.XPath.XDocument.dll System.Xml.XPath\Debug\net7.0\System.Xml.XPath.dll coreclr\windows.x64.Debug\IL\System.Private.CoreLib.dll System.Collections.Immutable\Debug\net7.0\System.Collections.Immutable.dll System.Diagnostics.DiagnosticSource\Debug\net7.0\System.Diagnostics.DiagnosticSource.dll System.Formats.Asn1\Debug\net7.0\System.Formats.Asn1.dll System.Linq.Expressions\Debug\net7.0\System.Linq.Expressions.dll System.Linq\Debug\net7.0\System.Linq.dll System.Net.Http.Json\Debug\net7.0\System.Net.Http.Json.dll System.Net.WebClient\Debug\net7.0\System.Net.WebClient.dll System.Net.WebProxy\Debug\net7.0\System.Net.WebProxy.dll System.Net.WebSockets.Client\Debug\net7.0\System.Net.WebSockets.Client.dll System.Reflection.Metadata\Debug\net7.0\System.Reflection.Metadata.dll System.Runtime.InteropServices.JavaScript\Debug\net7.0\System.Runtime.InteropServices.JavaScript.dll System.Runtime.Serialization.Formatters\Debug\net7.0\System.Runtime.Serialization.Formatters.dll System.Text.Encodings.Web\Debug\net7.0\System.Text.Encodings.Web.dll System.Text.Json\Debug\net7.0\System.Text.Json.dll System.Threading.Channels\Debug\net7.0\System.Threading.Channels.dll System.Threading.Tasks.Dataflow\Debug\net7.0\System.Threading.Tasks.Dataflow.dll Microsoft.VisualBasic\Debug\net7.0-windows\Microsoft.VisualBasic.dll mscorlib\Debug\net7.0-windows\mscorlib.dll netstandard\Debug\net7.0-windows\netstandard.dll System.ComponentModel.DataAnnotations\Debug\net7.0-windows\System.ComponentModel.DataAnnotations.dll System.Configuration\Debug\net7.0-windows\System.Configuration.dll System.Core\Debug\net7.0-windows\System.Core.dll System\Debug\net7.0-windows\System.dll System.Data\Debug\net7.0-windows\System.Data.dll System.Drawing\Debug\net7.0-windows\System.Drawing.dll System.IO.Compression.FileSystem\Debug\net7.0-windows\System.IO.Compression.FileSystem.dll System.Net\Debug\net7.0-windows\System.Net.dll System.Numerics\Debug\net7.0-windows\System.Numerics.dll System.Runtime.Serialization\Debug\net7.0-windows\System.Runtime.Serialization.dll System.Security\Debug\net7.0-windows\System.Security.dll System.ServiceModel.Web\Debug\net7.0-windows\System.ServiceModel.Web.dll System.ServiceProcess\Debug\net7.0-windows\System.ServiceProcess.dll System.Transactions\Debug\net7.0-windows\System.Transactions.dll System.Web\Debug\net7.0-windows\System.Web.dll System.Windows\Debug\net7.0-windows\System.Windows.dll System.Xml\Debug\net7.0-windows\System.Xml.dll System.Xml.Linq\Debug\net7.0-windows\System.Xml.Linq.dll System.Xml.Serialization\Debug\net7.0-windows\System.Xml.Serialization.dll WindowsBase\Debug\net7.0-windows\WindowsBase.dll
Author: ViktorHofer
Assignees: ViktorHofer
Labels:

area-Infrastructure-libraries

Milestone: -

eng/illink.targets Outdated Show resolved Hide resolved
Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your change looks good. I just had one question about the existing behavior.

<OOBAssemblyToTrim Include="@(OOBAssemblyToTrimWithFilename->Metadata('OriginalIdentity'))" />
<OOBAssemblyReference Include="@(OOBAssemblyToIgnoreWithFilename->Metadata('OriginalIdentity'));
<OOBAssemblyToTrim Include="@(OOBAssembly->WithMetadataValue('IsTrimmable', 'true'))" />
<OOBAssemblyReference Include="@(OOBAssembly->WithMetadataValue('IsTrimmable', 'false'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was existing behavior, but I find it kind of weird that we are passing in these "untrimmable" assemblies as References for the trimmable assemblies.

@joperezr - do you remember why it was done this way? I would hope we don't have any "trimmable" assemblies that reference these "untrimmable" assemblies... that would seem backwards.

Copy link
Member Author

@ViktorHofer ViktorHofer Jul 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what you get when you don't pass them in as references:

  oob -> Trimming win-x64 out-of-band assemblies with ILLinker...
C:\git\runtime2\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\DiagnosticsConfiguration.cs(
69,13): Trim analysis warning IL2075: System.Diagnostics.DiagnosticsConfiguration.CanInitialize(): 'this' argument does
 not satisfy 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String, BindingFl
ags)'. The return value of method 'System.Type.GetTypeFromHandle(RuntimeTypeHandle)' does not have matching annotations
. The source value must declare at least the same requirements as those declared on the target location it is assigned
to. [C:\git\runtime2\src\libraries\oob.proj]
C:\git\runtime2\src\libraries\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\DiagnosticsConfiguration.cs(
86,17): Trim analysis warning IL2075: System.Diagnostics.DiagnosticsConfiguration.Initialize(): 'this' argument does no
t satisfy 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String, BindingFlags
)'. The return value of method 'System.Type.GetTypeFromHandle(RuntimeTypeHandle)' does not have matching annotations. T
he source value must declare at least the same requirements as those declared on the target location it is assigned to.
 [C:\git\runtime2\src\libraries\oob.proj]
ILLink : Trim analysis warning IL2062: System.Runtime.Caching.Configuration.MemoryCacheElement.Name: Value passed to pa
rameter 'type' of method 'System.ComponentModel.TypeConverterAttribute.TypeConverterAttribute(Type)' can not be statica
lly determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. [C:\git\runtime2\src\libraries\oob.
proj]
ILLink : Trim analysis warning IL2062: System.Runtime.Caching.Configuration.MemoryCacheElement.Name: Value passed to pa
rameter 'type' of method 'System.ComponentModel.TypeConverterAttribute.TypeConverterAttribute(Type)' can not be statica
lly determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. [C:\git\runtime2\src\libraries\oob.
proj]
ILLink : Trim analysis warning IL2062: System.Runtime.Caching.Configuration.MemoryCacheElement.Name: Value passed to pa
rameter 'type' of method 'System.ComponentModel.TypeConverterAttribute.TypeConverterAttribute(Type)' can not be statica
lly determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. [C:\git\runtime2\src\libraries\oob.
proj]
ILLink : Trim analysis warning IL2062: System.Runtime.Caching.Configuration.MemoryCacheElement.PollingInterval: Value p
assed to parameter 'type' of method 'System.ComponentModel.TypeConverterAttribute.TypeConverterAttribute(Type)' can not
 be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. [C:\git\runtime2\src\lib
raries\oob.proj]
ILLink : Trim analysis warning IL2062: System.Runtime.Caching.Configuration.MemoryCacheElement.PollingInterval: Value p
assed to parameter 'type' of method 'System.ComponentModel.TypeConverterAttribute.TypeConverterAttribute(Type)' can not
 be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. [C:\git\runtime2\src\lib
raries\oob.proj]
ILLink : Trim analysis warning IL2062: System.Runtime.Caching.Configuration.MemoryCacheElement.PollingInterval: Value p
assed to parameter 'type' of method 'System.ComponentModel.TypeConverterAttribute.TypeConverterAttribute(Type)' can not
 be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. [C:\git\runtime2\src\lib
raries\oob.proj]

Copy link
Member Author

@ViktorHofer ViktorHofer Jul 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I.e. PerformanceCounter relies on ConfigurationManager here:

bool setConfigurationSystemInProgress = (bool)(typeof(ConfigurationManager).GetProperty("SetConfigurationSystemInProgress", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null));

Runtime.Caching depends on ConfigurationManager as well:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System.Runtime.Caching also relies on ConfigurationManager:

<ProjectReference Include="$(LibrariesProjectRoot)System.Configuration.ConfigurationManager\src\System.Configuration.ConfigurationManager.csproj" />

Copy link
Member Author

@ViktorHofer ViktorHofer Jul 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that ConfigurationManager is the only dependency that needs to be passed in. Should we filter this down and just pass ConfigurationManager in? Of course, ideally we would not have this dependency at all.

Is there an issue that tracks marking these remaining assemblies as trimmable? (if that's even possible)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not necessarily wrong for trimmable assembly to depend on non-trimmable assembly. The trimmable assembly may have this dependency just for a small part of its functionality. If your app does not use this small part, it is still going be fine with trimming.

Is there an issue that tracks marking these remaining assemblies as trimmable

#49062

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we filter this down and just pass ConfigurationManager in?

No, I would leave it for now.

@ViktorHofer ViktorHofer merged commit 81a3dcd into main Jul 14, 2022
@ViktorHofer ViktorHofer deleted the ViktorHofer-patch-2 branch July 14, 2022 23:03
@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-libraries linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TrimOOBAssemblies target shouldn't hardcode untrimmable assemblies
3 participants