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
6 changes: 5 additions & 1 deletion eng/testing/WasmRunnerTemplate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ if /I [%XHARNESS_COMMAND%] == [test] (
)

if [%JS_ENGINE_ARGS%] == [] (
set "JS_ENGINE_ARGS=--engine-arg^=--stack-trace-limit^=1000 --engine-arg^=--module"
set "JS_ENGINE_ARGS=--engine-arg^=--stack-trace-limit^=1000"

if [!JS_ENGINE!] == [--engine^=V8] (
set "JS_ENGINE_ARGS=!JS_ENGINE_ARGS! --engine-arg^=--module"
)
)
) else (
if /I [%SCENARIO%] == [WasmTestOnChrome] (
Expand Down
11 changes: 7 additions & 4 deletions eng/testing/WasmRunnerTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@ if [[ -z "$XHARNESS_COMMAND" ]]; then
fi

if [[ "$XHARNESS_COMMAND" == "test" ]]; then
if [[ -z "$JS_ENGINE" ]]; then
JS_ENGINE="--engine=V8"
fi
if [[ -z "$MAIN_JS" ]]; then
MAIN_JS="--js-file=test-main.js"
fi

if [[ -z "$JS_ENGINE_ARGS" ]]; then
JS_ENGINE_ARGS="--engine-arg=--stack-trace-limit=1000 --engine-arg=--module"
fi
JS_ENGINE_ARGS="--engine-arg=--stack-trace-limit=1000"

if [[ -z "$JS_ENGINE" ]]; then
JS_ENGINE="--engine=V8"
if [[ "$JS_ENGINE" == "--engine=V8" ]] ; then
JS_ENGINE_ARGS="$JS_ENGINE_ARGS --engine-arg=--module"
fi
fi
else
if [[ "$SCENARIO" == "WasmTestOnChrome" || "$SCENARIO" == "wasmtestonchrome" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
<PlatformManifestFileEntry Include="libSystem.Native.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Native.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Native.so" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Native.TimeZoneData.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Native.TimeZoneData.Invariant.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Net.Http.Native.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Net.Http.Native.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Net.Http.Native.so" IsNative="true" />
Expand Down Expand Up @@ -220,7 +222,6 @@
<PlatformManifestFileEntry Include="libmono-wasm-eh-wasm.a" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-wasm-simd.a" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-wasm-nosimd.a" IsNative="true" />
<PlatformManifestFileEntry Include="wasm-bundled-timezones.a" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.js" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.js.map" IsNative="true" />
<PlatformManifestFileEntry Include="dotnet.runtime.js" IsNative="true" />
Expand Down
76 changes: 3 additions & 73 deletions src/mono/browser/browser.proj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<WasmEnableJsInteropByValue Condition="'$(WasmEnableJsInteropByValue)' == '' and '$(WasmEnableThreads)' == 'true'">true</WasmEnableJsInteropByValue>
<WasmEnableJsInteropByValue Condition="'$(WasmEnableJsInteropByValue)' == ''">false</WasmEnableJsInteropByValue>
<EnableDiagnostics Condition="'$(EnableDiagnostics)' == ''">false</EnableDiagnostics>
<FilterSystemTimeZones Condition="'$(FilterSystemTimeZones)' == ''">false</FilterSystemTimeZones>
<EmccCmd>emcc</EmccCmd>
<WasmObjDir>$(ArtifactsObjDir)wasm</WasmObjDir>
<_EmccDefaultsRspPath>$(NativeBinDir)src\emcc-default.rsp</_EmccDefaultsRspPath>
Expand All @@ -46,7 +45,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Runtime.ICU.Transport" PrivateAssets="all" Version="$(MicrosoftNETCoreRuntimeICUTransportVersion)" GeneratePathProperty="true" />
<PackageReference Include="System.Runtime.TimeZoneData" PrivateAssets="all" Version="$(SystemRuntimeTimeZoneDataVersion)" GeneratePathProperty="true" />
</ItemGroup>

<UsingTask TaskName="ManagedToNativeGenerator" AssemblyFile="$(WasmAppBuilderTasksAssemblyPath)" TaskFactory="TaskHostFactory" />
Expand Down Expand Up @@ -81,74 +79,7 @@
</ManagedToNativeGenerator>
</Target>

<UsingTask TaskName="EmitBundleSourceFiles" AssemblyFile="$(MonoTargetsTasksAssemblyPath)" TaskFactory="TaskHostFactory" />
<Target Name="GenerateTimezonesArchive" Returns="@(_WasmArchivedTimezones)" Condition="'$(InvariantTimezone)' != 'true'">
<PropertyGroup>
<_WasmTimezonesPath>$([MSBuild]::NormalizePath('$(PkgSystem_Runtime_TimeZoneData)', 'contentFiles', 'any', 'any', 'data'))</_WasmTimezonesPath>
<_WasmTimezonesBundleSourceFile>wasm-bundled-timezones.c</_WasmTimezonesBundleSourceFile>
<_WasmTimezonesBundleArchive>$(WasmObjDir)\wasm-bundled-timezones.a</_WasmTimezonesBundleArchive>
<_WasmTimezonesSourcesRsp>$(WasmObjDir)\wasm-bundled-timezones-sources.rsp</_WasmTimezonesSourcesRsp>
<_WasmTimezonesArchiveRsp>$(WasmObjDir)\wasm-bundled-timezones-archive.rsp</_WasmTimezonesArchiveRsp>
</PropertyGroup>
<ItemGroup>
<_WasmTimezonesInternal Include="$(_WasmTimezonesPath)\**\*.*" WasmRole="Timezone"/>
</ItemGroup>
<ItemGroup>
<_WasmTimezonesInternal Update="@(_WasmTimezonesInternal)">
<RegisteredName>/usr/share/zoneinfo/$([MSBuild]::MakeRelative($(_WasmTimezonesPath), %(_WasmTimezonesInternal.Identity)).Replace('\','/'))</RegisteredName>
</_WasmTimezonesInternal>
</ItemGroup>
<!-- TODO make this incremental compilation -->
<EmitBundleSourceFiles
FilesToBundle="@(_WasmTimezonesInternal)"
BundleRegistrationFunctionName="mono_register_timezones_bundle"
BundleFile="$(_WasmTimezonesBundleSourceFile)"
OutputDirectory="$(WasmObjDir)">
<Output TaskParameter="BundledResources" ItemName="BundledWasmTimezones" />
</EmitBundleSourceFiles>

<ItemGroup>
<_WasmBundleTimezonesSources Include="$([MSBuild]::MakeRelative($(WasmObjDir), %(BundledWasmTimezones.DestinationFile)).Replace('\','/'))" />
<_WasmBundleTimezonesSources Include="$(_WasmTimezonesBundleSourceFile)" />
</ItemGroup>
<WriteLinesToFile File="$(_WasmTimezonesSourcesRsp)"
Overwrite="true"
Lines="@(_WasmBundleTimezonesSources, ' ')"
WriteOnlyWhenDifferent="true" />
<RunWithEmSdkEnv Command="$(EmccCmd) -xc -c @$(_WasmTimezonesSourcesRsp)"
WorkingDirectory="$(WasmObjDir)"
EmSdkPath="$(EMSDK_PATH)"
ConsoleToMsBuild="true"
IgnoreStandardErrorWarningFormat="true">
</RunWithEmSdkEnv>
<ItemGroup>
<WasmBundleTimezonesObjects Include="%(_WasmBundleTimezonesSources.Filename).o" />
</ItemGroup>
<WriteLinesToFile File="$(_WasmTimezonesArchiveRsp)"
Overwrite="true"
Lines="@(WasmBundleTimezonesObjects, ' ')"
WriteOnlyWhenDifferent="true" />
<RunWithEmSdkEnv Command="$(EmSdkLLVMAr) cs -r $(_WasmTimezonesBundleArchive) @$(_WasmTimezonesArchiveRsp)"
EmSdkPath="$(EMSDK_PATH)"
WorkingDirectory="$(WasmObjDir)"
ConsoleToMsBuild="true"
IgnoreStandardErrorWarningFormat="true">
</RunWithEmSdkEnv>

<ItemGroup>
<_WasmArchivedTimezones Include="$(WasmObjDir)\wasm-bundled-timezones.a" />
</ItemGroup>

<!-- Clean up the bundle-objects dir - remove anything we no longer need -->
<ItemGroup>
<_WasmBundleTimezonesToDelete Include="$(_WasmIntermediateOutputPath)*.o" />
<_WasmBundleTimezonesToDelete Include="$(_WasmIntermediateOutputPath)*.c" />
<_WasmBundleTimezonesToDelete Remove="$(WasmObjDir)\$(_WasmTimezonesBundleSourceFile)" />
<_WasmBundleTimezonesToDelete Remove="%(BundledWasmTimezones.DestinationFile)" />
<_WasmBundleTimezonesToDelete Remove="$(WasmObjDir)\%(WasmBundleTimezonesObjects)" />
</ItemGroup>
<Delete Files="@(_WasmBundleTimezonesToDelete)" />
</Target>

<Target Name="GenerateEmccPropsAndRspFiles">

Expand Down Expand Up @@ -374,7 +305,7 @@
<!-- This is a documented target that is invoked by developers in their innerloop work. -->
<Target Name="BuildWasmRuntimes"
AfterTargets="Build"
DependsOnTargets="GenerateEmccPropsAndRspFiles;GenerateManagedToNative;GenerateTimezonesArchive;InstallNpmPackages;BuildWithRollup">
DependsOnTargets="GenerateEmccPropsAndRspFiles;GenerateManagedToNative;InstallNpmPackages;BuildWithRollup">

<ItemGroup>
<ICULibNativeFiles Include="$(ICULibDir)/libicuuc.a;
Expand Down Expand Up @@ -475,8 +406,7 @@
SkipUnchangedFiles="true" />

<Copy SourceFiles="@(ICULibFiles);
@(ICULibNativeFiles);
@(_WasmArchivedTimezones);"
@(ICULibNativeFiles);"
DestinationFolder="$(NativeBinDir)"
SkipUnchangedFiles="true" />

Expand Down Expand Up @@ -519,7 +449,7 @@
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
SkipUnchangedFiles="true" />

<Copy SourceFiles="@(IcuDataFiles);@(ICULibNativeFiles);@(_WasmArchivedTimezones)"
<Copy SourceFiles="@(IcuDataFiles);@(ICULibNativeFiles)"
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
SkipUnchangedFiles="true" />

Expand Down
6 changes: 3 additions & 3 deletions src/mono/browser/build/BrowserWasmApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,9 @@
<_EmccCFlags Include="-DENABLE_AOT=1" Condition="'$(_WasmShouldAOT)' == 'true'" />
<_EmccCFlags Include="-DDRIVER_GEN=1" Condition="'$(_WasmShouldAOT)' == 'true'" />
<_EmccCFlags Include="-DINVARIANT_GLOBALIZATION=1" Condition="'$(InvariantGlobalization)' == 'true'" />
<_EmccCFlags Include="-DINVARIANT_TIMEZONE=1" Condition="'$(InvariantTimezone)' == 'true'" />
<_EmccCFlags Include="-DLINK_ICALLS=1" Condition="'$(WasmLinkIcalls)' == 'true'" />
<_EmccCFlags Include="-DENABLE_AOT_PROFILER=1" Condition="$(WasmProfilers.Contains('aot'))" />
<_EmccCFlags Include="-DENABLE_DEVTOOLS_PROFILER=1" Condition="$(WasmProfilers.Contains('browser'))" />
<_EmccCFlags Include="-DENABLE_DEVTOOLS_PROFILER=1" Condition="$(WasmProfilers.Contains('browser'))" />
<_EmccCFlags Include="-DENABLE_LOG_PROFILER=1" Condition="$(WasmProfilers.Contains('log'))" />
<_EmccCFlags Include="-DENABLE_JS_INTEROP_BY_VALUE=1" Condition="'$(WasmEnableJsInteropByValue)' == 'true'" />

Expand Down Expand Up @@ -459,9 +458,10 @@
</PropertyGroup>

<ItemGroup>
<_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/>
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(EnableDiagnostics)' != 'true'" />
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-stub-static.lib" Condition="'$(EnableDiagnostics)' == 'true'" />
<_MonoRuntimeComponentDontLink Include="libSystem.Native.TimeZoneData.Invariant.a" Condition="'$(InvariantTimezone)' != 'true'" />
<_MonoRuntimeComponentDontLink Include="libSystem.Native.TimeZoneData.a" Condition="'$(InvariantTimezone)' == 'true'" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ target_link_libraries(dotnet.native
${MONO_ARTIFACTS_DIR}/libmono-icall-table.a
${MONO_ARTIFACTS_DIR}/libmono-wasm-eh-js.a
${MONO_ARTIFACTS_DIR}/libmono-wasm-${CONFIGURATION_INTERPSIMDTABLES_LIB}.a
${NATIVE_BIN_DIR}/wasm-bundled-timezones.a
${NATIVE_BIN_DIR}/libSystem.Native.a
${NATIVE_BIN_DIR}/libSystem.Native.TimeZoneData.a
${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a
${NATIVE_BIN_DIR}/libSystem.IO.Compression.Native.a
${NATIVE_BIN_DIR}/libz.a)
Expand Down
9 changes: 0 additions & 9 deletions src/mono/browser/runtime/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ int monoeg_g_setenv(const char *variable, const char *value, int overwrite);
char *mono_method_get_full_name (MonoMethod *method);
char *mono_method_full_name (MonoMethod *method, int32_t signature);

#ifndef INVARIANT_TIMEZONE
extern void mono_register_timezones_bundle (void);
#endif /* INVARIANT_TIMEZONE */
extern void mono_wasm_set_entrypoint_breakpoint (const char* assembly_name, int method_token);

extern void mono_bundled_resources_add_assembly_resource (const char *id, const char *name, const uint8_t *data, uint32_t size, void (*free_func)(void *, void*), void *free_data);
Expand Down Expand Up @@ -193,12 +190,6 @@ mono_wasm_load_runtime (int debug_level, int propertyCount, const char **propert

monovm_initialize (propertyCount, propertyKeys, propertyValues);

#ifndef INVARIANT_TIMEZONE
char* invariant_timezone = monoeg_g_getenv ("DOTNET_SYSTEM_TIMEZONE_INVARIANT");
if (strcmp(invariant_timezone, "true") != 0 && strcmp(invariant_timezone, "1") != 0)
mono_register_timezones_bundle ();
#endif /* INVARIANT_TIMEZONE */

root_domain = mono_wasm_load_runtime_common (debug_level, wasm_trace_logger, interp_opts);

bindings_initialize_internals();
Expand Down
4 changes: 2 additions & 2 deletions src/mono/wasi/build/WasiApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@
<_WasmCommonCFlags Condition="'$(_DriverGenCNeeded)' == 'true'" Include="-DDRIVER_GEN=1" />
<_WasmCommonCFlags Condition="'$(WasmSingleFileBundle)' == 'true'" Include="-DWASM_SINGLE_FILE=1" />
<_WasmCommonCFlags Condition="'$(InvariantGlobalization)' == 'true'" Include="-DINVARIANT_GLOBALIZATION=1" />
<_WasmCommonCFlags Condition="'$(InvariantTimezone)' == 'true'" Include="-DINVARIANT_TIMEZONE=1" />
<_WasmCommonCFlags Condition="'$(WasmLinkIcalls)' == 'true'" Include="-DLINK_ICALLS=1" />
<_WasmCommonCFlags Condition="'$(_IsLibraryMode)' == 'true'" Include="-DWASM_LIBRARY_MODE=1" />
<_WasiClangCFlags Include="@(_WasmCommonCFlags)" />
Expand Down Expand Up @@ -365,9 +364,10 @@
</PropertyGroup>

<ItemGroup>
<_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/>
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(EnableDiagnostics)' != 'true'" />
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-stub-static.lib" Condition="'$(EnableDiagnostics)' == 'true'" />
<_MonoRuntimeComponentDontLink Include="libSystem.Native.TimeZoneData.Invariant.a" Condition="'$(InvariantTimezone)' != 'true'" />
<_MonoRuntimeComponentDontLink Include="libSystem.Native.TimeZoneData.a" Condition="'$(InvariantTimezone)' == 'true'" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasi/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ target_link_libraries(dotnet
${MONO_ARTIFACTS_DIR}/libmonosgen-2.0.a
${MONO_ARTIFACTS_DIR}/libmono-icall-table.a
${MONO_ARTIFACTS_DIR}/libmono-wasm-${CONFIGURATION_INTERPSIMDTABLES_LIB}.a
${NATIVE_BIN_DIR}/wasm-bundled-timezones.a
${NATIVE_BIN_DIR}/libSystem.Native.a
${NATIVE_BIN_DIR}/libSystem.Native.TimeZoneData.a
${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a
${NATIVE_BIN_DIR}/libSystem.IO.Compression.Native.a
${NATIVE_BIN_DIR}/libz.a
Expand Down
8 changes: 0 additions & 8 deletions src/mono/wasi/runtime/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ int monoeg_g_setenv(const char *variable, const char *value, int overwrite);
int32_t monoeg_g_hasenv(const char *variable);
void mono_free (void*);
char *mono_method_get_full_name (MonoMethod *method);
#ifndef INVARIANT_TIMEZONE
extern void mono_register_timezones_bundle (void);
#endif /* INVARIANT_TIMEZONE */
#ifdef WASM_SINGLE_FILE
extern void mono_register_assemblies_bundle (void);
extern void mono_register_runtimeconfig_bin (void);
Expand Down Expand Up @@ -265,11 +262,6 @@ mono_wasm_load_runtime (int debug_level)
load_runtimeconfig();
monovm_initialize (2, appctx_keys, appctx_values);

#ifndef INVARIANT_TIMEZONE
char* invariant_timezone = monoeg_g_getenv ("DOTNET_SYSTEM_TIMEZONE_INVARIANT");
if (strcmp(invariant_timezone, "true") != 0 && strcmp(invariant_timezone, "1") != 0)
mono_register_timezones_bundle ();
#endif /* INVARIANT_TIMEZONE */
#ifdef WASM_SINGLE_FILE
mono_register_assemblies_bundle ();
#endif
Expand Down
Loading
Loading