From b661c9bfc6bb8ee9c63d94b0db89c860013b49ac Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Fri, 17 Mar 2023 10:00:11 +0100 Subject: [PATCH 1/3] Fix. --- src/tasks/Common/Utils.cs | 26 +++---------------- .../BlazorWasmBuildPublishTests.cs | 2 +- .../Wasm.Build.Tests/BuildPublishTests.cs | 2 +- .../Wasm.Build.Tests/BuildTestBase.cs | 1 + 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/tasks/Common/Utils.cs b/src/tasks/Common/Utils.cs index 8ed6c2c13711e..4833b4cd19b0c 100644 --- a/src/tasks/Common/Utils.cs +++ b/src/tasks/Common/Utils.cs @@ -64,6 +64,9 @@ static string CreateTemporaryBatchFile(string command) using StreamWriter sw = new(file); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { + // set encoding to UTF-8 -> full Unicode support is needed for usernames - + // `command` contains tmp dir path with the username + sw.WriteLine(@"%SystemRoot%\System32\chcp.com 65001>nul"); sw.WriteLine("setlocal"); sw.WriteLine("set errorlevel=dummy"); sw.WriteLine("set errorlevel="); @@ -187,29 +190,6 @@ public static (int, string) TryRunProcess( return (process.ExitCode, outputBuilder.ToString().Trim('\r', '\n')); } - internal static string CreateTemporaryBatchFile(string command) - { - string extn = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".cmd" : ".sh"; - string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); - - using StreamWriter sw = new(file); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - sw.WriteLine("setlocal"); - sw.WriteLine("set errorlevel=dummy"); - sw.WriteLine("set errorlevel="); - } - else - { - // Use sh rather than bash, as not all 'nix systems necessarily have Bash installed - sw.WriteLine("#!/bin/sh"); - } - - sw.WriteLine(command); - - return file; - } - public static bool CopyIfDifferent(string src, string dst, bool useHash) { if (!File.Exists(src)) diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs index a40ef1fdd6997..09bbcf8e1d024 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs @@ -26,7 +26,7 @@ public BlazorWasmBuildPublishTests(ITestOutputHelper output, SharedBuildPerTestC [InlineData("Release")] public void DefaultTemplate_WithoutWorkload(string config) { - string id = $"blz_no_workload_{config}"; + string id = $"blz_no_workload_{config}{s_unicodeChar}"; CreateBlazorWasmTemplateProject(id); // Build diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildPublishTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildPublishTests.cs index c798c79cd041f..66fed9a630d16 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildPublishTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildPublishTests.cs @@ -25,7 +25,7 @@ public BuildPublishTests(ITestOutputHelper output, SharedBuildPerTestClassFixtur [BuildAndRun(host: RunHost.Chrome, aot: false, config: "Debug")] public void BuildThenPublishNoAOT(BuildArgs buildArgs, RunHost host, string id) { - string projectName = $"build_publish_{buildArgs.Config}"; + string projectName = $"build_publish_{buildArgs.Config}_{s_unicodeChar}"; buildArgs = buildArgs with { ProjectName = projectName }; buildArgs = ExpandBuildArgs(buildArgs); diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs index f0dc3d3457ea9..b8fdd74808859 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs @@ -29,6 +29,7 @@ public abstract class BuildTestBase : IClassFixture Date: Tue, 21 Mar 2023 15:58:34 +0100 Subject: [PATCH 2/3] Applied @pavelsavara's review. --- src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs index b8fdd74808859..4805396442a6c 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs @@ -29,7 +29,7 @@ public abstract class BuildTestBase : IClassFixture Date: Thu, 23 Mar 2023 17:34:43 -0600 Subject: [PATCH 3/3] Update dependencies from https://github.com/dotnet/emsdk build 20230323.1 (#83860) Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100 From Version 7.0.4 -> To Version 7.0.5 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 2 +- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NuGet.config b/NuGet.config index 82b1ce9063aa6..1eaea52495863 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - +