Skip to content

Commit

Permalink
Skip AOT of Microsoft.CodeAnalysis.CSharp.dll for WASM, due to out-of…
Browse files Browse the repository at this point in the history
…-memory issues in CI (#63958)
  • Loading branch information
directhex authored Feb 15, 2022
1 parent 193aeef commit 14e6411
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 9 deletions.
9 changes: 8 additions & 1 deletion eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<BuildAOTTestsOn Condition="'$(BuildAOTTestsOn)' == ''">local</BuildAOTTestsOn>
</PropertyGroup>

<ItemGroup>
<_AOT_InternalForceInterpretAssemblies Include="@(HighAotMemoryUsageAssembly)" />
</ItemGroup>

<!--
This is running during compile time and therefore $(Scenario) is empty, unless the specific project sets it.
Any settings in the project file could be replaced on Helix.
Expand Down Expand Up @@ -120,7 +124,7 @@
<PropertyGroup>
<_MainAssemblyPath Condition="'%(WasmAssembliesToBundle.FileName)' == $(AssemblyName) and '%(WasmAssembliesToBundle.Extension)' == '.dll'">%(WasmAssembliesToBundle.Identity)</_MainAssemblyPath>
<RuntimeConfigFilePath>$([System.IO.Path]::ChangeExtension($(_MainAssemblyPath), '.runtimeconfig.json'))</RuntimeConfigFilePath>
<EmccLinkOptimizationFlag Condition="'$(EmccLinkOptimizationFlag)' == ''">-Oz -Wl%252C-O0 -Wl%252C-lto-O0</EmccLinkOptimizationFlag>
<EmccLinkOptimizationFlag Condition="'$(EmccLinkOptimizationFlag)' == ''">-Oz -Wl,-O0 -Wl,-lto-O0</EmccLinkOptimizationFlag>
</PropertyGroup>

<Error Text="Item WasmAssembliesToBundle is empty. This is likely an authoring error." Condition="@(WasmAssembliesToBundle->Count()) == 0" />
Expand Down Expand Up @@ -171,6 +175,9 @@
<_WasmItemsToPass Include="@(BundleFiles)" OriginalItemName__="BundleFiles" ConditionToUse__="'$(Foo)' != 'true'" />
-->

<_WasmItemsToPass Include="@(_AOT_InternalForceInterpretAssemblies)" OriginalItemName__="_AOT_InternalForceInterpretAssemblies" />

</ItemGroup>

<!-- This file gets imported by the project file on helix -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
</PropertyGroup>

<ItemGroup>
<HighAotMemoryUsageAssembly Include="Microsoft.CodeAnalysis.CSharp.dll" />
</ItemGroup>

<Import Project="Microsoft.Extensions.Logging.Generators.targets"/>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<WasmNativeStrip>false</WasmNativeStrip>
</PropertyGroup>

<ItemGroup>
<HighAotMemoryUsageAssembly Include="Microsoft.CodeAnalysis.CSharp.dll" />
</ItemGroup>

<Import Project="Microsoft.Extensions.Logging.Generators.targets"/>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<HighAotMemoryUsageAssembly Include="Microsoft.CodeAnalysis.CSharp.dll" />
</ItemGroup>

<Import Project="System.Text.Json.SourceGeneration.Tests.targets" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
</PropertyGroup>

<ItemGroup>
<HighAotMemoryUsageAssembly Include="Microsoft.CodeAnalysis.CSharp.dll" />
</ItemGroup>

<Import Project="System.Text.Json.SourceGeneration.Unit.Tests.targets" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
</PropertyGroup>

<ItemGroup>
<HighAotMemoryUsageAssembly Include="Microsoft.CodeAnalysis.CSharp.dll" />
</ItemGroup>

<Import Project="System.Text.Json.SourceGeneration.Unit.Tests.targets" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<IsHighAotMemoryUsageTest>true</IsHighAotMemoryUsageTest>
</PropertyGroup>

<ItemGroup>
<HighAotMemoryUsageAssembly Include="Microsoft.CodeAnalysis.CSharp.dll" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.RegularExpressions\src\System.Text.RegularExpressions.csproj" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />
Expand Down
8 changes: 0 additions & 8 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@

<!-- Wasm aot on !windows -->
<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(BuildAOTTestsOnHelix)' == 'true' and '$(RunDisabledWasmTests)' != 'true' and '$(RunAOTCompilation)' == 'true' and '$(BrowserHost)' != 'Windows'">
<!-- Exceeds VM resources in CI on compilation: https://github.com/dotnet/runtime/issues/61339 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Abstractions\tests\Microsoft.Extensions.Logging.Generators.Tests\Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Abstractions\tests\Microsoft.Extensions.Logging.Generators.Tests\Microsoft.Extensions.Logging.Generators.Roslyn4.0.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Unit.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Unit.Tests\System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\System.Text.RegularExpressions.Generators.Tests\System.Text.RegularExpressions.Generators.Tests.csproj" />

<!-- https://github.com/dotnet/runtime/issues/61756 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\System.Text.RegularExpressions.Tests.csproj" />
</ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions src/mono/wasm/build/WasmApp.Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,13 @@ EMSCRIPTEN_KEEPALIVE void mono_wasm_load_profiler_aot (const char *desc) { mono_
<_WasmAOTSearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)\lib\net7.0" />
</ItemGroup>

<ItemGroup>
<!-- Skip known-huge assemblies specified in csproj -->
<_AotInputAssemblies Condition="'%(Filename)' != '' and '@(_AotInputAssemblies->Metadata(`Filename`))' != '' and '@(_AOT_InternalForceInterpretAssemblies->Metadata(`Filename`))' != ''">
<AOT_InternalForceToInterpret>true</AOT_InternalForceToInterpret>
</_AotInputAssemblies>
</ItemGroup>

<PropertyGroup>
<!--<AOTMode Condition="'$(AOTMode)' == '' and '$(AOTProfilePath)' != ''">LLVMOnlyInterp</AOTMode>-->
<AOTMode Condition="'$(AOTMode)' == ''">LLVMOnlyInterp</AOTMode>
Expand Down Expand Up @@ -575,6 +582,9 @@ EMSCRIPTEN_KEEPALIVE void mono_wasm_load_profiler_aot (const char *desc) { mono_
<ItemGroup>
<_BitcodeFile Include="%(_WasmAssembliesInternal.LlvmBitcodeFile)" />
<_BitcodeFile ObjectFile="$(_WasmIntermediateOutputPath)%(FileName).o" />

<!-- Add the skipped assemblies -->
<_WasmAssembliesInternal Include="@(_AotInputAssemblies->WithMetadataValue('AOT_InternalForceToInterpret', 'true'))" />
</ItemGroup>
</Target>

Expand Down

0 comments on commit 14e6411

Please sign in to comment.