From 686b90decc1be47f7c3cbf2f68e43f574a4e734b Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 28 Jul 2026 17:50:14 -0500 Subject: [PATCH] Fix CLR_Tools_Tests build break in WasmArgumentLayoutTests WasmArgumentLayoutTests.CreateWasmContext constructs ReadyToRunCompilerContext with five arguments, but a targetAllowsRuntimeCodeGeneration parameter was added to that constructor, so the ILCompiler.ReadyToRun.Tests project no longer compiles. The two changes landed close enough together that neither one's CI saw the other. Pass false, which is what crossgen2's Program.GetTargetAllowsRuntimeCodeGeneration computes for --targetarch wasm --targetos browser, the configuration this test context mirrors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb624f92-0ff3-435c-8963-5b203384fbed --- .../aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs index f3e8082e09f5a4..14f487560d8cb9 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs @@ -163,7 +163,8 @@ private ReadyToRunCompilerContext CreateWasmContext() InstructionSetSupport instructionSetSupport = new(default, default, TargetArchitecture.Wasm32); TargetDetails target = new(TargetArchitecture.Wasm32, TargetOS.Browser, TargetAbi.NativeAot, instructionSetSupport.GetVectorTSimdVector()); - ReadyToRunCompilerContext context = new(target, SharedGenericsMode.CanonicalReferenceTypes, bubbleIncludesCoreModule: true, instructionSetSupport, oldTypeSystemContext: null) + // Wasm cannot generate code at runtime, matching what crossgen2's Program computes for this target. + ReadyToRunCompilerContext context = new(target, SharedGenericsMode.CanonicalReferenceTypes, bubbleIncludesCoreModule: true, targetAllowsRuntimeCodeGeneration: false, instructionSetSupport, oldTypeSystemContext: null) { InputFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "System.Private.CoreLib", coreLibPath } }, ReferenceFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase),