From 7c7ecb88b4b3ef82de3bc1f6629b91cd9631dc52 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Tue, 6 Sep 2022 12:33:17 -0400 Subject: [PATCH 01/10] [wasm-mt] Build the threaded CoreLib if MonoWasmBuildVariant is 'multithread' Also define the perf-tracing feature flag for the threaded and perf-tracing build variants. --- src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj index 7eb9314c1ce62..b39c450444046 100644 --- a/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -125,8 +125,8 @@ $(DefineConstants);MONO_FEATURE_SRE true - true - true + true + true true true true From 94c4e8b43e0b523ccac3f586a8e339ee3ed215c1 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Tue, 6 Sep 2022 14:47:28 -0400 Subject: [PATCH 02/10] Also fixup the BCL assemblies --- .../src/System.Diagnostics.Tracing.csproj | 4 ++-- .../ref/System.Private.CoreLib.csproj | 6 +++--- .../src/System.Threading.Thread.csproj | 2 +- .../src/System.Threading.ThreadPool.csproj | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libraries/System.Diagnostics.Tracing/src/System.Diagnostics.Tracing.csproj b/src/libraries/System.Diagnostics.Tracing/src/System.Diagnostics.Tracing.csproj index a08b302253bf8..ccbd35a5a34fc 100644 --- a/src/libraries/System.Diagnostics.Tracing/src/System.Diagnostics.Tracing.csproj +++ b/src/libraries/System.Diagnostics.Tracing/src/System.Diagnostics.Tracing.csproj @@ -6,10 +6,10 @@ - + - \ No newline at end of file + diff --git a/src/libraries/System.Private.CoreLib/ref/System.Private.CoreLib.csproj b/src/libraries/System.Private.CoreLib/ref/System.Private.CoreLib.csproj index 413026393547b..4cf77fe8bffa1 100644 --- a/src/libraries/System.Private.CoreLib/ref/System.Private.CoreLib.csproj +++ b/src/libraries/System.Private.CoreLib/ref/System.Private.CoreLib.csproj @@ -10,8 +10,8 @@ $(NoWarn);0809;0618;CS8614;CS3015 SilverlightPlatform true - true - true + true + true $(DefineConstants);FEATURE_WASM_PERFTRACING $(DefineConstants);FEATURE_WASM_THREADS $(DefineConstants);BUILDING_CORELIB_REFERENCE @@ -51,4 +51,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Threading.Thread/src/System.Threading.Thread.csproj b/src/libraries/System.Threading.Thread/src/System.Threading.Thread.csproj index 57a6f7f3c4ddb..4d133621e598d 100644 --- a/src/libraries/System.Threading.Thread/src/System.Threading.Thread.csproj +++ b/src/libraries/System.Threading.Thread/src/System.Threading.Thread.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/libraries/System.Threading.ThreadPool/src/System.Threading.ThreadPool.csproj b/src/libraries/System.Threading.ThreadPool/src/System.Threading.ThreadPool.csproj index bda556178b9e6..051ec503dc245 100644 --- a/src/libraries/System.Threading.ThreadPool/src/System.Threading.ThreadPool.csproj +++ b/src/libraries/System.Threading.ThreadPool/src/System.Threading.ThreadPool.csproj @@ -6,10 +6,10 @@ - + - \ No newline at end of file + From e5c2aae68103df8840ca44ef0cfd0d06cbf3e0c9 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Tue, 6 Sep 2022 14:52:43 -0400 Subject: [PATCH 03/10] [wasm-mt] look for WasmEnableThreads in user projects not WasmEnabelThreading. Conversely, use `WasmEnablePerfTracing`, not `WasmEnablePerfTrace`. --- .../WorkloadManifest.targets.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/WorkloadManifest.targets.in b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/WorkloadManifest.targets.in index c6b512e6c4516..2c2b814df0cb6 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/WorkloadManifest.targets.in +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/WorkloadManifest.targets.in @@ -103,8 +103,8 @@ $(_MonoWorkloadRuntimePackPackageVersion) - Microsoft.NETCore.App.Runtime.Mono.multithread.net7.**RID** - Microsoft.NETCore.App.Runtime.Mono.perftrace.net7.**RID** + Microsoft.NETCore.App.Runtime.Mono.multithread.net7.**RID** + Microsoft.NETCore.App.Runtime.Mono.perftrace.net7.**RID** From 0fe387a4a949322641bdeb8a7d532496ef65869b Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Tue, 6 Sep 2022 16:01:24 -0400 Subject: [PATCH 04/10] include dotnet.worker.js in runtime pack --- eng/liveBuilds.targets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 5a3bf10c3e00a..f44a64d54f7e9 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -187,6 +187,11 @@ $(LibrariesNativeArtifactsPath)dotnet.timezones.blat; $(LibrariesNativeArtifactsPath)*.dat;" IsNative="true" /> + + Date: Tue, 6 Sep 2022 16:42:28 -0400 Subject: [PATCH 06/10] fix whitespace --- eng/liveBuilds.targets | 6 +++--- .../templates/browser/.template.config/template.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index f44a64d54f7e9..6ba9ce672785b 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -189,9 +189,9 @@ IsNative="true" /> + Include=" + $(LibrariesNativeArtifactsPath)dotnet.worker.js" + IsNative="true" /> Date: Wed, 7 Sep 2022 08:08:15 -0400 Subject: [PATCH 07/10] when updating RuntimePackNamePatterns don't include net7 component The workload resolver already did its job by the time this property is updated, so we need to use patterns that correspond to actual nupkg names (unversioned), not runtime pack alias names from the manifest (versioned with 'net7') --- .../WorkloadManifest.targets.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/WorkloadManifest.targets.in b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/WorkloadManifest.targets.in index 2c2b814df0cb6..59e7badcacfa6 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/WorkloadManifest.targets.in +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/WorkloadManifest.targets.in @@ -103,8 +103,8 @@ $(_MonoWorkloadRuntimePackPackageVersion) - Microsoft.NETCore.App.Runtime.Mono.multithread.net7.**RID** - Microsoft.NETCore.App.Runtime.Mono.perftrace.net7.**RID** + Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** + Microsoft.NETCore.App.Runtime.Mono.perftrace.**RID** From a75226bc3550641d73183e4a4d21ca5c1b92c537 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Wed, 7 Sep 2022 08:09:55 -0400 Subject: [PATCH 08/10] WBT: unset MonoWasmBuildVariant for the non-threaded runtime For local testing if the built runtime is a multithreaded one, make and we need to make the normal variant nuget, unset MonoWasmBuildVariant property --- eng/testing/workloads-testing.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/workloads-testing.targets b/eng/testing/workloads-testing.targets index 537fa502c57e1..280d9160b9c9e 100644 --- a/eng/testing/workloads-testing.targets +++ b/eng/testing/workloads-testing.targets @@ -171,7 +171,7 @@ <_NuGetsToBuild Include="$(LibrariesShippingPackagesDir)Microsoft.NETCore.App.Runtime.Mono.browser-wasm.$(_PackageVersion).nupkg" Project="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj" - Properties="@(_DefaultPropsForNuGetBuild, ';')" + Properties="@(_DefaultPropsForNuGetBuild, ';');MonoWasmBuildVariant=" Dependencies="$(_DefaultRuntimePackNuGetPath)" Descriptor="single threaded runtime pack" Condition="'$(_DefaultBuildVariant)' != '.'" /> From a0ee8796e8484ff703903bdf4e7a2eaeded9de7d Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Wed, 7 Sep 2022 10:23:01 -0400 Subject: [PATCH 09/10] [WorkloadBuildTasks] remove the workload manifest net6/net7 hack Starting with 7.0.100-rc.2.22457.6 we already have the versioned net6/net7 toolchains, so the hack isn't needed anymore (and in fact, breaks workload installation during testing) --- .../InstallWorkloadFromArtifacts.cs | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs b/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs index f4763c1b76115..26c043c7df1ba 100644 --- a/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs +++ b/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs @@ -141,37 +141,6 @@ private bool InstallAllManifests() return true; } - // HACK BEGIN - because sdk doesn't yet have the net6/net7 manifest names in the known workloads - // list - string? txtPath = Directory.EnumerateFiles(Path.Combine(SdkWithNoWorkloadInstalledPath, "sdk"), "IncludedWorkloadManifests.txt", - new EnumerationOptions { RecurseSubdirectories = true, MaxRecursionDepth = 2}) - .FirstOrDefault(); - if (txtPath is null) - throw new LogAsErrorException($"Could not find IncludedWorkloadManifests.txt in {SdkWithNoWorkloadInstalledPath}"); - - string stampPath = Path.Combine(Path.GetDirectoryName(txtPath)!, ".stamp"); - if (!File.Exists(stampPath)) - { - Log.LogMessage(MessageImportance.High, $"txtPath: {txtPath}"); - string newTxt = File.ReadAllText(txtPath) - .Replace("microsoft.net.workload.mono.toolchain", - $"microsoft.net.workload.mono.toolchain.net6{Environment.NewLine}microsoft.net.workload.mono.toolchain.net7") - .Replace("microsoft.net.workload.emscripten", - $"microsoft.net.workload.emscripten.net6{Environment.NewLine}microsoft.net.workload.emscripten.net7"); - File.WriteAllText(txtPath, newTxt); - File.WriteAllText(stampPath, ""); - } - - string p = Path.Combine(SdkWithNoWorkloadInstalledPath, "sdk-manifests", "7.0.100", "microsoft.net.workload.mono.toolchain"); - Log.LogMessage(MessageImportance.High, $"Deleting {p}"); - if (Directory.Exists(p)) - Directory.Delete(p, recursive: true); - p = Path.Combine(SdkWithNoWorkloadInstalledPath, "sdk-manifests", "7.0.100", "microsoft.net.workload.emscripten"); - Log.LogMessage(MessageImportance.High, $"Deleting {p}"); - if (Directory.Exists(p)) - Directory.Delete(p, recursive: true); - // HACK END - string nugetConfigContents = GetNuGetConfig(); HashSet manifestsInstalled = new(); foreach (ITaskItem workload in WorkloadIds) From 27370f0a7a524f19fce9435e5a545e7793b2f1ea Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Wed, 7 Sep 2022 19:55:17 -0400 Subject: [PATCH 10/10] also build the JS interop library with threading if variant is used --- .../src/System.Runtime.InteropServices.JavaScript.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj index e9c286f47aa84..82b95560ab2a9 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj @@ -6,7 +6,7 @@ - true + true