From 811f5bba4b66e5177642f0b02238b8f84e27e235 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Mon, 30 Oct 2023 12:43:23 +0100 Subject: [PATCH 1/7] Fix --- src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs | 5 ++++- src/mono/wasm/build/WasmApp.Native.targets | 2 +- src/tasks/AotCompilerTask/MonoAOTCompiler.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs b/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs index 7ee80b1c435fbe..7056543a39dd56 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs @@ -32,7 +32,10 @@ public class BuildEnvironment public static readonly string RelativeTestAssetsPath = @"..\testassets\"; public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets"); public static readonly string TestDataPath = Path.Combine(AppContext.BaseDirectory, "data"); - public static readonly string TmpPath = Path.Combine(AppContext.BaseDirectory, "wbt"); + // ActiveIssue for Linux/OSx: https://github.com/dotnet/runtime/issues/92335 + public static readonly string TmpPath = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? + Path.Combine(AppContext.BaseDirectory, "wbt artifacts") : + Path.Combine(AppContext.BaseDirectory, "wbt"); public static readonly string DefaultRuntimeIdentifier = #if TARGET_WASI diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index 43428034a93c1e..6f4b748b3fbecf 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -416,7 +416,7 @@ - Date: Mon, 30 Oct 2023 15:55:30 +0100 Subject: [PATCH 2/7] Fix template wbt --- .../wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs index cf626a59ff282d..853454c2740ca6 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs @@ -278,7 +278,7 @@ private async Task BrowserRunTwiceWithAndThenWithoutBuildAsync(string config, st .WithWorkingDirectory(workingDir); await using var runner = new BrowserRunner(_testOutput); - var page = await runner.RunAsync(runCommand, $"run --no-silent -c {config} --project {projectFile} --forward-console"); + var page = await runner.RunAsync(runCommand, $"run --no-silent -c {config} --project \"{projectFile}\" --forward-console"); await runner.WaitForExitMessageAsync(TimeSpan.FromMinutes(2)); Assert.Contains("Hello, Browser!", string.Join(Environment.NewLine, runner.OutputLines)); } @@ -288,7 +288,7 @@ private async Task BrowserRunTwiceWithAndThenWithoutBuildAsync(string config, st .WithWorkingDirectory(workingDir); await using var runner = new BrowserRunner(_testOutput); - var page = await runner.RunAsync(runCommand, $"run --no-silent -c {config} --no-build --project {projectFile} --forward-console"); + var page = await runner.RunAsync(runCommand, $"run --no-silent -c {config} --no-build --project \"{projectFile}\" --forward-console"); await runner.WaitForExitMessageAsync(TimeSpan.FromMinutes(2)); Assert.Contains("Hello, Browser!", string.Join(Environment.NewLine, runner.OutputLines)); } @@ -308,7 +308,7 @@ private Task ConsoleRunWithAndThenWithoutBuildAsync(string config, string extraP string workingDir = runOutsideProjectDirectory ? BuildEnvironment.TmpPath : _projectDir!; { - string runArgs = $"run --no-silent -c {config} --project {projectFile}"; + string runArgs = $"run --no-silent -c {config} --project \"{projectFile}\""; runArgs += " x y z"; using var cmd = new RunCommand(s_buildEnv, _testOutput, label: id) .WithWorkingDirectory(workingDir) @@ -324,7 +324,7 @@ private Task ConsoleRunWithAndThenWithoutBuildAsync(string config, string extraP { // Run with --no-build - string runArgs = $"run --no-silent -c {config} --project {projectFile} --no-build"; + string runArgs = $"run --no-silent -c {config} --project \"{projectFile}\" --no-build"; runArgs += " x y z"; using var cmd = new RunCommand(s_buildEnv, _testOutput, label: id) .WithWorkingDirectory(workingDir); From a4deeea269d8135538ac72a78bb7d179d1e3a544 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Mon, 30 Oct 2023 16:01:06 +0100 Subject: [PATCH 3/7] Fix config wbt. --- src/mono/wasm/Wasm.Build.Tests/ConfigSrcTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/ConfigSrcTests.cs b/src/mono/wasm/Wasm.Build.Tests/ConfigSrcTests.cs index ac71dafe0eb305..329ecbe0b49ca7 100644 --- a/src/mono/wasm/Wasm.Build.Tests/ConfigSrcTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/ConfigSrcTests.cs @@ -32,6 +32,6 @@ public void ConfigSrcAbsolutePath(BuildArgs buildArgs, RunHost host, string id) string bundleDir = Path.Combine(binDir, "AppBundle"); string configSrc = Path.GetFullPath(Path.Combine(bundleDir, "_framework", "blazor.boot.json")); - RunAndTestWasmApp(buildArgs, expectedExitCode: 42, host: host, id: id, extraXHarnessMonoArgs: $"--config-src={configSrc}"); + RunAndTestWasmApp(buildArgs, expectedExitCode: 42, host: host, id: id, extraXHarnessMonoArgs: $"--config-src=\"{configSrc}\""); } } From f52eae6787c1d282109e7004b2ea66accfce04cc Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Mon, 30 Oct 2023 16:43:43 +0100 Subject: [PATCH 4/7] Should fix native wbt but does not. --- src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs b/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs index ef3ed921a70037..ec39d12d173cab 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs @@ -65,7 +65,7 @@ public void IntermediateBitcodeToObjectFilesAreNotLLVMIR(BuildArgs buildArgs, st { string printFileTypeTarget = @" - From 626f434fb5bde36846b81b6b09139172bca3db34 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Tue, 31 Oct 2023 10:39:39 +0100 Subject: [PATCH 5/7] Missing change. --- src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs b/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs index ec39d12d173cab..ac8b567761f36a 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs @@ -65,7 +65,7 @@ public void IntermediateBitcodeToObjectFilesAreNotLLVMIR(BuildArgs buildArgs, st { string printFileTypeTarget = @" - From 4126db58d6e4070b575ba6c1e4be223325877c28 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:53:50 +0100 Subject: [PATCH 6/7] Update src/tasks/AotCompilerTask/MonoAOTCompiler.cs Co-authored-by: Ankit Jain --- src/tasks/AotCompilerTask/MonoAOTCompiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs index 7d22da51109fa3..f0d2ba39eda009 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs @@ -951,7 +951,7 @@ private PrecompileArguments GetPrecompileArgumentsFor(ITaskItem assemblyItem, st if (isDedup) { foreach (var aItem in _assembliesToCompile!) - processArgs.Add('"' + aItem.ItemSpec + '"'); + processArgs.Add($"'{aItem.ItemSpec}'"); } else { From 16c9f782e52a536e5a83f1654aaa3c849bc842d2 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:55:51 +0100 Subject: [PATCH 7/7] Double quotes needed, not single. --- src/tasks/AotCompilerTask/MonoAOTCompiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs index f0d2ba39eda009..0a761b44a4c8f2 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.cs +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.cs @@ -951,7 +951,7 @@ private PrecompileArguments GetPrecompileArgumentsFor(ITaskItem assemblyItem, st if (isDedup) { foreach (var aItem in _assembliesToCompile!) - processArgs.Add($"'{aItem.ItemSpec}'"); + processArgs.Add($"\"{aItem.ItemSpec}\""); } else {