Skip to content

Commit

Permalink
[wasm] WBT: fix failing no-trimming test
Browse files Browse the repository at this point in the history
The test build gets terminated with:
`Precompiling failed for /root/helix/work/workitem/e/wbt/4hiqh2hp_nji/obj/Release/net8.0/browser-wasm/wasm/for-publish/aot-in/aot-instances.dll with exit code 137`

.. while compiling `aot-instances.dll`, with 190+ assemblies when not
trimming. Since, the particular tests terminate the build after this
step, and don't need the output, use `WasmDedup=false` to avoid using
`aot-instances.dll` at all.

Fixes dotnet#93522
  • Loading branch information
radical committed Oct 24, 2023
1 parent fe043b4 commit 7a7b99b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@ public void BlazorWasm_CanRunMonoAOTCross_WithNoTrimming(string config)
<Error Text=""Stopping after AOT"" Condition=""'$(WasmBuildingForNestedPublish)' == 'true'"" />
</Target>
";

// Use WasmDedup=false because aot-instances.dll for the no-trimming case ends
// up oom'ing.
AddItemsPropertiesToProject(Path.Combine(_projectDir!, $"{id}.csproj"),
extraItems: null,
extraProperties: null,
extraProperties: "<WasmDedup>false</WasmDedup>",
atTheEnd: target);

string publishLogPath = Path.Combine(s_buildEnv.LogRootPath, id, $"{id}.binlog");
Expand Down
4 changes: 3 additions & 1 deletion src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public void MonoAOTCross_WorksWithNoTrimming(BuildArgs buildArgs, string id)

string projectName = $"mono_aot_cross_{buildArgs.Config}_{buildArgs.AOT}";

buildArgs = buildArgs with { ProjectName = projectName, ExtraBuildArgs = "-p:PublishTrimmed=false -v:n" };
// Use WasmDedup=false because aot-instances.dll for the no-trimming case ends
// up oom'ing.
buildArgs = buildArgs with { ProjectName = projectName, ExtraBuildArgs = "-p:PublishTrimmed=false -p:WasmDedup=false" };
buildArgs = ExpandBuildArgs(buildArgs, extraProperties: "<WasmBuildNative>true</WasmBuildNative>", insertAtEnd: target);

(_, string output) = BuildProject(
Expand Down

0 comments on commit 7a7b99b

Please sign in to comment.