From 06da452660dfbd55c380192bce88259c0750ecef Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 27 Apr 2023 23:59:21 +0000 Subject: [PATCH 01/12] wip --- eng/testing/tests.browser.targets | 3 ++- ...Microsoft.NET.Sdk.WebAssembly.Pack.pkgproj | 2 +- ...icrosoft.NET.Sdk.WebAssembly.Browser.props | 0 ...rosoft.NET.Sdk.WebAssembly.Browser.targets | 0 .../Sdk.props} | 0 .../Sdk.targets} | 0 .../{build => Sdk}/Wasm.web.config | 0 .../WorkloadManifest.json.in | 6 +++++ .../WorkloadManifest.targets.in | 3 +++ .../templates/browser/browser.0.csproj | 4 +-- .../browser/{ => wwwroot}/index.html | 0 .../templates/browser/{ => wwwroot}/main.js | 5 ++-- .../InstallWorkloadFromArtifacts.cs | 25 +------------------ 13 files changed, 17 insertions(+), 31 deletions(-) rename src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/{build => Sdk}/Microsoft.NET.Sdk.WebAssembly.Browser.props (100%) rename src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/{build => Sdk}/Microsoft.NET.Sdk.WebAssembly.Browser.targets (100%) rename src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/{build/Microsoft.NET.Sdk.WebAssembly.Pack.props => Sdk/Sdk.props} (100%) rename src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/{build/Microsoft.NET.Sdk.WebAssembly.Pack.targets => Sdk/Sdk.targets} (100%) rename src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/{build => Sdk}/Wasm.web.config (100%) rename src/mono/wasm/templates/templates/browser/{ => wwwroot}/index.html (100%) rename src/mono/wasm/templates/templates/browser/{ => wwwroot}/main.js (87%) diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets index ac4796a41af24d..d84fc3aa9c58cf 100644 --- a/eng/testing/tests.browser.targets +++ b/eng/testing/tests.browser.targets @@ -1,6 +1,7 @@ <_UseWasmSymbolicator Condition="'$(TestTrimming)' != 'true'">true + true @@ -265,7 +266,7 @@ Condition="'$(WorkloadsTestPreviousVersions)' == 'true'" /> - + diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Microsoft.NET.Sdk.WebAssembly.Pack.pkgproj b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Microsoft.NET.Sdk.WebAssembly.Pack.pkgproj index 32b0ded6b35fd7..7887f7a2457af3 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Microsoft.NET.Sdk.WebAssembly.Pack.pkgproj +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Microsoft.NET.Sdk.WebAssembly.Pack.pkgproj @@ -7,7 +7,7 @@ - + diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.props b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Microsoft.NET.Sdk.WebAssembly.Browser.props similarity index 100% rename from src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.props rename to src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Microsoft.NET.Sdk.WebAssembly.Browser.props diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Microsoft.NET.Sdk.WebAssembly.Browser.targets similarity index 100% rename from src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets rename to src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Microsoft.NET.Sdk.WebAssembly.Browser.targets diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Pack.props b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.props similarity index 100% rename from src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Pack.props rename to src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.props diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Pack.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.targets similarity index 100% rename from src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Pack.targets rename to src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.targets diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Wasm.web.config b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Wasm.web.config similarity index 100% rename from src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Wasm.web.config rename to src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Wasm.web.config diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.json.in b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.json.in index 72d84e806825e4..c7ced02a5e1478 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.json.in +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.json.in @@ -8,6 +8,7 @@ "description": ".NET WebAssembly build tools", "packs": [ "Microsoft.NET.Runtime.WebAssembly.Sdk", + "Microsoft.NET.Sdk.WebAssembly.Pack", "Microsoft.NETCore.App.Runtime.Mono.browser-wasm", "Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm" ], @@ -27,6 +28,7 @@ "wasi-experimental": { "description": ".NET WASI experimental", "packs": [ + "Microsoft.NET.Sdk.WebAssembly.Pack", "Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk", "Microsoft.NETCore.App.Runtime.Mono.wasi-wasm", "Microsoft.NET.Runtime.WebAssembly.Templates" @@ -178,6 +180,10 @@ "kind": "Sdk", "version": "${PackageVersion}" }, + "Microsoft.NET.Sdk.WebAssembly.Pack": { + "kind": "Sdk", + "version": "${PackageVersion}" + }, "Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk": { "kind": "Sdk", "version": "${PackageVersion}" diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in index e5c4a1e176e317..1f7bfc7f911793 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in @@ -123,6 +123,8 @@ + + @@ -149,6 +151,7 @@ Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** Microsoft.NETCore.App.Runtime.Mono.perftrace.**RID** + + + + + + wasmbrowser-legacy + + + + + + + + + + diff --git a/src/mono/wasm/testassets/wasmbrowser-legacy/main.js b/src/mono/wasm/testassets/wasmbrowser-legacy/main.js new file mode 100644 index 00000000000000..6d9bd43f7eb7b3 --- /dev/null +++ b/src/mono/wasm/testassets/wasmbrowser-legacy/main.js @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import { dotnet } from './dotnet.js' + +const { setModuleImports, getAssemblyExports, getConfig } = await dotnet + .withDiagnosticTracing(false) + .withApplicationArgumentsFromQuery() + .create(); + +setModuleImports('main.js', { + window: { + location: { + href: () => globalThis.window.location.href + } + } +}); + +const config = getConfig(); +const exports = await getAssemblyExports(config.mainAssemblyName); +const text = exports.MyClass.Greeting(); +console.log(text); + +document.getElementById('out').innerHTML = text; +await dotnet.run(); \ No newline at end of file diff --git a/src/mono/wasm/testassets/wasmbrowser-legacy/runtimeconfig.template.json b/src/mono/wasm/testassets/wasmbrowser-legacy/runtimeconfig.template.json new file mode 100644 index 00000000000000..8f0557352c6ed3 --- /dev/null +++ b/src/mono/wasm/testassets/wasmbrowser-legacy/runtimeconfig.template.json @@ -0,0 +1,11 @@ +{ + "wasmHostProperties": { + "perHostConfig": [ + { + "name": "browser", + "html-path": "index.html", + "Host": "browser" + } + ] + } +} diff --git a/src/mono/wasm/testassets/wasmbrowser-legacy/wasmbrowser-legacy.csproj b/src/mono/wasm/testassets/wasmbrowser-legacy/wasmbrowser-legacy.csproj new file mode 100644 index 00000000000000..9182165a667094 --- /dev/null +++ b/src/mono/wasm/testassets/wasmbrowser-legacy/wasmbrowser-legacy.csproj @@ -0,0 +1,13 @@ + + + net8.0 + browser-wasm + Exe + true + + + + + + + From 2837c9008af5a968733044e5055a2a98ff622eee Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 3 May 2023 02:19:35 +0000 Subject: [PATCH 04/12] wip --- ...rosoft.NET.Sdk.WebAssembly.Browser.targets | 7 +- .../wasm/Wasm.Build.Tests/BrowserRunner.cs | 12 +- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 134 +++++++++++------- .../wasm/Wasm.Build.Tests/Common/Utils.cs | 3 +- .../WasmLegacyTemplateTests.cs | 6 +- .../Wasm.Build.Tests/WasmTemplateTests.cs | 18 ++- .../templates/browser/browser.0.csproj | 2 +- 7 files changed, 114 insertions(+), 68 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 47b4cf3206231a..f9e38a686c5a31 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -488,6 +488,11 @@ Copyright (c) .NET Foundation. All rights reserved. + + <_WasmLinkerEnabled>$(PublishTrimmed) + <_WasmLinkerEnabled Condition="'$(_WasmLinkerEnabled)' == ''">false + + RunAsync(ToolCommand cmd, string args, bool headless = }); IPage page = await Browser.NewPageAsync(); - if (onConsoleMessage is not null) - page.Console += (_, msg) => onConsoleMessage(msg); + page.Console += (_, msg) => + { + if (onConsoleMessage is not null) + onConsoleMessage(msg); + + // when not forwarding console messages, they show up as + // Console log messages here. That should be checked with + // the various regexes + outputHandler(msg.Text); + }; await page.GotoAsync(urlAvailable.Task.Result); RunTask = runTask; return page; diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index b9e15242d3ce23..1882f3ccee0f26 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -440,7 +440,8 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp options.PredefinedIcudt ?? "", options.DotnetWasmFromRuntimePack ?? !buildArgs.AOT, UseWebcil, - options.IsBrowserTemplateProject); + options.FromTemplate, + options.Publish); } if (options.UseCache) @@ -632,6 +633,8 @@ protected void AssertDotNetNativeFiles(NativeFilesType type, string config, bool AssertNotSameFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.wasm"), Path.Combine(binFrameworkDir, "dotnet.wasm"), label); AssertNotSameFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.js"), dotnetJsPath!, label); } + + AssertIcuAssets(binFrameworkDir, GlobalizationMode.FullIcu, ""); } static void AssertRuntimePackPath(string buildOutput, string targetFramework) @@ -656,25 +659,48 @@ protected static void AssertBasicAppBundle(string bundleDir, string predefinedIcudt = "", bool dotnetWasmFromRuntimePack = true, bool useWebcil = true, - bool isBrowserProject = true) + WasmTemplate fromTemplate = WasmTemplate.none, + bool isPublish = false) { var filesToExist = new List() { - mainJS, "dotnet.wasm", - "mono-config.json", "dotnet.js" }; - if (isBrowserProject) - filesToExist.Add("index.html"); + Console.WriteLine ($"AssertBasicAppBundle: isPub:{isPublish}"); + // FIXME: um.. does this apply to all the templates? + if (isPublish) + { + filesToExist.Add(Path.Combine(bundleDir, mainJS)); + } + + string managedDir; + if (fromTemplate == WasmTemplate.wasmbrowser) + { + bundleDir = Path.Combine(bundleDir, "_framework"); + managedDir = bundleDir; + + filesToExist.Add("blazor.boot.json"); + if (isPublish) + filesToExist.Add("index.html"); + } + else + { + managedDir = Path.Combine(bundleDir, "managed"); + + if (fromTemplate == WasmTemplate.wasmbrowser_legacy) + { + filesToExist.Add("mono-config.json"); + filesToExist.Add("index.html"); + } + } AssertFilesExist(bundleDir, filesToExist); AssertFilesExist(bundleDir, new[] { "run-v8.sh" }, expectToExist: hasV8Script); - AssertIcuAssets(); + AssertIcuAssets(bundleDir, globalizationMode, predefinedIcudt); - string managedDir = Path.Combine(bundleDir, "managed"); string bundledMainAppAssembly = useWebcil ? $"{projectName}.webcil" : $"{projectName}.dll"; AssertFilesExist(managedDir, new[] { bundledMainAppAssembly }); @@ -694,53 +720,54 @@ protected static void AssertBasicAppBundle(string bundleDir, } AssertDotNetWasmJs(bundleDir, fromRuntimePack: dotnetWasmFromRuntimePack, targetFramework); + } - void AssertIcuAssets() + protected static void AssertIcuAssets(string bundleDir, GlobalizationMode? globalizationMode, string predefinedIcudt) + { + bool expectEFIGS = false; + bool expectCJK = false; + bool expectNOCJK = false; + bool expectFULL = false; + switch (globalizationMode) { - bool expectEFIGS = false; - bool expectCJK = false; - bool expectNOCJK = false; - bool expectFULL = false; - switch (globalizationMode) - { - case GlobalizationMode.Invariant: - break; - case GlobalizationMode.FullIcu: - expectFULL = true; - break; - case GlobalizationMode.PredefinedIcu: - if (string.IsNullOrEmpty(predefinedIcudt)) - throw new ArgumentException("WasmBuildTest is invalid, value for predefinedIcudt is required when GlobalizationMode=PredefinedIcu."); - AssertFilesExist(bundleDir, new[] { predefinedIcudt }, expectToExist: true); - // predefined ICU name can be identical with the icu files from runtime pack - switch (predefinedIcudt) - { - case "icudt.dat": - expectFULL = true; - break; - case "icudt_EFIGS.dat": - expectEFIGS = true; - break; - case "icudt_CJK.dat": - expectCJK = true; - break; - case "icudt_no_CJK.dat": - expectNOCJK = true; - break; - } - break; - default: - // icu shard chosen based on the locale - expectCJK = true; - expectEFIGS = true; - expectNOCJK = true; - break; - } - AssertFilesExist(bundleDir, new[] { "icudt.dat" }, expectToExist: expectFULL); - AssertFilesExist(bundleDir, new[] { "icudt_EFIGS.dat" }, expectToExist: expectEFIGS); - AssertFilesExist(bundleDir, new[] { "icudt_CJK.dat" }, expectToExist: expectCJK); - AssertFilesExist(bundleDir, new[] { "icudt_no_CJK.dat" }, expectToExist: expectNOCJK); + case GlobalizationMode.Invariant: + break; + case GlobalizationMode.FullIcu: + expectFULL = true; + break; + case GlobalizationMode.PredefinedIcu: + if (string.IsNullOrEmpty(predefinedIcudt)) + throw new ArgumentException("WasmBuildTest is invalid, value for predefinedIcudt is required when GlobalizationMode=PredefinedIcu."); + AssertFilesExist(bundleDir, new[] { predefinedIcudt }, expectToExist: true); + // predefined ICU name can be identical with the icu files from runtime pack + switch (predefinedIcudt) + { + case "icudt.dat": + expectFULL = true; + break; + case "icudt_EFIGS.dat": + expectEFIGS = true; + break; + case "icudt_CJK.dat": + expectCJK = true; + break; + case "icudt_no_CJK.dat": + expectNOCJK = true; + break; + } + break; + default: + // icu shard chosen based on the locale + expectCJK = true; + expectEFIGS = true; + expectNOCJK = true; + break; } + // FIXME: AJ: open an issue + AssertFilesExist(bundleDir, new[] { "icudt.dat" }, expectToExist: expectFULL); + AssertFilesExist(bundleDir, new[] { "icudt_EFIGS.dat" }, expectToExist: expectEFIGS); + AssertFilesExist(bundleDir, new[] { "icudt_CJK.dat" }, expectToExist: expectCJK); + AssertFilesExist(bundleDir, new[] { "icudt_no_CJK.dat" }, expectToExist: expectNOCJK); } protected static void AssertDotNetWasmJs(string bundleDir, bool fromRuntimePack, string targetFramework) @@ -771,7 +798,7 @@ protected static void AssertFilesExist(string dir, IEnumerable filenames throw new XunitException($"[{label}] {dir} not found"); foreach (string filename in filenames) { - string path = Path.Combine(dir, filename); + string path = Path.IsPathRooted(filename) ? filename : Path.Combine(dir, filename); if (expectToExist && !File.Exists(path)) throw new XunitException($"{prefix}Expected the file to exist: {path}"); @@ -1255,6 +1282,7 @@ public enum WasmTemplate none, wasmconsole, wasmbrowser, + wasmbrowser_legacy, wasiconsole }; diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/Utils.cs b/src/mono/wasm/Wasm.Build.Tests/Common/Utils.cs index 048368cc430040..870d5be85f1476 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/Utils.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/Utils.cs @@ -24,7 +24,8 @@ public static void DirectoryCopy(string sourceDirName, string destDirName, Func< DirectoryInfo[] dirs = dir.GetDirectories(); // If the destination directory doesn't exist, create it. - Directory.CreateDirectory(destDirName); + if (!Directory.Exists(destDirName)) + Directory.CreateDirectory(destDirName); // Get the files in the directory and copy them to the new location. FileInfo[] files = dir.GetFiles(); diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs index 4fe25e4ab06ae4..013b5d5c5a3aaa 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs @@ -57,7 +57,7 @@ private void UpdateMainJsEnvironmentVariables(params (string key, string value)[ [InlineData("Release")] public void BrowserBuildThenPublish(string config) { - string id = $"browser_{config}_{Path.GetRandomFileName()}"; + string id = $"browser_legacy_{config}_{Path.GetRandomFileName()}"; string projectFile = CreateWasmTemplateProjectFromAssets(id, "wasmbrowser-legacy"); string projectName = Path.GetFileNameWithoutExtension(projectFile); @@ -136,7 +136,7 @@ public Task RunWithDifferentAppBundleLocations(bool forConsole, bool runOutsideP private async Task BrowserRunTwiceWithAndThenWithoutBuildAsync(string config, string extraProperties = "", bool runOutsideProjectDirectory = false) { - string id = $"browser_{config}_{Path.GetRandomFileName()}"; + string id = $"browser_legacy_{config}_{Path.GetRandomFileName()}"; string projectFile = CreateWasmTemplateProjectFromAssets(id, "wasmbrowser-legacy"); UpdateBrowserMainJs(DefaultTargetFramework); @@ -171,7 +171,7 @@ private async Task BrowserRunTwiceWithAndThenWithoutBuildAsync(string config, st public async Task BrowserBuildAndRun() { string config = "Debug"; - string id = $"browser_{config}_{Path.GetRandomFileName()}"; + string id = $"browser_legacy_{config}_{Path.GetRandomFileName()}"; CreateWasmTemplateProjectFromAssets(id, "wasmbrowser-legacy"); UpdateBrowserMainJs("net8.0"); diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs index 796fb63ce750f6..c7a99700c99e8f 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs @@ -41,10 +41,11 @@ private void UpdateBrowserMainJs(string targetFramework) string mainJsPath = Path.Combine(_projectDir!, "wwwroot", "main.js"); string mainJsContent = File.ReadAllText(mainJsPath); + // FIXME: withConsoleForwarding - use only with wasm app host // .withExitOnUnhandledError() is available only only >net7.0 mainJsContent = mainJsContent.Replace(".create()", targetFramework == "net8.0" - ? ".withConsoleForwarding().withElementOnExit().withExitCodeLogging().withExitOnUnhandledError().create()" + ? ".withElementOnExit().withExitCodeLogging().withExitOnUnhandledError().create()" : ".withConsoleForwarding().withElementOnExit().withExitCodeLogging().create()"); File.WriteAllText(mainJsPath, mainJsContent); } @@ -99,10 +100,12 @@ public void BrowserBuildThenPublish(string config) HasV8Script: false, MainJS: "main.js", Publish: false, - TargetFramework: BuildTestBase.DefaultTargetFramework + TargetFramework: DefaultTargetFramework, + FromTemplate: WasmTemplate.wasmbrowser )); - AssertDotNetJsSymbols(Path.Combine(GetBinDir(config), "wwwroot"), fromRuntimePack: true, targetFramework: DefaultTargetFramework); + // FIXME: AJ: disabled for non-legacy wasmbrowser + // AssertDotNetJsSymbols(Path.Combine(GetBinDir(config), "wwwroot"), fromRuntimePack: true, targetFramework: DefaultTargetFramework); if (!_buildContext.TryGetBuildFor(buildArgs, out BuildProduct? product)) throw new XunitException($"Test bug: could not get the build product in the cache"); @@ -121,7 +124,8 @@ public void BrowserBuildThenPublish(string config) MainJS: "main.js", Publish: true, TargetFramework: BuildTestBase.DefaultTargetFramework, - UseCache: false)); + UseCache: false, + FromTemplate: WasmTemplate.wasmbrowser)); AssertDotNetJsSymbols(Path.Combine(GetBinDir(config), "wwwroot"), fromRuntimePack: !expectRelinking, targetFramework: DefaultTargetFramework); } @@ -238,8 +242,8 @@ public static TheoryData TestDataForAppBundleDir() AddTestData(forConsole: true, runOutsideProjectDirectory: false); AddTestData(forConsole: true, runOutsideProjectDirectory: true); - AddTestData(forConsole: false, runOutsideProjectDirectory: false); - AddTestData(forConsole: false, runOutsideProjectDirectory: true); + // AddTestData(forConsole: false, runOutsideProjectDirectory: false); + // AddTestData(forConsole: false, runOutsideProjectDirectory: true); void AddTestData(bool forConsole, bool runOutsideProjectDirectory) { @@ -440,7 +444,7 @@ public async Task BrowserBuildAndRun(string extraNewArgs, string targetFramework .WithWorkingDirectory(_projectDir!); await using var runner = new BrowserRunner(_testOutput); - var page = await runner.RunAsync(runCommand, $"run -c {config} --no-build -r browser-wasm --forward-console"); + var page = await runner.RunAsync(runCommand, $"run -c {config} --no-build -r browser-wasm"); await runner.WaitForExitMessageAsync(TimeSpan.FromMinutes(2)); Assert.Contains("Hello, Browser!", string.Join(Environment.NewLine, runner.OutputLines)); } diff --git a/src/mono/wasm/templates/templates/browser/browser.0.csproj b/src/mono/wasm/templates/templates/browser/browser.0.csproj index 91651a49fdf64e..c4181b52c56b06 100644 --- a/src/mono/wasm/templates/templates/browser/browser.0.csproj +++ b/src/mono/wasm/templates/templates/browser/browser.0.csproj @@ -7,6 +7,6 @@ - + From 1dccd9ea6aecfb7bb2adc502e3179f3c6d8b36a2 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 3 May 2023 02:51:14 +0000 Subject: [PATCH 05/12] [wasi] Remove WebAssembly.Pack reference --- .../WorkloadManifest.json.in | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.json.in b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.json.in index c7ced02a5e1478..43556dbf37d1ae 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.json.in +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.json.in @@ -28,7 +28,6 @@ "wasi-experimental": { "description": ".NET WASI experimental", "packs": [ - "Microsoft.NET.Sdk.WebAssembly.Pack", "Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk", "Microsoft.NETCore.App.Runtime.Mono.wasi-wasm", "Microsoft.NET.Runtime.WebAssembly.Templates" From 24173df3b3250ee3363ab1c344fd3a747f44959a Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 3 May 2023 05:59:21 +0000 Subject: [PATCH 06/12] wip --- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 24 +++++++++++-------- .../Wasm.Build.Tests/WasmTemplateTests.cs | 3 ++- .../templates/browser/browser.0.csproj | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index 1882f3ccee0f26..124c937daf8d9a 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -428,7 +428,7 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp { AssertRuntimePackPath(result.buildOutput, options.TargetFramework ?? DefaultTargetFramework); - string bundleDir = Path.Combine(GetBinDir(config: buildArgs.Config, targetFramework: options.TargetFramework ?? DefaultTargetFramework), + string bundleDir = Path.Combine(GetBinDir(config: buildArgs.Config, targetFramework: options.TargetFramework ?? DefaultTargetFramework, isPublish: options.Publish), options.IsBrowserTemplateProject ? "wwwroot" : "AppBundle"); AssertBasicAppBundle(bundleDir, buildArgs.ProjectName, @@ -633,8 +633,6 @@ protected void AssertDotNetNativeFiles(NativeFilesType type, string config, bool AssertNotSameFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.wasm"), Path.Combine(binFrameworkDir, "dotnet.wasm"), label); AssertNotSameFile(Path.Combine(s_buildEnv.GetRuntimeNativeDir(targetFramework), "dotnet.js"), dotnetJsPath!, label); } - - AssertIcuAssets(binFrameworkDir, GlobalizationMode.FullIcu, ""); } static void AssertRuntimePackPath(string buildOutput, string targetFramework) @@ -668,22 +666,19 @@ protected static void AssertBasicAppBundle(string bundleDir, "dotnet.js" }; - Console.WriteLine ($"AssertBasicAppBundle: isPub:{isPublish}"); // FIXME: um.. does this apply to all the templates? if (isPublish) - { filesToExist.Add(Path.Combine(bundleDir, mainJS)); - } string managedDir; if (fromTemplate == WasmTemplate.wasmbrowser) { + if (isPublish) + filesToExist.Add(Path.Combine(bundleDir, "index.html")); bundleDir = Path.Combine(bundleDir, "_framework"); managedDir = bundleDir; filesToExist.Add("blazor.boot.json"); - if (isPublish) - filesToExist.Add("index.html"); } else { @@ -724,6 +719,7 @@ protected static void AssertBasicAppBundle(string bundleDir, protected static void AssertIcuAssets(string bundleDir, GlobalizationMode? globalizationMode, string predefinedIcudt) { + Console.WriteLine ($"AssertIcuAssets: mode: {globalizationMode}, predef: {predefinedIcudt}"); bool expectEFIGS = false; bool expectCJK = false; bool expectNOCJK = false; @@ -734,6 +730,10 @@ protected static void AssertIcuAssets(string bundleDir, GlobalizationMode? globa break; case GlobalizationMode.FullIcu: expectFULL = true; + // Bug: all the files are deployed currently for blazor, and wasmbrowser case + expectCJK = true; + expectEFIGS = true; + expectNOCJK = true; break; case GlobalizationMode.PredefinedIcu: if (string.IsNullOrEmpty(predefinedIcudt)) @@ -761,6 +761,8 @@ protected static void AssertIcuAssets(string bundleDir, GlobalizationMode? globa expectCJK = true; expectEFIGS = true; expectNOCJK = true; + // Bug: all the files are deployed currently for blazor, and wasmbrowser case + expectFULL = true; break; } // FIXME: AJ: open an issue @@ -853,6 +855,8 @@ protected void AssertBlazorBundle(string config, bool isPublish, bool dotnetWasm dotnetJsPath!, "Expected dotnet.js to be same as the runtime pack", same: dotnetWasmFromRuntimePack); + + AssertIcuAssets(binFrameworkDir, GlobalizationMode.FullIcu, ""); } protected void AssertBlazorBootJson(string config, bool isPublish, string targetFramework = DefaultTargetFrameworkForBlazor, string? binFrameworkDir=null) @@ -896,11 +900,11 @@ private string FindSubDirIgnoringCase(string parentDir, string dirName) return first ?? Path.Combine(parentDir, dirName); } - protected string GetBinDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null) + protected string GetBinDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null, bool isPublish=false) { var dir = baseDir ?? _projectDir; Assert.NotNull(dir); - return Path.Combine(dir!, "bin", config, targetFramework, "browser-wasm"); + return Path.Combine(dir!, "bin", config, targetFramework, "browser-wasm", isPublish ? "publish" : string.Empty); } protected string GetObjDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null) diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs index c7a99700c99e8f..aa5a3c5addb800 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs @@ -127,7 +127,8 @@ public void BrowserBuildThenPublish(string config) UseCache: false, FromTemplate: WasmTemplate.wasmbrowser)); - AssertDotNetJsSymbols(Path.Combine(GetBinDir(config), "wwwroot"), fromRuntimePack: !expectRelinking, targetFramework: DefaultTargetFramework); + // FIXME: AJ: no dotnet.js.symbols in wasmbrowser yet + //AssertDotNetJsSymbols(Path.Combine(GetBinDir(config, isPublish: true), "wwwroot"), fromRuntimePack: !expectRelinking, targetFramework: DefaultTargetFramework); } [Theory] diff --git a/src/mono/wasm/templates/templates/browser/browser.0.csproj b/src/mono/wasm/templates/templates/browser/browser.0.csproj index c4181b52c56b06..d2d3164e7bfc0b 100644 --- a/src/mono/wasm/templates/templates/browser/browser.0.csproj +++ b/src/mono/wasm/templates/templates/browser/browser.0.csproj @@ -7,6 +7,6 @@ - + From 308bdc72d9c919c016cec8b6941e4908e90af2d2 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 3 May 2023 19:56:09 +0000 Subject: [PATCH 07/12] wip --- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index 124c937daf8d9a..1381f91d1f1763 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -428,8 +428,14 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp { AssertRuntimePackPath(result.buildOutput, options.TargetFramework ?? DefaultTargetFramework); - string bundleDir = Path.Combine(GetBinDir(config: buildArgs.Config, targetFramework: options.TargetFramework ?? DefaultTargetFramework, isPublish: options.Publish), - options.IsBrowserTemplateProject ? "wwwroot" : "AppBundle"); + string bundleDir = GetBinDir(config: buildArgs.Config, + targetFramework: options.TargetFramework ?? DefaultTargetFramework); + + if (options.IsTemplateUsingWasmSdk) + bundleDir = Path.Combine(bundleDir, options.Publish ? "publish" : string.Empty, "wwwroot"); + else + bundleDir = Path.Combine(bundleDir, "AppBundle"); + AssertBasicAppBundle(bundleDir, buildArgs.ProjectName, buildArgs.Config, @@ -694,7 +700,7 @@ protected static void AssertBasicAppBundle(string bundleDir, AssertFilesExist(bundleDir, filesToExist); AssertFilesExist(bundleDir, new[] { "run-v8.sh" }, expectToExist: hasV8Script); - AssertIcuAssets(bundleDir, globalizationMode, predefinedIcudt); + AssertIcuAssets(bundleDir, globalizationMode, predefinedIcudt, fromTemplate); string bundledMainAppAssembly = useWebcil ? $"{projectName}.webcil" : $"{projectName}.dll"; @@ -717,7 +723,7 @@ protected static void AssertBasicAppBundle(string bundleDir, AssertDotNetWasmJs(bundleDir, fromRuntimePack: dotnetWasmFromRuntimePack, targetFramework); } - protected static void AssertIcuAssets(string bundleDir, GlobalizationMode? globalizationMode, string predefinedIcudt) + protected static void AssertIcuAssets(string bundleDir, GlobalizationMode? globalizationMode, string predefinedIcudt, WasmTemplate fromTemplate) { Console.WriteLine ($"AssertIcuAssets: mode: {globalizationMode}, predef: {predefinedIcudt}"); bool expectEFIGS = false; @@ -730,10 +736,13 @@ protected static void AssertIcuAssets(string bundleDir, GlobalizationMode? globa break; case GlobalizationMode.FullIcu: expectFULL = true; - // Bug: all the files are deployed currently for blazor, and wasmbrowser case - expectCJK = true; - expectEFIGS = true; - expectNOCJK = true; + if (fromTemplate == WasmTemplate.wasmbrowser || fromTemplate == WasmTemplate.blazorwasm) + { + // Bug: all the files are deployed currently for blazor, and wasmbrowser case + expectCJK = true; + expectEFIGS = true; + expectNOCJK = true; + } break; case GlobalizationMode.PredefinedIcu: if (string.IsNullOrEmpty(predefinedIcudt)) @@ -761,8 +770,11 @@ protected static void AssertIcuAssets(string bundleDir, GlobalizationMode? globa expectCJK = true; expectEFIGS = true; expectNOCJK = true; - // Bug: all the files are deployed currently for blazor, and wasmbrowser case - expectFULL = true; + if (fromTemplate == WasmTemplate.wasmbrowser || fromTemplate == WasmTemplate.blazorwasm) + { + // Bug: all the files are deployed currently for blazor, and wasmbrowser case + expectFULL = true; + } break; } // FIXME: AJ: open an issue @@ -856,7 +868,7 @@ protected void AssertBlazorBundle(string config, bool isPublish, bool dotnetWasm "Expected dotnet.js to be same as the runtime pack", same: dotnetWasmFromRuntimePack); - AssertIcuAssets(binFrameworkDir, GlobalizationMode.FullIcu, ""); + AssertIcuAssets(binFrameworkDir, GlobalizationMode.FullIcu, "", WasmTemplate.blazorwasm); } protected void AssertBlazorBootJson(string config, bool isPublish, string targetFramework = DefaultTargetFrameworkForBlazor, string? binFrameworkDir=null) @@ -900,11 +912,11 @@ private string FindSubDirIgnoringCase(string parentDir, string dirName) return first ?? Path.Combine(parentDir, dirName); } - protected string GetBinDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null, bool isPublish=false) + protected string GetBinDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null) { var dir = baseDir ?? _projectDir; Assert.NotNull(dir); - return Path.Combine(dir!, "bin", config, targetFramework, "browser-wasm", isPublish ? "publish" : string.Empty); + return Path.Combine(dir!, "bin", config, targetFramework, "browser-wasm"); } protected string GetObjDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null) @@ -1261,7 +1273,7 @@ public record BuildProjectOptions IDictionary? ExtraBuildEnvironmentVariables = null ) { - public bool IsBrowserTemplateProject => FromTemplate == WasmTemplate.wasmbrowser; + public bool IsTemplateUsingWasmSdk => FromTemplate == WasmTemplate.wasmbrowser || FromTemplate == WasmTemplate.blazorwasm; } public record BlazorBuildOptions @@ -1287,7 +1299,8 @@ public enum WasmTemplate wasmconsole, wasmbrowser, wasmbrowser_legacy, - wasiconsole + wasiconsole, + blazorwasm }; public enum NativeFilesType { FromRuntimePack, Relinked, AOT }; From 00d621f2a1d9dc4d738cb5db94b02e56375baa9c Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 3 May 2023 20:08:00 +0000 Subject: [PATCH 08/12] disable non-wasm builds --- eng/pipelines/common/platform-matrix.yml | 788 ----------------------- 1 file changed, 788 deletions(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 15529c28b36f3d..7ee6c61eeb3ffd 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -24,406 +24,6 @@ parameters: jobs: -# Linux arm -- ${{ if or(containsValue(parameters.platforms, 'linux_arm'), in(parameters.platformGroup, 'all', 'gcstress')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: arm - targetRid: linux-arm - platform: linux_arm - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_arm - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux armv6 -- ${{ if containsValue(parameters.platforms, 'linux_armv6') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: armv6 - targetRid: linux-armv6 - platform: linux_armv6 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_armv6 - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux arm64 - -- ${{ if or(containsValue(parameters.platforms, 'linux_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: arm64 - targetRid: linux-arm64 - platform: linux_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - ${{ if eq(parameters.container, '') }}: - container: linux_arm64 - ${{ if ne(parameters.container, '') }}: - container: - image: ${{ parameters.container }} - registry: mcr - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux musl x64 - -- ${{ if or(containsValue(parameters.platforms, 'linux_musl_x64'), eq(parameters.platformGroup, 'all')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - osSubgroup: _musl - archType: x64 - targetRid: linux-musl-x64 - platform: linux_musl_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_musl_x64 - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux musl arm - -- ${{ if or(containsValue(parameters.platforms, 'linux_musl_arm'), eq(parameters.platformGroup, 'all')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - osSubgroup: _musl - archType: arm - targetRid: linux-musl-arm - platform: linux_musl_arm - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_musl_arm - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux musl arm64 - -- ${{ if or(containsValue(parameters.platforms, 'linux_musl_arm64'), eq(parameters.platformGroup, 'all')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - osSubgroup: _musl - archType: arm64 - targetRid: linux-musl-arm64 - platform: linux_musl_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_musl_arm64 - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux Bionic arm64 - -- ${{ if containsValue(parameters.platforms, 'linux_bionic_arm64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - osSubgroup: _bionic - archType: arm64 - targetRid: linux-bionic-arm64 - platform: linux_bionic_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_bionic - jobParameters: - runtimeFlavor: mono - # We build on Linux, but the test queue runs Windows, so - # we need to override the test script generation - runScriptWindowsCmd: true - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux Bionic x64 - -- ${{ if containsValue(parameters.platforms, 'linux_bionic_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - osSubgroup: _bionic - archType: x64 - targetRid: linux-bionic-x64 - platform: linux_bionic_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_bionic - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux x64 - -- ${{ if or(containsValue(parameters.platforms, 'linux_x64'), containsValue(parameters.platforms, 'CoreClrTestBuildHost'), in(parameters.platformGroup, 'all', 'gcstress')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: x64 - targetRid: linux-x64 - platform: linux_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - ${{ if eq(parameters.container, '') }}: - container: linux_x64 - ${{ if ne(parameters.container, '') }}: - container: - image: ${{ parameters.container }} - registry: mcr - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux x86 - -- ${{ if containsValue(parameters.platforms, 'linux_x86') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: x86 - targetRid: linux-x86 - platform: linux_x86 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_x86 - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - disableClrTest: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Centos 7 x64 Source Build - -- ${{ if containsValue(parameters.platforms, 'SourceBuild_centos7_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: x64 - targetRid: centos.7-x64 - platform: centos7_linux_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: - image: centos-7-source-build - registry: mcr - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - isSourceBuild: true - isNonPortableSourceBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Non-existent RID Source Build - -- ${{ if containsValue(parameters.platforms, 'SourceBuild_banana24_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: x64 - targetRid: banana.24-x64 - platform: banana24_linux_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: - image: centos-7-source-build-20210714125450-5d87b80 - registry: mcr - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - isSourceBuild: true - isNonPortableSourceBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Portable Linux x64 Source Build - -- ${{ if containsValue(parameters.platforms, 'SourceBuild_linux_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: x64 - targetRid: linux-x64 - platform: linux_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: SourceBuild_linux_x64 - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - isSourceBuild: true - isNonPortableSourceBuild: false - ${{ insert }}: ${{ parameters.jobParameters }} - -# GCC Linux x64 Build - -- ${{ if containsValue(parameters.platforms, 'gcc_linux_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: x64 - targetRid: linux-x64 - platform: linux_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: debian-11-gcc12-amd64 - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - compilerName: gcc - ${{ insert }}: ${{ parameters.jobParameters }} - -# Mono LLVMAot test build - -- ${{ if containsValue(parameters.platforms, 'linux_x64_llvmaot') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: x64 - targetRid: linux-x64 - platform: linux_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_x64_llvmaot - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux s390x - -- ${{ if containsValue(parameters.platforms, 'linux_s390x') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: s390x - targetRid: linux-s390x - platform: linux_s390x - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_s390x - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux PPC64le - -- ${{ if containsValue(parameters.platforms, 'linux_ppc64le') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: ppc64le - targetRid: linux-ppc64le - platform: linux_ppc64le - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_ppc64le - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Linux RISCV64 - -- ${{ if containsValue(parameters.platforms, 'linux_riscv64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: linux - archType: riscv64 - targetRid: linux-riscv64 - platform: linux_riscv64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_riscv64 - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - disableClrTest: true - ${{ insert }}: ${{ parameters.jobParameters }} - # WASI WebAssembly - ${{ if containsValue(parameters.platforms, 'wasi_wasm') }}: @@ -523,391 +123,3 @@ jobs: runtimeFlavor: ${{ parameters.runtimeFlavor }} buildConfig: ${{ parameters.buildConfig }} ${{ insert }}: ${{ parameters.jobParameters }} - -# FreeBSD -- ${{ if containsValue(parameters.platforms, 'freebsd_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: freebsd - archType: x64 - targetRid: freebsd-x64 - platform: freebsd_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: freebsd_x64 - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Android x64 - -- ${{ if containsValue(parameters.platforms, 'android_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: android - archType: x64 - targetRid: android-x64 - platform: android_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_bionic - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Android x86 - -- ${{ if containsValue(parameters.platforms, 'android_x86') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: android - archType: x86 - targetRid: android-x86 - platform: android_x86 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_bionic - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Android arm - -- ${{ if containsValue(parameters.platforms, 'android_arm') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: android - archType: arm - targetRid: android-arm - platform: android_arm - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_bionic - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Android arm64 - -- ${{ if containsValue(parameters.platforms, 'android_arm64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: android - archType: arm64 - targetRid: android-arm64 - platform: android_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: linux_bionic - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Mac Catalyst x64 - -- ${{ if containsValue(parameters.platforms, 'maccatalyst_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: maccatalyst - archType: x64 - targetRid: maccatalyst-x64 - platform: maccatalyst_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Mac Catalyst arm64 - -- ${{ if containsValue(parameters.platforms, 'maccatalyst_arm64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: maccatalyst - archType: arm64 - targetRid: maccatalyst-arm64 - platform: maccatalyst_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# tvOS arm64 - -- ${{ if containsValue(parameters.platforms, 'tvos_arm64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: tvos - archType: arm64 - targetRid: tvos-arm64 - platform: tvos_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# tvOS Simulator x64 - -- ${{ if containsValue(parameters.platforms, 'tvossimulator_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: tvossimulator - archType: x64 - targetRid: tvossimulator-x64 - platform: tvossimulator_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# tvOS Simulator arm64 - -- ${{ if containsValue(parameters.platforms, 'tvossimulator_arm64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: tvossimulator - archType: arm64 - targetRid: tvossimulator-arm64 - platform: tvossimulator_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# iOS arm64 - -- ${{ if containsValue(parameters.platforms, 'ios_arm64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: ios - archType: arm64 - targetRid: ios-arm64 - platform: ios_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# iOS Simulator x64 - -- ${{ if containsValue(parameters.platforms, 'iossimulator_x64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: iossimulator - archType: x64 - targetRid: iossimulator-x64 - platform: iossimulator_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# iOS Simulator arm64 - -- ${{ if containsValue(parameters.platforms, 'iossimulator_arm64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: iossimulator - archType: arm64 - targetRid: iossimulator-arm64 - platform: iossimulator_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: mono - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# macOS arm64 - -- ${{ if containsValue(parameters.platforms, 'osx_arm64') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: osx - archType: arm64 - targetRid: osx-arm64 - platform: osx_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# macOS x64 - -- ${{ if or(containsValue(parameters.platforms, 'osx_x64'), eq(parameters.platformGroup, 'all')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: osx - archType: x64 - targetRid: osx-x64 - platform: osx_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Tizen armel - -- ${{ if containsValue(parameters.platforms, 'tizen_armel') }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: tizen - archType: armel - targetRid: tizen-armel - platform: tizen_armel - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: tizen_armel - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true - disableClrTest: true - ${{ insert }}: ${{ parameters.jobParameters }} - -# Windows x64 - -- ${{ if or(containsValue(parameters.platforms, 'windows_x64'), in(parameters.platformGroup, 'all', 'gcstress')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: windows - archType: x64 - targetRid: win-x64 - platform: windows_x64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Windows x86 - -- ${{ if or(containsValue(parameters.platforms, 'windows_x86'), in(parameters.platformGroup, 'all', 'gcstress')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: windows - archType: x86 - targetRid: win-x86 - platform: windows_x86 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Windows arm -- ${{ if or(containsValue(parameters.platforms, 'windows_arm'), eq(parameters.platformGroup, 'all')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: windows - archType: arm - targetRid: win-arm - platform: windows_arm - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} - -# Windows arm64 - -- ${{ if or(containsValue(parameters.platforms, 'windows_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}: - - template: xplat-setup.yml - parameters: - jobTemplate: ${{ parameters.jobTemplate }} - helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} - variables: ${{ parameters.variables }} - osGroup: windows - archType: arm64 - targetRid: win-arm64 - platform: windows_arm64 - shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - jobParameters: - runtimeFlavor: ${{ parameters.runtimeFlavor }} - buildConfig: ${{ parameters.buildConfig }} - helixQueueGroup: ${{ parameters.helixQueueGroup }} - ${{ insert }}: ${{ parameters.jobParameters }} From 8e132ce3e6779dcb749c9fa30f87943c8cfe61de Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 3 May 2023 20:25:49 +0000 Subject: [PATCH 09/12] disable non-wbt jobs --- eng/pipelines/runtime.yml | 182 +++++++++++++++++++------------------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 4ad81e6c23d7bd..fd05714340de66 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -408,51 +408,51 @@ extends: # # WebAssembly legs # - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm - alwaysRun: ${{ variables.isRollingBuild }} - scenarios: - - normal - - WasmTestOnBrowser - - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm_win - alwaysRun: ${{ variables.isRollingBuild }} - scenarios: - - WasmTestOnBrowser - - # EAT Library tests - only run on linux - - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml - parameters: - platforms: - - browser_wasm - nameSuffix: _EAT - runAOT: false - shouldRunSmokeOnly: false - alwaysRun: ${{ variables.isRollingBuild }} - - # AOT Library tests - - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml - parameters: - platforms: - - browser_wasm - nameSuffix: _AOT - runAOT: true - shouldRunSmokeOnly: true - alwaysRun: ${{ variables.isRollingBuild }} - - - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml - parameters: - platforms: - - browser_wasm_win - nameSuffix: _AOT - runAOT: true - shouldRunSmokeOnly: true - alwaysRun: ${{ variables.isRollingBuild }} + #- template: /eng/pipelines/common/templates/wasm-library-tests.yml + #parameters: + #platforms: + #- browser_wasm + #alwaysRun: ${{ variables.isRollingBuild }} + #scenarios: + #- normal + #- WasmTestOnBrowser + + #- template: /eng/pipelines/common/templates/wasm-library-tests.yml + #parameters: + #platforms: + #- browser_wasm_win + #alwaysRun: ${{ variables.isRollingBuild }} + #scenarios: + #- WasmTestOnBrowser + + ## EAT Library tests - only run on linux + #- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml + #parameters: + #platforms: + #- browser_wasm + #nameSuffix: _EAT + #runAOT: false + #shouldRunSmokeOnly: false + #alwaysRun: ${{ variables.isRollingBuild }} + + ## AOT Library tests + #- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml + #parameters: + #platforms: + #- browser_wasm + #nameSuffix: _AOT + #runAOT: true + #shouldRunSmokeOnly: true + #alwaysRun: ${{ variables.isRollingBuild }} + + #- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml + #parameters: + #platforms: + #- browser_wasm_win + #nameSuffix: _AOT + #runAOT: true + #shouldRunSmokeOnly: true + #alwaysRun: ${{ variables.isRollingBuild }} # Wasm.Build.Tests - template: /eng/pipelines/common/templates/wasm-build-tests.yml @@ -463,61 +463,61 @@ extends: alwaysRun: ${{ variables.isRollingBuild }} # Wasm Debugger tests - - template: /eng/pipelines/common/templates/wasm-debugger-tests.yml - parameters: - platforms: - - browser_wasm - - browser_wasm_win - alwaysRun: ${{ variables.isRollingBuild }} - - # Wasm runtime tests - - template: /eng/pipelines/common/templates/wasm-runtime-tests.yml - parameters: - platforms: - - browser_wasm - alwaysRun: ${{ variables.isRollingBuild }} - - # Build and Smoke Tests only - Wasm Threading Legs - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm - nameSuffix: _Threading_Smoke - extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:_WasmPThreadPoolSize=8 - shouldRunSmokeOnly: true - alwaysRun: ${{ variables.isRollingBuild }} - scenarios: - - WasmTestOnBrowser - - - template: /eng/pipelines/common/templates/wasm-build-only.yml - parameters: - platforms: - - browser_wasm - nameSuffix: _Threading_PerfTracing - extraBuildArgs: /p:MonoWasmBuildVariant=perftrace - alwaysRun: ${{ variables.isRollingBuild }} + #- template: /eng/pipelines/common/templates/wasm-debugger-tests.yml + #parameters: + #platforms: + #- browser_wasm + #- browser_wasm_win + #alwaysRun: ${{ variables.isRollingBuild }} + + ## Wasm runtime tests + #- template: /eng/pipelines/common/templates/wasm-runtime-tests.yml + #parameters: + #platforms: + #- browser_wasm + #alwaysRun: ${{ variables.isRollingBuild }} + + ## Build and Smoke Tests only - Wasm Threading Legs + #- template: /eng/pipelines/common/templates/wasm-library-tests.yml + #parameters: + #platforms: + #- browser_wasm + #nameSuffix: _Threading_Smoke + #extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:_WasmPThreadPoolSize=8 + #shouldRunSmokeOnly: true + #alwaysRun: ${{ variables.isRollingBuild }} + #scenarios: + #- WasmTestOnBrowser + + #- template: /eng/pipelines/common/templates/wasm-build-only.yml + #parameters: + #platforms: + #- browser_wasm + #nameSuffix: _Threading_PerfTracing + #extraBuildArgs: /p:MonoWasmBuildVariant=perftrace + #alwaysRun: ${{ variables.isRollingBuild }} # WASI/WASM - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - wasi_wasm - - wasi_wasm_win - nameSuffix: '_Smoke' - extraBuildArgs: /p:EnableAggressiveTrimming=true /p:RunWasmSamples=true - shouldContinueOnError: true - shouldRunSmokeOnly: true - alwaysRun: ${{ variables.isRollingBuild }} - scenarios: - - normal + #- template: /eng/pipelines/common/templates/wasm-library-tests.yml + #parameters: + #platforms: + #- wasi_wasm + #- wasi_wasm_win + #nameSuffix: '_Smoke' + #extraBuildArgs: /p:EnableAggressiveTrimming=true /p:RunWasmSamples=true + #shouldContinueOnError: true + #shouldRunSmokeOnly: true + #alwaysRun: ${{ variables.isRollingBuild }} + #scenarios: + #- normal - template: /eng/pipelines/common/templates/wasm-build-tests.yml parameters: platforms: - wasi_wasm - wasi_wasm_win - alwaysRun: ${{ variables.isRollingBuild }} + alwaysRun: true # # iOS/tvOS devices - Full AOT + AggressiveTrimming to reduce size From a0dbd8f7ae525a7931a7b81172a3b751ea98480d Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 3 May 2023 20:59:07 +0000 Subject: [PATCH 10/12] wip --- src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs index 013b5d5c5a3aaa..d24ab15240d88f 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs @@ -26,7 +26,7 @@ private void UpdateBrowserMainJs(string targetFramework) string mainJsPath = Path.Combine(_projectDir!, "main.js"); string mainJsContent = File.ReadAllText(mainJsPath); - // FIXME: withConsoleForwarding - use only with wasm app host + // .withConsoleForwarding - use only with WasmAppHost // .withExitOnUnhandledError() is available only only >net7.0 mainJsContent = mainJsContent.Replace(".create()", targetFramework == "net8.0" From 7395196b06b95b0fc13e2f9806a2a89772d013e4 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 4 May 2023 01:16:52 +0000 Subject: [PATCH 11/12] wip --- .../Sdk/Sdk.props | 1 + .../Sdk/Sdk.targets | 4 +- .../WorkloadManifest.targets.in | 4 +- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 56 ++++++++++++------- .../WasmLegacyTemplateTests.cs | 4 +- .../Wasm.Build.Tests/WasmTemplateTests.cs | 12 ++-- 6 files changed, 51 insertions(+), 30 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.props b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.props index a41609b5c15a65..080265ffdf6b69 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.props +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.props @@ -17,4 +17,5 @@ Copyright (c) .NET Foundation. All rights reserved. <_WebAssemblyPropsFile>$(MSBuildThisFileDirectory)\Microsoft.NET.Sdk.WebAssembly.Browser.props <_WebAssemblyTargetsFile>$(MSBuildThisFileDirectory)\Microsoft.NET.Sdk.WebAssembly.Browser.targets + diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.targets index df15f880ba1b39..62bf568a23a7dc 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/Sdk/Sdk.targets @@ -9,4 +9,6 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> - + + + diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in index 1f7bfc7f911793..bd6cd13541eb07 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in @@ -123,8 +123,8 @@ - - + + diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index 1381f91d1f1763..47419d314836d1 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -374,16 +374,7 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp if (options.CreateProject) { - InitPaths(id); - InitProjectDir(_projectDir); - options.InitProject?.Invoke(); - - File.WriteAllText(Path.Combine(_projectDir, $"{buildArgs.ProjectName}.csproj"), buildArgs.ProjectFileContents); - File.Copy(Path.Combine(AppContext.BaseDirectory, - options.TargetFramework == "net8.0" ? "test-main.js" : "data/test-main-7.0.js"), - Path.Combine(_projectDir, "test-main.js")); - - File.WriteAllText(Path.Combine(_projectDir!, "index.html"), @""); + CreateProject(id, buildArgs, options); } else if (_projectDir is null) { @@ -429,7 +420,8 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp AssertRuntimePackPath(result.buildOutput, options.TargetFramework ?? DefaultTargetFramework); string bundleDir = GetBinDir(config: buildArgs.Config, - targetFramework: options.TargetFramework ?? DefaultTargetFramework); + targetFramework: options.TargetFramework ?? DefaultTargetFramework, + usesWasmSdk: options.IsTemplateUsingWasmSdk); if (options.IsTemplateUsingWasmSdk) bundleDir = Path.Combine(bundleDir, options.Publish ? "publish" : string.Empty, "wwwroot"); @@ -451,18 +443,43 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp } if (options.UseCache) - _buildContext.CacheBuild(buildArgs, new BuildProduct(_projectDir, logFilePath, true, result.buildOutput)); + _buildContext.CacheBuild(buildArgs, new BuildProduct(_projectDir!, logFilePath, true, result.buildOutput)); - return (_projectDir, result.buildOutput); + return (_projectDir!, result.buildOutput); } catch (Exception ex) { if (options.UseCache) - _buildContext.CacheBuild(buildArgs, new BuildProduct(_projectDir, logFilePath, false, $"The build attempt resulted in exception: {ex}.")); + _buildContext.CacheBuild(buildArgs, new BuildProduct(_projectDir!, logFilePath, false, $"The build attempt resulted in exception: {ex}.")); throw; } } + protected void CreateProject(string id, BuildArgs buildArgs, BuildProjectOptions options) + { + if (options.FromTemplate == WasmTemplate.wasmbrowser) + { + CreateWasmTemplateProject(id, template: "wasmbrowser", buildArgs.ExtraBuildArgs ?? string.Empty); + File.Copy(Path.Combine(AppContext.BaseDirectory, + options.TargetFramework == "net8.0" ? "test-main.js" : "data/test-main-7.0.js"), + Path.Combine(_projectDir!, "wwwroot", "test-main.js")); + File.Move(Path.Combine(_projectDir!, $"{id}.csproj"), Path.Combine(_projectDir!, $"{buildArgs.ProjectName}.csproj")); + } + else + { + InitPaths(id); + InitProjectDir(_projectDir); + options.InitProject?.Invoke(); + + File.WriteAllText(Path.Combine(_projectDir, $"{buildArgs.ProjectName}.csproj"), buildArgs.ProjectFileContents); + File.Copy(Path.Combine(AppContext.BaseDirectory, + options.TargetFramework == "net8.0" ? "test-main.js" : "data/test-main-7.0.js"), + Path.Combine(_projectDir, "test-main.js")); + + File.WriteAllText(Path.Combine(_projectDir!, "index.html"), @""); + } + } + public void InitBlazorWasmProjectDir(string id, string targetFramework = DefaultTargetFrameworkForBlazor) { InitPaths(id); @@ -809,7 +826,7 @@ protected static void AssertFilesExist(string dir, IEnumerable filenames { string prefix = label != null ? $"{label}: " : string.Empty; if (!Directory.Exists(dir)) - throw new XunitException($"[{label}] {dir} not found"); + throw new XunitException($"[{label}] {dir} directory not found"); foreach (string filename in filenames) { string path = Path.IsPathRooted(filename) ? filename : Path.Combine(dir, filename); @@ -912,11 +929,11 @@ private string FindSubDirIgnoringCase(string parentDir, string dirName) return first ?? Path.Combine(parentDir, dirName); } - protected string GetBinDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null) + protected string GetBinDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null, bool usesWasmSdk=false) { var dir = baseDir ?? _projectDir; Assert.NotNull(dir); - return Path.Combine(dir!, "bin", config, targetFramework, "browser-wasm"); + return Path.Combine(dir!, "bin", config, targetFramework, usesWasmSdk ? string.Empty : "browser-wasm"); } protected string GetObjDir(string config, string targetFramework=DefaultTargetFramework, string? baseDir=null) @@ -1264,16 +1281,17 @@ public record BuildProjectOptions bool CreateProject = true, bool Publish = true, bool BuildOnlyAfterPublish = true, - bool HasV8Script = true, + // bool HasV8Script = true, string? Verbosity = null, string? Label = null, string? TargetFramework = null, string? MainJS = null, - WasmTemplate FromTemplate = WasmTemplate.none, + WasmTemplate FromTemplate = WasmTemplate.wasmbrowser, IDictionary? ExtraBuildEnvironmentVariables = null ) { public bool IsTemplateUsingWasmSdk => FromTemplate == WasmTemplate.wasmbrowser || FromTemplate == WasmTemplate.blazorwasm; + public bool HasV8Script => !IsTemplateUsingWasmSdk && FromTemplate != WasmTemplate.wasmbrowser_legacy && FromTemplate != WasmTemplate.wasmconsole; } public record BlazorBuildOptions diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs index d24ab15240d88f..bf95a1b98f9607 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmLegacyTemplateTests.cs @@ -71,7 +71,7 @@ public void BrowserBuildThenPublish(string config) new BuildProjectOptions( DotnetWasmFromRuntimePack: true, CreateProject: false, - HasV8Script: false, + // HasV8Script: false, MainJS: "main.js", Publish: false, TargetFramework: DefaultTargetFramework, @@ -94,7 +94,7 @@ public void BrowserBuildThenPublish(string config) new BuildProjectOptions( DotnetWasmFromRuntimePack: !expectRelinking, CreateProject: false, - HasV8Script: false, + // HasV8Script: false, MainJS: "main.js", Publish: true, TargetFramework: DefaultTargetFramework, diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs index aa5a3c5addb800..2e28809c247a8b 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs @@ -97,7 +97,7 @@ public void BrowserBuildThenPublish(string config) new BuildProjectOptions( DotnetWasmFromRuntimePack: true, CreateProject: false, - HasV8Script: false, + // HasV8Script: false, MainJS: "main.js", Publish: false, TargetFramework: DefaultTargetFramework, @@ -120,7 +120,7 @@ public void BrowserBuildThenPublish(string config) new BuildProjectOptions( DotnetWasmFromRuntimePack: !expectRelinking, CreateProject: false, - HasV8Script: false, + // HasV8Script: false, MainJS: "main.js", Publish: true, TargetFramework: BuildTestBase.DefaultTargetFramework, @@ -150,7 +150,7 @@ public void ConsoleBuildThenPublish(string config) new BuildProjectOptions( DotnetWasmFromRuntimePack: true, CreateProject: false, - HasV8Script: false, + // HasV8Script: false, MainJS: "main.mjs", Publish: false, TargetFramework: BuildTestBase.DefaultTargetFramework, @@ -176,7 +176,7 @@ public void ConsoleBuildThenPublish(string config) new BuildProjectOptions( DotnetWasmFromRuntimePack: !expectRelinking, CreateProject: false, - HasV8Script: false, + // HasV8Script: false, MainJS: "main.mjs", Publish: true, TargetFramework: BuildTestBase.DefaultTargetFramework, @@ -220,7 +220,7 @@ private void ConsoleBuildAndRun(string config, bool relinking, string extraNewAr new BuildProjectOptions( DotnetWasmFromRuntimePack: !relinking, CreateProject: false, - HasV8Script: false, + // HasV8Script: false, MainJS: "main.mjs", Publish: false, TargetFramework: expectedTFM, @@ -392,7 +392,7 @@ public void ConsolePublishAndRun(string config, bool aot, bool relinking) new BuildProjectOptions( DotnetWasmFromRuntimePack: !expectRelinking, CreateProject: false, - HasV8Script: false, + // HasV8Script: false, MainJS: "main.mjs", Publish: true, TargetFramework: BuildTestBase.DefaultTargetFramework, From 745ab31c7fb01f353d36eb1ef2f2ba4b092d0940 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 4 May 2023 01:32:22 +0000 Subject: [PATCH 12/12] wip --- eng/testing/workloads-testing.targets | 7 +++++ src/mono/wasm/Wasm.Build.Tests/WasmSdk.props | 29 +++++++++++++++++++ .../wasm/Wasm.Build.Tests/WasmSdk.targets | 16 ++++++++++ 3 files changed, 52 insertions(+) create mode 100644 src/mono/wasm/Wasm.Build.Tests/WasmSdk.props create mode 100644 src/mono/wasm/Wasm.Build.Tests/WasmSdk.targets diff --git a/eng/testing/workloads-testing.targets b/eng/testing/workloads-testing.targets index 541e476fad3d9a..49180f0b4bd5e5 100644 --- a/eng/testing/workloads-testing.targets +++ b/eng/testing/workloads-testing.targets @@ -77,6 +77,13 @@ + + <_WasmSdkProps Include="$(_SdkWithNoWorkloadPath)\sdk\**\Microsoft.NET.Sdk.WebAssembly\Sdk\Sdk.props" /> + <_WasmSdkTargets Include="$(_SdkWithNoWorkloadPath)\sdk\**\Microsoft.NET.Sdk.WebAssembly\Sdk\Sdk.targets" /> + + + + diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSdk.props b/src/mono/wasm/Wasm.Build.Tests/WasmSdk.props new file mode 100644 index 00000000000000..831955a0c9ce1d --- /dev/null +++ b/src/mono/wasm/Wasm.Build.Tests/WasmSdk.props @@ -0,0 +1,29 @@ + + + + + true + true + + + browser-wasm + true + + <_WasmSdkImportsMicrosoftNETSdkPublish Condition="'$(UsingMicrosoftNETSdkPublish)' != 'true'">true + <_WasmSdkImportsMicrosoftNETSdkStaticWebAssets Condition="'$(UsingMicrosoftNETSdkStaticWebAssets)' != 'true'">true + + + + + + diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSdk.targets b/src/mono/wasm/Wasm.Build.Tests/WasmSdk.targets new file mode 100644 index 00000000000000..b843a3024d53e0 --- /dev/null +++ b/src/mono/wasm/Wasm.Build.Tests/WasmSdk.targets @@ -0,0 +1,16 @@ + + + + + +