Support Roslyn 1.x/2.x compiler configurations in tests on non-Windows - #3914
Merged
Merged
Conversation
siegfriedpammer
force-pushed
the
linux-test-matrix
branch
from
July 27, 2026 03:56
4f84cc4 to
857e290
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the decompiler test compiler-matrix to support Roslyn 1.x/2.x configurations on non-Windows hosts by switching Roslyn 2.10 to the dotnet-hosted toolset, optionally enabling Roslyn 1.3 under Mono, and adjusting VB and PDB handling to work cross-platform.
Changes:
- Fetch Roslyn 2.10 from
Microsoft.NETCore.Compilerson non-Windows, adddotnet --roll-forward LatestMajor, and run.execompilers viamonowhen applicable. - Adjust VB compilation references/runtime handling for the non-Windows
netcoreapp2.2configuration, and skip two VBPretty fixtures whose output differs under the substituted runtime. - Request portable PDBs for Roslyn on non-Windows and tweak the reference-assembly list for
netcoreapp2.2.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs | Skips two VBPretty tests on non-Windows Roslyn 2.10 + non-net40 due to VB runtime substitution affecting output. |
| ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs | Updates VB reference selection and -vbruntime handling for non-Windows netcoreapp2.2 to avoid identity conflicts and missing runtime assemblies. |
| ICSharpCode.Decompiler.Tests/Helpers/Tester.cs | Adds non-Windows Roslyn 2.10 toolset selection, Mono detection, cross-platform compiler wrapping, portable PDB selection, and reference list tweaks. |
| ICSharpCode.Decompiler.Tests/Helpers/RoslynToolset.cs | Improves compiler-path selection to support both dotnet-hosted and Mono-hosted Roslyn toolsets on non-Windows. |
Comments suppressed due to low confidence (1)
ICSharpCode.Decompiler.Tests/Helpers/Tester.cs:205
- This XML doc says Roslyn 1.x/2.x and mcs are removed on non-Windows unless Mono is available, but SupportedOnCurrentPlatform currently always excludes mcs and does not require Mono for Roslyn 2.10 (it runs dotnet-hosted). Please update the comment to match the actual filtering logic.
/// depend on Windows-only tools or runtimes are removed: the legacy (pre-Roslyn) csc/vbc
/// and Force32Bit (requires a 32-bit runtime) always; Roslyn 1.x/2.x (their packages only
/// ship .NET Framework binaries) and mcs unless a Mono runtime is available to host them.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The Roslyn 1.3.2 and 2.10.0 configurations were excluded from the compiler matrix on non-Windows platforms because Microsoft.Net.Compilers only ships .NET Framework executables. Both can be enabled: - Roslyn 2.10.0 has a dotnet-hosted sibling package, Microsoft.NETCore.Compilers, whose tools/bincore/csc.dll runs on the installed runtime with --roll-forward LatestMajor (its runtimeconfig pins the out-of-support .NET Core 2.0). Fetched on non-Windows into the version's tools/bincore directory; GetCSharpCompiler probes for a direct csc.dll next to the installed path in addition to the bincore/ subfolder layout of the newer toolset packages. - Roslyn 1.3.2 has no .NET build; when a mono executable is found on the PATH, it is kept in the matrix and WrapCompiler hosts the .exe compilers through mono. Because the native DiaSymReader needed for Windows PDBs is unavailable there, GeneratePdb requests portable PDBs on non-Windows (Roslyn 2.x+ falls back on its own, 1.x needs the explicit -debug:portable). The mcs configurations stay excluded: the bundled mcs 2.6.4 needs the Reflection.Emit COMPILER_ACCESS mode that current Mono runtimes no longer implement. Old-compiler configurations also stay excluded from correctness-style fixtures: their output targets .NET Framework or .NET Core 2.2, which the runners cannot execute here. Microsoft.NETCore.Compilers-2.10.0.nupkg should be added to ILSpy-tests/nuget to keep the fetch offline-capable. Assisted-by: Claude:claude-fable-5:Claude Code
The netcore-2.2 reference set consists of the shared framework's facade assemblies split across many files, and vbc only binds special types like System.Void from an assembly that defines them rather than following type forwards, so without an implicit SDK it needs the same reference list as the C# side. The VB runtime must come from the legacy reference set: before .NET Core 3.0 there is no Microsoft.VisualBasic.Core.dll and the core build of the VB runtime is a trimmed-down subset (no UBound etc.). Referencing the target framework's own Microsoft.VisualBasic facade alongside that -vbruntime choice is a BC32210 identity conflict, so it is dropped from both the default reference list and the ReferenceVisualBasic flag handling. All of this applies only where vbc runs without its implicit desktop SDK path, i.e. off Windows; on Windows vbc.exe keeps the plain reference list that already worked. Assisted-by: Claude:claude-fable-5:Claude Code
siegfriedpammer
force-pushed
the
linux-test-matrix
branch
from
July 27, 2026 15:21
1e5586c to
5454c51
Compare
siegfriedpammer
added a commit
that referenced
this pull request
Jul 31, 2026
The dotnet-hosted Roslyn 2.10 build cannot start its VBCSCompiler server under a current dotnet host, so with /shared every test compilation first waited out the client's full 20-second new-server connection timeout before falling back to a sub-second in-process compile. Since the 2.10 configurations were enabled on non-Windows (#3914), that added ~29 minutes to the Linux CI job and ~43 minutes on macOS: ~340 affected tests at ~21s each, versus ~0.2s for the toolsets whose server works. Assisted-by: Claude:claude-fable-5:Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables the Roslyn 1.3.2 and 2.10.0 compiler configurations of the decompiler test matrix on non-Windows platforms, and makes the vbc 2.10 / netcore-2.2 combination compile there:
Microsoft.NETCore.Compilerssibling package (tools/bincore/csc.dll,--roll-forward LatestMajor).mono; since the native DiaSymReader is unavailable there,GeneratePdbrequests portable PDBs on non-Windows (Roslyn 2.x+ already falls back on its own). The 1.3.2 configurations stay in the matrix even when Mono is missing from the PATH and report the missing runtime viaAssert.Ignoreat compile time, so a box or CI image that loses Mono shows skipped tests instead of a silently smaller matrix.Microsoft.VisualBasic.dllas-vbruntime(noMicrosoft.VisualBasic.Core.dllbefore .NET Core 3.0). Referencing the target framework's ownMicrosoft.VisualBasicfacade alongside that is a BC32210 identity conflict, so it is dropped from the reference list. Two VBPretty fixtures (Issue2192,VBNonGenericForEach) produce different output under the substituted VB runtime and are ignored on non-Windows for the netcore-2.2 configuration, with a comment explaining why.Verified on Linux (Fedora, mono 6.x): full
ICSharpCode.Decompiler.Testssuite passes with the enabled matrix (3006 passed / 0 failed / 42 skipped); the VBPretty suite goes from 18 failures (allUseRoslyn2_10_0) to green. Windows behavior is unchanged.Follow-up (separate ILSpy-tests bump): add
Microsoft.NETCore.Compilers-2.10.0.nupkgtoILSpy-tests/nugetso the non-Windows fetch stays offline-capable; it currently falls back to nuget.org.This PR was prepared by an AI agent (Claude) on behalf of @siegfriedpammer.
🤖 Generated with Claude Code