diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index e602f23f060464..2d6ec5066fdb83 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -233,22 +233,31 @@ + + + + + + + + + diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj index f8e03ff1dc0b71..70681477a5869d 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj @@ -14,6 +14,7 @@ NetCore.SharedFramework true true + true diff --git a/src/libraries/sendtohelix-browser.targets b/src/libraries/sendtohelix-browser.targets index 3af0478473c414..e536101762ed76 100644 --- a/src/libraries/sendtohelix-browser.targets +++ b/src/libraries/sendtohelix-browser.targets @@ -174,7 +174,7 @@ <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' != 'true'">-trait category=no-workload <_XUnitTraitArg Condition="'$(WasmFingerprintAssets)' == 'false'">$(_XUnitTraitArg) -trait category=no-fingerprinting <_XUnitTraitArg Condition="'$(WasmBundlerFriendlyBootConfig)' == 'true'">$(_XUnitTraitArg) -trait category=bundler-friendly - <_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-notrait category=native -notrait category=mono -notrait category=workload + <_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-notrait category=mono -notrait category=workload diff --git a/src/mono/browser/build/BrowserWasmApp.CoreCLR.targets b/src/mono/browser/build/BrowserWasmApp.CoreCLR.targets index ab69d2c3d8465b..2d5011abc891d9 100644 --- a/src/mono/browser/build/BrowserWasmApp.CoreCLR.targets +++ b/src/mono/browser/build/BrowserWasmApp.CoreCLR.targets @@ -17,6 +17,11 @@ true + + false + true @@ -271,9 +276,15 @@ <_EmccCFlags Include="-DGEN_PINVOKE=1" /> <_EmccCFlags Include="$(EmccExtraCFlags)" /> - - <_EmccCFlags Include="-I"$(RepoRoot)src/coreclr/vm/wasm"" Condition="Exists('$(RepoRoot)src/coreclr/vm/wasm/callhelpers.hpp')" /> - <_EmccCFlags Include="-I"$(RepoRoot)src/native"" Condition="Exists('$(RepoRoot)src/native/minipal/entrypoints.h')" /> + + <_EmccCFlags Include="-I"$(MicrosoftNetCoreAppRuntimePackRidNativeDir)include"" Condition="Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)include/callhelpers.hpp')" /> + <_EmccCFlags Include="-I"$(RepoRoot)src/coreclr/vm/wasm"" Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)include/callhelpers.hpp') and '$(RepoRoot)' != '' and Exists('$(RepoRoot)src/coreclr/vm/wasm/callhelpers.hpp')" /> + <_EmccCFlags Include="-I"$([MSBuild]::NormalizePath('$(RepositoryEngineeringDir)', '..', 'src', 'coreclr', 'vm', 'wasm'))"" Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)include/callhelpers.hpp') and '$(RepoRoot)' == '' and '$(RepositoryEngineeringDir)' != '' and Exists('$([MSBuild]::NormalizePath($(RepositoryEngineeringDir), .., src, coreclr, vm, wasm, callhelpers.hpp))')" /> + <_EmccCFlags Include="-I"$(RepoRoot)src/native"" Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)include/minipal/entrypoints.h') and '$(RepoRoot)' != '' and Exists('$(RepoRoot)src/native/minipal/entrypoints.h')" /> + <_EmccCFlags Include="-I"$([MSBuild]::NormalizePath('$(RepositoryEngineeringDir)', '..', 'src', 'native'))"" Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)include/minipal/entrypoints.h') and '$(RepoRoot)' == '' and '$(RepositoryEngineeringDir)' != '' and Exists('$([MSBuild]::NormalizePath($(RepositoryEngineeringDir), .., src, native, minipal, entrypoints.h))')" /> <_EmccCFlags Include="-include "$(_WasmIntermediateOutputPath)coreclr_compat.h"" /> @@ -455,10 +466,10 @@ <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libSystem.Native.Browser.a" /> <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libSystem.Runtime.InteropServices.JavaScript.Native.a" /> <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libSystem.Native.a" /> - <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libSystem.Globalization.Native.a" Condition="'$(InvariantGlobalization)' != 'true'" /> - <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libicuuc.a" Condition="'$(InvariantGlobalization)' != 'true'" /> - <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libicui18n.a" Condition="'$(InvariantGlobalization)' != 'true'" /> - <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libicudata.a" Condition="'$(InvariantGlobalization)' != 'true'" /> + <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libSystem.Globalization.Native.a" /> + <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libicuuc.a" /> + <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libicui18n.a" /> + <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libicudata.a" /> <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libSystem.IO.Compression.Native.a" /> <_CoreCLRNativeLibs Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libz.a" /> diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs index 2883967abc0105..dab26e1fbba496 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs @@ -20,7 +20,7 @@ public IcuShardingTests(ITestOutputHelper output, SharedBuildPerTestClassFixture : base(output, buildContext) { } public static IEnumerable IcuExpectedAndMissingCustomShardTestData(Configuration config) => - from aot in boolOptions + from aot in aotBoolOptions from onlyPredefinedCultures in boolOptions // isOnlyPredefinedCultures = true fails with wasmbrowser: https://github.com/dotnet/runtime/issues/108272 where !(onlyPredefinedCultures) @@ -34,7 +34,7 @@ public static IEnumerable IcuExpectedAndMissingAutomaticShardTestData( { "ja-JP", GetCjkTestedLocales(SundayNames.Japanese) }, { "sk-SK", GetNocjkTestedLocales(SundayNames.Slovak) } }; - return from aot in boolOptions + return from aot in aotBoolOptions from locale in locales select new object[] { config, aot, locale.Key, locale.Value }; } diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs index 7005b99642b21e..7ed15d1c61928a 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs @@ -31,7 +31,7 @@ public static IEnumerable IcuExpectedAndMissingShardFromRuntimePackTes { "icudt_no_CJK.dat", GetNocjkTestedLocales() } }; return - from aot in boolOptions + from aot in aotBoolOptions from locale in locales select new object[] { config, aot, locale.Key, locale.Value }; } diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs b/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs index f57e229bc0200d..52f65f271bc378 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs @@ -20,7 +20,7 @@ public IcuTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildCo : base(output, buildContext) { } public static IEnumerable FullIcuWithICustomIcuTestData(Configuration config) => - from aot in boolOptions + from aot in aotBoolOptions from fullIcu in boolOptions select new object[] { config, aot, fullIcu }; @@ -34,7 +34,7 @@ public static IEnumerable FullIcuWithInvariantTestData(Configuration c new object[] { false, false, GetEfigsTestedLocales() }, new object[] { false, true, s_fullIcuTestedLocales } }; - return from aot in boolOptions + return from aot in aotBoolOptions from locale in locales select new object[] { config, aot, locale[0], locale[1], locale[2] }; } diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuTestsBase.cs b/src/mono/wasm/Wasm.Build.Tests/IcuTestsBase.cs index daf9b7ea597176..b635a10ea964df 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuTestsBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuTestsBase.cs @@ -20,6 +20,8 @@ public IcuTestsBase(ITestOutputHelper output, SharedBuildPerTestClassFixture bui private const string _fallbackSundayNameEnUS = "Sunday"; protected static string[] templateTypes = { "wasmbrowser" }; protected static bool[] boolOptions = { false, true }; + // CoreCLR WASM doesn't support AOT; filter to aot=false only for CoreCLR runs + protected static bool[] aotBoolOptions => IsCoreClrRuntime ? new[] { false } : new[] { false, true }; protected record SundayNames { diff --git a/src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs b/src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs index 9a7950b7a5ec4b..5e64d40d0cb8ff 100644 --- a/src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs @@ -45,6 +45,9 @@ public async Task RelinkingWithoutAOT(Configuration config, bool aot, bool? inva private async Task TestInvariantGlobalization(Configuration config, bool aot, bool? invariantGlobalization, bool? isNativeBuild = null) { + if (aot && IsCoreClrRuntime) + return; // CoreCLR WASM doesn't support AOT + string extraProperties = isNativeBuild == true ? "true" : ""; if (invariantGlobalization != null) { diff --git a/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj b/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj index 950f47c9b3ebe0..4bb51af40aeb67 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj +++ b/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj @@ -106,7 +106,7 @@ <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' != 'true'">-trait category=no-workload <_XUnitTraitArg Condition="'$(WasmFingerprintAssets)' == 'false'">-trait category=no-fingerprinting <_XUnitTraitArg Condition="'$(WasmBundlerFriendlyBootConfig)' == 'true'">-trait category=bundler-friendly - <_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-notrait category=native -notrait category=mono -notrait category=workload + <_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-notrait category=mono -notrait category=workload diff --git a/src/native/corehost/browserhost/CMakeLists.txt b/src/native/corehost/browserhost/CMakeLists.txt index 2249627f393f8d..b9bb956436b9da 100644 --- a/src/native/corehost/browserhost/CMakeLists.txt +++ b/src/native/corehost/browserhost/CMakeLists.txt @@ -138,5 +138,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dotnet.native.wasm DESTINATION sharedF install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dotnet.native.js.symbols DESTINATION corehost COMPONENT runtime) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dotnet.native.js.symbols DESTINATION sharedFramework COMPONENT runtime) +# Headers needed for app native re-link (ManagedToNativeGenerator output includes these) +install(FILES ${CLR_REPO_ROOT_DIR}/src/coreclr/vm/wasm/callhelpers.hpp DESTINATION sharedFramework/include COMPONENT runtime) +install(FILES ${CLR_REPO_ROOT_DIR}/src/native/minipal/entrypoints.h DESTINATION sharedFramework/include/minipal COMPONENT runtime) +install(FILES ${CLR_REPO_ROOT_DIR}/src/native/minipal/utils.h DESTINATION sharedFramework/include/minipal COMPONENT runtime) + set_source_files_properties(${BROWSERHOST_SOURCES} PROPERTIES OBJECT_DEPENDS "${JS_SYSTEM_NATIVE_BROWSER};${JS_SYSTEM_BROWSER_UTILS};${JS_SYSTEM_RUNTIME_INTEROPSERVICES_JAVASCRIPT_NATIVE};${JS_BROWSER_HOST};${JS_SYSTEM_NATIVE_BROWSER_EXPOST}") diff --git a/src/native/corehost/browserhost/libBrowserHost.footer.js b/src/native/corehost/browserhost/libBrowserHost.footer.js index f400eb4798b0dd..153f891e1251ad 100644 --- a/src/native/corehost/browserhost/libBrowserHost.footer.js +++ b/src/native/corehost/browserhost/libBrowserHost.footer.js @@ -18,8 +18,10 @@ function libBrowserHostFactory() { libBrowserHost(exports); // libBrowserHostFn is too complex for acorn-optimizer.mjs to find the dependencies + // NOTE: wasm_load_icu_data is NOT listed here because it's only available when + // InvariantGlobalization != true. The loadIcuData() JS code is only called when + // ICU data is present, so the symbol doesn't need to be a hard link-time dependency. let explicitDeps = [ - "wasm_load_icu_data", "BrowserHost_CreateHostContract", "BrowserHost_InitializeDotnet", "BrowserHost_ExecuteAssembly",