Skip to content

Commit d7173ab

Browse files
marafCopilotradekdoulik
authored
[browser] More Wasm.Build.Tests on CoreCLR (#128296)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Radek Doulik <radek.doulik@gmail.com>
1 parent 12e5b3b commit d7173ab

52 files changed

Lines changed: 533 additions & 158 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eng/liveBuilds.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@
245245
$(LibrariesSharedFrameworkDir)*.a;
246246
$(LibrariesSharedFrameworkDir)*.dat;
247247
"
248+
Exclude="$(LibrariesSharedFrameworkDir)libminipal.a;
249+
$(LibrariesSharedFrameworkDir)libSystem.IO.Compression.Native.a;
250+
$(LibrariesSharedFrameworkDir)libz.a"
248251
IsNative="true" />
249252

250253
<!-- Runtime tests for Helix are built without the host subset, so browser host files are excluded from the runtime tests build -->

eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,12 @@ Wasm.Build.Tests.WasmRunOutOfAppBundleTests
1212
Wasm.Build.Tests.WasmTemplateTests
1313
Wasm.Build.Tests.MaxParallelDownloadsTests
1414
Wasm.Build.Tests.LibraryInitializerTests
15+
Wasm.Build.Tests.NativeBuildTests
16+
Wasm.Build.Tests.DllImportTests
17+
Wasm.Build.Tests.PInvokeTableGeneratorTests
18+
Wasm.Build.Tests.NativeLibraryTests
19+
Wasm.Build.Tests.IcuShardingTests
20+
Wasm.Build.Tests.IcuShardingTests2
21+
Wasm.Build.Tests.IcuTests
22+
Wasm.Build.Tests.MemoryTests
1523
Wasm.Build.Tests.DownloadThenInitTests

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,14 @@
271271
<PlatformManifestFileEntry Include="libgcinfo_unix_wasm.a" IsNative="true" />
272272
<PlatformManifestFileEntry Include="libminipal.a" IsNative="true" />
273273
<PlatformManifestFileEntry Include="libnativeresourcestring.a" IsNative="true" />
274+
<PlatformManifestFileEntry Include="libBrowserHost.a" IsNative="true" />
274275
<PlatformManifestFileEntry Include="libBrowserHost.js" IsNative="true" />
275276
<PlatformManifestFileEntry Include="libBrowserHost.js.map" IsNative="true" />
276277
<PlatformManifestFileEntry Include="libSystem.Native.Browser.Utils.js" IsNative="true" />
277278
<PlatformManifestFileEntry Include="libSystem.Native.Browser.Utils.js.map" IsNative="true" />
278279
<PlatformManifestFileEntry Include="libSystem.Native.Browser.js" IsNative="true" />
279280
<PlatformManifestFileEntry Include="libSystem.Native.Browser.js.map" IsNative="true" />
281+
<PlatformManifestFileEntry Include="libSystem.Native.Browser.extpost.js" IsNative="true" />
280282
<PlatformManifestFileEntry Include="libSystem.Runtime.InteropServices.JavaScript.Native.js" IsNative="true" />
281283
<PlatformManifestFileEntry Include="libSystem.Runtime.InteropServices.JavaScript.Native.js.map" IsNative="true" />
282284
<!-- wasi specific -->

src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<VSInsertionShortComponentName>NetCore.SharedFramework</VSInsertionShortComponentName>
1515
<UseTemplatedPlatformManifest>true</UseTemplatedPlatformManifest>
1616
<UseRidGraph>true</UseRidGraph>
17+
<!-- WASM CoreCLR ships static libs in the runtime pack so apps can relink with emcc. -->
18+
<IncludeStaticLibrariesInPack Condition="'$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi'">true</IncludeStaticLibrariesInPack>
1719
</PropertyGroup>
1820

1921
<ItemGroup>

src/libraries/sendtohelix-browser.targets

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,17 @@
158158
<HelixPreCommand Include="$(EnvVarCommand) BROWSER_BUILD_TARGETS_DIR=$HELIX_CORRELATION_PAYLOAD/build/wasm/" />
159159
<HelixPreCommand Include="$(EnvVarCommand) WASM_APP_BUILDER_TASKS_ASSEMBLY_PATH=$HELIX_CORRELATION_PAYLOAD/build/WasmAppBuilder/WasmAppBuilder.dll" />
160160
<HelixPreCommand Include="$(EnvVarCommand) EMSDK_PATH=$HELIX_CORRELATION_PAYLOAD/build/emsdk/" />
161+
<HelixPreCommand Include="$(EnvVarCommand) MINIPAL_INCLUDE_DIR=$HELIX_CORRELATION_PAYLOAD/build/minipal/" />
162+
<HelixPreCommand Include="$(EnvVarCommand) CORECLR_VM_WASM_INCLUDE_DIR=$HELIX_CORRELATION_PAYLOAD/build/coreclr-vm-wasm/" />
161163
</ItemGroup>
162164

163165
<ItemGroup Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(Scenario)' == 'BuildWasmApps' and '$(WindowsShell)' == 'true'">
164166
<HelixPreCommand Include="$(EnvVarCommand) REPOSITORY_ENGINEERING_DIR=%HELIX_CORRELATION_PAYLOAD%\build\eng\" />
165167
<HelixPreCommand Include="$(EnvVarCommand) BROWSER_BUILD_TARGETS_DIR=%HELIX_CORRELATION_PAYLOAD%\build\wasm\" />
166168
<HelixPreCommand Include="$(EnvVarCommand) WASM_APP_BUILDER_TASKS_ASSEMBLY_PATH=%HELIX_CORRELATION_PAYLOAD%\build\WasmAppBuilder\WasmAppBuilder.dll" />
167169
<HelixPreCommand Include="$(EnvVarCommand) EMSDK_PATH=%HELIX_CORRELATION_PAYLOAD%\build\emsdk\" />
170+
<HelixPreCommand Include="$(EnvVarCommand) MINIPAL_INCLUDE_DIR=%HELIX_CORRELATION_PAYLOAD%\build\minipal\" />
171+
<HelixPreCommand Include="$(EnvVarCommand) CORECLR_VM_WASM_INCLUDE_DIR=%HELIX_CORRELATION_PAYLOAD%\build\coreclr-vm-wasm\" />
168172
</ItemGroup>
169173

170174
<PropertyGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
@@ -174,7 +178,7 @@
174178
<_XUnitTraitArg Condition="'$(TestUsingWorkloads)' != 'true'">-trait category=no-workload</_XUnitTraitArg>
175179
<_XUnitTraitArg Condition="'$(WasmFingerprintAssets)' == 'false'">$(_XUnitTraitArg) -trait category=no-fingerprinting</_XUnitTraitArg>
176180
<_XUnitTraitArg Condition="'$(WasmBundlerFriendlyBootConfig)' == 'true'">$(_XUnitTraitArg) -trait category=bundler-friendly</_XUnitTraitArg>
177-
<_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-notrait category=native -notrait category=mono -notrait category=workload</_XUnitTraitArg>
181+
<_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-notrait category=native-mono -notrait category=mono -notrait category=workload</_XUnitTraitArg>
178182
</PropertyGroup>
179183

180184
<PropertyGroup>
@@ -283,6 +287,34 @@
283287
<HelixCorrelationPayload Include="$(_CoreCLRWbtEngPayloadDir)" Destination="build/eng" />
284288
</ItemGroup>
285289

290+
<!-- CoreCLR WBT: ship src/native/minipal/{utils.h,entrypoints.h} and
291+
src/coreclr/vm/wasm/callhelpers.hpp into the payload so per-app native
292+
re-link (BrowserWasmApp.CoreCLR.targets) can resolve the #include lines
293+
emitted by ManagedToNativeGenerator output. Stage into directories first
294+
because HelixCorrelationPayload on individual files causes the Helix
295+
client to try unzipping them as archives. -->
296+
<PropertyGroup Condition="'$(NeedsEMSDK)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'">
297+
<_CoreCLRWbtMinipalPayloadDir>$(ArtifactsObjDir)helix-staging\coreclr-wbt-minipal\</_CoreCLRWbtMinipalPayloadDir>
298+
<_CoreCLRWbtVmWasmPayloadDir>$(ArtifactsObjDir)helix-staging\coreclr-wbt-vm-wasm\</_CoreCLRWbtVmWasmPayloadDir>
299+
</PropertyGroup>
300+
<ItemGroup Condition="'$(NeedsEMSDK)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'">
301+
<_CoreCLRWbtMinipalFiles Include="$(RepoRoot)src\native\minipal\utils.h" />
302+
<_CoreCLRWbtMinipalFiles Include="$(RepoRoot)src\native\minipal\entrypoints.h" />
303+
<_CoreCLRWbtVmWasmFiles Include="$(RepoRoot)src\coreclr\vm\wasm\callhelpers.hpp" />
304+
</ItemGroup>
305+
<Copy Condition="'$(NeedsEMSDK)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'"
306+
SourceFiles="@(_CoreCLRWbtMinipalFiles)"
307+
DestinationFolder="$(_CoreCLRWbtMinipalPayloadDir)"
308+
SkipUnchangedFiles="true" />
309+
<Copy Condition="'$(NeedsEMSDK)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'"
310+
SourceFiles="@(_CoreCLRWbtVmWasmFiles)"
311+
DestinationFolder="$(_CoreCLRWbtVmWasmPayloadDir)"
312+
SkipUnchangedFiles="true" />
313+
<ItemGroup Condition="'$(NeedsEMSDK)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'">
314+
<HelixCorrelationPayload Include="$(_CoreCLRWbtMinipalPayloadDir)" Destination="build/minipal" />
315+
<HelixCorrelationPayload Include="$(_CoreCLRWbtVmWasmPayloadDir)" Destination="build/coreclr-vm-wasm" />
316+
</ItemGroup>
317+
286318
<!-- copy node separately only if EMSDK is not being included -->
287319
<ItemGroup Condition="'$(IncludeNodePayload)' == 'true'">
288320
<HelixCorrelationPayload Include="$(EmSdkDirForHelixPayload)node" Destination="build/emsdk-node" />

0 commit comments

Comments
 (0)