Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
nameSuffix: _Threading
extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
extraHelixArguments: /p:WasmEnableThreads=true
shouldContinueOnError: true
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
alwaysRun: ${{ parameters.isWasmOnlyBuild }}
Expand Down
8 changes: 0 additions & 8 deletions eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
<!-- set this when provisioning emsdk on CI -->
<EMSDK_PATH Condition="'$(EMSDK_PATH)' == '' and '$(ContinuousIntegrationBuild)' == 'true' and '$(MonoProjectRoot)' != ''">$([MSBuild]::NormalizeDirectory($(BrowserProjectRoot), 'emsdk'))</EMSDK_PATH>

<!--
- For regular library tests, it will use the symbols file from the runtime pack.
- for AOT library tests, we avoid WasmNativeDebugSymbols so that we don't run OOM on helix during wasm-opt
-->
<WasmNativeStrip Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(RunAOTCompilation)' == 'true'">true</WasmNativeStrip>
<WasmNativeDebugSymbols Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(RunAOTCompilation)' == 'true'">false</WasmNativeDebugSymbols>
<WasmEmitSymbolMap Condition="'$(WasmEmitSymbolMap)' == ''">true</WasmEmitSymbolMap>

<_WasmMainJSFileName Condition="'$(WasmMainJSPath)' != ''">$([System.IO.Path]::GetFileName('$(WasmMainJSPath)'))</_WasmMainJSFileName>
Expand Down Expand Up @@ -172,8 +166,6 @@
<WasmMainHtmlPath>$(PublishDir)index.html</WasmMainHtmlPath>
<WasmInvariantGlobalization>$(InvariantGlobalization)</WasmInvariantGlobalization>
<WasmGenerateRunV8Script>true</WasmGenerateRunV8Script>

<WasmNativeDebugSymbols Condition="'$(DebuggerSupport)' == 'true' and '$(WasmNativeDebugSymbols)' == ''">true</WasmNativeDebugSymbols>
</PropertyGroup>

<ItemGroup Condition="'$(IncludeSatelliteAssembliesInVFS)' == 'true' and '$(BuildAOTTestsOnHelix)' != 'true'">
Expand Down
2 changes: 0 additions & 2 deletions eng/testing/tests.wasi.targets
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@
<PropertyGroup>
<WasmAppDir>$(BundleDir)</WasmAppDir>
<WasmInvariantGlobalization>$(InvariantGlobalization)</WasmInvariantGlobalization>

<WasmNativeDebugSymbols Condition="'$(DebuggerSupport)' == 'true' and '$(WasmNativeDebugSymbols)' == ''">true</WasmNativeDebugSymbols>
</PropertyGroup>

<ItemGroup Condition="'$(IncludeSatelliteAssembliesInVFS)' == 'true' and '$(BuildAOTTestsOnHelix)' != 'true'">
Expand Down
8 changes: 8 additions & 0 deletions eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
<WasmDebugLevel Condition="'$(Configuration)' == 'Debug' and '$(WasmDebugLevel)' == ''">-1</WasmDebugLevel>
<WasmDebugLevel Condition="'$(WasmDebugLevel)' == ''">0</WasmDebugLevel>

<!--
- For regular library tests, it will use the symbols file from the runtime pack.
- for AOT library tests, we avoid WasmNativeDebugSymbols and we WasmNativeStrip so that we don't run OOM on helix during wasm-opt
-->
<WasmNativeStrip Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(RunAOTCompilation)' == 'true'">true</WasmNativeStrip>
<WasmNativeDebugSymbols Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(RunAOTCompilation)' == 'true'">false</WasmNativeDebugSymbols>
<WasmNativeDebugSymbols Condition="'$(DebuggerSupport)' == 'true' and '$(WasmNativeDebugSymbols)' == ''">true</WasmNativeDebugSymbols>

<TrimMode Condition="'$(TrimMode)' == ''">full</TrimMode>
<JsonSerializerIsReflectionEnabledByDefault Condition="'$(JsonSerializerIsReflectionEnabledByDefault)' == ''">true</JsonSerializerIsReflectionEnabledByDefault>

Expand Down
2 changes: 0 additions & 2 deletions src/mono/wasi/build/WasiApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
<_MonoAotCrossCompilerPath>@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','wasi-wasm'))</_MonoAotCrossCompilerPath>
<_WasmDefaultFlagsRsp>$([MSBuild]::NormalizePath($(_WasmRuntimePackSrcDir), 'wasi-default.rsp'))</_WasmDefaultFlagsRsp>
<_WasmDefaultLinkFlagsRsp>$([MSBuild]::NormalizePath($(_WasmRuntimePackSrcDir), 'wasi-link.rsp'))</_WasmDefaultLinkFlagsRsp>
<WasmNativeDebugSymbols Condition="'$(WasmNativeDebugSymbols)' == ''">true</WasmNativeDebugSymbols>
<WasmLinkIcalls Condition="'$(WasmLinkIcalls)' == ''">$(WasmBuildNative)</WasmLinkIcalls>

<_WasmICallTablePath>$(_WasmIntermediateOutputPath)icall-table.h</_WasmICallTablePath>
Expand Down Expand Up @@ -242,7 +241,6 @@
<_WasiClangCommonFlags Include="$(WasiClangFlags)" />
<_WasiClangCommonFlags Include="--sysroot=&quot;$(WASI_SDK_PATH.Replace('\', '/'))share/wasi-sysroot&quot;" />
<_WasiClangCommonFlags Include="--target=wasm32-unknown-wasip2" />
<_WasiClangCommonFlags Include="-g" Condition="'$(WasmNativeStrip)' == 'false'" />
<_WasiClangCommonFlags Include="-v" Condition="'$(WasiClangVerbose)' != 'false'" />
<!--<_WasiClangCommonFlags Include="-s DISABLE_EXCEPTION_CATCHING=0" Condition="'$(WasmEnableExceptionHandling)' == 'false'" />-->
<!--<_WasiClangCommonFlags Include="-fwasm-exceptions" Condition="'$(WasmEnableExceptionHandling)' == 'true'" />-->
Expand Down
1 change: 0 additions & 1 deletion src/mono/wasi/wasi.proj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<_WasiDefaultsRspPath>$(NativeBinDir)src\wasi-default.rsp</_WasiDefaultsRspPath>
<_WasiCompileRspPath>$(NativeBinDir)src\wasi-compile.rsp</_WasiCompileRspPath>
<_WasiLinkRspPath>$(NativeBinDir)src\wasi-link.rsp</_WasiLinkRspPath>
<WasmNativeStrip Condition="'$(ContinuousIntegrationBuild)' == 'true'">false</WasmNativeStrip>
</PropertyGroup>

<Import Project="$(RepositoryEngineeringDir)AcquireWasiSdk.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ public async Task ExtraEmccFlagsSetButNoRealChange(Configuration config, bool ao
ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBasicTestApp, "rebuild_flags");
BuildPaths paths = await FirstNativeBuildAndRun(info, config, aot, requestNativeRelink: true, invariant: false);
var pathsDict = GetFilesTable(info.ProjectName, aot, paths, unchanged: true);
bool dotnetNativeFilesUnchanged = extraLDFlags.Length == 0;
bool dotnetNativeFilesUnchanged = extraLDFlags.Length == 0 && extraCFlags.Length == 0;
if (!dotnetNativeFilesUnchanged)
pathsDict.UpdateTo(unchanged: false, "dotnet.native.wasm", "dotnet.native.js");

if (extraCFlags.Length != 0)
pathsDict.UpdateTo(unchanged: false, "driver.o", "runtime.o", "corebindings.o", "pinvoke.o");

var originalStat = StatFiles(pathsDict);

// Rebuild
Expand All @@ -52,10 +55,10 @@ public async Task ExtraEmccFlagsSetButNoRealChange(Configuration config, bool ao
// cflags: pinvoke get's compiled, but doesn't overwrite pinvoke.o
// and thus doesn't cause relinking
TestUtils.AssertSubstring("pinvoke.c -> pinvoke.o", output, contains: extraCFlags.Length > 0);
// ldflags: link step args change, so it should trigger relink
TestUtils.AssertSubstring("Linking with emcc", output, contains: extraLDFlags.Length > 0);

// ldflags or cflags: link step args change, so it should trigger relink
TestUtils.AssertSubstring("Linking with emcc", output, contains: !dotnetNativeFilesUnchanged);

if (aot)
{
// ExtraEmccLDFlags does not affect .bc files
Expand Down
18 changes: 15 additions & 3 deletions src/mono/wasm/Wasm.Build.Tests/WasmNativeDefaultsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void WasmNativeStripDefaultWithBuild(Configuration config, string extraPr
CheckPropertyValues(line,
wasmBuildNative: expectedWasmBuildNativeValue,
wasmNativeStrip: expectedWasmNativeStripValue,
wasmNativeDebugSymbols: true,
wasmNativeDebugSymbols: config == Configuration.Debug && !expectedWasmNativeStripValue,
wasmBuildingForNestedPublish: null);
}

Expand All @@ -158,7 +158,7 @@ public void WasmNativeStripDefaultWithPublish(Configuration config, string extra
CheckPropertyValues(line,
wasmBuildNative: expectedWasmBuildNativeValue,
wasmNativeStrip: expectedWasmNativeStripValue,
wasmNativeDebugSymbols: true,
wasmNativeDebugSymbols: false,
wasmBuildingForNestedPublish: true);
}

Expand Down Expand Up @@ -225,12 +225,19 @@ public void WithNativeReference(Configuration config, string extraProperties, bo
private void InferAndCheckPropertyValues(string? line, bool isPublish, bool wasmBuildNative, Configuration config)
{
bool expectedWasmNativeStripValue;
bool expectedWasmNativeDebugSymbols;
if (!isPublish && wasmBuildNative && config == Configuration.Debug)
{
expectedWasmNativeStripValue = false;
expectedWasmNativeDebugSymbols = true;
}
else
{
expectedWasmNativeDebugSymbols = false;
expectedWasmNativeStripValue = true;
}

CheckPropertyValues(line, wasmBuildNative, expectedWasmNativeStripValue, /*wasmNativeDebugSymbols*/true, isPublish);
CheckPropertyValues(line, wasmBuildNative, expectedWasmNativeStripValue, expectedWasmNativeDebugSymbols, isPublish);
}

private void CheckPropertyValues(string? line, bool wasmBuildNative, bool wasmNativeStrip, bool wasmNativeDebugSymbols, bool? wasmBuildingForNestedPublish)
Expand All @@ -240,6 +247,11 @@ private void CheckPropertyValues(string? line, bool wasmBuildNative, bool wasmNa
$"WasmNativeStrip: '{wasmNativeStrip.ToString().ToLower()}', " +
$"WasmNativeDebugSymbols: '{wasmNativeDebugSymbols.ToString().ToLower()}', " +
$"WasmBuildingForNestedPublish: '{(wasmBuildingForNestedPublish.HasValue && wasmBuildingForNestedPublish == true ? "true" : "")}'";
if (!line.Contains(expected))
{
_testOutput.WriteLine($"Actual: {line}");
_testOutput.WriteLine($"Expected: {expected}");
}
Assert.Contains(expected, line);
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/mono/wasm/build/WasmApp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,15 @@
</PropertyGroup>

<!-- Default with nothing set: Build+relink+config=debug -->
<PropertyGroup Condition="'$(WasmNativeDebugSymbols)' == '' and '$(WasmNativeStrip)' == '' and '$(WasmBuildingForNestedPublish)' != 'true' and '$(WasmBuildNative)' == 'true' and '$(Configuration)' == 'Debug'">
<WasmNativeDebugSymbols>true</WasmNativeDebugSymbols>
<PropertyGroup Condition="'$(WasmNativeDebugSymbols)' != 'false' and '$(WasmNativeStrip)' == '' and '$(WasmBuildingForNestedPublish)' != 'true' and '$(WasmBuildNative)' == 'true' and '$(Configuration)' == 'Debug'">
<WasmNativeStrip>false</WasmNativeStrip>
</PropertyGroup>
<PropertyGroup Condition="'$(WasmNativeDebugSymbols)' == '' and '$(WasmNativeStrip)' == 'false' and '$(WasmBuildingForNestedPublish)' != 'true' and '$(WasmBuildNative)' == 'true' and '$(Configuration)' == 'Debug'">
<WasmNativeDebugSymbols>true</WasmNativeDebugSymbols>
</PropertyGroup>

<PropertyGroup>
<WasmNativeDebugSymbols Condition="'$(WasmNativeDebugSymbols)' == ''">true</WasmNativeDebugSymbols>
<WasmNativeDebugSymbols Condition="'$(WasmNativeDebugSymbols)' == ''">false</WasmNativeDebugSymbols>
<WasmNativeStrip Condition="'$(WasmNativeStrip)' == ''">true</WasmNativeStrip>
</PropertyGroup>
</Target>
Expand Down
2 changes: 0 additions & 2 deletions src/mono/wasm/data/aot-tests/ProxyProjectForAOTOnHelix.proj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<IntermediateOutputPath>$(TestRootDir)\obj\</IntermediateOutputPath>

<WasmStripAOTAssemblies>false</WasmStripAOTAssemblies>
<WasmNativeDebugSymbols>true</WasmNativeDebugSymbols>
<WasmNativeStrip>false</WasmNativeStrip>
<WasmBuildAppDependsOn>PrepareForWasmBuildApp;$(WasmBuildAppDependsOn)</WasmBuildAppDependsOn>

<_PropsFile>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).props</_PropsFile>
Expand Down
Loading