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

Tests are spamming ITestOutputHelper logs for passing tests #103445

Closed
MihaZupan opened this issue Jun 13, 2024 · 45 comments · Fixed by #105392
Closed

Tests are spamming ITestOutputHelper logs for passing tests #103445

MihaZupan opened this issue Jun 13, 2024 · 45 comments · Fixed by #105392
Labels
Milestone

Comments

@MihaZupan
Copy link
Member

MihaZupan commented Jun 13, 2024

Tests that use ITestOutputHelper are now printing the output even when the test is passing.
For example, if you run dotnet build .\src\libraries\System.Net.Http\tests\FunctionalTests\ /t:Test, the console will print 5000 lines of text even if everything's passing.

It looks like it started with #103279

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 13, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jun 13, 2024
@MihaZupan
Copy link
Member Author

cc: @ViktorHofer this seems to have regressed with the Arcade update in #103279

@ViktorHofer
Copy link
Member

Can you please provide an example test that does this and an example console log?

@MihaZupan
Copy link
Member Author

MihaZupan commented Jun 14, 2024

Random example:

public async Task ContentLength_DoesNotMatchRequestContentLength_Throws(int contentLength, int bytesSent)

.dotnet/dotnet build .\src\libraries\System.Net.Http\tests\FunctionalTests\ /t:Test /p:XUnitMethodName=System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest_Http2.ContentLength_DoesNotMatchRequestContentLength_Throws
PS C:\MihaZupan\runtime-debug-2> .dotnet/dotnet build .\src\libraries\System.Net.Http\tests\FunctionalTests\ /t:Test /p:XUnitMethodName=System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest_Http2.ContentLength_DoesNotMatchRequestContentLength_Throws

  Determining projects to restore...
  All projects are up-to-date for restore.
  TestUtilities -> C:\MihaZupan\runtime-debug-2\artifacts\bin\TestUtilities\Debug\net8.0\TestUtilities.dll
  ILLink.RoslynAnalyzer -> C:\MihaZupan\runtime-debug-2\artifacts\bin\ILLink.RoslynAnalyzer\Debug\netstandard2.0\ILLink.RoslynAnalyzer.dll
  ILLink.CodeFixProvider -> C:\MihaZupan\runtime-debug-2\artifacts\bin\ILLink.CodeFixProvider\Debug\netstandard2.0\ILLink.CodeFixProvider.dll
  ILCompiler.DependencyAnalysisFramework -> C:\MihaZupan\runtime-debug-2\artifacts\bin\ILCompiler.DependencyAnalysisFramework\Debug\ILCompiler.DependencyAnalysisFramework.dll
  Mono.Linker -> C:\MihaZupan\runtime-debug-2\artifacts\bin\Mono.Linker\ref\Debug\net9.0\illink.dll
  Mono.Linker -> C:\MihaZupan\runtime-debug-2\artifacts\bin\Mono.Linker\Debug\net9.0\illink.dll
  ILLink.Tasks -> C:\MihaZupan\runtime-debug-2\artifacts\bin\ILLink.Tasks\Debug\net9.0\ILLink.Tasks.dll
  System.DirectoryServices.Protocols -> C:\MihaZupan\runtime-debug-2\artifacts\bin\System.DirectoryServices.Protocols\ref\Debug\net9.0\System.DirectoryServices.Protocols.dll
  System.DirectoryServices.Protocols -> C:\MihaZupan\runtime-debug-2\artifacts\bin\System.DirectoryServices.Protocols\Debug\net9.0-windows\System.DirectoryServices.Protocols.dll
  StreamConformanceTests -> C:\MihaZupan\runtime-debug-2\artifacts\bin\StreamConformanceTests\Debug\net9.0\StreamConformanceTests.dll
  System.Net.Http.Functional.Tests -> C:\MihaZupan\runtime-debug-2\artifacts\bin\System.Net.Http.Functional.Tests\Debug\net9.0-windows\System.Net.Http.Functional.Tests.dll
  ========================= Begin custom configuration settings ==============================
  set __IsXUnitLogCheckerSupported=1
  ========================== End custom configuration settings ===============================
  ----- start Fri 06/14/2024 16:59:16.93 ===============  To repro directly: =====================================================
  pushd C:\MihaZupan\runtime-debug-2\artifacts\bin\System.Net.Http.Functional.Tests\Debug\net9.0-windows\
  "C:\MihaZupan\runtime-debug-2\artifacts\bin\testhost\net9.0-windows-Debug-x64\dotnet.exe" exec --runtimeconfig System.Net.Http.Functional.Tests.runtimeconfig.json --depsfile System.Net.Http.Functional.Tests.deps.json xunit.console.dll System.Net.Http.Functional.Tests.dll -xml testResults.xml -nologo -met
  hod System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest_Http2.ContentLength_DoesNotMatchRequestContentLength_Throws -notrait category=OuterLoop -notrait category=failing
  popd
  ===========================================================================================================
    Discovering: System.Net.Http.Functional.Tests (method display = ClassAndMethod, method display options = None)
    Discovered:  System.Net.Http.Functional.Tests (found 1 of 1791 test case)
    Starting:    System.Net.Http.Functional.Tests (parallel test collections = on [20 threads], stop on fail = off)
      System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest_Http2.ContentLength_DoesNotMatchRequestContentLength_Throws(contentLength: 0, bytesSent: 1) [PASS]
        Output:
          Ignored exception:
          System.IO.IOException: Got RST
             at System.Net.Test.Common.Http2LoopbackConnection.ReadBodyAsync(Boolean expectEndOfStream) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 588
             at System.Net.Test.Common.Http2LoopbackConnection.ReadAndParseRequestHeaderAsync(Boolean readBody) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 697
             at System.Net.Test.Common.Http2LoopbackConnection.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 981
             at System.Net.Test.Common.Http2LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackServer.cs:line 153
             at System.Net.Test.Common.Http2LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackServer.cs:line 153
             at System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest.<>c__DisplayClass1_0.<<ContentLength_DoesNotMatchRequestContentLength_Throws>b__1>d.MoveNext() in C:\MihaZupan\runtime-debug-2\src\libraries\System.Net.Http\tests\FunctionalTests\SocketsHttpHandlerTest.cs:line 4199
      System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest_Http2.ContentLength_DoesNotMatchRequestContentLength_Throws(contentLength: 1, bytesSent: 0) [PASS]
        Output:
          Ignored exception:
          System.IO.IOException: Got RST
             at System.Net.Test.Common.Http2LoopbackConnection.ReadBodyAsync(Boolean expectEndOfStream) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 588
             at System.Net.Test.Common.Http2LoopbackConnection.ReadAndParseRequestHeaderAsync(Boolean readBody) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 697
             at System.Net.Test.Common.Http2LoopbackConnection.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 981
             at System.Net.Test.Common.Http2LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackServer.cs:line 153
             at System.Net.Test.Common.Http2LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackServer.cs:line 153
             at System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest.<>c__DisplayClass1_0.<<ContentLength_DoesNotMatchRequestContentLength_Throws>b__1>d.MoveNext() in C:\MihaZupan\runtime-debug-2\src\libraries\System.Net.Http\tests\FunctionalTests\SocketsHttpHandlerTest.cs:line 4199
      System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest_Http2.ContentLength_DoesNotMatchRequestContentLength_Throws(contentLength: 1, bytesSent: 2) [PASS]
        Output:
          Ignored exception:
          System.IO.IOException: Got RST
             at System.Net.Test.Common.Http2LoopbackConnection.ReadBodyAsync(Boolean expectEndOfStream) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 588
             at System.Net.Test.Common.Http2LoopbackConnection.ReadAndParseRequestHeaderAsync(Boolean readBody) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 697
             at System.Net.Test.Common.Http2LoopbackConnection.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 981
             at System.Net.Test.Common.Http2LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackServer.cs:line 153
             at System.Net.Test.Common.Http2LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackServer.cs:line 153
             at System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest.<>c__DisplayClass1_0.<<ContentLength_DoesNotMatchRequestContentLength_Throws>b__1>d.MoveNext() in C:\MihaZupan\runtime-debug-2\src\libraries\System.Net.Http\tests\FunctionalTests\SocketsHttpHandlerTest.cs:line 4199
      System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest_Http2.ContentLength_DoesNotMatchRequestContentLength_Throws(contentLength: 2, bytesSent: 1) [PASS]
        Output:
          Ignored exception:
          System.IO.IOException: Got RST
             at System.Net.Test.Common.Http2LoopbackConnection.ReadBodyAsync(Boolean expectEndOfStream) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 588
             at System.Net.Test.Common.Http2LoopbackConnection.ReadAndParseRequestHeaderAsync(Boolean readBody) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 697
             at System.Net.Test.Common.Http2LoopbackConnection.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackConnection.cs:line 981
             at System.Net.Test.Common.Http2LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackServer.cs:line 153
             at System.Net.Test.Common.Http2LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in C:\MihaZupan\runtime-debug-2\src\libraries\Common\tests\System\Net\Http\Http2LoopbackServer.cs:line 153
             at System.Net.Http.Functional.Tests.SocketsHttpHandler_RequestContentLengthMismatchTest.<>c__DisplayClass1_0.<<ContentLength_DoesNotMatchRequestContentLength_Throws>b__1>d.MoveNext() in C:\MihaZupan\runtime-debug-2\src\libraries\System.Net.Http\tests\FunctionalTests\SocketsHttpHandlerTest.cs:line 4199
    Finished:    System.Net.Http.Functional.Tests
  === TEST EXECUTION SUMMARY ===
     System.Net.Http.Functional.Tests  Total: 4, Errors: 0, Failed: 0, Skipped: 0, Time: 0.500s
  ----- end Fri 06/14/2024 16:59:18.34 ----- exit code 0 ----------------------------------------------------------

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.76

@ViktorHofer
Copy link
Member

Tests that use ITestOutputHelper are now printing the output even when the test is passing.

That wasn't the case before? That sounds weird to me. cc @bradwilson (we recently upgraded to xunit 2.8.1)

@MihaZupan
Copy link
Member Author

No, you'd only see the output for failing tests.

@bradwilson
Copy link

bradwilson commented Jun 14, 2024

You shouldn't be seeing passing tests unless you're using the Verbose reporter.

Let me verify that something hasn't changed on our side.

@bradwilson
Copy link

bradwilson commented Jun 14, 2024

Actually, I take it back. This is working as designed.

The code that you're hitting has been there since 2016. We print passing tests if both of these things are true:

  • The test has output
  • You have enabled diagnostic messages

It's likely the 2nd thing that's changed for you.

Here's an example:

image

@bradwilson
Copy link

(I didn't see it on your provided command line, so I assumed it's been enabled in an xunit.runner.json file in the source tree.)

@MihaZupan
Copy link
Member Author

MihaZupan commented Jun 14, 2024

Setting diagnosticMessages to false does bring back the previous behavior (not printing output for passing tests),

"diagnosticMessages": true,

but this configuration also hasn't changed over the last 5 years 😕

@bradwilson
Copy link

bradwilson commented Jun 14, 2024

this configuration also hasn't changed over the last 5 years

Maybe the file wasn't being copied properly and thus never being used? Is it possible that that's a fix that went in recently?

@MihaZupan
Copy link
Member Author

Interestingly, other diagnostic info (e.g. how many tests were discovered) has been shown before, so it seems like the config was being honored.
That disappears if I just toggle that config to false.

@bradwilson
Copy link

That output is coming from our default reporter. Maybe you were running with a different reporter? What is the context where you're seeing this? We have several environmentally enabled reporters (mostly for CI environments like AppVeyor, TeamCity, and VSTS/Azure Pipelines).

@MihaZupan
Copy link
Member Author

Local run from a console on Windows

@bradwilson
Copy link

I tried rolling back to both the 2.4.2 framework and 2.4.2 runners, and I can still reproduce the behavior:

image

I am honestly perplexed about what's changed in your environment.

@vcsjones vcsjones removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 18, 2024
@MihaZupan
Copy link
Member Author

@bradwilson I was able to narrow it down to a change in xunit.runner.utility.netcoreapp10.dll between 2.8.0 and 2.8.1.
(replacing the assembly from a https://www.nuget.org/packages/xunit.runner.utility/2.8.0 package makes it behave like before)

Looking at the xUnit repo, I only see 4 commits there: xunit/xunit@ed625e5, xunit/xunit@bef8ac4, xunit/xunit@c2f2d47, xunit/xunit@f497d65
Does that ring any bells?

@bradwilson
Copy link

bradwilson commented Jun 18, 2024

It could very well be this: xunit/xunit@f497d65

But the point remains: this is still working as designed. The fact that it might've been previously broken in some scenarios and gotten fixed in the meantime won't change that fact. I'm not going to re-break the library by rolling back this fix for other issues.

@MihaZupan
Copy link
Member Author

@ViktorHofer do you see an issue if we toggle the diagnosticMessages off?

"diagnosticMessages": true,

As-is, the console output is a lot less useful -- example in #103703 where logs are just a red herring.

@ViktorHofer
Copy link
Member

Diagnostic messages got enabled to enable long running test logging.

@ManickaP
Copy link
Member

@ViktorHofer do you have any suggestions how to make this work for both sides? How should we log from the tests so that we don't spam the output in case the test is successful? We can change our code, but I'd prefer not to remove all the logging we have put in.

@ViktorHofer
Copy link
Member

I'm not sure that I'm the right person to answer this question. According to Brad it sounds like using ITestOutputHelper always logs, even in the success case and that previous behavior in runtime was just a glitch. @bradwilson I assume there isn't a log level lower than diagnostic messages so that long running tests still get logged but other stuff doesn't?

@bradwilson
Copy link

I assume there isn't a log level lower than diagnostic messages so that long running tests still get logged but other stuff doesn't?

There is not. The intention with diagnostic messages was that people would turn them on while they had a problem, to help them figure the problem out, then turn them back off.

My suggestion in this scenario would be to turn them off by default, so that your normal interactive usage would not be overwhelmed with the test output, and then you can temporarily turn them on when debugging issues. You could turn them for non-interactive builds like CI builds, since I presume that the output there would primarily be ignored if the tests were passing.

@ViktorHofer
Copy link
Member

ViktorHofer commented Jun 20, 2024

Thanks Brad. For us it's important to have long running tests logged in CI so we need diagnostic messages there. Having that turned off locally only sounds like a possible option.

@bradwilson
Copy link

You should be able to use environment variables to detect running in CI, and then use command line switches to override the configuration file. If you're directly using our command line runner, then it would be -diagnostics; if you're using VSTest via something like dotnet test, then you could add -- xUnit.DiagnosticMessages=true to modify the RunSettings.

More information on RunSettings: https://xunit.net/docs/runsettings

@MihaZupan
Copy link
Member Author

While definitely an improvement if it worked locally, this also isn't great in CI.
E.g. this is what a successful test run with no failures looks like: console logs
Or example from #103703 (comment) where a crash was misreported as a test failure because the logs are misleading.

@ManickaP
Copy link
Member

it's important to have long running tests logged in CI

Is there a difference in behavior of logging in CI and locally? Because long running tests do not produce output locally. AFAICT, the logs are printed after the test finishes, not during. And in case of long running tests / hangs, the process needs to be killed so there's not even testResults.xml.

@bradwilson
Copy link

If you insist on (a) having every test logging a ton, and (b) turning on diagnostic messages for long running test detection, there is no way today to separate the two situations.

I only have one other suggestion, which is probably not going to be helpful, but I thought I'd throw it out there anyways: have you considered not having your tests logging a ton of information all the time, and only turning it on when you're trying to debug a problem?

@ManickaP
Copy link
Member

ManickaP commented Jun 25, 2024

there is no way today to separate the two situations.

Would you be open to the idea of changing that? Separating the "long running test" messages into higher severity? We would be open to contribute that change if you'd be willing to accept it.

Edit: ping @bradwilson

@bradwilson
Copy link

I haven't had the time yet to plan out an appropriate design, though I will get to it.

@bradwilson
Copy link

Here's what my plan is.

  1. For v2 (with a release pending shortly) I'm going to give you an environment variable that you can set which will turn off showing output from passing tests. You can set this in your build scripts for both interactive and CI builds. I will forward-port this to v3.

  2. For v3, additionally I'm going to move long running test messages to their own category of message, so that enabling long running test detection does not require enabling diagnostic messages. This is the strategy I think probably fits best for you long term, though the environment variable option will still be present if you opt to keep diagnostic messages enabled.

bradwilson added a commit to xunit/xunit that referenced this issue Jul 6, 2024
…skip showing passing tests with output when diagnostic messages are enabled (dotnet/runtime#103445) (v2)
@bradwilson
Copy link

This is now available in v2 2.8.2-pre.20 https://xunit.net/docs/using-ci-builds

You can set XUNIT_HIDE_PASSING_OUTPUT_DIAGNOSTICS to any non-empty value and it will hide the passing tests with output from being shown. If the value is empty or missing, then the default behavior will be used.

I am planning to ship a new v2 release in the next few days, depending on how far behind I currently am on issues and pull requests after being heads down for 3 weeks working on v3.

@bradwilson
Copy link

I've also opened a discussion issue to understand how widespread the problem is, to decide whether we should also enable this behavioral switch via a configuration file item. Feel free to add your feedback there: xunit/xunit#2969

bradwilson added a commit to xunit/xunit that referenced this issue Jul 6, 2024
…skip showing passing tests with output when diagnostic messages are enabled (dotnet/runtime#103445) (v3)
@ViktorHofer
Copy link
Member

Perfect. We will update to 2.8.2 when it is stable as we are close to RC1 which requires stable package dependencies (a few of our packages depend on xunit). Thanks for your help, Brad 👍

@bradwilson
Copy link

bradwilson commented Jul 8, 2024

We have final RTM packages available on our CI server, but NuGet is rejecting them because of a certificate change. I have no idea when this will be resolved.

@bradwilson
Copy link

The packages are uploaded to NuGet.org now, and I'm just waiting for the xunit.net site deployment to make the announcement.

@bradwilson
Copy link

https://dotnet.social/@xunit/112752046346372524

@ericstj ericstj added test-enhancement Improvements of test source code and removed untriaged New issue has not been triaged by the area owner labels Jul 18, 2024
@ericstj ericstj added this to the 9.0.0 milestone Jul 18, 2024
@ViktorHofer
Copy link
Member

ViktorHofer commented Jul 18, 2024

This needed dotnet/arcade#14930 which is now merged. We are still waiting for dependency flow to bring this change into runtime though: #105301

@ViktorHofer
Copy link
Member

After the above dependency flow PR is merged the env var will need to be set. I assume that the RunTests.cmd/sh scripts are the right place for xunit.console and the runsettings.targets file for dotnet test.

@ViktorHofer
Copy link
Member

#105392 should fix this. @MihaZupan would you mind trying it out?

@bradwilson
Copy link

🎉

@ViktorHofer
Copy link
Member

Thanks a lot for your help, Brad 👍

@bradwilson
Copy link

Glad we could find a good workaround for you!

directhex pushed a commit that referenced this issue Jul 26, 2024
* Set xunit env var to not print output for passing tests

Fixes #103445

* Update xunit.console.targets

* Update xunit.console.targets
ilonatommy added a commit that referenced this issue Aug 1, 2024
…05110)

* Remove support for older LLVM versions, and re-order linker flags

We have generally tried to support linking multiple versions of LLVM
within our git tree. Every new LLVM version moves symbols around between
libraries, and as a result, every new version of LLVM requires different
linker flags to build. The command line tool `llvm-config` should tell
you the exact flags you need, but it is a problem for us when
cross-compiling to rely on this, and as a result, we transcribe
the result of various llvm-config outputs directly into Mono's
CMakeLists.txt.

In an effort to support multiple versions of LLVM, flags common between
all supported versions were kept in one place, then the version-specific
flags appended afterwards. And this has worked fine for years. However:

1. Whilst we only link with `lld`, it is common for contributors and
   source-build to link with `gold`, `bfd`, or some other GNU-flavoured
   linker, where library order is essential
2. The list of common libraries to link has remained unchanged for
   years, but the symbol intra-dependencies may have changed a long time
   ago, so common symbol order cannot be assumed to remain valid between
   LLVM versions

This has resulted in a long-standing problem for people using e.g.
Debian or Ubuntu or GitHub CodeSpaces, rather than always building
with one of our dockerfiles representing our "real" build environment,
when targeting platforms which use Mono and link LLVM.

* Bumping clang and llvm - make docs less ambiguous. (#105401)

* Bump main to RC1 (#105338)

* Update SDK to preview 6 (#104696)

* Update SDK to preview 6

* Update Shared.csproj

Fix `error NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability`

* Fix with existing version.

---------

Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>

* Change DefaultMaximumErrorResponseLength to KB from Byte (#105396)

* Change DefaultMaximumErrorResponseLength to KB from Byte

* Handle overflow

* Review feedback

* Fix warning for MakeGenericType annotation mismatch (#104921)

Fixes warning code when a generic type whose type parameters have DAM
annotations is used with MakeGenericType, over a type that doesn't
have matching annotations.

The code IL2070 used to mention the 'this' argument. Instead it should
have been IL2071 which mentions the generic argument as the cause of
the mismatch. Similar for MakeGenericMethod with IL2090 and IL2091.

* Set GCStressIncompatible on GenericContext tests (#104686)

Co-authored-by: Vladimir Sadov <vsadov@microsoft.com>

* Add runtime config parameter to force ijwhost to load assemblies in an isolated context (#105337)

* Add support for isolated load context in LoadInMemoryAssemblyInContext by passing -1 as loadContext
* Have ijwhost check a runtime config parameter to determine if it should run in an isolated load context
* Added test for ijwhost isolated load context runtime config option

* [RISC-V] Fix passing float and uint arguments in VM (#105021)

* Add tests

* Fix passing float and uint arguments in VM

* Change test lib name so it doesn't clash with managed DLL on Windows

* Fix platform analyzer attribute order for MacCatalyst (#105409)

We need to make sure the attribute for MacCatalyst comes _after_ the iOS one due to how MacCatalyst is a superset of iOS: https://learn.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer#platform-inclusion

This caused an error in aspnetcore in the latest dependency flow because the analyzer thought AesGcm is _only_ supported on MacCatalyst:
> error CA1416: (NETCORE_ENGINEERING_TELEMETRY=Build) This call site is reachable on all platforms. 'AesGcm.Decrypt(ReadOnlySpan<byte>, ReadOnlySpan<byte>, ReadOnlySpan<byte>, Span<byte>, ReadOnlySpan<byte>)' is only supported on: 'maccatalyst' 13.0 and later.

* Use correct `ExceptionArgument` value in  `System.IO.Pipelines` (#105418)

* Remove zlib from requirements script and instruction files (#105419)

* Remove zlib from requirements instructions

* Remove zlib from native requirements installation script

* Revert "Remove zlib from requirements script and instruction files (#105419)" (#105449)

This reverts commit 3ec6286.

* Ensure that WaitForPendingFinalizers has seen the expected Full GC count (#105289)

* Ensure that WaitForPendingFinalizers has seen the expected Full GC

* NativeAOT and some renames

* a testcase

* make the test not unsafe and make OuterLoop

* Use unsigned math when comparing collection ticks

* cast the diff to int when comparing gc ticks

* Migrate to zlib-ng, part 3: Remove zlib and zlib-intel source code and license mentions (second attempt) (#105371)

* Remove zlib/
* Remove zlib-intel/
* Remove third party notice
* Remove patches
* Remove version txts
* Remove cgmanifest.json entries
* Remove installer third party notice
* Update docs
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* [browser] Trigger relink on `EmccMaximumHeapSize` change (#105027)

* Edit test + trigger relink.

* Remove logging to speed up the test + decrease loop runs to prevent "Browser has been disconnected" error.

* Feedback - properties are not bool-only anymore.

* Fix: workload needed when heap size set.

---------

Co-authored-by: Larry Ewing <lewing@microsoft.com>

* Delete erroneous Socket test (#105448)

* Pull the python dependency from the EmsdkVersion where possible (#105437)

* Use `BinaryPrimitives` more in the ILCompiler (#105404)

* JIT: use VNVisitReachingVNs in IsVNNeverNegative (#105197)

* Set xunit env var to not print output for passing tests (#105392)

* Set xunit env var to not print output for passing tests

Fixes #103445

* Update xunit.console.targets

* Update xunit.console.targets

* Some more automated C# modernization in corelib (#105151)

* Fix IDE0056 on corelib (indexing can be simplified)

* Fix IDE (null check can be simplified)

* Fix IDE0078 (use pattern matching)

* Fix IDE0019 (use pattern matching)

* Fix IDE0066 (use switch expression)

* Fix IDE0250 (struct can be made readonly)

* Fix nullability warning and address PR feedback

* Address PR feedback and revert a downlevel change

* Wrap any `?? throw new`s that go beyond 120 characters

* Fix ECMA 355 Partition download links (#105454)

On https://github.com/dotnet/runtime/blob/main/docs/project/dotnet-standards.md the Partition with Notes download links using HTTP protocol fail to download in Chrome:

>Mixed Content: The site at 'https://github.com/' was loaded over a secure connection, but the file at 'https://download.microsoft.com/download/7/3/3/733AD403-90B2-4064-A81E-01035A7FE13C/MS%20Partition%20I.pdf' was redirected through an insecure connection. This file should be served over HTTPS. See https://blog.chromium.org/2020/02/protecting-users-from-insecure.html for more details.

(It might be reasonble for somebody else to followup fixing all domains on all pages with regex `\(http://([.a-z0-9-]+)` replacing with `(https://$1`, but I didn't test each blog site supports HTTPS.)

* Add swiftcall signature check for `mono_class_try_get_swift_error_class` (#105408)

* Add signature check for swiftcall

* Handle null values for swift_error_ptr

* Enable NativeAOT runtime tests on MacCatalyst (#102882)

This PR updates the CLRTest.Execute.Bash.targets file to set the apple run command for MacCatalyst. The command apple just-run used on Apple mobile is not permitted, and apple test requires the a test runner. Additionally, it is necessary to locate Info.plist in the Contents/ directory and the binary in Contents/MacOS/ within the bundle.

---------

Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>

* Resolving an antigen failure (#105260)

* Resolving an antigen failure

* Fix method accessibility so xunit doesn't complain

* Support field access on GetType() of T constrained to be Enum (#105351)

Adds trimming support for instance.GetType().GetFields(), where
instance is a variable of type `T` that is constrained to System.Enum.

This includes a change to have ILLink's TypeProxy track a
TypeReference instead of TypeDefinition, which was necessary to allow
TypeProxy to represent a generic parameter.

Note that this only supports the specific case where `GetType()` is
called on a variable of type `T` that is constrained to `Enum`. A
variable of type `Enum` is not supported, so the following will still
warn:


```csharp
static void M(Enum v) {
    v.GetType().GetFields();
}
```

* Update mono to support shuffle for constant inputs (#105299)

* Support mono creating xconst in a few more places

* Update mono to support shuffle for constant inputs

* Ensure that arm64 also accelerates shuffle for non-constant inputs

* Ensure OP_XZERO and OP_XONES are recognized as being constant

* Ensure shuffle creates a correct instruction when the fsig doesn't match the necessary parameter count

* Ensure that getting the index for floating-point shuffle is possible

* Ensure the right class handle is passed down to LLVM so overload resolution can function

* Make sure we update the original xconst if we mutate it

* Return a new constant and instead of mutating the existing one

* Insert relevant xcast nodes

* Add some asserts around the ecount

* Ensure we get the right element type

* Ensure we don't create nodes unnecessarily for create_elementwise

* Ensure that create_elementwise still works for other vector sizes

* Ensure indentation of switch cases is correct for Mono

* Make TooDeepJsonDocument test more consistent across platforms (#105445)

* Make TooDeepJsonDocument test more consistent across platforms

Run the test on a thread with as consistent a stack size as possible so that we don't inadvertently succeed due to having a really large stack.

* Disable test on mono

* Update the TypeLib embedding and add comments on API use (#105416)

There is an undocumented semantic of Win32 Resource APIs.
The missing semantic is that all resource type/name
strings are transparently converted to uppercase
when calling any of the Win32 Resource APIs.

We don't want to apply this undocumented semantic to the reader/writer API
so we document it instead. We are avoiding applying the behavior
since ReadyToRun scenarios are designed to be a byte for byte copy
of the resource, including name as it was written by other tooling.

* Update docs for ByRefLike with generics for work in .NET 10 (#103318)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* Fix double printing in StressLog and simplify stresslog macros (#105420)

* Add support for nested types in the `corelib.h` parser for rooting descriptors (#105432)

* Fixed for assertion failure due to not checking if we are processing Eph samples (#105164)

* [PERF] Use correct python executable on windows in venv (#105451)

* Fix up Fuzzlyn CI scripts for new hardware intrinsics support (#105470)

1) Strip out the extensions in the seed name when using it for file/directory names, since the list of extensions is quite long
2) Limit the number of unreduced/uncategorized example seeds we show

* Try to re-enable DeepEquals_TooDeepJsonDocument_ThrowsInsufficientExecutionStackException test on mono (#105509)

* zlib-ng: avoid suppressing WD4242 and WD4244 (#105433)

WD4242 and WD4244 are compiler warnings that should not be suppressed because the warn about possible loss of data.

WD4242 shows up in zlib-ng/arch/*/slide_hash*.c files and comes from the arguments passed to the slide_hash_chain method.
WD4244 happens in Windows when building in Debug configuration, in various zlib-ng/deflate*.c files, and comes from the arguments passed to the check_match method.

Fixed by:

- Adding asserts to verify the values are below the maximum allowed for their type.
- Casting them the proper type before passing them as arguments to their methods.
- Removing the WD suppressions, which unfortunately also propagated to other unrelated cmake files.
- Fixed a similar loss of data error in an unrelated mono file where the warning suppression was propagated due to this.

* Delete outdated comments (#105519)

* Arm64/Sve: Add FFR register liveness tracking (#105348)

* Add tracking of FFR register

somewhat workable

code cleanup

Remove FFR

Add all the GetFfr*

wip

Work with MskCns() model

Use physReg approach

Remove commented prototypes

working

Remove bunch of unnecessary code

Remove SpecialImport from GetFFR/SetFFR/LoadFirstFaulting

some more code cleanup

some fixup

* Change condition for PhysReg

* jit format

* review feedback

* unspill for LoadVectorFirstFaulting as well

* Use the right opReg

* skip spilling tracking

* review feedback

* Use non-existent REG_FFR

* Do not reload from FFR for GetFfr()

* review feedback

* Make just GrabTemp

* fix build and formatting

* missed another build failure for arm

* Fix throwing exception when calling RunClassConstructor on a generic type with a static constructor (#105513)

* Fix throwing exception when calling RunClassConstructor on a generic type with a static constructor

#99183 seems to have done away with assuming that a generic type's static constructor was
always "initialized". As a result, if you call RunClassConstructor on it, the runtime would throw an exception.

Fixes #103891

* Apply suggestions from code review

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* [RISC-V][LoongArch64] New passing info for floating-point structs (#103945)

* Replace StructFloatFieldInfoFlags with FpStructInRegistersInfo which carries also exact field sizes and offsets

* Replace StructFloatFieldInfoFlags with FpStruct::Flags in profiler

* Remove FpStructInRegistersInfo::FromOldFlags()

* Fix duplicating types in HandleInlineArray

* Remove signedness from FpStruct::IntKind because most probably we won't need it

* Remove old StructFloatFieldInfoFlags calculating routine

* Typo in TARGET_LOONGARCH64

* Remove m_returnedFpFieldOffsets from ArgIterator

* Add missing ENREGISTERED_PARAMTYPE_MAXSIZE condition to C# version of FpStruct info calculation

* Rename RISCV64PassStructInRegister to match settled casing for RiscV in class names

* Update hardcoded flags for float and double in ArgIteratorTemplate::ComputeReturnFlags()

This fixes JIT/HardwareIntrinsics/General/Vector* tests.

* Fix build on other platforms

* Update LoongArch to use FpStructInRegistersInfo

* Remove unused old flag masks

* LoongArch64 typo

Co-authored-by: Qiao Pengcheng <qiaopengcheng@loongson.cn>

* Missing FpStruct namespace

Co-authored-by: Qiao Pengcheng <qiaopengcheng@loongson.cn>

* Missing FpStruct namespace

Co-authored-by: Qiao Pengcheng <qiaopengcheng@loongson.cn>

* Missing FpStruct namespace

Co-authored-by: Qiao Pengcheng <qiaopengcheng@loongson.cn>

* Use FpStruct namespace everywhere in JIT

* JIT review

* Update StructFloatFieldInfoFlags description

* Revert to hitherto instruction set order as it's not the point of this PR

* Unify get{LoongArch,RiscV}64PassFpStructInRegistersInfo JIT interfaces

* Use JIT_TO_EE_TRANSITION instead of _LEAF because MethodTable::GetFpStructInRegistersInfo may throw

* Remove FpStruct::IntKind, we should have similar info in ClassLayout in JIT

* Change JIT interface to return a struct similar to CORINFO_SWIFT_LOWERING to facilitate code unification in the future

* Change JIT to use new Swift-like getFpStructLowering

* Cache CORINFO_FPSTRUCT_LOWERING

* Update LoongArch classifier to use CORINFO_FPSTRUCT_LOWERING

* Update StructFloatInfoFlags doc comment on C#

* Move StructFloatFieldInfoFlags and FpStructInRegistersInfo out of the JIT interface

* Merge LoongArch and RISC-V AOT calculation of FpStructInRegistersInfo because they were identical. Move it to Common\Internal/Runtime because it's no longer exposed in JIT interface.

* Don't zero-initialize CORINFO_FPSTRUCT_LOWERING

* Add note for CORINFO_FPSTRUCT_LOWERING::loweredElements type

---------

Co-authored-by: Qiao Pengcheng <qiaopengcheng@loongson.cn>

* Ensure we don't reuse temps when calling fgMorphArgs on LIR nodes (#105508)

* Ensure constant evaluation of shifts on xarch broadcast the operand to the correct size (#105487)

* Ensure constant evaluation of shifts on xarch broadcast the operand to the correct size

* Ensure we don't try to execute AVX2 code on unsupported platforms

* Use ConcurrentDictionary in runtimecounters test (#105520)

* Use ConcurrentDictionary in runtimecounters test

Fixes #105443

* Fix build break

* Fix issue 98506 - Excessive exceptions generated in StackTraceSymbols (#105530)

* Fix issue 98506 - Excessive exceptions generated in StackTraceSymbols

* Code review feedback

* Clean up some usages of LowLevelList<T> (#105407)

* Fix ShuffleThunk cache heap (#105480)

There was a problem with using heap from the related LoaderAllocator for
shuffle thunk cache heap. I have tested it again and it seems that the
issue is gone.

So I am removing the workaround, making the cache use LoaderAllocator
local heap.

Close #55697

* [browser] Fix computing destination sub path and publish extension target path in Wasm SDK (#105458)

* Bump flags to LLVM 19, not 16

---------

Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Ahmet Ibrahim Aksoy <aaksoy@microsoft.com>
Co-authored-by: Sven Boemer <sbomer@gmail.com>
Co-authored-by: Steve Pfister <steveisok@users.noreply.github.com>
Co-authored-by: Vladimir Sadov <vsadov@microsoft.com>
Co-authored-by: Mike Oliphant <oliphant@nostatic.org>
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Paulus Pärssinen <paulus.parssinen@gmail.com>
Co-authored-by: Egor Bogatov <egorbo@gmail.com>
Co-authored-by: Carl Walsh <darthwalsh@gmail.com>
Co-authored-by: Milos Kotlar <kotlarmilos@gmail.com>
Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
Co-authored-by: Mukund Raghav Sharma (Moko) <68247673+mrsharm@users.noreply.github.com>
Co-authored-by: Cameron Aavik <99771732+caaavik-msft@users.noreply.github.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
Co-authored-by: Qiao Pengcheng <qiaopengcheng@loongson.cn>
Co-authored-by: Mike McLaughlin <mikem@microsoft.com>
Co-authored-by: Huo Yaoyuan <huoyaoyuan@hotmail.com>
Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
Co-authored-by: Marek Fišera <mara@neptuo.com>
@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants