diff --git a/NuGet.config b/NuGet.config index 8d2d351914d014..d89fa51e4679ea 100644 --- a/NuGet.config +++ b/NuGet.config @@ -22,6 +22,7 @@ + diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 1dc3a25ec99aaa..d4768aa15dc4a4 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -51,35 +51,35 @@ This file should be imported by eng/Versions.props 11.0.0-alpha.1.26281.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 - 19.1.0-alpha.1.26256.1 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 + 23.1.0-alpha.1.26314.2 11.0.0-alpha.1.26303.1 11.0.0-alpha.1.26303.1 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 475e4c6c804222..09f0e48312555c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -5,37 +5,37 @@ https://github.com/dotnet/icu d94093d6935a845e9a508e023ae1a94102a801b6 - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c https://github.com/dotnet/dotnet @@ -175,89 +175,89 @@ https://github.com/dotnet/runtime-assets 741cd9b2bf5a322b38c37367bc26c4e97ab16abe - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c - + https://github.com/dotnet/llvm-project - 64a0a6a5130929ccaa47b52ad28997b7922920cc + 921a6f0c606b4504c5d221aede62d4e35339ec1c https://github.com/dotnet/dotnet diff --git a/eng/Versions.props b/eng/Versions.props index 4625dbb9864ccb..3596f889d8ecd7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -27,7 +27,12 @@ <_GlobalJsonContent>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)../global.json')) <_GlobalJsonSdkVersion Condition="'$(_GlobalJsonContent)' != ''">$([System.Text.RegularExpressions.Regex]::Match($(_GlobalJsonContent), '"sdk"\s*:\s*\{[^\}]*"version"\s*:\s*"([^"]+)"', System.Text.RegularExpressions.RegexOptions.Singleline).Groups[1].Value) - <_DotnetSdkVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest110100TransportVersion) + + <_DotnetSdkVersion>11.0.100-preview.6.26314.102 $(_DotnetSdkVersion) $(_GlobalJsonSdkVersion) $([System.String]::Copy('$(SdkVersionForWorkloadTesting)').Split('.')[0]) @@ -166,13 +171,21 @@ 2.5.7 - - $(MicrosoftDotNetApiCompatTaskPackageVersion) + + 11.0.100-preview.6.26314.102 - $(MicrosoftNETCoreAppRefPackageVersion) + + 11.0.0-preview.6.26314.102 $(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion) - 3.1.56 + 5.0.6 1.1.87-gba258badda 1.0.0-v3.14.0.5722 diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 308e6fc7e2b760..6dd6ce0407489d 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -274,11 +274,6 @@ $(LibrariesNativeArtifactsPath)dotnet.diagnostics.js.map; $(LibrariesNativeArtifactsPath)dotnet.native.js.symbols;" IsNative="true" /> - - <_HasDotnetWasm Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.wasm'">true - <_HasDotnetJsWorker Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.worker.mjs'">true <_HasDotnetJsSymbols Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.js.symbols'">true <_HasDotnetNativeJs Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.js'">true <_WasmIcuDataFileName Condition="'$(WasmIcuDataFileName)' != '' and Exists('$(WasmIcuDataFileName)')">$(WasmIcuDataFileName) @@ -311,7 +310,6 @@ - - diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileStatus.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileStatus.Unix.cs index 4ffd7cd8cd811c..9a54a0cd620022 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileStatus.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileStatus.Unix.cs @@ -394,12 +394,6 @@ private unsafe void SetAccessOrWriteTimeCore(SafeFileHandle? handle, string? pat long seconds = time.ToUnixTimeSeconds(); long nanoseconds = UnixTimeSecondsToNanoseconds(time, seconds); -#if TARGET_BROWSER || TARGET_WASI - buf[0].TvSec = seconds; - buf[0].TvNsec = nanoseconds; - buf[1].TvSec = seconds; - buf[1].TvNsec = nanoseconds; -#else if (isAccessTime) { buf[0].TvSec = seconds; @@ -414,7 +408,6 @@ private unsafe void SetAccessOrWriteTimeCore(SafeFileHandle? handle, string? pat buf[1].TvSec = seconds; buf[1].TvNsec = nanoseconds; } -#endif int rv = handle is not null ? Interop.Sys.FUTimens(handle, buf) : Interop.Sys.UTimensat(path!, buf); diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Base/BaseGetSetTimes.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Base/BaseGetSetTimes.cs index d1205dc6ba7148..762e22ad646e99 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Base/BaseGetSetTimes.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/Base/BaseGetSetTimes.cs @@ -11,28 +11,18 @@ namespace System.IO.Tests { public abstract class BaseGetSetTimes : FileSystemTest { - protected const string HFS = "hfs"; public delegate void SetTime(T item, DateTime time); public delegate DateTime GetTime(T item); // AppContainer restricts access to DriveFormat (::GetVolumeInformation) private static string driveFormat = PlatformDetection.IsInAppContainer ? string.Empty : new DriveInfo(Path.GetTempPath()).DriveFormat; - protected static bool isHFS => driveFormat != null && driveFormat.Equals(HFS, StringComparison.InvariantCultureIgnoreCase); + private static bool isHFS => driveFormat != null && driveFormat.Equals("hfs", StringComparison.InvariantCultureIgnoreCase); - protected static bool LowTemporalResolution => PlatformDetection.IsBrowser || isHFS; - protected static bool HighTemporalResolution => !LowTemporalResolution; - - private static void CheckHighTemporalResolution() - { - if (!HighTemporalResolution) - throw new SkipTestException(nameof(HighTemporalResolution)); - } - - private static void CheckLowTemporalResolution() - { - if (!LowTemporalResolution) - throw new SkipTestException(nameof(LowTemporalResolution)); - } + protected static bool SecondTemporalResolution => true; + protected static bool MilliSecondTemporalResolution => SecondTemporalResolution && !isHFS; // HFS only supports temporal resolution of 1 second + protected static bool NanoSecondTemporalResolution => MilliSecondTemporalResolution && !PlatformDetection.IsBrowser; // Browser does not support nanosecond resolution + protected static bool NotMilliSecondTemporalResolution => !MilliSecondTemporalResolution; + protected static bool NotNanoSecondTemporalResolution => !NanoSecondTemporalResolution; protected abstract bool CanBeReadOnly { get; } @@ -83,8 +73,7 @@ private void SettingUpdatesPropertiesCore(T item, T? linkTarget = default) bool isLink = linkTarget is not null; // Checking that milliseconds are not dropped after setter. - // Emscripten drops milliseconds in Browser - DateTime dt = new DateTime(2014, 12, 1, 12, 3, 3, LowTemporalResolution ? 0 : 321, function.Kind); + DateTime dt = new DateTime(2014, 12, 1, 12, 3, 3, NotMilliSecondTemporalResolution ? 0 : 321, function.Kind); function.Setter(item, dt); T getTarget = !isLink || ApiTargetsLink ? item : linkTarget; @@ -181,7 +170,6 @@ public void SettingPropertiesOnSymlink(bool targetExists) } [Fact] - [PlatformSpecific(~TestPlatforms.Browser)] // Browser is excluded as there is only 1 effective time store. public void SettingUpdatesPropertiesAfterAnother() { T item = GetExistingItem(); @@ -219,9 +207,9 @@ public void SettingUpdatesPropertiesAfterAnother() bool reverse = functions.reverse; // Checking that milliseconds are not dropped after setter. - DateTime dt1 = new DateTime(2002, 12, 1, 12, 3, 3, LowTemporalResolution ? 0 : 321, DateTimeKind.Utc); - DateTime dt2 = new DateTime(2001, 12, 1, 12, 3, 3, LowTemporalResolution ? 0 : 321, DateTimeKind.Utc); - DateTime dt3 = new DateTime(2000, 12, 1, 12, 3, 3, LowTemporalResolution ? 0 : 321, DateTimeKind.Utc); + DateTime dt1 = new DateTime(2002, 12, 1, 12, 3, 3, NotMilliSecondTemporalResolution ? 0 : 321, DateTimeKind.Utc); + DateTime dt2 = new DateTime(2001, 12, 1, 12, 3, 3, NotMilliSecondTemporalResolution ? 0 : 321, DateTimeKind.Utc); + DateTime dt3 = new DateTime(2000, 12, 1, 12, 3, 3, NotMilliSecondTemporalResolution ? 0 : 321, DateTimeKind.Utc); if (reverse) //reverse the order of setting dates { (dt1, dt3) = (dt3, dt1); @@ -245,10 +233,12 @@ public void CanGetAllTimesAfterCreation() ValidateSetTimes(item, beforeTime, afterTime); } - [ConditionalFact] // OSX HFS driver format and Browser platform do not support millisec granularity + [ConditionalFact] public void TimesIncludeMillisecondPart() { - CheckHighTemporalResolution(); + if (!MilliSecondTemporalResolution) + throw new SkipTestException(nameof(MilliSecondTemporalResolution)); + T item = GetExistingItem(); Assert.All(TimeFunctions(), (function) => { @@ -279,11 +269,12 @@ public void TimesIncludeMillisecondPart() } [ConditionalFact] - public void TimesIncludeMillisecondPart_LowTempRes() + public void TimesNotIncludeMillisecondPart() { - CheckLowTemporalResolution(); + if (MilliSecondTemporalResolution) + throw new SkipTestException(nameof(MilliSecondTemporalResolution)); + T item = GetExistingItem(); - // OSX HFS driver format and Browser do not support millisec granularity Assert.All(TimeFunctions(), (function) => { DateTime time = function.Getter(item); diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/Copy.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/Copy.cs index a3a8c7526bd045..bfe2dd3040937b 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/Copy.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/Copy.cs @@ -142,15 +142,7 @@ public void CopyFileWithData(char[] data, bool readOnly) } // Ensure last write/access time on the new file is appropriate - // - // For browser, there is technically only 1 time. It's the max - // of LastWrite and LastAccess. On browser, File.SetLastWriteTime - // overwrites LastWrite and LastAccess, and File.Copy - // overwrites LastWrite , so this check doesn't apply. - if (PlatformDetection.IsNotBrowser) - { - Assert.InRange(File.GetLastWriteTimeUtc(testFileDest), lastWriteTime.AddSeconds(-1), lastWriteTime.AddSeconds(1)); - } + Assert.InRange(File.GetLastWriteTimeUtc(testFileDest), lastWriteTime.AddSeconds(-1), lastWriteTime.AddSeconds(1)); Assert.Equal(readOnly, (File.GetAttributes(testFileDest) & FileAttributes.ReadOnly) != 0); if (readOnly) diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/GetSetTimes.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/GetSetTimes.cs index 566d52cf35058d..1273a17d538626 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/GetSetTimes.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/GetSetTimes.cs @@ -138,7 +138,6 @@ public override IEnumerable TimeFunctions(bool requiresRoundtrippi } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/83197", TestPlatforms.Browser)] public void SetLastWriteTimeTicks() { string firstFile = GetTestFilePath(); @@ -153,7 +152,7 @@ public void SetLastWriteTimeTicks() Assert.True(firstFileTicks <= secondFileTicks, $"First File Ticks\t{firstFileTicks}\nSecond File Ticks\t{secondFileTicks}"); } - [ConditionalFact(typeof(File_GetSetTimes), nameof(HighTemporalResolution))] // OSX HFS driver format/Browser Platform do not support nanosecond granularity. + [ConditionalFact(typeof(File_GetSetTimes), nameof(NanoSecondTemporalResolution))] public void SetUptoNanoseconds() { string file = GetTestFilePath(); @@ -185,7 +184,6 @@ public void SetDateTimeMax() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/83197", TestPlatforms.Browser)] public void SetLastAccessTimeTicks() { string firstFile = GetTestFilePath(); diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileInfo/GetSetTimes.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileInfo/GetSetTimes.cs index 8f6000cf957787..2307287976e805 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileInfo/GetSetTimes.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileInfo/GetSetTimes.cs @@ -52,15 +52,12 @@ public FileInfo GetNonZeroNanoseconds() if (!HasNonZeroNanoseconds(fileinfo.LastWriteTime)) { - if (PlatformDetection.IsApplePlatform) - return null; - DateTime dt = fileinfo.LastWriteTime; dt = dt.AddTicks(1); fileinfo.LastWriteTime = dt; } - Assert.True(HasNonZeroNanoseconds(fileinfo.LastWriteTime)); + Assert.True(HasNonZeroNanoseconds(fileinfo.LastWriteTime), "Expected non-zero nanoseconds, got: " + fileinfo.LastWriteTime.Ticks); return fileinfo; } @@ -113,7 +110,7 @@ public override IEnumerable TimeFunctions(bool requiresRoundtrippi DateTimeKind.Utc); } - [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(HighTemporalResolution))] + [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(MilliSecondTemporalResolution))] public void CopyToMillisecondPresent() { FileInfo input = GetNonZeroMilliseconds(); @@ -127,24 +124,21 @@ public void CopyToMillisecondPresent() Assert.NotEqual(0, output.LastWriteTime.Millisecond); } - [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(HighTemporalResolution))] + [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(NanoSecondTemporalResolution))] public void CopyToNanosecondsPresent() { FileInfo input = GetNonZeroNanoseconds(); - if (input == null) - return; - FileInfo output = new FileInfo(Path.Combine(GetTestFilePath(), input.Name)); output.Directory.Create(); output = input.CopyTo(output.FullName, true); Assert.Equal(input.LastWriteTime.Ticks, output.LastWriteTime.Ticks); - Assert.True(HasNonZeroNanoseconds(output.LastWriteTime)); + Assert.True(HasNonZeroNanoseconds(output.LastWriteTime), "Expected non-zero nanoseconds, got: " + output.LastWriteTime.Ticks); } - [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(LowTemporalResolution))] - public void CopyToNanosecondsPresent_LowTempRes() + [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(NotNanoSecondTemporalResolution))] + public void CopyToNanosecondsNotPresent() { FileInfo input = new FileInfo(GetTestFilePath()); input.Create().Dispose(); @@ -153,17 +147,12 @@ public void CopyToNanosecondsPresent_LowTempRes() output.Directory.Create(); output = input.CopyTo(output.FullName, true); - // On Browser, we sometimes see a difference of exactly 10M, eg., - // Expected: 637949564520000000 - // Actual: 637949564530000000 - double tolerance = PlatformDetection.IsBrowser ? 10_000_000 : 0; - - Assert.Equal(input.LastWriteTime.Ticks, output.LastWriteTime.Ticks, tolerance); - Assert.False(HasNonZeroNanoseconds(output.LastWriteTime)); + Assert.Equal(input.LastWriteTime.Ticks, output.LastWriteTime.Ticks); + Assert.False(HasNonZeroNanoseconds(output.LastWriteTime), "Expected zero nanoseconds, got: " + output.LastWriteTime.Ticks); } - [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(LowTemporalResolution))] - public void MoveToMillisecondPresent_LowTempRes() + [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(NotMilliSecondTemporalResolution))] + public void MoveToMillisecondNotPresent() { FileInfo input = new FileInfo(GetTestFilePath()); input.Create().Dispose(); @@ -174,7 +163,7 @@ public void MoveToMillisecondPresent_LowTempRes() Assert.Equal(0, output.LastWriteTime.Millisecond); } - [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(HighTemporalResolution))] + [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(MilliSecondTemporalResolution))] public void MoveToMillisecondPresent() { FileInfo input = GetNonZeroMilliseconds(); @@ -185,8 +174,8 @@ public void MoveToMillisecondPresent() Assert.NotEqual(0, output.LastWriteTime.Millisecond); } - [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(LowTemporalResolution))] - public void CopyToMillisecondPresent_LowTempRes() + [ConditionalFact(typeof(FileInfo_GetSetTimes), nameof(NotMilliSecondTemporalResolution))] + public void CopyToMillisecondNotPresent() { FileInfo input = new FileInfo(GetTestFilePath()); input.Create().Dispose(); diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 89f3ea3bd4fd85..d2a2348e06f96a 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -637,21 +637,21 @@ if(LLVM_PREFIX) string(REGEX REPLACE ".*MONO_API_VERSION ([0-9]+)" "\\1" llvm_api_version ${llvm_api_version_line}) # IMPORTANT: when bumping LLVM make sure to rerun the llvm-config commands below and update the variables accordingly - if (NOT ${llvm_api_version} EQUAL 1900) + if (NOT ${llvm_api_version} EQUAL 2300) message(FATAL_ERROR "Unexpected LLVM version: ${llvm_api_version}.") endif() # llvm-config --libs analysis core bitwriter mcjit orcjit - set(MONO_llvm_core_libs "LLVMOrcJIT" "LLVMPasses" "LLVMIRPrinter" "LLVMHipStdPar" "LLVMCoroutines" "LLVMipo" "LLVMInstrumentation" "LLVMVectorize" "LLVMLinker" "LLVMFrontendOpenMP" "LLVMFrontendOffloading" "LLVMCodeGen" "LLVMScalarOpts" "LLVMInstCombine" "LLVMObjCARCOpts" "LLVMCodeGenTypes" "LLVMCFGuard" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMWindowsDriver" "LLVMJITLink" "LLVMOption" "LLVMMCJIT" "LLVMExecutionEngine" "LLVMTarget" "LLVMRuntimeDyld" "LLVMOrcTargetProcess" "LLVMOrcShared" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMSymbolize" "LLVMDebugInfoBTF" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoDWARF" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMIRReader" "LLVMAsmParser" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMBinaryFormat" "LLVMTargetParser" "LLVMSupport" "LLVMDemangle") + set(MONO_llvm_core_libs "LLVMOrcJIT" "LLVMPasses" "LLVMIRPrinter" "LLVMHipStdPar" "LLVMCoroutines" "LLVMipo" "LLVMInstrumentation" "LLVMVectorize" "LLVMSandboxIR" "LLVMLinker" "LLVMFrontendOpenMP" "LLVMFrontendDirective" "LLVMFrontendAtomic" "LLVMFrontendOffloading" "LLVMObjectYAML" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMCodeGen" "LLVMScalarOpts" "LLVMInstCombine" "LLVMObjCARCOpts" "LLVMCodeGenTypes" "LLVMCGData" "LLVMCFGuard" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMWindowsDriver" "LLVMJITLink" "LLVMOption" "LLVMMCJIT" "LLVMExecutionEngine" "LLVMTarget" "LLVMRuntimeDyld" "LLVMOrcTargetProcess" "LLVMOrcShared" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMSymbolize" "LLVMDebugInfoBTF" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoCodeView" "LLVMDebugInfoGSYM" "LLVMDebugInfoDWARF" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMIRReader" "LLVMAsmParser" "LLVMMC" "LLVMDebugInfoDWARFLowLevel" "LLVMBitReader" "LLVMFrontendHLSL" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMBinaryFormat" "LLVMTargetParser" "LLVMSupport" "LLVMDemangle") # llvm-config --libs x86codegen - set(MONO_llvm_extra_libs_x86codegen "LLVMX86CodeGen" "LLVMX86Desc" "LLVMX86Info" "LLVMMCDisassembler" "LLVMInstrumentation" "LLVMIRPrinter" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMCFGuard" "LLVMAsmPrinter" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMObjCARCOpts" "LLVMTransformUtils" "LLVMCodeGenTypes" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMSymbolize" "LLVMDebugInfoBTF" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoDWARF" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMIRReader" "LLVMAsmParser" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMBinaryFormat" "LLVMTargetParser" "LLVMSupport" "LLVMDemangle") + set(MONO_llvm_extra_libs_x86codegen "LLVMX86CodeGen" "LLVMX86Desc" "LLVMX86Info" "LLVMMCDisassembler" "LLVMInstrumentation" "LLVMIRPrinter" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMCFGuard" "LLVMAsmPrinter" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMObjCARCOpts" "LLVMTransformUtils" "LLVMCodeGenTypes" "LLVMCGData" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMSymbolize" "LLVMDebugInfoBTF" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoCodeView" "LLVMDebugInfoGSYM" "LLVMDebugInfoDWARF" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMIRReader" "LLVMAsmParser" "LLVMMC" "LLVMDebugInfoDWARFLowLevel" "LLVMBitReader" "LLVMFrontendHLSL" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMBinaryFormat" "LLVMTargetParser" "LLVMSupport" "LLVMDemangle") # llvm-config --libs armcodegen - set(MONO_llvm_extra_libs_armcodegen "LLVMARMCodeGen" "LLVMipo" "LLVMInstrumentation" "LLVMVectorize" "LLVMLinker" "LLVMFrontendOpenMP" "LLVMFrontendOffloading" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMCFGuard" "LLVMAsmPrinter" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMObjCARCOpts" "LLVMTransformUtils" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMSymbolize" "LLVMDebugInfoBTF" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoDWARF" "LLVMARMDesc" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMIRReader" "LLVMAsmParser" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMMCDisassembler" "LLVMCodeGenTypes" "LLVMARMUtils" "LLVMARMInfo" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMBinaryFormat" "LLVMTargetParser" "LLVMSupport" "LLVMDemangle") + set(MONO_llvm_extra_libs_armcodegen "LLVMARMCodeGen" "LLVMipo" "LLVMInstrumentation" "LLVMVectorize" "LLVMSandboxIR" "LLVMLinker" "LLVMFrontendOpenMP" "LLVMFrontendDirective" "LLVMFrontendAtomic" "LLVMFrontendOffloading" "LLVMObjectYAML" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMCFGuard" "LLVMAsmPrinter" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMObjCARCOpts" "LLVMTransformUtils" "LLVMCGData" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMSymbolize" "LLVMDebugInfoBTF" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoCodeView" "LLVMDebugInfoGSYM" "LLVMDebugInfoDWARF" "LLVMFrontendHLSL" "LLVMARMDesc" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMIRReader" "LLVMAsmParser" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMMCDisassembler" "LLVMCodeGenTypes" "LLVMARMUtils" "LLVMARMInfo" "LLVMMC" "LLVMDebugInfoDWARFLowLevel" "LLVMBinaryFormat" "LLVMTargetParser" "LLVMSupport" "LLVMDemangle") # llvm-config --libs aarch64codegen - set(MONO_llvm_extra_libs_aarch64codegen "LLVMAArch64CodeGen" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMCFGuard" "LLVMAsmPrinter" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMObjCARCOpts" "LLVMTransformUtils" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMSymbolize" "LLVMDebugInfoBTF" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoDWARF" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMIRReader" "LLVMAsmParser" "LLVMBitReader" "LLVMAArch64Desc" "LLVMCodeGenTypes" "LLVMAArch64Utils" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMAArch64Info" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMBinaryFormat" "LLVMTargetParser" "LLVMSupport" "LLVMDemangle") + set(MONO_llvm_extra_libs_aarch64codegen "LLVMAArch64CodeGen" "LLVMPasses" "LLVMIRPrinter" "LLVMHipStdPar" "LLVMCoroutines" "LLVMipo" "LLVMInstrumentation" "LLVMVectorize" "LLVMSandboxIR" "LLVMLinker" "LLVMFrontendOpenMP" "LLVMFrontendDirective" "LLVMFrontendAtomic" "LLVMFrontendOffloading" "LLVMObjectYAML" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMCFGuard" "LLVMAsmPrinter" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMObjCARCOpts" "LLVMTransformUtils" "LLVMCGData" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMSymbolize" "LLVMDebugInfoBTF" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoCodeView" "LLVMDebugInfoGSYM" "LLVMDebugInfoDWARF" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMIRReader" "LLVMAsmParser" "LLVMBitReader" "LLVMFrontendHLSL" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMAArch64Desc" "LLVMCodeGenTypes" "LLVMAArch64Utils" "LLVMAArch64Info" "LLVMMC" "LLVMDebugInfoDWARFLowLevel" "LLVMBinaryFormat" "LLVMTargetParser" "LLVMSupport" "LLVMDemangle") if(HOST_LINUX AND NOT HOST_WASM AND NOT HOST_WASI) set(MONO_stdlib "-nostdinc++ -nostdlib++") diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 93a3f0bd930ccf..34270be1895f80 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -322,6 +322,8 @@ -g -Os -DDEBUG=1 -Oz + $(CMakeConfigurationEmccFlags) -fwasm-exceptions -sWASM_LEGACY_EXCEPTIONS=1 + $(CMakeConfigurationEmccFlags) -fexceptions $(CMakeConfigurationEmccFlags) -s ASSERTIONS=1 -O2 @@ -331,6 +333,8 @@ $(CMakeConfigurationLinkFlags) -msimd128 $(CMakeConfigurationLinkFlags) -Wno-pthreads-mem-growth $(CMakeConfigurationLinkFlags) --emit-symbol-map + $(CMakeConfigurationLinkFlags) -fwasm-exceptions -sWASM_LEGACY_EXCEPTIONS=1 + $(CMakeConfigurationLinkFlags) -fexceptions -DEMSDK_PATH="$(EMSDK_PATH.TrimEnd('\/').Replace('\','/'))" @@ -345,6 +349,9 @@ $(CMakeBuildRuntimeConfigureCmd) -DNATIVE_BIN_DIR="$(NativeBinDir.TrimEnd('\/').Replace('\','/'))" $(CMakeBuildRuntimeConfigureCmd) -DCONFIGURATION_COMPILE_OPTIONS="-msimd128" -DCONFIGURATION_INTERPSIMDTABLES_LIB="simd" $(CMakeBuildRuntimeConfigureCmd) -DCONFIGURATION_INTERPSIMDTABLES_LIB="nosimd" + + $(CMakeBuildRuntimeConfigureCmd) -DCONFIGURATION_EH_LIB="eh-wasm" + $(CMakeBuildRuntimeConfigureCmd) -DCONFIGURATION_EH_LIB="eh-js" $(CMakeBuildRuntimeConfigureCmd) -DDISABLE_THREADS=0 $(CMakeBuildRuntimeConfigureCmd) -DENABLE_JS_INTEROP_BY_VALUE=1 $(CMakeBuildRuntimeConfigureCmd) $(CMakeConfigurationEmsdkPath) @@ -437,11 +444,6 @@ DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)" SkipUnchangedFiles="true" /> - - diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 32541ff00fd668..3937ca4624c841 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -37,8 +37,8 @@ emcc <_WasmDefaultFlags Condition="'$(WasmEnableExceptionHandling)' == 'false'">-fexceptions - <_WasmDefaultFlags Condition="'$(WasmEnableExceptionHandling)' != 'false'">-fwasm-exceptions - <_WasmDefaultFlags Condition="'$(WasmEnableSIMD)' == 'true'">-msimd128 + <_WasmDefaultFlags Condition="'$(WasmEnableExceptionHandling)' != 'false'">-fwasm-exceptions -s WASM_LEGACY_EXCEPTIONS=1 + <_WasmDefaultFlags Condition="'$(WasmEnableSIMD)' == 'true'">$(_WasmDefaultFlags) -msimd128 <_WasmOutputFileName Condition="'$(WasmSingleFileBundle)' != 'true'">dotnet.native.wasm @@ -178,8 +178,10 @@ <_EmccCommonFlags Include="$(EmccFlags)" /> <_EmccCommonFlags Include="-v" Condition="'$(EmccVerbose)' != 'false'" /> <_EmccCommonFlags Include="-g" Condition="'$(WasmNativeDebugSymbols)' == 'true'" /> + <_EmccCommonFlags Include="-fexceptions" Condition="'$(WasmEnableExceptionHandling)' == 'false'" /> <_EmccCommonFlags Include="-s DISABLE_EXCEPTION_CATCHING=0" Condition="'$(WasmEnableExceptionHandling)' == 'false'" /> <_EmccCommonFlags Include="-fwasm-exceptions" Condition="'$(WasmEnableExceptionHandling)' == 'true'" /> + <_EmccCommonFlags Include="-s WASM_LEGACY_EXCEPTIONS=1" Condition="'$(WasmEnableExceptionHandling)' == 'true'" /> <_EmccCommonFlags Include="-s MAXIMUM_MEMORY=$(EmccMaximumHeapSize)" Condition="'$(EmccMaximumHeapSize)' != ''" /> <_EmccIncludePaths Include="$(_WasmIntermediateOutputPath.TrimEnd('\/'))" /> @@ -450,7 +452,6 @@ - <_WasmAssembliesInternal Remove="$(_WasmDedupAssembly)"/> diff --git a/src/mono/browser/emscripten-version.txt b/src/mono/browser/emscripten-version.txt index 4a8bd23c1443d4..4d5e5283b97fb2 100644 --- a/src/mono/browser/emscripten-version.txt +++ b/src/mono/browser/emscripten-version.txt @@ -1 +1 @@ -3.1.56 \ No newline at end of file +5.0.6 \ No newline at end of file diff --git a/src/mono/browser/runtime/CMakeLists.txt b/src/mono/browser/runtime/CMakeLists.txt index 788707244c11bd..25338f761a6006 100644 --- a/src/mono/browser/runtime/CMakeLists.txt +++ b/src/mono/browser/runtime/CMakeLists.txt @@ -22,7 +22,7 @@ target_link_libraries(dotnet.native ${MONO_ARTIFACTS_DIR}/libmono-ee-interp.a ${MONO_ARTIFACTS_DIR}/libmonosgen-2.0.a ${MONO_ARTIFACTS_DIR}/libmono-icall-table.a - ${MONO_ARTIFACTS_DIR}/libmono-wasm-eh-js.a + ${MONO_ARTIFACTS_DIR}/libmono-wasm-${CONFIGURATION_EH_LIB}.a ${MONO_ARTIFACTS_DIR}/libmono-wasm-${CONFIGURATION_INTERPSIMDTABLES_LIB}.a ${NATIVE_BIN_DIR}/libSystem.Native.a ${NATIVE_BIN_DIR}/libSystem.Native.TimeZoneData.a @@ -44,7 +44,7 @@ set(ignoreMeEmsdkPath "${EMSDK_PATH}") if(CMAKE_BUILD_TYPE STREQUAL "Release") add_custom_command(TARGET dotnet.native - POST_BUILD COMMAND ${EMSDK_PATH}/bin/wasm-opt --enable-exception-handling --enable-simd --enable-bulk-memory --enable-nontrapping-float-to-int ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm + POST_BUILD COMMAND ${EMSDK_PATH}/bin/wasm-opt --enable-exception-handling --enable-multivalue --enable-simd --enable-bulk-memory --enable-nontrapping-float-to-int ${CONFIGURATION_WASM_OPT_FLAGS} --strip-dwarf ${NATIVE_BIN_DIR}/dotnet.native.wasm -o ${NATIVE_BIN_DIR}/dotnet.native.wasm COMMENT "Stripping debug symbols from dotnet.native.wasm using wasm-opt") endif() diff --git a/src/mono/browser/runtime/assets.ts b/src/mono/browser/runtime/assets.ts index a899e1eb690565..e1d94fda04dc2d 100644 --- a/src/mono/browser/runtime/assets.ts +++ b/src/mono/browser/runtime/assets.ts @@ -24,7 +24,6 @@ export function instantiate_asset (asset: AssetEntry, url: string, bytes: Uint8A switch (asset.behavior) { case "dotnetwasm": - case "js-module-threads": case "js-module-diagnostics": case "symbols": // do nothing diff --git a/src/mono/browser/runtime/dotnet.d.ts b/src/mono/browser/runtime/dotnet.d.ts index 20057f71828688..2b99018f6f2897 100644 --- a/src/mono/browser/runtime/dotnet.d.ts +++ b/src/mono/browser/runtime/dotnet.d.ts @@ -261,7 +261,6 @@ interface Assets { lazyAssembly?: AssemblyAsset[]; corePdb?: PdbAsset[]; pdb?: PdbAsset[]; - jsModuleWorker?: JsAsset[]; jsModuleDiagnostics?: JsAsset[]; jsModuleNative: JsAsset[]; jsModuleRuntime: JsAsset[]; @@ -422,10 +421,6 @@ type SingleAssetBehaviors = * The javascript module for loader. */ | "js-module-dotnet" -/** - * The javascript module for threads. - */ - | "js-module-threads" /** * The javascript module for diagnostic server and client. */ diff --git a/src/mono/browser/runtime/loader/assets.ts b/src/mono/browser/runtime/loader/assets.ts index b23d66a3eac962..b2fc92a80891c4 100644 --- a/src/mono/browser/runtime/loader/assets.ts +++ b/src/mono/browser/runtime/loader/assets.ts @@ -27,7 +27,6 @@ const worker_empty_prefix = " - "; const jsRuntimeModulesAssetTypes: { [k: string]: boolean } = { - "js-module-threads": true, "js-module-runtime": true, "js-module-dotnet": true, "js-module-native": true, @@ -294,16 +293,12 @@ export function prepareAssets () { mono_assert(resources.wasmNative, "resources.wasmNative must be defined"); mono_assert(resources.jsModuleNative, "resources.jsModuleNative must be defined"); mono_assert(resources.jsModuleRuntime, "resources.jsModuleRuntime must be defined"); - mono_assert(!WasmEnableThreads || resources.jsModuleWorker, "resources.jsModuleWorker must be defined"); convert_single_asset(assetsToLoad, resources.wasmNative, "dotnetwasm"); convert_single_asset(modulesAssets, resources.jsModuleNative, "js-module-native"); convert_single_asset(modulesAssets, resources.jsModuleRuntime, "js-module-runtime"); if (resources.jsModuleDiagnostics) { convert_single_asset(modulesAssets, resources.jsModuleDiagnostics, "js-module-diagnostics"); } - if (WasmEnableThreads) { - convert_single_asset(modulesAssets, resources.jsModuleWorker, "js-module-threads"); - } const addAsset = (asset: Asset, behavior: AssetBehaviors, isCore: boolean) => { const assetEntry = asset as AssetEntryInternal; @@ -704,8 +699,7 @@ const monoToBlazorAssetTypeMap: { [key: string]: WebAssemblyBootResourceType | u "dotnetwasm": "dotnetwasm", "js-module-dotnet": "dotnetjs", "js-module-native": "dotnetjs", - "js-module-runtime": "dotnetjs", - "js-module-threads": "dotnetjs" + "js-module-runtime": "dotnetjs" }; function invokeLoadBootResource (asset: AssetEntryInternal): string | Promise | Promise | null | undefined { @@ -777,11 +771,10 @@ export async function streamingCompileWasm () { export function preloadWorkers () { if (!WasmEnableThreads) return; - const jsModuleWorker = resolve_single_asset_path("js-module-threads"); const loadingWorkers = []; for (let i = 0; i < loaderHelpers.config.pthreadPoolInitialSize!; i++) { const workerNumber = loaderHelpers.workerNextNumber++; - const worker: Partial = new Worker(jsModuleWorker.resolvedUrl!, { + const worker: Partial = new Worker(loaderHelpers.scriptUrl, { name: "dotnet-worker-" + workerNumber.toString().padStart(3, "0"), type: "module", }); diff --git a/src/mono/browser/runtime/loader/config.ts b/src/mono/browser/runtime/loader/config.ts index e0618be5918a46..13a58da1a58132 100644 --- a/src/mono/browser/runtime/loader/config.ts +++ b/src/mono/browser/runtime/loader/config.ts @@ -70,9 +70,6 @@ function deep_merge_resources (target: Assets, source: Assets): Assets { if (providedResources.pdb !== undefined) { providedResources.pdb = [...(target.pdb || []), ...(providedResources.pdb || [])]; } - if (providedResources.jsModuleWorker !== undefined) { - providedResources.jsModuleWorker = [...(target.jsModuleWorker || []), ...(providedResources.jsModuleWorker || [])]; - } if (providedResources.jsModuleNative !== undefined) { providedResources.jsModuleNative = [...(target.jsModuleNative || []), ...(providedResources.jsModuleNative || [])]; } @@ -129,7 +126,6 @@ export function normalizeConfig () { config.resources = config.resources || { assembly: [], jsModuleNative: [], - jsModuleWorker: [], jsModuleRuntime: [], wasmNative: [], vfs: [], @@ -163,9 +159,6 @@ export function normalizeConfig () { case "dotnetwasm": toMerge.wasmNative = [asset as WasmAsset]; break; - case "js-module-threads": - toMerge.jsModuleWorker = [asset as JsAsset]; - break; case "js-module-runtime": toMerge.jsModuleRuntime = [asset as JsAsset]; break; diff --git a/src/mono/browser/runtime/loader/globals.ts b/src/mono/browser/runtime/loader/globals.ts index 98f6dfd30bf24c..503e926834cae6 100644 --- a/src/mono/browser/runtime/loader/globals.ts +++ b/src/mono/browser/runtime/loader/globals.ts @@ -19,8 +19,8 @@ import { mono_log_error, set_thread_prefix, setup_proxy_console } from "./loggin import { invokeLibraryInitializers } from "./libraryInitializers"; import { deep_merge_config, isDebuggingSupported } from "./config"; -// if we are ST build or the first script loaded in the web worker, we are expected to become the sidecar -if (typeof importScripts === "function" && (!WasmEnableThreads || !globalThis.onmessage)) { +// If we are a single-threaded build running in a web worker, we are expected to become the sidecar +if (typeof importScripts === "function" && (!WasmEnableThreads)) { (globalThis as any).dotnetSidecar = true; } diff --git a/src/mono/browser/runtime/loader/run.ts b/src/mono/browser/runtime/loader/run.ts index b11bfddd8716e6..633f1f15ad298e 100644 --- a/src/mono/browser/runtime/loader/run.ts +++ b/src/mono/browser/runtime/loader/run.ts @@ -324,9 +324,7 @@ export async function createEmscripten (moduleFactory: DotnetModuleConfig | ((ap registerEmscriptenExitHandlers(); - return emscriptenModule.ENVIRONMENT_IS_PTHREAD - ? createEmscriptenWorker() - : createEmscriptenMain(); + return createEmscriptenMain(); } let jsModuleRuntimePromise: Promise; @@ -453,9 +451,33 @@ async function createEmscriptenWorker (): Promise { prepareAssetsWorker(); const promises = importModules(); const es6Modules = await Promise.all(promises); + (globalThis as any).name = "em-pthread"; await initializeModules(es6Modules as any); + if (loaderHelpers.config.exitOnUnhandledError) { + installUnhandledErrorHandler(); + } + registerEmscriptenExitHandlers(); + if (ENVIRONMENT_IS_WEB && loaderHelpers.config.forwardConsole && typeof globalThis.WebSocket != "undefined") { + setup_proxy_console("main", globalThis.console, globalThis.location.origin); + } + + await detect_features_and_polyfill(emscriptenModule); + await mono_download_assets(); + self.dispatchEvent(new MessageEvent("message", { + data: { + cmd: "load", + handlers: emscriptenModule.handlers, + wasmMemory: emscriptenModule.wasmMemory, + wasmModule: emscriptenModule.wasmModule + } + })); + return emscriptenModule; } + +if (ENVIRONMENT_IS_WORKER) { + void createEmscriptenWorker().catch((err) => mono_exit(1, err)); +} diff --git a/src/mono/browser/runtime/pthreads/ui-thread.ts b/src/mono/browser/runtime/pthreads/ui-thread.ts index 8a2e4f7fed7fe9..9eb4888490fa24 100644 --- a/src/mono/browser/runtime/pthreads/ui-thread.ts +++ b/src/mono/browser/runtime/pthreads/ui-thread.ts @@ -301,9 +301,8 @@ function getNewWorker (modulePThread: PThreadLibrary): PThreadWorker { function allocateUnusedWorker (): PThreadWorker { if (!WasmEnableThreads) return null as any; - const asset = loaderHelpers.resolve_single_asset_path("js-module-threads"); - const uri = asset.resolvedUrl; - mono_assert(uri !== undefined, "could not resolve the uri for the js-module-threads asset"); + const uri = loaderHelpers.scriptUrl; + mono_assert(uri !== undefined, "loaderHelpers.scriptUrl must be defined"); const workerNumber = loaderHelpers.workerNextNumber++; const worker = new Worker(uri, { name: "dotnet-worker-" + workerNumber.toString().padStart(3, "0"), diff --git a/src/mono/browser/runtime/types/index.ts b/src/mono/browser/runtime/types/index.ts index c6c3aca3bae53f..1a06897003c298 100644 --- a/src/mono/browser/runtime/types/index.ts +++ b/src/mono/browser/runtime/types/index.ts @@ -220,7 +220,6 @@ export interface Assets { corePdb?: PdbAsset[]; pdb?: PdbAsset[]; - jsModuleWorker?: JsAsset[]; jsModuleDiagnostics?: JsAsset[]; jsModuleNative: JsAsset[]; jsModuleRuntime: JsAsset[]; @@ -399,10 +398,6 @@ export type SingleAssetBehaviors = * The javascript module for loader. */ | "js-module-dotnet" - /** - * The javascript module for threads. - */ - | "js-module-threads" /** * The javascript module for diagnostic server and client. */ diff --git a/src/mono/mono.proj b/src/mono/mono.proj index c3844d6351437a..e936acfb2ce67f 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -757,7 +757,7 @@ <_PythonCmd Condition="'$(HostOS)' != 'windows'">python3 <_PythonCmd Condition="'$(HostOS)' == 'windows'">python - <_PythonCmd Condition="'$(HostOS)' == 'windows' and ('$(TargetsBrowser)' == 'true' or '$(TargetsWasi)' == 'true')">$([MSBuild]::NormalizePath('$(PkgMicrosoft_NET_Runtime_Emscripten_3_1_56_Python_win-x64)', 'tools', 'python.exe')) + <_PythonCmd Condition="'$(HostOS)' == 'windows' and ('$(TargetsBrowser)' == 'true' or '$(TargetsWasi)' == 'true')">$([MSBuild]::NormalizePath('$(PkgMicrosoft_NET_Runtime_Emscripten_5_0_6_Python_win-x64)', 'tools', 'python.exe')) diff --git a/src/mono/mono/metadata/assembly-load-context.c b/src/mono/mono/metadata/assembly-load-context.c index dec9f96b6755f3..f146548c2f4b9b 100644 --- a/src/mono/mono/metadata/assembly-load-context.c +++ b/src/mono/mono/metadata/assembly-load-context.c @@ -12,6 +12,7 @@ #include "mono/metadata/mono-debug.h" #include "mono/utils/mono-error-internals.h" #include "mono/utils/mono-logger-internals.h" +#include "mono/utils/mono-tls.h" GENERATE_GET_CLASS_WITH_CACHE (assembly_load_context, "System.Runtime.Loader", "AssemblyLoadContext"); static GENERATE_GET_CLASS_WITH_CACHE (assembly, "System.Reflection", "Assembly"); @@ -22,6 +23,14 @@ static MonoCoopMutex alc_list_lock; /* Used when accessing 'alcs' */ /* Protected by alc_list_lock */ static GSList *loaded_assemblies; +/* + * Per-thread list of "resolve_method:assembly_name" keys currently being resolved via a + * managed ALC resolve hook. Used to break re-entrant resolution: invoking a managed hook + * (e.g. MonoResolveUsingLoad) can have to JIT-compile methods, and under full-AOT that + * compilation may re-trigger resolution of the same assembly, causing unbounded recursion. + */ +static MonoNativeTlsKey alc_resolve_in_progress_tls_id; + static inline void alcs_lock (void) { @@ -79,6 +88,7 @@ void mono_alcs_init (void) { mono_coop_mutex_init (&alc_list_lock); + mono_native_tls_alloc (&alc_resolve_in_progress_tls_id, NULL); default_alc = mono_alc_create (FALSE); default_alc->gchandle = mono_gchandle_new_internal (NULL, FALSE); @@ -477,14 +487,35 @@ invoke_resolve_method (MonoMethod *resolve_method, MonoAssemblyLoadContext *alc, { MonoAssembly *result = NULL; char* aname_str = NULL; + char *resolve_key = NULL; + GSList *in_progress; if (mono_runtime_get_no_exec ()) return NULL; - HANDLE_FUNCTION_ENTER (); - aname_str = mono_stringify_assembly_name (aname); + /* + * Invoking a managed resolve hook can re-enter assembly resolution for the same + * assembly: constructing the AssemblyName inside the hook parses the name using a + * generic method, and under full-AOT JIT-compiling that method can itself trigger + * resolution of the same assembly -> unbounded recursion -> stack overflow. + * Guard against re-entering the same hook for the same name on the current thread + * (mirrors the TLS recursion guard in mono_class_setup_fields). + */ + resolve_key = g_strdup_printf ("%p:%s", (gpointer)resolve_method, aname_str); + in_progress = (GSList *)mono_native_tls_get_value (alc_resolve_in_progress_tls_id); + if (g_slist_find_custom (in_progress, resolve_key, (GCompareFunc)strcmp)) { + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "Skipping re-entrant ALC resolve for '%s'.", aname_str); + g_free (resolve_key); + g_free (aname_str); + return NULL; + } + in_progress = g_slist_prepend (in_progress, resolve_key); + mono_native_tls_set_value (alc_resolve_in_progress_tls_id, in_progress); + + HANDLE_FUNCTION_ENTER (); + MonoStringHandle aname_obj = mono_string_new_handle (aname_str, error); goto_if_nok (error, leave); @@ -500,6 +531,10 @@ invoke_resolve_method (MonoMethod *resolve_method, MonoAssemblyLoadContext *alc, result = MONO_HANDLE_GETVAL (assm, assembly); leave: + in_progress = (GSList *)mono_native_tls_get_value (alc_resolve_in_progress_tls_id); + in_progress = g_slist_remove (in_progress, resolve_key); + mono_native_tls_set_value (alc_resolve_in_progress_tls_id, in_progress); + g_free (resolve_key); g_free (aname_str); HANDLE_FUNCTION_RETURN_VAL (result); } diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 23b8d15bf708f1..3b95c60c1f45da 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -476,8 +476,8 @@ if(HOST_BROWSER) add_library(mono-wasm-eh-wasm STATIC llvm-runtime.cpp) target_link_libraries (mono-wasm-eh-wasm PRIVATE monoapi eglib_api) - set_target_properties(mono-wasm-eh-wasm PROPERTIES COMPILE_FLAGS "-fwasm-exceptions") - set_target_properties(mono-wasm-eh-wasm PROPERTIES LINK_FLAGS "-fwasm-exceptions") + set_target_properties(mono-wasm-eh-wasm PROPERTIES COMPILE_FLAGS "-fwasm-exceptions -sWASM_LEGACY_EXCEPTIONS=1") + set_target_properties(mono-wasm-eh-wasm PROPERTIES LINK_FLAGS "-fwasm-exceptions -sWASM_LEGACY_EXCEPTIONS=1") install(TARGETS mono-wasm-eh-wasm LIBRARY) endif() diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 9e33b23de7c1c4..324aca3ed4eda2 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -1374,8 +1374,6 @@ resolve_patch (MonoCompile *cfg, MonoJumpInfoType type, gconstpointer target) return res; } -static LLVMValueRef emit_fpnarrow (EmitContext *ctx, LLVMValueRef v, LLVMTypeRef dtype); - /* * convert_full: * @@ -1413,23 +1411,6 @@ convert_full (EmitContext *ctx, LLVMValueRef v, LLVMTypeRef dtype, gboolean is_u if (stype == LLVMDoubleType () && dtype == LLVMFloatType ()) return LLVMBuildFPTrunc (ctx->builder, v, dtype, ""); - /* - * Narrowing a float/double to half (IEEE binary16) must preserve NaN. Route it - * through emit_fpnarrow, which detects a NaN input explicitly and selects a - * canonical quiet NaN, so a target that drops the NaN mantissa during the - * fptrunc (yielding +/-Infinity) cannot turn a NaN into an infinity. Handles - * both scalar and vector half destinations. Mono itself does not emit half - * typed IR today, but keep the central converter correct and NaN-safe instead - * of hitting g_assert_not_reached () below. - */ - if (dtype == LLVMHalfType () && (stype == LLVMFloatType () || stype == LLVMDoubleType ())) - return emit_fpnarrow (ctx, v, dtype); - if (LLVMGetTypeKind (stype) == LLVMVectorTypeKind && LLVMGetTypeKind (dtype) == LLVMVectorTypeKind && - LLVMGetVectorSize (stype) == LLVMGetVectorSize (dtype) && - LLVMGetElementType (dtype) == LLVMHalfType () && - (LLVMGetElementType (stype) == LLVMFloatType () || LLVMGetElementType (stype) == LLVMDoubleType ())) - return emit_fpnarrow (ctx, v, dtype); - #ifdef USE_OPAQUE_POINTERS if (LLVMGetTypeKind (stype) == LLVMPointerTypeKind && LLVMGetTypeKind (dtype) == LLVMPointerTypeKind) return v; @@ -1470,75 +1451,6 @@ convert (EmitContext *ctx, LLVMValueRef v, LLVMTypeRef dtype) return convert_full (ctx, v, dtype, FALSE); } -/* - * quiet_nan_for_fptype: - * - * Return a constant quiet NaN matching the floating point type T. T can be a - * scalar (half/float/double) or a vector of those. - */ -#if LLVM_API_VERSION >= 2300 -static LLVMValueRef -quiet_nan_for_fptype (LLVMTypeRef t) -{ - LLVMTypeRef elem_t = LLVMGetTypeKind (t) == LLVMVectorTypeKind ? LLVMGetElementType (t) : t; - guint64 bits; - LLVMTypeRef int_t; - - switch (LLVMGetTypeKind (elem_t)) { - case LLVMHalfTypeKind: - bits = 0x7e00; /* IEEE binary16 quiet NaN */ - int_t = LLVMInt16Type (); - break; - case LLVMFloatTypeKind: - bits = 0x7fc00000; /* IEEE binary32 quiet NaN */ - int_t = LLVMInt32Type (); - break; - default: - bits = 0x7ff8000000000000ULL; /* IEEE binary64 quiet NaN */ - int_t = LLVMInt64Type (); - break; - } - - LLVMValueRef nan = LLVMConstBitCast (LLVMConstInt (int_t, bits, FALSE), elem_t); - if (LLVMGetTypeKind (t) == LLVMVectorTypeKind) { - unsigned int n = LLVMGetVectorSize (t); - LLVMValueRef elems [MAX_VECTOR_ELEMS]; - g_assert (n <= MAX_VECTOR_ELEMS); - for (unsigned int i = 0; i < n; ++i) - elems [i] = nan; - nan = LLVMConstVector (elems, n); - } - return nan; -} -#endif - -/* - * emit_fpnarrow: - * - * Emit a floating point narrowing conversion (fptrunc) of V to DTYPE which is - * guaranteed to preserve NaN. - * - * Background: the branchless software float->Half (IEEE binary16) conversion used - * by System.Half is, starting with LLVM 23, recognized by the optimizer and may be - * lowered to a hardware narrowing 'fptrunc to '. On some targets - * (e.g. arm64) that narrowing drops the NaN mantissa, leaving an all-ones exponent - * with a zero mantissa, i.e. +/-Infinity. The result is that operations which must - * produce or propagate NaN end up yielding +/-inf. To stay robust against the - * toolchain mis-handling NaN during FP narrowing, detect NaN inputs explicitly and - * select a canonical quiet NaN of the destination type. - */ -static LLVMValueRef -emit_fpnarrow (EmitContext *ctx, LLVMValueRef v, LLVMTypeRef dtype) -{ - LLVMValueRef trunc = LLVMBuildFPTrunc (ctx->builder, v, dtype, ""); -#if LLVM_API_VERSION >= 2300 - /* 'uno' (unordered) is true iff V is NaN, since a NaN is unordered with itself. */ - LLVMValueRef is_nan = LLVMBuildFCmp (ctx->builder, LLVMRealUNO, v, v, ""); - trunc = LLVMBuildSelect (ctx->builder, is_nan, quiet_nan_for_fptype (dtype), trunc, ""); -#endif - return trunc; -} - static void emit_memset (EmitContext *ctx, LLVMValueRef dest, LLVMValueRef val, LLVMValueRef size, int alignment) { @@ -7120,7 +7032,7 @@ MONO_RESTORE_WARNING values [ins->dreg] = LLVMBuildSIToFP (builder, lhs, LLVMFloatType (), ""); break; case OP_FCONV_TO_R4: - values [ins->dreg] = emit_fpnarrow (ctx, lhs, LLVMFloatType ()); + values [ins->dreg] = LLVMBuildFPTrunc (builder, lhs, LLVMFloatType (), ""); break; case OP_RCONV_TO_R8: values [ins->dreg] = LLVMBuildFPExt (builder, lhs, LLVMDoubleType (), dname); diff --git a/src/mono/nuget/Microsoft.NET.Runtime.WorkloadTesting.Internal/Sdk/WorkloadTesting.Core.targets b/src/mono/nuget/Microsoft.NET.Runtime.WorkloadTesting.Internal/Sdk/WorkloadTesting.Core.targets index c8a742387b7183..6a35675fe292fe 100755 --- a/src/mono/nuget/Microsoft.NET.Runtime.WorkloadTesting.Internal/Sdk/WorkloadTesting.Core.targets +++ b/src/mono/nuget/Microsoft.NET.Runtime.WorkloadTesting.Internal/Sdk/WorkloadTesting.Core.targets @@ -84,6 +84,19 @@ Retries="3" Condition="!Exists($(_DotNetInstallScriptPath))"/> + + + + + + diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs b/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs index 61a98572b2464d..d1b9594f1e0d39 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs @@ -213,7 +213,7 @@ private string GetRuntimePackName(RuntimeVariant runtimeType) public string GetRuntimeNativeDir(string tfm, RuntimeVariant runtimeType = RuntimeVariant.SingleThreaded) => Path.Combine(GetRuntimePackDir(tfm, runtimeType), "runtimes", DefaultRuntimeIdentifier, "native"); public bool IsMultiThreadingRuntimePackAvailableFor(string tfm) - => IsWorkload && File.Exists(Path.Combine(GetRuntimeNativeDir(tfm, RuntimeVariant.MultiThreaded), "dotnet.native.worker.mjs")); + => IsWorkload && File.Exists(Path.Combine(GetRuntimeNativeDir(tfm, RuntimeVariant.MultiThreaded), "dotnet.native.wasm")); public static string WasmOverridePacksTargetsPath = Path.Combine(TestDataPath, "WasmOverridePacks.targets"); diff --git a/src/mono/wasm/Wasm.Build.Tests/ProjectProviderBase.cs b/src/mono/wasm/Wasm.Build.Tests/ProjectProviderBase.cs index c1480d70fa91ee..301661f69af9f3 100644 --- a/src/mono/wasm/Wasm.Build.Tests/ProjectProviderBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/ProjectProviderBase.cs @@ -606,7 +606,6 @@ public BootJsonData AssertBootJson(AssertBundleOptions options) var bootJsonEntries = assets.jsModuleNative.Select(a => a.name) .Union(assets.wasmNative.Select(a => a.name)) .Union(assets.jsModuleRuntime.Select(a => a.name)) - .Union(assets.jsModuleWorker?.Select(a => a.name) ?? Enumerable.Empty()) .Union(assets.jsModuleDiagnostics?.Select(a => a.name) ?? Enumerable.Empty()) .Union(assets.wasmSymbols?.Select(a => a.name) ?? Enumerable.Empty()) .ToArray(); diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs b/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs index 618ae02613e576..38b88048204bfd 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs @@ -55,7 +55,6 @@ protected override IReadOnlyDictionary GetAllKnownDotnetFilesToFin { "dotnet.native.js", true }, { "dotnet.native.js.symbols", true }, { "dotnet.native.wasm", true }, - { "dotnet.native.worker.mjs", true }, { "dotnet.runtime.js", true }, { "dotnet.runtime.js.map", false }, { "dotnet.diagnostics.js", true }, @@ -77,10 +76,6 @@ protected override IReadOnlySet GetDotNetFilesExpectedSet(AssertBundleOp "dotnet.native.js", "dotnet.runtime.js", }; - if (assertOptions.BuildOptions.RuntimeType is RuntimeVariant.MultiThreaded) - { - res.Add("dotnet.native.worker.mjs"); - } if (!assertOptions.BuildOptions.IsPublish) { @@ -162,10 +157,6 @@ private void AssertBundle(AssertBundleOptions assertOptions) string buildType = assertOptions.BuildOptions.IsPublish ? "publish" : "build"; var nativeFilesToCheck = new List() { "dotnet.native.wasm", "dotnet.native.js" }; - if (assertOptions.BuildOptions.RuntimeType == RuntimeVariant.MultiThreaded) - { - nativeFilesToCheck.Add("dotnet.native.worker.mjs"); - } foreach (string nativeFilename in nativeFilesToCheck) { @@ -180,11 +171,6 @@ private void AssertBundle(AssertBundleOptions assertOptions) if (assertOptions.BuildOptions.ExpectedFileType != NativeFilesType.FromRuntimePack) { - if (nativeFilename == "dotnet.native.worker.mjs") - { - Console.WriteLine($"Skipping the verification whether {nativeFilename} is from the runtime pack. The check wouldn't be meaningful as the runtime pack file has the same size as the relinked file"); - continue; - } // Confirm that it doesn't match the file from the runtime pack TestUtils.AssertNotSameFile(Path.Combine(runtimeNativeDir, nativeFilename), actualDotnetFiles[nativeFilename].ActualPath, @@ -284,19 +270,6 @@ private void AssertBuildBundle(Configuration config, MSBuildOptions buildOptions AssertFileNotExists(Path.Combine(objDir, "wasm", "for-build"), file, "wasm/for-build"); } - if (buildOptions.RuntimeType == RuntimeVariant.MultiThreaded) - { - // dotnet.native.worker.mjs is validated for location only and not compared against - // the runtime pack — the publish-path AssertBundle skips the runtime-pack comparison - // for the same reason (the runtime-pack file has the same size as the relinked file, - // so the check is not meaningful). - const string multiThreadedWorkerFile = "dotnet.native.worker.mjs"; - AssertFileExists(nativeDir, multiThreadedWorkerFile); - AssertFileNotExists(objDir, multiThreadedWorkerFile, "obj root"); - if (!isNativeRebuild) - AssertFileNotExists(Path.Combine(objDir, "wasm", "for-build"), multiThreadedWorkerFile, "wasm/for-build"); - } - // --- Assembly files: webcil-converted in webcil/ or materialized DLLs in fx/_framework/ --- if (BuildTestBase.UseWebcil) { diff --git a/src/mono/wasm/Wasm.Build.Tests/data/nuget.config b/src/mono/wasm/Wasm.Build.Tests/data/nuget.config index c201e61aab33bf..6b97c38d08cf5b 100644 --- a/src/mono/wasm/Wasm.Build.Tests/data/nuget.config +++ b/src/mono/wasm/Wasm.Build.Tests/data/nuget.config @@ -12,6 +12,7 @@ + diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets index 86c53bcec5609c..d154d54a5b5104 100644 --- a/src/mono/wasm/build/WasmApp.Common.targets +++ b/src/mono/wasm/build/WasmApp.Common.targets @@ -930,8 +930,8 @@ <_WasmOptPostLinkFileName Condition="'$([System.IO.Path]::IsPathRooted($(_WasmOptPostLinkFileName)))' != 'true'">$([System.IO.Path]::Combine($(_WasmIntermediateOutputPath), $(_WasmOptPostLinkFileName))) - - + diff --git a/src/native/libs/Common/JavaScript/loader/assets.ts b/src/native/libs/Common/JavaScript/loader/assets.ts index 5d09b009855530..a6869643d76951 100644 --- a/src/native/libs/Common/JavaScript/loader/assets.ts +++ b/src/native/libs/Common/JavaScript/loader/assets.ts @@ -588,8 +588,7 @@ const behaviorToBlazorAssetTypeMap: { [key: string]: WebAssemblyBootResourceType "webcil": "assembly", "js-module-dotnet": "dotnetjs", "js-module-native": "dotnetjs", - "js-module-runtime": "dotnetjs", - "js-module-threads": "dotnetjs" + "js-module-runtime": "dotnetjs" }; const behaviorToContentTypeMap: { [key: string]: string | undefined } = { @@ -667,7 +666,6 @@ export async function prefetchAllResources(extraVfs?: VfsAsset[]): Promise ...(resources.jsModuleNative || []), ...(resources.jsModuleRuntime || []), ...(resources.jsModuleDiagnostics || []), - ...(resources.jsModuleWorker || []), ...(resources.modulesAfterConfigLoaded || []), ...(resources.modulesAfterRuntimeReady || []), ]); diff --git a/src/native/libs/Common/JavaScript/loader/config.ts b/src/native/libs/Common/JavaScript/loader/config.ts index 71ac243d65dcea..4570a0867d22b5 100644 --- a/src/native/libs/Common/JavaScript/loader/config.ts +++ b/src/native/libs/Common/JavaScript/loader/config.ts @@ -66,7 +66,6 @@ function mergeResources(target: Assets, source: Assets): Assets { source.lazyAssembly = [...target.lazyAssembly!, ...source.lazyAssembly || []]; source.corePdb = [...target.corePdb!, ...source.corePdb || []]; source.pdb = [...target.pdb!, ...source.pdb || []]; - source.jsModuleWorker = [...target.jsModuleWorker!, ...source.jsModuleWorker || []]; source.jsModuleNative = [...target.jsModuleNative!, ...source.jsModuleNative || []]; source.jsModuleDiagnostics = [...target.jsModuleDiagnostics!, ...source.jsModuleDiagnostics || []]; source.jsModuleRuntime = [...target.jsModuleRuntime!, ...source.jsModuleRuntime || []]; @@ -119,7 +118,6 @@ function normalizeResources(target: Assets) { if (!target.lazyAssembly) target.lazyAssembly = []; if (!target.corePdb) target.corePdb = []; if (!target.pdb) target.pdb = []; - if (!target.jsModuleWorker) target.jsModuleWorker = []; if (!target.jsModuleNative) target.jsModuleNative = []; if (!target.jsModuleDiagnostics) target.jsModuleDiagnostics = []; if (!target.jsModuleRuntime) target.jsModuleRuntime = []; diff --git a/src/native/libs/Common/JavaScript/loader/dotnet.d.ts b/src/native/libs/Common/JavaScript/loader/dotnet.d.ts index 60946334f7e9f4..edec8bb8668075 100644 --- a/src/native/libs/Common/JavaScript/loader/dotnet.d.ts +++ b/src/native/libs/Common/JavaScript/loader/dotnet.d.ts @@ -245,7 +245,6 @@ interface Assets { lazyAssembly?: AssemblyAsset[]; corePdb?: PdbAsset[]; pdb?: PdbAsset[]; - jsModuleWorker?: JsAsset[]; jsModuleDiagnostics?: JsAsset[]; jsModuleNative: JsAsset[]; jsModuleRuntime: JsAsset[]; @@ -396,10 +395,6 @@ type SingleAssetBehaviors = * The javascript module for loader. */ | "js-module-dotnet" -/** - * The javascript module for threads. - */ - | "js-module-threads" /** * The javascript module for diagnostic server and client. */ diff --git a/src/native/libs/Common/JavaScript/types/public-api.ts b/src/native/libs/Common/JavaScript/types/public-api.ts index a187a04f1639a0..f3f0a520a978e9 100644 --- a/src/native/libs/Common/JavaScript/types/public-api.ts +++ b/src/native/libs/Common/JavaScript/types/public-api.ts @@ -209,7 +209,6 @@ export interface Assets { lazyAssembly?: AssemblyAsset[]; corePdb?: PdbAsset[]; pdb?: PdbAsset[]; - jsModuleWorker?: JsAsset[]; jsModuleDiagnostics?: JsAsset[]; jsModuleNative: JsAsset[]; jsModuleRuntime: JsAsset[]; @@ -360,10 +359,6 @@ export type SingleAssetBehaviors = * The javascript module for loader. */ | "js-module-dotnet" - /** - * The javascript module for threads. - */ - | "js-module-threads" /** * The javascript module for diagnostic server and client. */ diff --git a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs index bf1b1061772d32..2c1b4ee152e1e4 100644 --- a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs +++ b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs @@ -118,7 +118,6 @@ static void AddDictionary(StringBuilder sb, Dictionary? res) AddDictionary(sb, resources.assembly); AddDictionary(sb, resources.coreAssembly); - AddDictionary(sb, resources.jsModuleWorker); AddDictionary(sb, resources.jsModuleDiagnostics); AddDictionary(sb, resources.jsModuleNative); AddDictionary(sb, resources.jsModuleRuntime); @@ -154,9 +153,7 @@ static void AddDictionary(StringBuilder sb, Dictionary? res) ResourcesData resources = (ResourcesData)bootConfig.resources; string resourceExtension = Path.GetExtension(resourceName); - if (resourceName.StartsWith("dotnet.native.worker", StringComparison.OrdinalIgnoreCase) && string.Equals(resourceExtension, ".mjs", StringComparison.OrdinalIgnoreCase)) - return resources.jsModuleWorker ??= new(); - else if (resourceName.StartsWith("dotnet.diagnostics", StringComparison.OrdinalIgnoreCase) && string.Equals(resourceExtension, ".js", StringComparison.OrdinalIgnoreCase)) + if (resourceName.StartsWith("dotnet.diagnostics", StringComparison.OrdinalIgnoreCase) && string.Equals(resourceExtension, ".js", StringComparison.OrdinalIgnoreCase)) return resources.jsModuleDiagnostics ??= new(); else if (resourceName.StartsWith("dotnet.native", StringComparison.OrdinalIgnoreCase) && string.Equals(resourceExtension, ".js", StringComparison.OrdinalIgnoreCase)) return resources.jsModuleNative ??= new(); @@ -216,7 +213,6 @@ public string TransformResourcesToAssets(BootJsonData config, bool bundlerFriend assets.hash = resources.hash; assets.jsModuleRuntime = MapJsAssets(resources.jsModuleRuntime); assets.jsModuleNative = MapJsAssets(resources.jsModuleNative); - assets.jsModuleWorker = MapJsAssets(resources.jsModuleWorker); assets.jsModuleDiagnostics = MapJsAssets(resources.jsModuleDiagnostics); assets.wasmNative = resources.wasmNative?.Select(a => diff --git a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonData.cs b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonData.cs index 716e468f6836af..063a365ae53163 100644 --- a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonData.cs +++ b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonData.cs @@ -182,14 +182,11 @@ public class ResourcesData /// .NET Wasm runtime resources (dotnet.wasm, dotnet.js) etc. /// /// - /// Deprecated in .NET 8, use , , , , , . + /// Deprecated in .NET 8, use , , , , . /// [DataMember(EmitDefaultValue = false)] public ResourceHashesByNameDictionary runtime { get; set; } - [DataMember(EmitDefaultValue = false)] - public ResourceHashesByNameDictionary jsModuleWorker { get; set; } - [DataMember(EmitDefaultValue = false)] public ResourceHashesByNameDictionary jsModuleDiagnostics { get; set; } @@ -284,9 +281,6 @@ public class AssetsData /// public string hash { get; set; } - [DataMember(EmitDefaultValue = false)] - public List jsModuleWorker { get; set; } - [DataMember(EmitDefaultValue = false)] public List jsModuleDiagnostics { get; set; } diff --git a/src/tests/JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype.cs b/src/tests/JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype.cs index 89fceaef8a6a2e..4d7ac9eb89a9da 100644 --- a/src/tests/JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype.cs +++ b/src/tests/JIT/Directed/nullabletypes/Desktop/boxunboxvaluetype.cs @@ -4696,7 +4696,7 @@ public static void Run() public class Test_boxunboxvaluetype { - [ActiveIssue("https://github.com/dotnet/runtime/issues/129508", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/pull/129702", TestRuntimes.Mono)] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/Directed/nullabletypes/castclassvaluetype.cs b/src/tests/JIT/Directed/nullabletypes/castclassvaluetype.cs index d5b23f43397160..76b9e1276e21a5 100644 --- a/src/tests/JIT/Directed/nullabletypes/castclassvaluetype.cs +++ b/src/tests/JIT/Directed/nullabletypes/castclassvaluetype.cs @@ -4695,7 +4695,7 @@ public static void Run() public class Test_castclassvaluetype { - [ActiveIssue("https://github.com/dotnet/runtime/issues/129508", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/pull/129702", TestRuntimes.Mono)] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.il index 2565bcc03b270e..320821b8927c5a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.il @@ -46,7 +46,7 @@ 01 00 00 00 ) .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, valuetype [Microsoft.DotNet.XUnitExtensions]Xunit.TestRuntimes) = { - string('https://github.com/dotnet/runtime/issues/129508') + string('https://github.com/dotnet/runtime/pull/129713') int32(0x2) // Mono } .entrypoint diff --git a/src/tests/JIT/Regression/JitBlue/WPF_3226/CSharpRepro/WPF_3226.cs b/src/tests/JIT/Regression/JitBlue/WPF_3226/CSharpRepro/WPF_3226.cs index 51106edc3fb893..333999379e67e3 100644 --- a/src/tests/JIT/Regression/JitBlue/WPF_3226/CSharpRepro/WPF_3226.cs +++ b/src/tests/JIT/Regression/JitBlue/WPF_3226/CSharpRepro/WPF_3226.cs @@ -38,7 +38,7 @@ static void WmGetMinMaxInfo(IntPtr lParam) Marshal.StructureToPtr(mmi, lParam, true); } - [ActiveIssue("https://github.com/dotnet/runtime/issues/129508", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/pull/129710", TestRuntimes.Mono)] [Fact] public unsafe static int TestEntryPoint() { diff --git a/src/tests/JIT/jit64/localloc/call/call05_large.il b/src/tests/JIT/jit64/localloc/call/call05_large.il index c4b74924e68fa6..44d5fef8cbd697 100644 --- a/src/tests/JIT/jit64/localloc/call/call05_large.il +++ b/src/tests/JIT/jit64/localloc/call/call05_large.il @@ -22,7 +22,7 @@ 01 00 00 00 ) .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, valuetype [Microsoft.DotNet.XUnitExtensions]Xunit.TestRuntimes) = { - string('https://github.com/dotnet/runtime/issues/129508') + string('https://github.com/dotnet/runtime/pull/129708') int32(0x2) // Mono } .entrypoint diff --git a/src/tests/JIT/jit64/localloc/call/call05_small.il b/src/tests/JIT/jit64/localloc/call/call05_small.il index d78aaeb6e2882c..bec3bc4ab2bc58 100644 --- a/src/tests/JIT/jit64/localloc/call/call05_small.il +++ b/src/tests/JIT/jit64/localloc/call/call05_small.il @@ -22,7 +22,7 @@ 01 00 00 00 ) .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, valuetype [Microsoft.DotNet.XUnitExtensions]Xunit.TestRuntimes) = { - string('https://github.com/dotnet/runtime/issues/129508') + string('https://github.com/dotnet/runtime/pull/129708') int32(0x2) // Mono } .entrypoint diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest_GVM_TypeLoadException.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest_GVM_TypeLoadException.il index 65df84dbdafa64..d1491f69e5f691 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest_GVM_TypeLoadException.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest_GVM_TypeLoadException.il @@ -479,7 +479,7 @@ ) .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = {string('Tests that expect TypeLoadException') type([TestLibrary]TestLibrary.Utilities) string[1] ('IsNativeAot') } .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, valuetype [Microsoft.DotNet.XUnitExtensions]Xunit.TestRuntimes) = { - string('https://github.com/dotnet/runtime/issues/129508') + string('https://github.com/dotnet/runtime/pull/129715') int32(0x2) // Mono } .entrypoint