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

Add IPAddress ISpanFormattable/Parsable implementations #82913

Merged
merged 4 commits into from
Mar 6, 2023

Conversation

stephentoub
Copy link
Member

Fixes #82842

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost assigned stephentoub Mar 2, 2023
@ghost
Copy link

ghost commented Mar 2, 2023

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

Issue Details

Fixes #82842

Author: stephentoub
Assignees: -
Labels:

area-System.Net, new-api-needs-documentation

Milestone: -

@stephentoub
Copy link
Member Author

@lewing, can you help me understand what would cause this failure on wasm?

[22:01:25] info: Discovering: System.Net.Primitives.Pal.Tests.dll (method display = ClassAndMethod, method display options = None)
[22:01:25] info:    at System.RuntimeType.GetMethodsByName(String , BindingFlags , MemberListType , RuntimeType )
[22:01:25] info:    at System.RuntimeType.GetMethodCandidates(String , BindingFlags , CallingConventions , Type[] , Int32 , Boolean )
[22:01:25] info:    at System.RuntimeType.GetMethods(BindingFlags )
[22:01:25] info:    at System.Reflection.RuntimeReflectionExtensions.GetRuntimeMethods(Type )
[22:01:25] info:    at Xunit.Sdk.ReflectionTypeInfo.GetMethods(Boolean )
[22:01:25] info:    at Xunit.Sdk.XunitTestFrameworkDiscoverer.FindTestsForType(ITestClass , Boolean , IMessageBus , ITestFrameworkDiscoveryOptions )
[22:01:25] info:    at Microsoft.DotNet.XHarness.TestRunners.Xunit.ThreadlessXunitDiscoverer.FindWithoutThreads(Boolean , IMessageSink , ITestFrameworkDiscoveryOptions )
[22:01:25] info:    at Microsoft.DotNet.XHarness.TestRunners.Xunit.ThreadlessXunitTestRunner.Run(IEnumerable`1 )
[22:01:25] info:    at Microsoft.DotNet.XHarness.TestRunners.Common.ApplicationEntryPoint.InternalRunAsync(LogWriter )
[22:01:25] info:    at Microsoft.DotNet.XHarness.TestRunners.Common.ApplicationEntryPoint.InternalRunAsync(ApplicationOptions , TextWriter , TextWriter )
[22:01:25] info:    at Microsoft.DotNet.XHarness.TestRunners.Common.WasmApplicationEntryPointBase.RunAsync()
[22:01:25] info:    at Microsoft.DotNet.XHarness.TestRunners.Xunit.WasmApplicationEntryPoint.Run()
[22:01:25] info:    at SimpleWasmTestRunner.Main(String[] args)
[22:01:25] info: Error: Could not load list of method overrides due to Method not found: bool System.IParsable`1.TryParse(string,System.IFormatProvider,!0&)
[22:01:25] info:     at To (/root/helix/work/workitem/e/wasm_build/AppBundle/dotnet.js:3:104514)
[22:01:25] info:     at jo (/root/helix/work/workitem/e/wasm_build/AppBundle/dotnet.js:3:103879)
[22:01:25] info:     at do_icall (do_icall (wasm://wasm/00a9a02e:wasm-function[376]:0x208a7))
[22:01:25] info:     at do_icall_wrapper (do_icall_wrapper (wasm://wasm/00a9a02e:wasm-function[246]:0x1d2db))
[22:01:25] info:     at mono_interp_exec_method (mono_interp_exec_method (wasm://wasm/00a9a02e:wasm-function[236]:0x10fa5))
[22:01:25] info:     at interp_runtime_invoke (interp_runtime_invoke (wasm://wasm/00a9a02e:wasm-function[284]:0x1e2ba))
[22:01:25] info:     at mono_jit_runtime_invoke (mono_jit_runtime_invoke (wasm://wasm/00a9a02e:wasm-function[8470]:0x1b872f))
[22:01:25] info:     at do_runtime_invoke (do_runtime_invoke (wasm://wasm/00a9a02e:wasm-function[2815]:0xae576))
[22:01:25] info:     at mono_runtime_try_invoke (mono_runtime_try_invoke (wasm://wasm/00a9a02e:wasm-function[2820]:0xaec18))
[22:01:25] info:     at mono_runtime_invoke (mono_runtime_invoke (wasm://wasm/00a9a02e:wasm-function[2847]:0xb0f0f))
[22:01:25] info: WASM EXIT 1
[22:01:25] info: exiting due to exception: Error: Could not load list of method overrides due to Method not found: bool System.IParsable`1.TryParse(string,System.IFormatProvider,!0&)
[22:01:25] info: Process v8 exited with 1

The cited method is an explicit static interface implementation added in this PR.

@lewing
Copy link
Member

lewing commented Mar 3, 2023

I'll take a look but failures in the EAT (Enable Aggressive Trimming) lane are almost always trimming related

@lewing
Copy link
Member

lewing commented Mar 3, 2023

@lambdageek @vitek-karas @sbomer any idea why class initialization would fail here after the aggressive trimming pass?

@lewing
Copy link
Member

lewing commented Mar 3, 2023

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sbomer
Copy link
Member

sbomer commented Mar 3, 2023

Not sure, but there was a recently-fixed issue around static interface trimming that may be relevant: #82197. Though I wouldn't expect this to be a problem if the EAT test is fully trimming the assembly containing the implementation. @jtschuster

@jtschuster
Copy link
Member

The error looks the same as the failures that #82197 fixed, but since all the assemblies are fully trimmed, I think this might be related to having multiple layers with IPAddress implementing ISpanParsable which implements IParsable. I'll look into it.

@stephentoub
Copy link
Member Author

Thanks. In the meantime, can I disable these test suites for these legs, and if so, what's the best way to do so currently? Or should I hold off on this PR until you complete your investigation?

@stephentoub
Copy link
Member Author

@lewing, I merged in the latest main and it's now passed the wasm legs. Does that mean this is ok to merge? Did we maybe take in some dependency update that included a fix?

@lewing
Copy link
Member

lewing commented Mar 6, 2023

go ahead and merge, i'll keep an eye out for any problems

@jtschuster
Copy link
Member

Did we maybe take in some dependency update that included a fix?

Looks like yes, the failure was using version 8.0.0-preview.2.23112.4 of the linker which didn't have #82197, and now runtime uses version 8.0.0-preview.2.23126.3 with the fix.

@stephentoub
Copy link
Member Author

Thanks

@stephentoub stephentoub merged commit d39dbac into dotnet:main Mar 6, 2023
@stephentoub stephentoub deleted the ipaddressinterfaces branch March 6, 2023 21:39
@karelz karelz added this to the 8.0.0 milestone Mar 22, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: IPAddress should implement ISpanFormattable/Parsable<IPAddress>
7 participants