Skip to content

Commit d2627a4

Browse files
marafCopilot
andcommitted
[browser] CoreCLR in-tree relink
Implements the WASM native re-link pipeline for CoreCLR browser-wasm, replacing the stub WasmBuildApp / WasmTriggerPublishApp targets with a full Emscripten-based native build. Contributes to #123670 Contributes to #126100 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 52e2158 commit d2627a4

File tree

6 files changed

+736
-80
lines changed

6 files changed

+736
-80
lines changed

eng/native.wasm.targets

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<Project>
22
<Import Project="$(RepositoryEngineeringDir)AcquireEmscriptenSdk.targets" />
33

4-
<ItemGroup>
4+
<!-- These packages provide ICU and timezone data paths for the native build (CMake).
5+
Skip them during app-level relink (IsBrowserWasmProject) since the runtime pack
6+
already includes the pre-built native files, and the NuGet contentFiles (timezone
7+
data, READMEs) would pollute the app's Content items causing VFS/StaticWebAssets
8+
validation failures. -->
9+
<ItemGroup Condition="'$(IsBrowserWasmProject)' != 'true'">
510
<PackageReference Condition="'$(TargetsWasm)' == 'true'" Include="Microsoft.NETCore.Runtime.ICU.Transport" PrivateAssets="all" Version="$(MicrosoftNETCoreRuntimeICUTransportVersion)" GeneratePathProperty="true" />
611
<PackageReference Condition="'$(TargetsWasm)' == 'true'" Include="System.Runtime.TimeZoneData" PrivateAssets="all" Version="$(SystemRuntimeTimeZoneDataVersion)" GeneratePathProperty="true" />
712
</ItemGroup>
813

914
<PropertyGroup>
1015
<_RuntimeVariant />
1116
<_RuntimeVariant Condition="'$(WasmEnableThreads)' == 'true'">-threads</_RuntimeVariant>
17+
<FeatureMultithreading Condition="('$(TargetsBrowser)' != 'true' and '$(TargetsWasi)' != 'true') or '$(WasmEnableThreads)' == 'true'">true</FeatureMultithreading>
1218

1319
<_IcuDir Condition="'$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)' != '' and '$(TargetsWasm)' == 'true'">$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/$(TargetOS)-$(TargetArchitecture)$(_RuntimeVariant)/native</_IcuDir>
1420
<_TzdDir Condition="'$(PkgSystem_Runtime_TimeZoneData)' != '' and '$(TargetsWasm)' == 'true'">$([MSBuild]::NormalizePath('$(PkgSystem_Runtime_TimeZoneData)', 'contentFiles', 'any', 'any', 'data'))</_TzdDir>
@@ -33,18 +39,18 @@
3339
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_PERFTRACING_DISABLE_PERFTRACING_LISTEN_PORTS=1&quot;" />
3440
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT=1&quot;" />
3541
</ItemGroup>
36-
<ItemGroup Condition="'$(TargetsBrowser)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR' and '$(WasmEnableThreads)' != 'true'">
42+
<ItemGroup Condition="'$(FeatureMultithreading)' != 'true'">
3743
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_PERFTRACING_DISABLE_THREADS=1&quot;" />
38-
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_SINGLE_THREADED=1&quot;" />
3944
</ItemGroup>
40-
<!-- TODO-WASM - https://github.com/dotnet/runtime/issues/68162
41-
<ItemGroup Condition="'$(WasmEnableThreads)' == 'true'">
42-
-sUSE_PTHREADS=1
43-
-sPTHREAD_POOL_SIZE=0
44-
-sPTHREAD_POOL_SIZE_STRICT=0
45-
-Wno-pthreads-mem-growth
45+
<ItemGroup Condition="'$(FeatureMultithreading)' == 'true'">
46+
<NativeCMakeArg Include="-cmakeargs &quot;-DFEATURE_MULTITHREADING=1&quot;" />
47+
<!-- TODO-WASM - https://github.com/dotnet/runtime/issues/68162
48+
-sUSE_PTHREADS=1
49+
-sPTHREAD_POOL_SIZE=0
50+
-sPTHREAD_POOL_SIZE_STRICT=0
51+
-Wno-pthreads-mem-growth
52+
-->
4653
</ItemGroup>
47-
-->
4854

4955
<Target Name="GenerateEmccExports" Condition="'$(TargetsBrowser)' == 'true'">
5056
<ItemGroup>

0 commit comments

Comments
 (0)