Skip to content

Commit 6ed9563

Browse files
Build the time zone data as part of libs.native
This simplifies the WASM build, making this data just another static library. We produce two flavors of it: full and disabled, the latter to support the invariant timezone switch.
1 parent 94f0a90 commit 6ed9563

File tree

11 files changed

+43
-158
lines changed

11 files changed

+43
-158
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
<PlatformManifestFileEntry Include="libSystem.Native.a" IsNative="true" />
8383
<PlatformManifestFileEntry Include="libSystem.Native.dylib" IsNative="true" />
8484
<PlatformManifestFileEntry Include="libSystem.Native.so" IsNative="true" />
85+
<PlatformManifestFileEntry Include="libSystem.Native.TimeZoneData.a" IsNative="true" />
86+
<PlatformManifestFileEntry Include="libSystem.Native.TimeZoneData.Disabled.a" IsNative="true" />
8587
<PlatformManifestFileEntry Include="libSystem.Net.Http.Native.a" IsNative="true" />
8688
<PlatformManifestFileEntry Include="libSystem.Net.Http.Native.dylib" IsNative="true" />
8789
<PlatformManifestFileEntry Include="libSystem.Net.Http.Native.so" IsNative="true" />
@@ -220,7 +222,6 @@
220222
<PlatformManifestFileEntry Include="libmono-wasm-eh-wasm.a" IsNative="true" />
221223
<PlatformManifestFileEntry Include="libmono-wasm-simd.a" IsNative="true" />
222224
<PlatformManifestFileEntry Include="libmono-wasm-nosimd.a" IsNative="true" />
223-
<PlatformManifestFileEntry Include="wasm-bundled-timezones.a" IsNative="true" />
224225
<PlatformManifestFileEntry Include="dotnet.js" IsNative="true" />
225226
<PlatformManifestFileEntry Include="dotnet.js.map" IsNative="true" />
226227
<PlatformManifestFileEntry Include="dotnet.runtime.js" IsNative="true" />

src/mono/browser/browser.proj

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<WasmEnableJsInteropByValue Condition="'$(WasmEnableJsInteropByValue)' == '' and '$(WasmEnableThreads)' == 'true'">true</WasmEnableJsInteropByValue>
2929
<WasmEnableJsInteropByValue Condition="'$(WasmEnableJsInteropByValue)' == ''">false</WasmEnableJsInteropByValue>
3030
<EnableDiagnostics Condition="'$(EnableDiagnostics)' == ''">false</EnableDiagnostics>
31-
<FilterSystemTimeZones Condition="'$(FilterSystemTimeZones)' == ''">false</FilterSystemTimeZones>
3231
<EmccCmd>emcc</EmccCmd>
3332
<WasmObjDir>$(ArtifactsObjDir)wasm</WasmObjDir>
3433
<_EmccDefaultsRspPath>$(NativeBinDir)src\emcc-default.rsp</_EmccDefaultsRspPath>
@@ -46,7 +45,6 @@
4645

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

5250
<UsingTask TaskName="ManagedToNativeGenerator" AssemblyFile="$(WasmAppBuilderTasksAssemblyPath)" TaskFactory="TaskHostFactory" />
@@ -81,74 +79,7 @@
8179
</ManagedToNativeGenerator>
8280
</Target>
8381

84-
<UsingTask TaskName="EmitBundleSourceFiles" AssemblyFile="$(MonoTargetsTasksAssemblyPath)" TaskFactory="TaskHostFactory" />
85-
<Target Name="GenerateTimezonesArchive" Returns="@(_WasmArchivedTimezones)" Condition="'$(InvariantTimezone)' != 'true'">
86-
<PropertyGroup>
87-
<_WasmTimezonesPath>$([MSBuild]::NormalizePath('$(PkgSystem_Runtime_TimeZoneData)', 'contentFiles', 'any', 'any', 'data'))</_WasmTimezonesPath>
88-
<_WasmTimezonesBundleSourceFile>wasm-bundled-timezones.c</_WasmTimezonesBundleSourceFile>
89-
<_WasmTimezonesBundleArchive>$(WasmObjDir)\wasm-bundled-timezones.a</_WasmTimezonesBundleArchive>
90-
<_WasmTimezonesSourcesRsp>$(WasmObjDir)\wasm-bundled-timezones-sources.rsp</_WasmTimezonesSourcesRsp>
91-
<_WasmTimezonesArchiveRsp>$(WasmObjDir)\wasm-bundled-timezones-archive.rsp</_WasmTimezonesArchiveRsp>
92-
</PropertyGroup>
93-
<ItemGroup>
94-
<_WasmTimezonesInternal Include="$(_WasmTimezonesPath)\**\*.*" WasmRole="Timezone"/>
95-
</ItemGroup>
96-
<ItemGroup>
97-
<_WasmTimezonesInternal Update="@(_WasmTimezonesInternal)">
98-
<RegisteredName>/usr/share/zoneinfo/$([MSBuild]::MakeRelative($(_WasmTimezonesPath), %(_WasmTimezonesInternal.Identity)).Replace('\','/'))</RegisteredName>
99-
</_WasmTimezonesInternal>
100-
</ItemGroup>
101-
<!-- TODO make this incremental compilation -->
102-
<EmitBundleSourceFiles
103-
FilesToBundle="@(_WasmTimezonesInternal)"
104-
BundleRegistrationFunctionName="mono_register_timezones_bundle"
105-
BundleFile="$(_WasmTimezonesBundleSourceFile)"
106-
OutputDirectory="$(WasmObjDir)">
107-
<Output TaskParameter="BundledResources" ItemName="BundledWasmTimezones" />
108-
</EmitBundleSourceFiles>
10982

110-
<ItemGroup>
111-
<_WasmBundleTimezonesSources Include="$([MSBuild]::MakeRelative($(WasmObjDir), %(BundledWasmTimezones.DestinationFile)).Replace('\','/'))" />
112-
<_WasmBundleTimezonesSources Include="$(_WasmTimezonesBundleSourceFile)" />
113-
</ItemGroup>
114-
<WriteLinesToFile File="$(_WasmTimezonesSourcesRsp)"
115-
Overwrite="true"
116-
Lines="@(_WasmBundleTimezonesSources, ' ')"
117-
WriteOnlyWhenDifferent="true" />
118-
<RunWithEmSdkEnv Command="$(EmccCmd) -xc -c @$(_WasmTimezonesSourcesRsp)"
119-
WorkingDirectory="$(WasmObjDir)"
120-
EmSdkPath="$(EMSDK_PATH)"
121-
ConsoleToMsBuild="true"
122-
IgnoreStandardErrorWarningFormat="true">
123-
</RunWithEmSdkEnv>
124-
<ItemGroup>
125-
<WasmBundleTimezonesObjects Include="%(_WasmBundleTimezonesSources.Filename).o" />
126-
</ItemGroup>
127-
<WriteLinesToFile File="$(_WasmTimezonesArchiveRsp)"
128-
Overwrite="true"
129-
Lines="@(WasmBundleTimezonesObjects, ' ')"
130-
WriteOnlyWhenDifferent="true" />
131-
<RunWithEmSdkEnv Command="$(EmSdkLLVMAr) cs -r $(_WasmTimezonesBundleArchive) @$(_WasmTimezonesArchiveRsp)"
132-
EmSdkPath="$(EMSDK_PATH)"
133-
WorkingDirectory="$(WasmObjDir)"
134-
ConsoleToMsBuild="true"
135-
IgnoreStandardErrorWarningFormat="true">
136-
</RunWithEmSdkEnv>
137-
138-
<ItemGroup>
139-
<_WasmArchivedTimezones Include="$(WasmObjDir)\wasm-bundled-timezones.a" />
140-
</ItemGroup>
141-
142-
<!-- Clean up the bundle-objects dir - remove anything we no longer need -->
143-
<ItemGroup>
144-
<_WasmBundleTimezonesToDelete Include="$(_WasmIntermediateOutputPath)*.o" />
145-
<_WasmBundleTimezonesToDelete Include="$(_WasmIntermediateOutputPath)*.c" />
146-
<_WasmBundleTimezonesToDelete Remove="$(WasmObjDir)\$(_WasmTimezonesBundleSourceFile)" />
147-
<_WasmBundleTimezonesToDelete Remove="%(BundledWasmTimezones.DestinationFile)" />
148-
<_WasmBundleTimezonesToDelete Remove="$(WasmObjDir)\%(WasmBundleTimezonesObjects)" />
149-
</ItemGroup>
150-
<Delete Files="@(_WasmBundleTimezonesToDelete)" />
151-
</Target>
15283

15384
<Target Name="GenerateEmccPropsAndRspFiles">
15485

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

379310
<ItemGroup>
380311
<ICULibNativeFiles Include="$(ICULibDir)/libicuuc.a;
@@ -475,8 +406,7 @@
475406
SkipUnchangedFiles="true" />
476407

477408
<Copy SourceFiles="@(ICULibFiles);
478-
@(ICULibNativeFiles);
479-
@(_WasmArchivedTimezones);"
409+
@(ICULibNativeFiles);"
480410
DestinationFolder="$(NativeBinDir)"
481411
SkipUnchangedFiles="true" />
482412

@@ -519,7 +449,7 @@
519449
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
520450
SkipUnchangedFiles="true" />
521451

522-
<Copy SourceFiles="@(IcuDataFiles);@(ICULibNativeFiles);@(_WasmArchivedTimezones)"
452+
<Copy SourceFiles="@(IcuDataFiles);@(ICULibNativeFiles)"
523453
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
524454
SkipUnchangedFiles="true" />
525455

src/mono/browser/build/BrowserWasmApp.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,9 @@
328328
<_EmccCFlags Include="-DENABLE_AOT=1" Condition="'$(_WasmShouldAOT)' == 'true'" />
329329
<_EmccCFlags Include="-DDRIVER_GEN=1" Condition="'$(_WasmShouldAOT)' == 'true'" />
330330
<_EmccCFlags Include="-DINVARIANT_GLOBALIZATION=1" Condition="'$(InvariantGlobalization)' == 'true'" />
331-
<_EmccCFlags Include="-DINVARIANT_TIMEZONE=1" Condition="'$(InvariantTimezone)' == 'true'" />
332331
<_EmccCFlags Include="-DLINK_ICALLS=1" Condition="'$(WasmLinkIcalls)' == 'true'" />
333332
<_EmccCFlags Include="-DENABLE_AOT_PROFILER=1" Condition="$(WasmProfilers.Contains('aot'))" />
334-
<_EmccCFlags Include="-DENABLE_DEVTOOLS_PROFILER=1" Condition="$(WasmProfilers.Contains('browser'))" />
333+
<_EmccCFlags Include="-DENABLE_DEVTOOLS_PROFILER=1" Condition="$(WasmProfilers.Contains('browser'))" />
335334
<_EmccCFlags Include="-DENABLE_LOG_PROFILER=1" Condition="$(WasmProfilers.Contains('log'))" />
336335
<_EmccCFlags Include="-DENABLE_JS_INTEROP_BY_VALUE=1" Condition="'$(WasmEnableJsInteropByValue)' == 'true'" />
337336

@@ -459,7 +458,6 @@
459458
</PropertyGroup>
460459

461460
<ItemGroup>
462-
<_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/>
463461
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(EnableDiagnostics)' != 'true'" />
464462
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-stub-static.lib" Condition="'$(EnableDiagnostics)' == 'true'" />
465463
</ItemGroup>
@@ -484,6 +482,8 @@
484482
<_WasmNativeFileForLinking Condition="'$(_WasmSIMDLib)' != ''" Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)$(_WasmSIMDLib)" />
485483
<_WasmNativeFileForLinking Remove="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)$(_WasmEHLibToExclude)" />
486484
<_WasmNativeFileForLinking Remove="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)$(_WasmSIMDLibToExclude)" />
485+
<_WasmNativeFileForLinking Condition="'$(InvariantTimezone)' == 'true'" Remove="libSystem.Native.TimeZoneData.a" />
486+
<_WasmNativeFileForLinking Condition="'$(InvariantTimezone)' != 'true'" Remove="libSystem.Native.TimeZoneData.Disabled.a" />
487487

488488
<_WasmExtraJSFile Include="@(Content)" Condition="'%(Content.Extension)' == '.js'" />
489489

src/mono/browser/runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ target_link_libraries(dotnet.native
2626
${MONO_ARTIFACTS_DIR}/libmono-icall-table.a
2727
${MONO_ARTIFACTS_DIR}/libmono-wasm-eh-js.a
2828
${MONO_ARTIFACTS_DIR}/libmono-wasm-${CONFIGURATION_INTERPSIMDTABLES_LIB}.a
29-
${NATIVE_BIN_DIR}/wasm-bundled-timezones.a
3029
${NATIVE_BIN_DIR}/libSystem.Native.a
30+
${NATIVE_BIN_DIR}/libSystem.Native.TimeZoneData.a
3131
${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a
3232
${NATIVE_BIN_DIR}/libSystem.IO.Compression.Native.a
3333
${NATIVE_BIN_DIR}/libz.a)

src/mono/browser/runtime/driver.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ int monoeg_g_setenv(const char *variable, const char *value, int overwrite);
4444
char *mono_method_get_full_name (MonoMethod *method);
4545
char *mono_method_full_name (MonoMethod *method, int32_t signature);
4646

47-
#ifndef INVARIANT_TIMEZONE
48-
extern void mono_register_timezones_bundle (void);
49-
#endif /* INVARIANT_TIMEZONE */
5047
extern void mono_wasm_set_entrypoint_breakpoint (const char* assembly_name, int method_token);
5148

5249
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);
@@ -193,12 +190,6 @@ mono_wasm_load_runtime (int debug_level, int propertyCount, const char **propert
193190

194191
monovm_initialize (propertyCount, propertyKeys, propertyValues);
195192

196-
#ifndef INVARIANT_TIMEZONE
197-
char* invariant_timezone = monoeg_g_getenv ("DOTNET_SYSTEM_TIMEZONE_INVARIANT");
198-
if (strcmp(invariant_timezone, "true") != 0 && strcmp(invariant_timezone, "1") != 0)
199-
mono_register_timezones_bundle ();
200-
#endif /* INVARIANT_TIMEZONE */
201-
202193
root_domain = mono_wasm_load_runtime_common (debug_level, wasm_trace_logger, interp_opts);
203194

204195
bindings_initialize_internals();

src/mono/wasi/build/WasiApp.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@
248248
<_WasmCommonCFlags Condition="'$(_DriverGenCNeeded)' == 'true'" Include="-DDRIVER_GEN=1" />
249249
<_WasmCommonCFlags Condition="'$(WasmSingleFileBundle)' == 'true'" Include="-DWASM_SINGLE_FILE=1" />
250250
<_WasmCommonCFlags Condition="'$(InvariantGlobalization)' == 'true'" Include="-DINVARIANT_GLOBALIZATION=1" />
251-
<_WasmCommonCFlags Condition="'$(InvariantTimezone)' == 'true'" Include="-DINVARIANT_TIMEZONE=1" />
252251
<_WasmCommonCFlags Condition="'$(WasmLinkIcalls)' == 'true'" Include="-DLINK_ICALLS=1" />
253252
<_WasmCommonCFlags Condition="'$(_IsLibraryMode)' == 'true'" Include="-DWASM_LIBRARY_MODE=1" />
254253
<_WasiClangCFlags Include="@(_WasmCommonCFlags)" />
@@ -360,7 +359,6 @@
360359
</PropertyGroup>
361360

362361
<ItemGroup>
363-
<_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/>
364362
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(EnableDiagnostics)' != 'true'" />
365363
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-stub-static.lib" Condition="'$(EnableDiagnostics)' == 'true'" />
366364
</ItemGroup>
@@ -387,6 +385,8 @@
387385
<_WasmNativeFileForLinking Condition="'$(_WasmSIMDLib)' != ''" Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)$(_WasmSIMDLib)" />
388386
<_WasmNativeFileForLinking Remove="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)$(_WasmEHLibToExclude)" />
389387
<_WasmNativeFileForLinking Remove="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)$(_WasmSIMDLibToExclude)" />
388+
<_WasmNativeFileForLinking Condition="'$(InvariantTimezone)' == 'true'" Remove="libSystem.Native.TimeZoneData.a" />
389+
<_WasmNativeFileForLinking Condition="'$(InvariantTimezone)' != 'true'" Remove="libSystem.Native.TimeZoneData.Disabled.a" />
390390

391391
<_WasmNativeFileForLinking Include="$(WasiSysRoot)\lib\wasm32-wasip2\libc++.a" />
392392
<_WasmNativeFileForLinking Include="$(WasiSysRoot)\lib\wasm32-wasip2\libc++abi.a" />

src/mono/wasi/runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ target_link_libraries(dotnet
2727
${MONO_ARTIFACTS_DIR}/libmonosgen-2.0.a
2828
${MONO_ARTIFACTS_DIR}/libmono-icall-table.a
2929
${MONO_ARTIFACTS_DIR}/libmono-wasm-${CONFIGURATION_INTERPSIMDTABLES_LIB}.a
30-
${NATIVE_BIN_DIR}/wasm-bundled-timezones.a
3130
${NATIVE_BIN_DIR}/libSystem.Native.a
31+
${NATIVE_BIN_DIR}/libSystem.Native.TimeZoneData.a
3232
${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a
3333
${NATIVE_BIN_DIR}/libSystem.IO.Compression.Native.a
3434
${NATIVE_BIN_DIR}/libz.a

src/mono/wasi/runtime/driver.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ int monoeg_g_setenv(const char *variable, const char *value, int overwrite);
4141
int32_t monoeg_g_hasenv(const char *variable);
4242
void mono_free (void*);
4343
char *mono_method_get_full_name (MonoMethod *method);
44-
#ifndef INVARIANT_TIMEZONE
45-
extern void mono_register_timezones_bundle (void);
46-
#endif /* INVARIANT_TIMEZONE */
4744
#ifdef WASM_SINGLE_FILE
4845
extern void mono_register_assemblies_bundle (void);
4946
extern void mono_register_runtimeconfig_bin (void);
@@ -265,11 +262,6 @@ mono_wasm_load_runtime (int debug_level)
265262
load_runtimeconfig();
266263
monovm_initialize (2, appctx_keys, appctx_values);
267264

268-
#ifndef INVARIANT_TIMEZONE
269-
char* invariant_timezone = monoeg_g_getenv ("DOTNET_SYSTEM_TIMEZONE_INVARIANT");
270-
if (strcmp(invariant_timezone, "true") != 0 && strcmp(invariant_timezone, "1") != 0)
271-
mono_register_timezones_bundle ();
272-
#endif /* INVARIANT_TIMEZONE */
273265
#ifdef WASM_SINGLE_FILE
274266
mono_register_assemblies_bundle ();
275267
#endif

src/mono/wasi/wasi.proj

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -71,54 +71,6 @@
7171
</ManagedToNativeGenerator>
7272
</Target>
7373

74-
<UsingTask TaskName="EmitBundleObjectFiles" AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />
75-
<Target Name="GenerateTimezonesArchive" Returns="@(_WasmArchivedTimezones)" Condition="'$(InvariantTimezone)' != 'true'">
76-
<PropertyGroup>
77-
<_WasmTimezonesPath>$([MSBuild]::NormalizePath('$(PkgSystem_Runtime_TimeZoneData)', 'contentFiles', 'any', 'any', 'data'))</_WasmTimezonesPath>
78-
<_WasmTimezonesBundleObjectFile>wasm-bundled-timezones.o</_WasmTimezonesBundleObjectFile>
79-
<_WasmTimezonesBundleArchive>$(WasiObjDir)\wasm-bundled-timezones.a</_WasmTimezonesBundleArchive>
80-
<_WasmTimezonesArchiveRsp>$(WasiObjDir)\wasm-bundled-timezones-archive.rsp</_WasmTimezonesArchiveRsp>
81-
</PropertyGroup>
82-
<ItemGroup>
83-
<_WasmTimezonesInternal Include="$(_WasmTimezonesPath)\**\*.*" WasmRole="Timezone"/>
84-
</ItemGroup>
85-
<ItemGroup>
86-
<_WasmTimezonesInternal Update="@(_WasmTimezonesInternal)">
87-
<RegisteredName>/usr/share/zoneinfo/$([MSBuild]::MakeRelative($(_WasmTimezonesPath), %(_WasmTimezonesInternal.Identity)).Replace('\','/'))</RegisteredName>
88-
</_WasmTimezonesInternal>
89-
</ItemGroup>
90-
<!-- TODO make this incremental compilation -->
91-
<EmitBundleObjectFiles
92-
FilesToBundle="@(_WasmTimezonesInternal)"
93-
ClangExecutable="$(WasiClang)"
94-
BundleRegistrationFunctionName="mono_register_timezones_bundle"
95-
BundleFile="$(_WasmTimezonesBundleObjectFile)"
96-
OutputDirectory="$(WasiObjDir)">
97-
<Output TaskParameter="BundledResources" ItemName="BundledWasiTimezones" />
98-
</EmitBundleObjectFiles>
99-
<ItemGroup>
100-
<WasmBundleTimezonesObjects Include="$([MSBuild]::MakeRelative($(WasiObjDir), %(BundledWasiTimezones.DestinationFile)).Replace('\','/'))" />
101-
<WasmBundleTimezonesObjects Include="$(_WasmTimezonesBundleObjectFile)" />
102-
</ItemGroup>
103-
<WriteLinesToFile File="$(_WasmTimezonesArchiveRsp)"
104-
Overwrite="true"
105-
Lines="@(WasmBundleTimezonesObjects, ' ')"
106-
WriteOnlyWhenDifferent="true" />
107-
<Exec Command="$(WasiLLVMAr) cs -r $(_WasmTimezonesBundleArchive) @$(_WasmTimezonesArchiveRsp)" WorkingDirectory="$(WasiObjDir)" />
108-
109-
<ItemGroup>
110-
<_WasmArchivedTimezones Include="$(_WasmTimezonesBundleArchive)" />
111-
</ItemGroup>
112-
113-
<!-- Clean up the bundle-objects dir - remove anything we no longer need -->
114-
<ItemGroup>
115-
<_WasmBundleTimezonesToDelete Include="$(_WasmIntermediateOutputPath)*.o" />
116-
<_WasmBundleTimezonesToDelete Remove="$(WasiObjDir)\$(_WasmTimezonesBundleObjectFile)" />
117-
<_WasmBundleTimezonesToDelete Remove="%(BundledWasiTimezones.DestinationFile)" />
118-
</ItemGroup>
119-
<Delete Files="@(_WasmBundleTimezonesToDelete)" />
120-
</Target>
121-
12274
<Target Name="GenerateWasiPropsAndRspFiles">
12375

12476
<!-- Generate wasm-props.json -->
@@ -198,7 +150,7 @@
198150
<!-- This is a documented target that is invoked by developers in their innerloop work. -->
199151
<Target Name="BuildWasiRuntimes"
200152
AfterTargets="Build"
201-
DependsOnTargets="GenerateWasiPropsAndRspFiles;GenerateManagedToNative;GenerateTimezonesArchive">
153+
DependsOnTargets="GenerateWasiPropsAndRspFiles;GenerateManagedToNative">
202154

203155
<ItemGroup>
204156
<ICULibNativeFiles Include="$(ICULibDir)/libicuuc.a;
@@ -277,7 +229,6 @@
277229

278230
<Copy SourceFiles="@(ICULibFiles);
279231
@(ICULibNativeFiles);
280-
@(_WasmArchivedTimezones);
281232
@(WASIComponentImports);"
282233
DestinationFolder="$(NativeBinDir)"
283234
SkipUnchangedFiles="true" />
@@ -296,7 +247,7 @@
296247
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
297248
SkipUnchangedFiles="true" />
298249

299-
<Copy SourceFiles="@(IcuDataFiles);@(ICULibNativeFiles);@(_WasmArchivedTimezones);@(WASIComponentImports);"
250+
<Copy SourceFiles="@(IcuDataFiles);@(ICULibNativeFiles);@(WASIComponentImports);"
300251
DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)"
301252
SkipUnchangedFiles="true" />
302253

src/native/libs/System.Native/pal_datetime.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,11 @@ char* SystemNative_GetDefaultTimeZone(void)
6464
return NULL;
6565
}
6666
#endif
67+
68+
#if !defined(TARGET_WASM)
69+
const char* SystemNative_GetTimeZoneData(const char* name, int* length)
70+
{
71+
*length = 0;
72+
return NULL;
73+
}
74+
#endif

0 commit comments

Comments
 (0)