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

[wasm] Perftracing build broken due to trimming errors #73933

Closed
radical opened this issue Aug 15, 2022 · 2 comments · Fixed by #73894
Closed

[wasm] Perftracing build broken due to trimming errors #73933

radical opened this issue Aug 15, 2022 · 2 comments · Fixed by #73894
Labels
arch-wasm WebAssembly architecture area-Build-mono
Milestone

Comments

@radical
Copy link
Member

radical commented Aug 15, 2022

Build:

/__w/1/s/artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/runtimes/browser-wasm/native/System.Private.CoreLib.dll : error IL2104: Assembly 'System.Private.CoreLib' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/__w/1/s/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
##[error]artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/runtimes/browser-wasm/native/System.Private.CoreLib.dll(0,0): error IL2104: (NETCORE_ENGINEERING_TELEMETRY=Build) Assembly 'System.Private.CoreLib' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries
/__w/1/s/.dotnet/sdk/7.0.100-preview.5.22307.18/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ILLink.targets(110,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [/__w/1/s/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
##[error].dotnet/sdk/7.0.100-preview.5.22307.18/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ILLink.targets(110,5): error NETSDK1144: (NETCORE_ENGINEERING_TELEMETRY=Build) Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.

This is broken on main too.

@radical radical added arch-wasm WebAssembly architecture blocking-release blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' area-Build-mono labels Aug 15, 2022
@radical radical added this to the 7.0.0 milestone Aug 15, 2022
@ghost
Copy link

ghost commented Aug 15, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Build:

/__w/1/s/artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/runtimes/browser-wasm/native/System.Private.CoreLib.dll : error IL2104: Assembly 'System.Private.CoreLib' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [/__w/1/s/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
##[error]artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/runtimes/browser-wasm/native/System.Private.CoreLib.dll(0,0): error IL2104: (NETCORE_ENGINEERING_TELEMETRY=Build) Assembly 'System.Private.CoreLib' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries
/__w/1/s/.dotnet/sdk/7.0.100-preview.5.22307.18/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ILLink.targets(110,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [/__w/1/s/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
##[error].dotnet/sdk/7.0.100-preview.5.22307.18/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ILLink.targets(110,5): error NETSDK1144: (NETCORE_ENGINEERING_TELEMETRY=Build) Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.

This is broken on main too.

Author: radical
Assignees: -
Labels:

arch-wasm, blocking-release, blocking-clean-ci, area-Build-mono

Milestone: 7.0.0

@radical
Copy link
Member Author

radical commented Aug 15, 2022

Running with TrimmerSingleWarn=false to get the individual warnings:

ILLink : Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource: Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2113'. Consi
der removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
ILLink : Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource: Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2115'. Consi
der removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(885,9): Trim analysis error IL2121: System.Diagn
ostics.Tracing.EventSource.WriteEvent(Int32, Int64, Int64, Int64): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removi
ng the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1067,9): Trim analysis error IL2121: System.Diag
nostics.Tracing.EventSource.WriteEvent(Int32, Int32, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing th
e unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(955,9): Trim analysis error IL2121: System.Diagn
ostics.Tracing.EventSource.WriteEvent(Int32, String, String, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider rem
oving the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(927,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, String, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(796,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, Int32): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1366,13): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, Object[]): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(904,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1236,13): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventCore(Int32, Int32, EventData*): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1959,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventVarargs(Int32, Guid*, Object[]): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1350,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityIdCore(Int32, Guid*, Int32, EventData*): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sa
mple.csproj]
ILLink : Trim analysis error IL2121: System.Resources.ResourceReader.DeserializeObject(Int32): Unused 'UnconditionalSuppressMessageAttribute' for warni
ng 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sampl
e.csproj]
...

The issue seems to be that the sample project overrides the $(NoWarn) value.

radical added a commit that referenced this issue Aug 15, 2022
`IL2121` was disabled for samples, but the project discard the value of
`$(NoWarn)`, thus missing the warning code.

```
ILLink : Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource: Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2113'. Consi
der removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
ILLink : Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource: Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2115'. Consi
der removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(885,9): Trim analysis error IL2121: System.Diagn
ostics.Tracing.EventSource.WriteEvent(Int32, Int64, Int64, Int64): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removi
ng the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1067,9): Trim analysis error IL2121: System.Diag
nostics.Tracing.EventSource.WriteEvent(Int32, Int32, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing th
e unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(955,9): Trim analysis error IL2121: System.Diagn
ostics.Tracing.EventSource.WriteEvent(Int32, String, String, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider rem
oving the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(927,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, String, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(796,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, Int32): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1366,13): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, Object[]): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(904,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1236,13): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventCore(Int32, Int32, EventData*): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1959,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventVarargs(Int32, Guid*, Object[]): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1350,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityIdCore(Int32, Guid*, Int32, EventData*): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sa
mple.csproj]
ILLink : Trim analysis error IL2121: System.Resources.ResourceReader.DeserializeObject(Int32): Unused 'UnconditionalSuppressMessageAttribute' for warni
ng 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sampl
e.csproj]
```

Fixes #73933 .
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 15, 2022
radical added a commit that referenced this issue Aug 15, 2022
* Update dependencies from https://github.com/dotnet/linker build 20220812.4

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22412.3 -> To Version 7.0.100-1.22412.4

* `System.Runtime.Serialization.Json.ReflectionOnly.Tests` - fix linker

.. errors.

```
[22:32:27] fail: [FAIL] DataContractJsonSerializerTests.DCJS_VerifyDateTimeForFormatStringDCJsonSerSettings
[22:32:27] info: System.InvalidOperationException : No set method for property 'UtcDateTime' in type 'System.Runtime.Serialization.DateTimeOffsetAdapter'.
[22:32:27] info:    at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
[22:32:27] info:    at DataContractJsonSerializerTests.SerializeAndDeserialize[DateTimeOffset](DateTimeOffset value, String baseline, DataContractJsonSerializerSettings settings, Func`1 serializerFactory, Boolean skipStringCompare)
[22:32:27] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
[22:32:27] fail: [FAIL] DataContractJsonSerializerTests.DCJS_ClassWithDatetimeOffsetTypeProperty
[22:32:27] info: System.InvalidOperationException : No set method for property 'UtcDateTime' in type 'System.Runtime.Serialization.DateTimeOffsetAdapter'.
[22:32:27] info:    at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
[22:32:27] info:    at DataContractJsonSerializerTests.SerializeAndDeserialize[TypeWithDateTimeOffsetTypeProperty](TypeWithDateTimeOffsetTypeProperty value, String baseline, DataContractJsonSerializerSettings settings, Func`1 serializerFactory, Boolean skipStringCompare)
[22:32:27] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
```

* [wasm] System.Runtime.Serialization.Schema.Tests - fix linker errors

```
  fail: [FAIL] System.Runtime.Serialization.Schema.Tests.ImporterTests.Import(import: Action`1 { Method = Void <Import_MemberData>b__7(System.Runtime.S
erialization.XsdDataContractImporter), Target = <>c__DisplayClass7_1 { schemaSet = XmlSchemaSet { ... }, typeName = http://schemas.datacontract.org/200
4/07/System.Runtime.Serialization.Schema.Tests:ImporterTests.SerializableFormatClass } }, codeLength: -1)
  info: System.MissingMethodException : No parameterless constructor defined for type 'Microsoft.CSharp.CSharpCodeProvider'.
  info:    at System.RuntimeType.CreateInstanceMono(Boolean , Boolean )
  info:    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean , Boolean )
  info:    at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
  info:    at System.Activator.CreateInstance(Type type, Boolean nonPublic)
  info:    at System.Activator.CreateInstance(Type type)
  info:    at System.CodeDom.Compiler.CompilerInfo.CreateProvider()
  info:    at System.CodeDom.Compiler.CodeDomProvider.CreateProvider(String )
  info:    at System.Runtime.Serialization.Schema.Tests.SchemaUtils.DumpCode(CodeCompileUnit ccu, CodeDomProvider provider)
  info:    at System.Runtime.Serialization.Schema.Tests.ImporterTests.Import(Action`1 import, Int32 codeLength)
  info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
```

* [wasm] System.Runtime.Serialization.Xml.ReflectionOnly.Tests - fix

.. linker errors.

```
[02:47:16] fail: [FAIL] DataContractSerializerTests.DCS_MemoryStream_Serialize_UsesBuiltInAdapter
[02:47:16] info: System.Runtime.Serialization.InvalidDataContractException : No get method for property 'Capacity' in type 'System.Runtime.Serialization.MemoryStreamAdapter'.
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.DataContract.DataContractCriticalHelper.ThrowInvalidDataContractException(String , Type )
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.DataContract.DataContractCriticalHelper.ThrowInvalidDataContractException(String )
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.ClassDataContract.ClassDataContractCriticalHelper.ImportDataMembers()
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.ClassDataContract.ClassDataContractCriticalHelper..ctor(Type )
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.ClassDataContract..ctor(Type )
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.DataContract.DataContractCriticalHelper.CreateDataContract(Type )
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.DataContract.DataContractCriticalHelper.CreateDataContract(Int32 , RuntimeTypeHandle , Type )
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.DataContract.DataContractCriticalHelper.GetDataContractSkipValidation(Int32 , RuntimeTypeHandle , Type )
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.DataContract.GetDataContractSkipValidation(Int32 id, RuntimeTypeHandle typeHandle, Type type)
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.DataContract.GetDataContract(RuntimeTypeHandle typeHandle, Type type)
[02:47:16] info:    at System.Runtime.Serialization.DataContracts.DataContract.GetDataContract(Type type)
[02:47:16] info:    at System.Runtime.Serialization.DataContractSerializer.get_RootContract()
[02:47:16] info:    at System.Runtime.Serialization.DataContractSerializer.InternalWriteStartObject(XmlWriterDelegator writer, Object graph)
[02:47:16] info:    at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
[02:47:16] info:    at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
[02:47:16] info:    at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
[02:47:16] info:    at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter , Object )
[02:47:16] info:    at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(Stream , Object )
[02:47:16] info:    at System.Runtime.Serialization.Tests.DataContractSerializerHelper.SerializeAndDeserialize[MemoryStream](MemoryStream value, String baseline, DataContractSerializerSettings settings, Func`1 serializerFactory, Boolean skipStringCompare)
[02:47:16] info:    at DataContractSerializerTests.<DCS_MemoryStream_Serialize_UsesBuiltInAdapter>g__ValidateObject|240_0(MemoryStream original, String expectedXml, Byte[] expectedData, Int32 expectedPosition, Boolean expectedExposable)
[02:47:16] info:    at DataContractSerializerTests.DCS_MemoryStream_Serialize_UsesBuiltInAdapter()
[02:47:16] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
```

* Fix linker errors - System.Xml.XmlSerializer.ReflectionOnly.Tests

```
[02:47:21] fail: [FAIL] XmlSerializerTests.Xml_ImmutableCollections(type: typeof(System.Collections.Immutable.ImmutableArray<int>), collection: [42], createException: null, addException: typeof(System.InvalidOperationException), expectedXml: "<?xml version=\"1.0\" encoding=\"utf-8\"?><ArrayOf"..., exMsg: "Specified method is not supported.")
[02:47:21] info: System.InvalidOperationException : There was an error generating the XML document.
[02:47:21] info: ---- System.InvalidOperationException : To be XML serializable, types which inherit from ICollection must have an implementation of Add(System.Int32) at all levels of their inheritance hierarchy. System.Collections.Immutable.ImmutableArray`1[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] does not implement Add(System.Int32).
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle)
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces)
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.Serialize(Stream stream, Object o, XmlSerializerNamespaces namespaces)
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.Serialize(Stream stream, Object o)
[02:47:21] info:    at XmlSerializerTests.Serialize[Object](Object value, String baseline, Func`1 serializerFactory, Boolean skipStringCompare, XmlSerializerNamespaces xns)
[02:47:21] info:    at XmlSerializerTests.Xml_ImmutableCollections(Type type, Object collection, Type createException, Type addException, String expectedXml, String exMsg)
[02:47:21] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
[02:47:21] info: ----- Inner Stack Trace -----
[02:47:21] info:    at System.Xml.Serialization.TypeScope.GetDefaultIndexer(Type , String )
[02:47:21] info:    at System.Xml.Serialization.TypeScope.GetCollectionElementType(Type , String )
[02:47:21] info:    at System.Xml.Serialization.TypeScope.ImportTypeDesc(Type , MemberInfo , Boolean )
[02:47:21] info:    at System.Xml.Serialization.TypeScope.GetTypeDesc(Type , MemberInfo , Boolean , Boolean )
[02:47:21] info:    at System.Xml.Serialization.TypeScope.GetTypeDesc(Type , MemberInfo , Boolean )
[02:47:21] info:    at System.Xml.Serialization.ModelScope.GetTypeModel(Type , Boolean )
[02:47:21] info:    at System.Xml.Serialization.ModelScope.GetTypeModel(Type )
[02:47:21] info:    at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type , XmlRootAttribute , String )
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.GenerateXmlTypeMapping(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace)
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.GetMapping()
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.SerializeUsingReflection(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
[02:47:21] info:    at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
```

* [wasm] Fix trimming errors in event-pipe sample

`IL2121` was disabled for samples, but the project discard the value of
`$(NoWarn)`, thus missing the warning code.

```
ILLink : Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource: Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2113'. Consi
der removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
ILLink : Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource: Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2115'. Consi
der removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(885,9): Trim analysis error IL2121: System.Diagn
ostics.Tracing.EventSource.WriteEvent(Int32, Int64, Int64, Int64): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removi
ng the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1067,9): Trim analysis error IL2121: System.Diag
nostics.Tracing.EventSource.WriteEvent(Int32, Int32, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing th
e unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(955,9): Trim analysis error IL2121: System.Diagn
ostics.Tracing.EventSource.WriteEvent(Int32, String, String, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider rem
oving the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(927,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, String, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(796,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, Int32): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1366,13): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, Object[]): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(904,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEvent(Int32, String): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1236,13): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventCore(Int32, Int32, EventData*): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1959,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventVarargs(Int32, Guid*, Object[]): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj]
/workspaces/runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs(1350,9): Trim analysis error IL2121: System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityIdCore(Int32, Guid*, Int32, EventData*): Unused 'UnconditionalSuppressMessageAttribute' for warning 'IL2112'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sa
mple.csproj]
ILLink : Trim analysis error IL2121: System.Resources.ResourceReader.DeserializeObject(Int32): Unused 'UnconditionalSuppressMessageAttribute' for warni
ng 'IL2026'. Consider removing the unused warning suppression. [/workspaces/runtime/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sampl
e.csproj]
```

Fixes #73933 .

* [wasm] Disable tests failing with trimming

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 15, 2022
@radical radical removed blocking-release blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' labels Aug 15, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant