From c9dfa92af89f0a922060288d4eb2886af4190293 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 10:14:34 -0500 Subject: [PATCH 01/33] [automated] Merge branch 'release/9.0' => 'release/9.0-staging' (#116514) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Merged PR 49479: [internal/release/9.0] Fix issue where libhost scenarios (COM, C++/CLI, custom component host) could try to load coreclr from CWD There is a fallback for apps with no .deps.json where the host will consider the app directory for loading coreclr. In component hosting scenarios, we do not have an app path / directory. We were incorrectly going down the path of looking for coreclr next to the empty app directory, which resulted in looking in the current directory. This change skips that path for libhost scenarios. It also adds checks that the paths we determine for loading coreclr, hostpolicy, and hostfxr are absolute. * Delete s390x and ppc64le helix queues (#116537) These queues are non-functional and there is no plan to fix them. Co-authored-by: Jan Kotas --------- Co-authored-by: Elinor Fung Co-authored-by: Mirroring Co-authored-by: Sean Reeser Co-authored-by: David Cantú Co-authored-by: vseanreesermsft <78103370+vseanreesermsft@users.noreply.github.com> Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jan Kotas --- .../libraries/helix-queues-setup.yml | 8 ----- eng/pipelines/runtime-community.yml | 11 ------- .../NativeHosting/Comhost.cs | 29 +++++++++++++++++ .../NativeHosting/Ijwhost.cs | 26 +++++++++++++++ .../LoadAssemblyAndGetFunctionPointer.cs | 32 +++++++++++++++++++ ...ns.cs => NativeHostingResultExtensions.cs} | 19 ++++++++++- .../apphost/standalone/hostfxr_resolver.cpp | 5 +++ .../fxr/standalone/hostpolicy_resolver.cpp | 4 +++ src/native/corehost/fxr_resolver.h | 4 +++ .../corehost/hostpolicy/deps_resolver.cpp | 16 +++++++--- .../standalone/coreclr_resolver.cpp | 4 +++ 11 files changed, 133 insertions(+), 25 deletions(-) rename src/installer/tests/HostActivation.Tests/NativeHosting/{FunctionPointerResultExtensions.cs => NativeHostingResultExtensions.cs} (69%) diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 13b30af22e8682..7b849e1bea38c5 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -75,14 +75,6 @@ jobs: # Limiting interp runs as we don't need as much coverage. - (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 - # Linux s390x - - ${{ if eq(parameters.platform, 'linux_s390x') }}: - - Ubuntu.2004.S390X.Experimental.Open - - # Linux PPC64le - - ${{ if eq(parameters.platform, 'linux_ppc64le') }}: - - Ubuntu.2204.PPC64le.Experimental.Open - # OSX arm64 - ${{ if eq(parameters.platform, 'osx_arm64') }}: - OSX.1200.ARM64.Open diff --git a/eng/pipelines/runtime-community.yml b/eng/pipelines/runtime-community.yml index b7a21f588973c1..446996e505b72b 100644 --- a/eng/pipelines/runtime-community.yml +++ b/eng/pipelines/runtime-community.yml @@ -71,17 +71,6 @@ extends: eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true), eq(variables['isRollingBuild'], true)) - # extra steps, run tests - postBuildSteps: - - template: /eng/pipelines/libraries/helix.yml - parameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - condition: >- - or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isRollingBuild'], true)) # # Build the whole product using Mono diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs index 3d5b902ff1ad4f..f16e4e1d0e8e7a 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs @@ -111,6 +111,35 @@ public void ActivateClass_IgnoreAppLocalHostFxr() } } + [Fact] + public void ActivateClass_IgnoreWorkingDirectory() + { + using (TestArtifact cwd = TestArtifact.Create("cwd")) + { + // Validate that hosting components in the working directory will not be used + File.Copy(Binaries.CoreClr.MockPath, Path.Combine(cwd.Location, Binaries.CoreClr.FileName)); + File.Copy(Binaries.HostFxr.MockPath_5_0, Path.Combine(cwd.Location, Binaries.HostFxr.FileName)); + File.Copy(Binaries.HostPolicy.MockPath, Path.Combine(cwd.Location, Binaries.HostPolicy.FileName)); + + string[] args = { + "comhost", + "synchronous", + "1", + sharedState.ComHostPath, + sharedState.ClsidString + }; + sharedState.CreateNativeHostCommand(args, TestContext.BuiltDotNet.BinPath) + .WorkingDirectory(cwd.Location) + .Execute() + .Should().Pass() + .And.HaveStdOutContaining("New instance of Server created") + .And.HaveStdOutContaining($"Activation of {sharedState.ClsidString} succeeded.") + .And.ResolveHostFxr(TestContext.BuiltDotNet) + .And.ResolveHostPolicy(TestContext.BuiltDotNet) + .And.ResolveCoreClr(TestContext.BuiltDotNet); + } + } + [Fact] public void ActivateClass_ValidateIErrorInfoResult() { diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs index fa00b0419a85ef..35d6e2af1298e4 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs @@ -89,6 +89,32 @@ public void LoadLibrary_ContextConfig(bool load_isolated) } } + [Fact] + public void LoadLibrary_IgnoreWorkingDirectory() + { + using (TestArtifact cwd = TestArtifact.Create("cwd")) + { + // Validate that hosting components in the working directory will not be used + File.Copy(Binaries.CoreClr.MockPath, Path.Combine(cwd.Location, Binaries.CoreClr.FileName)); + File.Copy(Binaries.HostFxr.MockPath_5_0, Path.Combine(cwd.Location, Binaries.HostFxr.FileName)); + File.Copy(Binaries.HostPolicy.MockPath, Path.Combine(cwd.Location, Binaries.HostPolicy.FileName)); + + string [] args = { + "ijwhost", + sharedState.IjwApp.AppDll, + "NativeEntryPoint" + }; + sharedState.CreateNativeHostCommand(args, TestContext.BuiltDotNet.BinPath) + .WorkingDirectory(cwd.Location) + .Execute() + .Should().Pass() + .And.HaveStdOutContaining("[C++/CLI] NativeEntryPoint: calling managed class") + .And.HaveStdOutContaining("[C++/CLI] ManagedClass: AssemblyLoadContext = \"Default\" System.Runtime.Loader.DefaultAssemblyLoadContext") + .And.ResolveHostFxr(TestContext.BuiltDotNet) + .And.ResolveHostPolicy(TestContext.BuiltDotNet) + .And.ResolveCoreClr(TestContext.BuiltDotNet); + } + } [Fact] public void LoadLibraryWithoutRuntimeConfigButActiveRuntime() diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs index 39cdc5edb4ca35..6f7cae81047915 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.IO; using System.Linq; using Microsoft.DotNet.Cli.Build.Framework; @@ -231,6 +232,37 @@ public void CallDelegateOnComponentContext_UnhandledException() .And.ExecuteFunctionPointerWithException(entryPoint, 1); } + [Fact] + public void CallDelegateOnComponentContext_IgnoreWorkingDirectory() + { + using (TestArtifact cwd = TestArtifact.Create("cwd")) + { + // Validate that hosting components in the working directory will not be used + File.Copy(Binaries.CoreClr.MockPath, Path.Combine(cwd.Location, Binaries.CoreClr.FileName)); + File.Copy(Binaries.HostPolicy.MockPath, Path.Combine(cwd.Location, Binaries.HostPolicy.FileName)); + + var component = sharedState.Component; + string[] args = + { + ComponentLoadAssemblyAndGetFunctionPointerArg, + sharedState.HostFxrPath, + component.RuntimeConfigJson, + component.AppDll, + sharedState.ComponentTypeName, + sharedState.ComponentEntryPoint1, + }; + + sharedState.CreateNativeHostCommand(args, sharedState.DotNetRoot) + .WorkingDirectory(cwd.Location) + .Execute() + .Should().Pass() + .And.InitializeContextForConfig(component.RuntimeConfigJson) + .And.ExecuteFunctionPointer(sharedState.ComponentEntryPoint1, 1, 1) + .And.ResolveHostPolicy(TestContext.BuiltDotNet) + .And.ResolveCoreClr(TestContext.BuiltDotNet); + } + } + public class SharedTestState : SharedTestStateBase { public string HostFxrPath { get; } diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/FunctionPointerResultExtensions.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs similarity index 69% rename from src/installer/tests/HostActivation.Tests/NativeHosting/FunctionPointerResultExtensions.cs rename to src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs index 09fdc52bc186bf..9a0447a219dcb9 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/FunctionPointerResultExtensions.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs @@ -2,10 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.IO; namespace Microsoft.DotNet.CoreSetup.Test.HostActivation.NativeHosting { - internal static class FunctionPointerResultExtensions + internal static class NativeHostingResultExtensions { public static FluentAssertions.AndConstraint ExecuteFunctionPointer(this CommandResultAssertions assertion, string methodName, int callCount, int returnValue) { @@ -47,5 +48,21 @@ public static FluentAssertions.AndConstraint ExecuteWit { return assertion.HaveStdOutContaining($"{assemblyName}: Location = '{location}'"); } + + public static FluentAssertions.AndConstraint ResolveHostFxr(this CommandResultAssertions assertion, Microsoft.DotNet.Cli.Build.DotNetCli dotnet) + { + return assertion.HaveStdErrContaining($"Resolved fxr [{dotnet.GreatestVersionHostFxrFilePath}]"); + } + + public static FluentAssertions.AndConstraint ResolveHostPolicy(this CommandResultAssertions assertion, Microsoft.DotNet.Cli.Build.DotNetCli dotnet) + { + return assertion.HaveStdErrContaining($"{Binaries.HostPolicy.FileName} directory is [{dotnet.GreatestVersionSharedFxPath}]"); + } + + public static FluentAssertions.AndConstraint ResolveCoreClr(this CommandResultAssertions assertion, Microsoft.DotNet.Cli.Build.DotNetCli dotnet) + { + return assertion.HaveStdErrContaining($"CoreCLR path = '{Path.Combine(dotnet.GreatestVersionSharedFxPath, Binaries.CoreClr.FileName)}'") + .And.HaveStdErrContaining($"CoreCLR dir = '{dotnet.GreatestVersionSharedFxPath}{Path.DirectorySeparatorChar}'"); + } } } diff --git a/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp b/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp index 073445177993cc..c8e5000805289a 100644 --- a/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp +++ b/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp @@ -118,6 +118,11 @@ hostfxr_resolver_t::hostfxr_resolver_t(const pal::string_t& app_root) { m_status_code = StatusCode::CoreHostLibMissingFailure; } + else if (!pal::is_path_rooted(m_fxr_path)) + { + // We should always be loading hostfxr from an absolute path + m_status_code = StatusCode::CoreHostLibMissingFailure; + } else if (pal::load_library(&m_fxr_path, &m_hostfxr_dll)) { m_status_code = StatusCode::Success; diff --git a/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp b/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp index 4e75400a04a81b..6092fea3cd8d9f 100644 --- a/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp +++ b/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp @@ -180,6 +180,10 @@ int hostpolicy_resolver::load( return StatusCode::CoreHostLibMissingFailure; } + // We should always be loading hostpolicy from an absolute path + if (!pal::is_path_rooted(host_path)) + return StatusCode::CoreHostLibMissingFailure; + // Load library // We expect to leak hostpolicy - just as we do not unload coreclr, we do not unload hostpolicy if (!pal::load_library(&host_path, &g_hostpolicy)) diff --git a/src/native/corehost/fxr_resolver.h b/src/native/corehost/fxr_resolver.h index b61f3b8fb4e6dc..88fc9f8781efdd 100644 --- a/src/native/corehost/fxr_resolver.h +++ b/src/native/corehost/fxr_resolver.h @@ -55,6 +55,10 @@ int load_fxr_and_get_delegate(hostfxr_delegate_type type, THostPathToConfigCallb return StatusCode::CoreHostLibMissingFailure; } + // We should always be loading hostfxr from an absolute path + if (!pal::is_path_rooted(fxr_path)) + return StatusCode::CoreHostLibMissingFailure; + // Load library if (!pal::load_library(&fxr_path, &fxr)) { diff --git a/src/native/corehost/hostpolicy/deps_resolver.cpp b/src/native/corehost/hostpolicy/deps_resolver.cpp index 55d9bd8f948868..0e87b791cfbfc4 100644 --- a/src/native/corehost/hostpolicy/deps_resolver.cpp +++ b/src/native/corehost/hostpolicy/deps_resolver.cpp @@ -830,15 +830,21 @@ bool deps_resolver_t::resolve_probe_dirs( } } - // If the deps file is missing add known locations. - if (!get_app_deps().exists()) + // If the deps file is missing for the app, add known locations. + // For libhost scenarios, there is no app or app path + if (m_host_mode != host_mode_t::libhost && !get_app_deps().exists()) { + assert(!m_app_dir.empty()); + // App local path add_unique_path(asset_type, m_app_dir, &items, output, &non_serviced, core_servicing); - // deps_resolver treats being able to get the coreclr path as optional, so we ignore the return value here. - // The caller is responsible for checking whether coreclr path is set and handling as appropriate. - (void) file_exists_in_dir(m_app_dir, LIBCORECLR_NAME, &m_coreclr_path); + if (m_coreclr_path.empty()) + { + // deps_resolver treats being able to get the coreclr path as optional, so we ignore the return value here. + // The caller is responsible for checking whether coreclr path is set and handling as appropriate. + (void) file_exists_in_dir(m_app_dir, LIBCORECLR_NAME, &m_coreclr_path); + } } // Handle any additional deps.json that were specified. diff --git a/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp b/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp index b040c3e8546278..8df8e395e3f259 100644 --- a/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp +++ b/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp @@ -13,6 +13,10 @@ bool coreclr_resolver_t::resolve_coreclr(const pal::string_t& libcoreclr_path, c pal::string_t coreclr_dll_path(libcoreclr_path); append_path(&coreclr_dll_path, LIBCORECLR_NAME); + // We should always be loading coreclr from an absolute path + if (!pal::is_path_rooted(coreclr_dll_path)) + return false; + if (!pal::load_library(&coreclr_dll_path, &coreclr_resolver_contract.coreclr)) { return false; From b9f365b8d6dd86bb9a9fc49abc4a8768e5d9f2c4 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Tue, 17 Jun 2025 18:25:38 +0200 Subject: [PATCH 02/33] Disable all MT tests. (#116747) --- .../runtime-extra-platforms-wasm.yml | 21 ++++---- eng/pipelines/runtime-official.yml | 35 ++++++------- eng/pipelines/runtime.yml | 50 ++++++++++--------- 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index ea18dd02459c90..006faf47674290 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -233,16 +233,17 @@ jobs: publishArtifactsForWorkload: true publishWBT: true - - template: /eng/pipelines/common/templates/wasm-build-only.yml - parameters: - platforms: - - browser_wasm - - browser_wasm_win - nameSuffix: MultiThreaded - extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - condition: ne(variables['wasmMultiThreadedBuildOnlyNeededOnDefaultPipeline'], true) - publishArtifactsForWorkload: true - publishWBT: false + # disabled: https://github.com/dotnet/runtime/issues/116492 + # - template: /eng/pipelines/common/templates/wasm-build-only.yml + # parameters: + # platforms: + # - browser_wasm + # - browser_wasm_win + # nameSuffix: MultiThreaded + # extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + # condition: ne(variables['wasmMultiThreadedBuildOnlyNeededOnDefaultPipeline'], true) + # publishArtifactsForWorkload: true + # publishWBT: false # Browser Wasm.Build.Tests - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index e3c7dc5050005f..b8bd6a82fc8aa1 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -364,23 +364,24 @@ extends: parameters: name: MonoRuntimePacks - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - buildConfig: release - runtimeFlavor: mono - platforms: - - browser_wasm - jobParameters: - templatePath: 'templates-official' - buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - nameSuffix: Mono_multithread - isOfficialBuild: ${{ variables.isOfficialBuild }} - runtimeVariant: multithread - postBuildSteps: - - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml - parameters: - name: MonoRuntimePacks + # disabled: https://github.com/dotnet/runtime/issues/116492 + # - template: /eng/pipelines/common/platform-matrix.yml + # parameters: + # jobTemplate: /eng/pipelines/common/global-build-job.yml + # buildConfig: release + # runtimeFlavor: mono + # platforms: + # - browser_wasm + # jobParameters: + # templatePath: 'templates-official' + # buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + # nameSuffix: Mono_multithread + # isOfficialBuild: ${{ variables.isOfficialBuild }} + # runtimeVariant: multithread + # postBuildSteps: + # - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml + # parameters: + # name: MonoRuntimePacks # Build Mono AOT offset headers once, for consumption elsewhere diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 4a1010323440f3..be54c885cce17f 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -836,21 +836,22 @@ extends: scenarios: - WasmTestOnChrome + # disabled: https://github.com/dotnet/runtime/issues/116492 # Library tests with full threading - - template: /eng/pipelines/common/templates/wasm-library-tests.yml - parameters: - platforms: - - browser_wasm - #- browser_wasm_win - nameSuffix: _Threading - extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - extraHelixArguments: /p:WasmEnableThreads=true - alwaysRun: ${{ variables.isRollingBuild }} - shouldRunSmokeOnly: onLibrariesAndIllinkChanges - scenarios: - - WasmTestOnChrome - - WasmTestOnFirefox - #- WasmTestOnNodeJS - this is not supported yet, https://github.com/dotnet/runtime/issues/85592 + # - template: /eng/pipelines/common/templates/wasm-library-tests.yml + # parameters: + # platforms: + # - browser_wasm + # #- browser_wasm_win + # nameSuffix: _Threading + # extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + # extraHelixArguments: /p:WasmEnableThreads=true + # alwaysRun: ${{ variables.isRollingBuild }} + # shouldRunSmokeOnly: onLibrariesAndIllinkChanges + # scenarios: + # - WasmTestOnChrome + # - WasmTestOnFirefox + # #- WasmTestOnNodeJS - this is not supported yet, https://github.com/dotnet/runtime/issues/85592 # EAT Library tests - only run on linux - template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml @@ -887,16 +888,17 @@ extends: publishArtifactsForWorkload: true publishWBT: true - - template: /eng/pipelines/common/templates/wasm-build-only.yml - parameters: - platforms: - - browser_wasm - - browser_wasm_win - condition: or(eq(variables.isRollingBuild, true), eq(variables.wasmSingleThreadedBuildOnlyNeededOnDefaultPipeline, true)) - nameSuffix: MultiThreaded - extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - publishArtifactsForWorkload: true - publishWBT: false + # disabled: https://github.com/dotnet/runtime/issues/116492 + # - template: /eng/pipelines/common/templates/wasm-build-only.yml + # parameters: + # platforms: + # - browser_wasm + # - browser_wasm_win + # condition: or(eq(variables.isRollingBuild, true), eq(variables.wasmSingleThreadedBuildOnlyNeededOnDefaultPipeline, true)) + # nameSuffix: MultiThreaded + # extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + # publishArtifactsForWorkload: true + # publishWBT: false # Browser Wasm.Build.Tests - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml From 2536cdc617c1b1cf31968166a66aa8da304622d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Cant=C3=BA?= Date: Tue, 17 Jun 2025 14:39:39 -0500 Subject: [PATCH 03/33] Revert "[automated] Merge branch 'release/9.0' => 'release/9.0-staging' (#116514)" This reverts commit c9dfa92af89f0a922060288d4eb2886af4190293. --- .../libraries/helix-queues-setup.yml | 8 +++++ eng/pipelines/runtime-community.yml | 11 +++++++ .../NativeHosting/Comhost.cs | 29 ----------------- ....cs => FunctionPointerResultExtensions.cs} | 19 +---------- .../NativeHosting/Ijwhost.cs | 26 --------------- .../LoadAssemblyAndGetFunctionPointer.cs | 32 ------------------- .../apphost/standalone/hostfxr_resolver.cpp | 5 --- .../fxr/standalone/hostpolicy_resolver.cpp | 4 --- src/native/corehost/fxr_resolver.h | 4 --- .../corehost/hostpolicy/deps_resolver.cpp | 16 +++------- .../standalone/coreclr_resolver.cpp | 4 --- 11 files changed, 25 insertions(+), 133 deletions(-) rename src/installer/tests/HostActivation.Tests/NativeHosting/{NativeHostingResultExtensions.cs => FunctionPointerResultExtensions.cs} (69%) diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 7b849e1bea38c5..13b30af22e8682 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -75,6 +75,14 @@ jobs: # Limiting interp runs as we don't need as much coverage. - (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 + # Linux s390x + - ${{ if eq(parameters.platform, 'linux_s390x') }}: + - Ubuntu.2004.S390X.Experimental.Open + + # Linux PPC64le + - ${{ if eq(parameters.platform, 'linux_ppc64le') }}: + - Ubuntu.2204.PPC64le.Experimental.Open + # OSX arm64 - ${{ if eq(parameters.platform, 'osx_arm64') }}: - OSX.1200.ARM64.Open diff --git a/eng/pipelines/runtime-community.yml b/eng/pipelines/runtime-community.yml index 446996e505b72b..b7a21f588973c1 100644 --- a/eng/pipelines/runtime-community.yml +++ b/eng/pipelines/runtime-community.yml @@ -71,6 +71,17 @@ extends: eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true), eq(variables['isRollingBuild'], true)) + # extra steps, run tests + postBuildSteps: + - template: /eng/pipelines/libraries/helix.yml + parameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isRollingBuild'], true)) # # Build the whole product using Mono diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs index f16e4e1d0e8e7a..3d5b902ff1ad4f 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/Comhost.cs @@ -111,35 +111,6 @@ public void ActivateClass_IgnoreAppLocalHostFxr() } } - [Fact] - public void ActivateClass_IgnoreWorkingDirectory() - { - using (TestArtifact cwd = TestArtifact.Create("cwd")) - { - // Validate that hosting components in the working directory will not be used - File.Copy(Binaries.CoreClr.MockPath, Path.Combine(cwd.Location, Binaries.CoreClr.FileName)); - File.Copy(Binaries.HostFxr.MockPath_5_0, Path.Combine(cwd.Location, Binaries.HostFxr.FileName)); - File.Copy(Binaries.HostPolicy.MockPath, Path.Combine(cwd.Location, Binaries.HostPolicy.FileName)); - - string[] args = { - "comhost", - "synchronous", - "1", - sharedState.ComHostPath, - sharedState.ClsidString - }; - sharedState.CreateNativeHostCommand(args, TestContext.BuiltDotNet.BinPath) - .WorkingDirectory(cwd.Location) - .Execute() - .Should().Pass() - .And.HaveStdOutContaining("New instance of Server created") - .And.HaveStdOutContaining($"Activation of {sharedState.ClsidString} succeeded.") - .And.ResolveHostFxr(TestContext.BuiltDotNet) - .And.ResolveHostPolicy(TestContext.BuiltDotNet) - .And.ResolveCoreClr(TestContext.BuiltDotNet); - } - } - [Fact] public void ActivateClass_ValidateIErrorInfoResult() { diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/FunctionPointerResultExtensions.cs similarity index 69% rename from src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs rename to src/installer/tests/HostActivation.Tests/NativeHosting/FunctionPointerResultExtensions.cs index 9a0447a219dcb9..09fdc52bc186bf 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/NativeHostingResultExtensions.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/FunctionPointerResultExtensions.cs @@ -2,11 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.IO; namespace Microsoft.DotNet.CoreSetup.Test.HostActivation.NativeHosting { - internal static class NativeHostingResultExtensions + internal static class FunctionPointerResultExtensions { public static FluentAssertions.AndConstraint ExecuteFunctionPointer(this CommandResultAssertions assertion, string methodName, int callCount, int returnValue) { @@ -48,21 +47,5 @@ public static FluentAssertions.AndConstraint ExecuteWit { return assertion.HaveStdOutContaining($"{assemblyName}: Location = '{location}'"); } - - public static FluentAssertions.AndConstraint ResolveHostFxr(this CommandResultAssertions assertion, Microsoft.DotNet.Cli.Build.DotNetCli dotnet) - { - return assertion.HaveStdErrContaining($"Resolved fxr [{dotnet.GreatestVersionHostFxrFilePath}]"); - } - - public static FluentAssertions.AndConstraint ResolveHostPolicy(this CommandResultAssertions assertion, Microsoft.DotNet.Cli.Build.DotNetCli dotnet) - { - return assertion.HaveStdErrContaining($"{Binaries.HostPolicy.FileName} directory is [{dotnet.GreatestVersionSharedFxPath}]"); - } - - public static FluentAssertions.AndConstraint ResolveCoreClr(this CommandResultAssertions assertion, Microsoft.DotNet.Cli.Build.DotNetCli dotnet) - { - return assertion.HaveStdErrContaining($"CoreCLR path = '{Path.Combine(dotnet.GreatestVersionSharedFxPath, Binaries.CoreClr.FileName)}'") - .And.HaveStdErrContaining($"CoreCLR dir = '{dotnet.GreatestVersionSharedFxPath}{Path.DirectorySeparatorChar}'"); - } } } diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs index 35d6e2af1298e4..fa00b0419a85ef 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs @@ -89,32 +89,6 @@ public void LoadLibrary_ContextConfig(bool load_isolated) } } - [Fact] - public void LoadLibrary_IgnoreWorkingDirectory() - { - using (TestArtifact cwd = TestArtifact.Create("cwd")) - { - // Validate that hosting components in the working directory will not be used - File.Copy(Binaries.CoreClr.MockPath, Path.Combine(cwd.Location, Binaries.CoreClr.FileName)); - File.Copy(Binaries.HostFxr.MockPath_5_0, Path.Combine(cwd.Location, Binaries.HostFxr.FileName)); - File.Copy(Binaries.HostPolicy.MockPath, Path.Combine(cwd.Location, Binaries.HostPolicy.FileName)); - - string [] args = { - "ijwhost", - sharedState.IjwApp.AppDll, - "NativeEntryPoint" - }; - sharedState.CreateNativeHostCommand(args, TestContext.BuiltDotNet.BinPath) - .WorkingDirectory(cwd.Location) - .Execute() - .Should().Pass() - .And.HaveStdOutContaining("[C++/CLI] NativeEntryPoint: calling managed class") - .And.HaveStdOutContaining("[C++/CLI] ManagedClass: AssemblyLoadContext = \"Default\" System.Runtime.Loader.DefaultAssemblyLoadContext") - .And.ResolveHostFxr(TestContext.BuiltDotNet) - .And.ResolveHostPolicy(TestContext.BuiltDotNet) - .And.ResolveCoreClr(TestContext.BuiltDotNet); - } - } [Fact] public void LoadLibraryWithoutRuntimeConfigButActiveRuntime() diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs index 6f7cae81047915..39cdc5edb4ca35 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/LoadAssemblyAndGetFunctionPointer.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; -using System.IO; using System.Linq; using Microsoft.DotNet.Cli.Build.Framework; @@ -232,37 +231,6 @@ public void CallDelegateOnComponentContext_UnhandledException() .And.ExecuteFunctionPointerWithException(entryPoint, 1); } - [Fact] - public void CallDelegateOnComponentContext_IgnoreWorkingDirectory() - { - using (TestArtifact cwd = TestArtifact.Create("cwd")) - { - // Validate that hosting components in the working directory will not be used - File.Copy(Binaries.CoreClr.MockPath, Path.Combine(cwd.Location, Binaries.CoreClr.FileName)); - File.Copy(Binaries.HostPolicy.MockPath, Path.Combine(cwd.Location, Binaries.HostPolicy.FileName)); - - var component = sharedState.Component; - string[] args = - { - ComponentLoadAssemblyAndGetFunctionPointerArg, - sharedState.HostFxrPath, - component.RuntimeConfigJson, - component.AppDll, - sharedState.ComponentTypeName, - sharedState.ComponentEntryPoint1, - }; - - sharedState.CreateNativeHostCommand(args, sharedState.DotNetRoot) - .WorkingDirectory(cwd.Location) - .Execute() - .Should().Pass() - .And.InitializeContextForConfig(component.RuntimeConfigJson) - .And.ExecuteFunctionPointer(sharedState.ComponentEntryPoint1, 1, 1) - .And.ResolveHostPolicy(TestContext.BuiltDotNet) - .And.ResolveCoreClr(TestContext.BuiltDotNet); - } - } - public class SharedTestState : SharedTestStateBase { public string HostFxrPath { get; } diff --git a/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp b/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp index c8e5000805289a..073445177993cc 100644 --- a/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp +++ b/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp @@ -118,11 +118,6 @@ hostfxr_resolver_t::hostfxr_resolver_t(const pal::string_t& app_root) { m_status_code = StatusCode::CoreHostLibMissingFailure; } - else if (!pal::is_path_rooted(m_fxr_path)) - { - // We should always be loading hostfxr from an absolute path - m_status_code = StatusCode::CoreHostLibMissingFailure; - } else if (pal::load_library(&m_fxr_path, &m_hostfxr_dll)) { m_status_code = StatusCode::Success; diff --git a/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp b/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp index 6092fea3cd8d9f..4e75400a04a81b 100644 --- a/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp +++ b/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp @@ -180,10 +180,6 @@ int hostpolicy_resolver::load( return StatusCode::CoreHostLibMissingFailure; } - // We should always be loading hostpolicy from an absolute path - if (!pal::is_path_rooted(host_path)) - return StatusCode::CoreHostLibMissingFailure; - // Load library // We expect to leak hostpolicy - just as we do not unload coreclr, we do not unload hostpolicy if (!pal::load_library(&host_path, &g_hostpolicy)) diff --git a/src/native/corehost/fxr_resolver.h b/src/native/corehost/fxr_resolver.h index 88fc9f8781efdd..b61f3b8fb4e6dc 100644 --- a/src/native/corehost/fxr_resolver.h +++ b/src/native/corehost/fxr_resolver.h @@ -55,10 +55,6 @@ int load_fxr_and_get_delegate(hostfxr_delegate_type type, THostPathToConfigCallb return StatusCode::CoreHostLibMissingFailure; } - // We should always be loading hostfxr from an absolute path - if (!pal::is_path_rooted(fxr_path)) - return StatusCode::CoreHostLibMissingFailure; - // Load library if (!pal::load_library(&fxr_path, &fxr)) { diff --git a/src/native/corehost/hostpolicy/deps_resolver.cpp b/src/native/corehost/hostpolicy/deps_resolver.cpp index 0e87b791cfbfc4..55d9bd8f948868 100644 --- a/src/native/corehost/hostpolicy/deps_resolver.cpp +++ b/src/native/corehost/hostpolicy/deps_resolver.cpp @@ -830,21 +830,15 @@ bool deps_resolver_t::resolve_probe_dirs( } } - // If the deps file is missing for the app, add known locations. - // For libhost scenarios, there is no app or app path - if (m_host_mode != host_mode_t::libhost && !get_app_deps().exists()) + // If the deps file is missing add known locations. + if (!get_app_deps().exists()) { - assert(!m_app_dir.empty()); - // App local path add_unique_path(asset_type, m_app_dir, &items, output, &non_serviced, core_servicing); - if (m_coreclr_path.empty()) - { - // deps_resolver treats being able to get the coreclr path as optional, so we ignore the return value here. - // The caller is responsible for checking whether coreclr path is set and handling as appropriate. - (void) file_exists_in_dir(m_app_dir, LIBCORECLR_NAME, &m_coreclr_path); - } + // deps_resolver treats being able to get the coreclr path as optional, so we ignore the return value here. + // The caller is responsible for checking whether coreclr path is set and handling as appropriate. + (void) file_exists_in_dir(m_app_dir, LIBCORECLR_NAME, &m_coreclr_path); } // Handle any additional deps.json that were specified. diff --git a/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp b/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp index 8df8e395e3f259..b040c3e8546278 100644 --- a/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp +++ b/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp @@ -13,10 +13,6 @@ bool coreclr_resolver_t::resolve_coreclr(const pal::string_t& libcoreclr_path, c pal::string_t coreclr_dll_path(libcoreclr_path); append_path(&coreclr_dll_path, LIBCORECLR_NAME); - // We should always be loading coreclr from an absolute path - if (!pal::is_path_rooted(coreclr_dll_path)) - return false; - if (!pal::load_library(&coreclr_dll_path, &coreclr_resolver_contract.coreclr)) { return false; From 22cf0cda0eb4ffbcf91126909d88289795196618 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Thu, 19 Jun 2025 15:46:04 +0200 Subject: [PATCH 04/33] [release/9.0-staging] Backport "Dispose Xunit ToolCommand" (#116685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Backport "Dispose Xunit ToolCommand" * Feedback: add lock. * Update src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs Co-authored-by: Marek Fišera --------- Co-authored-by: Marek Fišera --- .../Blazor/BlazorWasmTestBase.cs | 16 ++--- .../Wasm.Build.Tests/Blazor/CleanTests.cs | 16 ++--- .../Wasm.Build.Tests/Blazor/MiscTests2.cs | 12 ++-- .../Wasm.Build.Tests/Blazor/MiscTests3.cs | 13 ++-- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 8 +-- .../Wasm.Build.Tests/Common/ToolCommand.cs | 49 +++++++++----- .../NonWasmTemplateBuildTests.cs | 20 +++--- .../Templates/NativeBuildTests.cs | 24 +++---- .../Templates/WasmTemplateTests.cs | 67 ++++++++++--------- .../TestAppScenarios/SatelliteLoadingTests.cs | 4 +- .../WasmAppBuilderDebugLevelTests.cs | 8 +-- .../Wasm.Build.Tests/WasmTemplateTestBase.cs | 4 +- 12 files changed, 128 insertions(+), 113 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorWasmTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorWasmTestBase.cs index 46c8f2ce132870..e2406c873b986c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorWasmTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/BlazorWasmTestBase.cs @@ -46,11 +46,11 @@ public void InitBlazorWasmProjectDir(string id, string targetFramework = Default public string CreateBlazorWasmTemplateProject(string id) { InitBlazorWasmProjectDir(id); - new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) - .WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .ExecuteWithCapturedOutput("new blazorwasm") - .EnsureSuccessful(); + using DotNetCommand dotnetCommand = new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false); + CommandResult result = dotnetCommand.WithWorkingDirectory(_projectDir!) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) + .ExecuteWithCapturedOutput("new blazorwasm") + .EnsureSuccessful(); return Path.Combine(_projectDir!, $"{id}.csproj"); } @@ -195,12 +195,12 @@ public async Task BlazorRunTest(string runArgs, runOptions.ServerEnvironment?.ToList().ForEach( kv => s_buildEnv.EnvVars[kv.Key] = kv.Value); - using var runCommand = new RunCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(workingDirectory); + using RunCommand runCommand = new RunCommand(s_buildEnv, _testOutput); + ToolCommand cmd = runCommand.WithWorkingDirectory(workingDirectory); await using var runner = new BrowserRunner(_testOutput); var page = await runner.RunAsync( - runCommand, + cmd, runArgs, onConsoleMessage: OnConsoleMessage, onServerMessage: runOptions.OnServerMessage, diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/CleanTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/CleanTests.cs index db3c7da2243ac0..122aa274962373 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/CleanTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/CleanTests.cs @@ -40,11 +40,11 @@ public void Blazor_BuildThenClean_NativeRelinking(string config) Assert.True(Directory.Exists(relinkDir), $"Could not find expected relink dir: {relinkDir}"); string logPath = Path.Combine(s_buildEnv.LogRootPath, id, $"{id}-clean.binlog"); - new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .ExecuteWithCapturedOutput("build", "-t:Clean", $"-p:Configuration={config}", $"-bl:{logPath}") - .EnsureSuccessful(); + using ToolCommand cmd = new DotNetCommand(s_buildEnv, _testOutput) + .WithWorkingDirectory(_projectDir!); + cmd.WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) + .ExecuteWithCapturedOutput("build", "-t:Clean", $"-p:Configuration={config}", $"-bl:{logPath}") + .EnsureSuccessful(); AssertEmptyOrNonExistentDirectory(relinkDir); } @@ -88,9 +88,9 @@ private void Blazor_BuildNativeNonNative_ThenCleanTest(string config, bool first Assert.True(Directory.Exists(relinkDir), $"Could not find expected relink dir: {relinkDir}"); string logPath = Path.Combine(s_buildEnv.LogRootPath, id, $"{id}-clean.binlog"); - new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _projectDir!) + using ToolCommand cmd = new DotNetCommand(s_buildEnv, _testOutput) + .WithWorkingDirectory(_projectDir!); + cmd.WithEnvironmentVariable("NUGET_PACKAGES", _projectDir!) .ExecuteWithCapturedOutput("build", "-t:Clean", $"-p:Configuration={config}", $"-bl:{logPath}") .EnsureSuccessful(); diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests2.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests2.cs index 23c002b454d91c..00a47837523ce4 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests2.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests2.cs @@ -59,11 +59,11 @@ private CommandResult PublishForRequiresWorkloadTest(string config, string extra extraItems: extraItems); string publishLogPath = Path.Combine(s_buildEnv.LogRootPath, id, $"{id}.binlog"); - return new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .ExecuteWithCapturedOutput("publish", - $"-bl:{publishLogPath}", - $"-p:Configuration={config}"); + using DotNetCommand cmd = new DotNetCommand(s_buildEnv, _testOutput); + return cmd.WithWorkingDirectory(_projectDir!) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) + .ExecuteWithCapturedOutput("publish", + $"-bl:{publishLogPath}", + $"-p:Configuration={config}"); } } diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests3.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests3.cs index 4d82356b103790..a7f39ce9d3341a 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests3.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests3.cs @@ -99,17 +99,16 @@ public void BugRegression_60479_WithRazorClassLib() string wasmProjectDir = Path.Combine(_projectDir!, "wasm"); string wasmProjectFile = Path.Combine(wasmProjectDir, "wasm.csproj"); Directory.CreateDirectory(wasmProjectDir); - new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) - .WithWorkingDirectory(wasmProjectDir) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .ExecuteWithCapturedOutput("new blazorwasm") - .EnsureSuccessful(); + using DotNetCommand cmd = new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false); + cmd.WithWorkingDirectory(wasmProjectDir) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) + .ExecuteWithCapturedOutput("new blazorwasm") + .EnsureSuccessful(); string razorProjectDir = Path.Combine(_projectDir!, "RazorClassLibrary"); Directory.CreateDirectory(razorProjectDir); - new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) - .WithWorkingDirectory(razorProjectDir) + cmd.WithWorkingDirectory(razorProjectDir) .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) .ExecuteWithCapturedOutput("new razorclasslib") .EnsureSuccessful(); diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index 4ac3be17fb615e..44c7d67ba22e1c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -164,10 +164,10 @@ public BuildTestBase(ProjectProviderBase providerBase, ITestOutputHelper output, if (buildProjectOptions.Publish && buildProjectOptions.BuildOnlyAfterPublish) commandLineArgs.Append("-p:WasmBuildOnlyAfterPublish=true"); - var cmd = new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .WithEnvironmentVariables(buildProjectOptions.ExtraBuildEnvironmentVariables); + using ToolCommand cmd = new DotNetCommand(s_buildEnv, _testOutput) + .WithWorkingDirectory(_projectDir!); + cmd.WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) + .WithEnvironmentVariables(buildProjectOptions.ExtraBuildEnvironmentVariables); if (UseWBTOverridePackTargets && s_buildEnv.IsWorkload) cmd.WithEnvironmentVariable("WBTOverrideRuntimePack", "true"); diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs b/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs index c8289da17350d6..fb7a43bf19d826 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs @@ -13,6 +13,8 @@ namespace Wasm.Build.Tests { public class ToolCommand : IDisposable { + private bool isDisposed = false; + private readonly object _lock = new object(); private string _label; protected ITestOutputHelper _testOutput; @@ -93,11 +95,17 @@ public virtual CommandResult ExecuteWithCapturedOutput(params string[] args) public virtual void Dispose() { - if (CurrentProcess is not null && !CurrentProcess.HasExited) + lock (_lock) { - CurrentProcess.Kill(entireProcessTree: true); - CurrentProcess.Dispose(); - CurrentProcess = null; + if (isDisposed) + return; + if (CurrentProcess is not null && !CurrentProcess.HasExited) + { + CurrentProcess.Kill(entireProcessTree: true); + CurrentProcess.Dispose(); + CurrentProcess = null; + } + isDisposed = true; } } @@ -109,24 +117,33 @@ private async Task ExecuteAsyncInternal(string executable, string CurrentProcess = CreateProcess(executable, args); DataReceivedEventHandler errorHandler = (s, e) => { - if (e.Data == null) + if (e.Data == null || isDisposed) return; - string msg = $"[{_label}] {e.Data}"; - output.Add(msg); - _testOutput.WriteLine(msg); - ErrorDataReceived?.Invoke(s, e); + lock (_lock) + { + if (e.Data == null || isDisposed) + return; + + string msg = $"[{_label}] {e.Data}"; + output.Add(msg); + _testOutput.WriteLine(msg); + ErrorDataReceived?.Invoke(s, e); + } }; DataReceivedEventHandler outputHandler = (s, e) => { - if (e.Data == null) - return; - - string msg = $"[{_label}] {e.Data}"; - output.Add(msg); - _testOutput.WriteLine(msg); - OutputDataReceived?.Invoke(s, e); + lock (_lock) + { + if (e.Data == null || isDisposed) + return; + + string msg = $"[{_label}] {e.Data}"; + output.Add(msg); + _testOutput.WriteLine(msg); + OutputDataReceived?.Invoke(s, e); + } }; CurrentProcess.ErrorDataReceived += errorHandler; diff --git a/src/mono/wasm/Wasm.Build.Tests/NonWasmTemplateBuildTests.cs b/src/mono/wasm/Wasm.Build.Tests/NonWasmTemplateBuildTests.cs index 90ce88af865f72..e85a212f83d49f 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NonWasmTemplateBuildTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NonWasmTemplateBuildTests.cs @@ -112,22 +112,18 @@ private void NonWasmConsoleBuild(string config, File.WriteAllText(Path.Combine(_projectDir, "Directory.Build.props"), ""); File.WriteAllText(Path.Combine(_projectDir, "Directory.Build.targets"), directoryBuildTargets); - new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput("new console --no-restore") - .EnsureSuccessful(); + using ToolCommand cmd = new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) + .WithWorkingDirectory(_projectDir!); + cmd.ExecuteWithCapturedOutput("new console --no-restore") + .EnsureSuccessful(); - new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"build -restore -c {config} -bl:{Path.Combine(s_buildEnv.LogRootPath, $"{id}.binlog")} {extraBuildArgs} -f {targetFramework}") - .EnsureSuccessful(); + cmd.ExecuteWithCapturedOutput($"build -restore -c {config} -bl:{Path.Combine(s_buildEnv.LogRootPath, $"{id}.binlog")} {extraBuildArgs} -f {targetFramework}") + .EnsureSuccessful(); if (shouldRun) { - var result = new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"run -c {config} -f {targetFramework} --no-build") - .EnsureSuccessful(); + CommandResult result = cmd.ExecuteWithCapturedOutput($"run -c {config} -f {targetFramework} --no-build") + .EnsureSuccessful(); Assert.Contains("Hello, World!", result.Output); } diff --git a/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs b/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs index 37f9b6aa46ca25..ff111d60207aa2 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs @@ -45,10 +45,10 @@ public void BuildWithUndefinedNativeSymbol(bool allowUndefined) File.WriteAllText(Path.Combine(_projectDir!, "Program.cs"), code); File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "native-libs", "undefined-symbol.c"), Path.Combine(_projectDir!, "undefined_xyz.c")); - CommandResult result = new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .ExecuteWithCapturedOutput("build", "-c Release"); + using DotNetCommand cmd = new DotNetCommand(s_buildEnv, _testOutput); + CommandResult result = cmd.WithWorkingDirectory(_projectDir!) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) + .ExecuteWithCapturedOutput("build", "-c Release"); if (allowUndefined) { @@ -83,17 +83,17 @@ public void ProjectWithDllImportsRequiringMarshalIlGen_ArrayTypeParameter(string Path.Combine(_projectDir!, "Program.cs"), overwrite: true); - CommandResult result = new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .ExecuteWithCapturedOutput("build", $"-c {config} -bl"); + using DotNetCommand cmd = new DotNetCommand(s_buildEnv, _testOutput); + CommandResult result = cmd.WithWorkingDirectory(_projectDir!) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) + .ExecuteWithCapturedOutput("build", $"-c {config} -bl"); Assert.True(result.ExitCode == 0, "Expected build to succeed"); - CommandResult res = new RunCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config}") - .EnsureSuccessful(); + using RunCommand runCmd = new RunCommand(s_buildEnv, _testOutput); + CommandResult res = runCmd.WithWorkingDirectory(_projectDir!) + .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config}") + .EnsureSuccessful(); Assert.Contains("Hello, Console!", res.Output); Assert.Contains("Hello, World! Greetings from node version", res.Output); } diff --git a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs index b32b95debd879f..df96cac3f9ba6c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs @@ -193,10 +193,10 @@ public void ConsoleBuildThenPublish(string config) IsBrowserProject: false )); - CommandResult res = new RunCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config}") - .EnsureSuccessful(); + using RunCommand cmd = new RunCommand(s_buildEnv, _testOutput); + CommandResult res = cmd.WithWorkingDirectory(_projectDir!) + .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config}") + .EnsureSuccessful(); Assert.Contains("Hello, Console!", res.Output); if (!_buildContext.TryGetBuildFor(buildArgs, out BuildProduct? product)) @@ -262,10 +262,10 @@ private void ConsoleBuildAndRun(string config, bool relinking, string extraNewAr IsBrowserProject: false )); - CommandResult res = new RunCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config} x y z") - .EnsureExitCode(42); + using RunCommand cmd = new RunCommand(s_buildEnv, _testOutput); + CommandResult res = cmd.WithWorkingDirectory(_projectDir!) + .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config} x y z") + .EnsureExitCode(42); Assert.Contains("args[0] = x", res.Output); Assert.Contains("args[1] = y", res.Output); @@ -355,7 +355,7 @@ private Task ConsoleRunWithAndThenWithoutBuildAsync(string config, string extraP using var cmd = new RunCommand(s_buildEnv, _testOutput, label: id) .WithWorkingDirectory(workingDir) .WithEnvironmentVariables(s_buildEnv.EnvVars); - var res = cmd.ExecuteWithCapturedOutput(runArgs).EnsureExitCode(42); + CommandResult res = cmd.ExecuteWithCapturedOutput(runArgs).EnsureExitCode(42); Assert.Contains("args[0] = x", res.Output); Assert.Contains("args[1] = y", res.Output); @@ -370,7 +370,7 @@ private Task ConsoleRunWithAndThenWithoutBuildAsync(string config, string extraP runArgs += " x y z"; using var cmd = new RunCommand(s_buildEnv, _testOutput, label: id) .WithWorkingDirectory(workingDir); - var res = cmd.ExecuteWithCapturedOutput(runArgs).EnsureExitCode(42); + CommandResult res = cmd.ExecuteWithCapturedOutput(runArgs).EnsureExitCode(42); Assert.Contains("args[0] = x", res.Output); Assert.Contains("args[1] = y", res.Output); @@ -429,23 +429,26 @@ public void ConsolePublishAndRun(string config, bool aot, bool relinking) UseCache: false, IsBrowserProject: false)); - new RunCommand(s_buildEnv, _testOutput, label: id) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput("--info") - .EnsureExitCode(0); + using (RunCommand cmd = new RunCommand(s_buildEnv, _testOutput, label: id)) + { + cmd.WithWorkingDirectory(_projectDir!) + .ExecuteWithCapturedOutput("--info") + .EnsureExitCode(0); + } string runArgs = $"run --no-silent --no-build -c {config} -v diag"; runArgs += " x y z"; - var res = new RunCommand(s_buildEnv, _testOutput, label: id) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput(runArgs) - .EnsureExitCode(42); - - if (aot) - Assert.Contains($"AOT: image '{Path.GetFileNameWithoutExtension(projectFile)}' found", res.Output); - Assert.Contains("args[0] = x", res.Output); - Assert.Contains("args[1] = y", res.Output); - Assert.Contains("args[2] = z", res.Output); + using (RunCommand cmd = new RunCommand(s_buildEnv, _testOutput, label: id)) + { + CommandResult res = cmd.WithWorkingDirectory(_projectDir!) + .ExecuteWithCapturedOutput(runArgs) + .EnsureExitCode(42); + if (aot) + Assert.Contains($"AOT: image '{Path.GetFileNameWithoutExtension(projectFile)}' found", res.Output); + Assert.Contains("args[0] = x", res.Output); + Assert.Contains("args[1] = y", res.Output); + Assert.Contains("args[2] = z", res.Output); + } } public static IEnumerable BrowserBuildAndRunTestData() @@ -474,10 +477,10 @@ public async Task BrowserBuildAndRun(string extraNewArgs, string targetFramework UpdateBrowserMainJs(targetFramework, runtimeAssetsRelativePath); - new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .Execute($"build -c {config} -bl:{Path.Combine(s_buildEnv.LogRootPath, $"{id}.binlog")} {(runtimeAssetsRelativePath != DefaultRuntimeAssetsRelativePath ? "-p:WasmRuntimeAssetsLocation=" + runtimeAssetsRelativePath : "")}") - .EnsureSuccessful(); + using ToolCommand cmd = new DotNetCommand(s_buildEnv, _testOutput) + .WithWorkingDirectory(_projectDir!); + cmd.Execute($"build -c {config} -bl:{Path.Combine(s_buildEnv.LogRootPath, $"{id}.binlog")} {(runtimeAssetsRelativePath != DefaultRuntimeAssetsRelativePath ? "-p:WasmRuntimeAssetsLocation=" + runtimeAssetsRelativePath : "")}") + .EnsureSuccessful(); using var runCommand = new RunCommand(s_buildEnv, _testOutput) .WithWorkingDirectory(_projectDir!); @@ -578,10 +581,10 @@ public void Test_WasmStripILAfterAOT(string stripILAfterAOT, bool expectILStripp AssertAppBundle: false)); string runArgs = $"run --no-silent --no-build -c {config}"; - var res = new RunCommand(s_buildEnv, _testOutput, label: id) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput(runArgs) - .EnsureExitCode(42); + using ToolCommand cmd = new RunCommand(s_buildEnv, _testOutput, label: id) + .WithWorkingDirectory(_projectDir!); + CommandResult res = cmd.ExecuteWithCapturedOutput(runArgs) + .EnsureExitCode(42); string frameworkDir = Path.Combine(projectDirectory, "bin", config, BuildTestBase.DefaultTargetFramework, "browser-wasm", "AppBundle", "_framework"); string objBuildDir = Path.Combine(projectDirectory, "obj", config, BuildTestBase.DefaultTargetFramework, "browser-wasm", "wasm", "for-publish"); diff --git a/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/SatelliteLoadingTests.cs b/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/SatelliteLoadingTests.cs index 4ef606b784e45b..ea1037e27872ac 100644 --- a/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/SatelliteLoadingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/SatelliteLoadingTests.cs @@ -77,8 +77,8 @@ public async Task LoadSatelliteAssemblyFromReference() // Build the library var libraryCsprojPath = Path.GetFullPath(Path.Combine(_projectDir!, "..", "ResourceLibrary")); - new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(libraryCsprojPath) + using DotNetCommand cmd = new DotNetCommand(s_buildEnv, _testOutput); + CommandResult res = cmd.WithWorkingDirectory(libraryCsprojPath) .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) .ExecuteWithCapturedOutput("build -c Release") .EnsureSuccessful(); diff --git a/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/WasmAppBuilderDebugLevelTests.cs b/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/WasmAppBuilderDebugLevelTests.cs index 83809b3c2a9a3a..bf8c3272960b36 100644 --- a/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/WasmAppBuilderDebugLevelTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/WasmAppBuilderDebugLevelTests.cs @@ -35,8 +35,8 @@ protected override void SetupProject(string projectId) protected override Task RunForBuild(string configuration) { - CommandResult res = new RunCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) + using RunCommand cmd = new RunCommand(s_buildEnv, _testOutput); + CommandResult res = cmd.WithWorkingDirectory(_projectDir!) .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {configuration}"); return Task.FromResult(ProcessRunOutput(res)); @@ -61,8 +61,8 @@ protected override Task RunForPublish(string configuration) { // WasmAppBuilder does publish to the same folder as build (it overrides the output), // and thus using dotnet run work correctly for publish as well. - CommandResult res = new RunCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) + using RunCommand cmd = new RunCommand(s_buildEnv, _testOutput); + CommandResult res = cmd.WithWorkingDirectory(_projectDir!) .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {configuration}"); return Task.FromResult(ProcessRunOutput(res)); diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs index 894097fed554b6..3ea5078b4da3e2 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs @@ -43,8 +43,8 @@ public string CreateWasmTemplateProject(string id, string template = "wasmbrowse if (addFrameworkArg) extraArgs += $" -f {DefaultTargetFramework}"; - new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) - .WithWorkingDirectory(_projectDir!) + using DotNetCommand cmd = new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false); + CommandResult result = cmd.WithWorkingDirectory(_projectDir!) .ExecuteWithCapturedOutput($"new {template} {extraArgs}") .EnsureSuccessful(); From 33e5d247f141fa7215dbe44bf07ca362f5bf63d6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 12:07:33 +0200 Subject: [PATCH 05/33] [release/9.0-staging] Skip SSL key log test for OpenSSL 3.5+ (#116687) * Skip SSL key log test for openssl 3.5+ * Minor changes, active issue comment * Conditional return * Add IsOpenSsl3_5 to platform detection helper --------- Co-authored-by: Roman Konecny --- .../tests/TestUtilities/System/PlatformDetection.Unix.cs | 2 ++ .../tests/FunctionalTests/SslStreamRemoteExecutorTests.cs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs index 20f5fc2989f6db..db6f7b863a0891 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs @@ -51,9 +51,11 @@ public static partial class PlatformDetection private static readonly Version s_openssl3Version = new Version(3, 0, 0); private static readonly Version s_openssl3_4Version = new Version(3, 4, 0); + private static readonly Version s_openssl3_5Version = new Version(3, 5, 0); public static bool IsOpenSsl3 => IsOpenSslVersionAtLeast(s_openssl3Version); public static bool IsOpenSsl3_4 => IsOpenSslVersionAtLeast(s_openssl3_4Version); + public static bool IsOpenSsl3_5 => IsOpenSslVersionAtLeast(s_openssl3_5Version); /// /// If gnulibc is available, returns the release, such as "stable". diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs index 87ec6605e37aad..46a4707b43cf01 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamRemoteExecutorTests.cs @@ -25,6 +25,7 @@ public SslStreamRemoteExecutorTests() [PlatformSpecific(TestPlatforms.Linux)] // SSLKEYLOGFILE is only supported on Linux for SslStream [InlineData(true)] [InlineData(false)] + //[ActiveIssue("https://github.com/dotnet/runtime/issues/116473")] public async Task SslKeyLogFile_IsCreatedAndFilled(bool enabledBySwitch) { if (PlatformDetection.IsDebugLibrary(typeof(SslStream).Assembly) && !enabledBySwitch) @@ -34,6 +35,13 @@ public async Task SslKeyLogFile_IsCreatedAndFilled(bool enabledBySwitch) return; } + if (PlatformDetection.IsOpenSsl3_5 && !enabledBySwitch) + { + // OpenSSL 3.5 and later versions log into file in SSLKEYLOGFILE environment variable by default, + // regardless of AppContext switch. + return; + } + var psi = new ProcessStartInfo(); var tempFile = Path.GetTempFileName(); psi.Environment.Add("SSLKEYLOGFILE", tempFile); From b3d02f69311717ed79665746d7b9db4411954ad4 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Wed, 25 Jun 2025 15:30:47 -0700 Subject: [PATCH 06/33] Fix absolute path check when loading hostfxr/hostpolicy/coreclr (#116775) On Windows, we were incorrectly only checking for : and incorrectly determining that UNC and device paths were not absolute. This updates pal::is_path_rooted to match the managed Path.IsPathRooted and adds a pal::is_path_absolute with the logic of Path.IsPartiallyQualified This also adds an error message when we can't resolve hostfxr and tests for device paths. --- .../FrameworkDependentAppLaunch.cs | 27 +++++++++++++++++++ .../SelfContainedAppLaunch.cs | 23 ++++++++++++++++ .../apphost/standalone/hostfxr_resolver.cpp | 2 +- src/native/corehost/corehost.cpp | 1 + .../fxr/standalone/hostpolicy_resolver.cpp | 2 +- src/native/corehost/fxr_resolver.h | 2 +- src/native/corehost/hostmisc/pal.h | 1 + src/native/corehost/hostmisc/pal.unix.cpp | 9 +++++-- src/native/corehost/hostmisc/pal.windows.cpp | 24 ++++++++++++++++- .../corehost/hostpolicy/deps_resolver.cpp | 2 +- .../standalone/coreclr_resolver.cpp | 2 +- 11 files changed, 87 insertions(+), 8 deletions(-) diff --git a/src/installer/tests/HostActivation.Tests/FrameworkDependentAppLaunch.cs b/src/installer/tests/HostActivation.Tests/FrameworkDependentAppLaunch.cs index 2f486fda3bd327..57e7172faf0e43 100644 --- a/src/installer/tests/HostActivation.Tests/FrameworkDependentAppLaunch.cs +++ b/src/installer/tests/HostActivation.Tests/FrameworkDependentAppLaunch.cs @@ -191,6 +191,33 @@ public void AppHost_DisableCetCompat() .And.HaveStdOutContaining(TestContext.MicrosoftNETCoreAppVersion); } + [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + public void AppHost_DotNetRoot_DevicePath() + { + string appExe = sharedTestState.App.AppExe; + + string dotnetPath = $@"\\?\{TestContext.BuiltDotNet.BinPath}"; + Command.Create(appExe) + .CaptureStdErr() + .CaptureStdOut() + .DotNetRoot(dotnetPath, TestContext.BuildArchitecture) + .Execute() + .Should().Pass() + .And.HaveStdOutContaining("Hello World") + .And.HaveStdOutContaining(TestContext.MicrosoftNETCoreAppVersion); + + dotnetPath = $@"\\.\{TestContext.BuiltDotNet.BinPath}"; + Command.Create(appExe) + .CaptureStdErr() + .CaptureStdOut() + .DotNetRoot(dotnetPath, TestContext.BuildArchitecture) + .Execute() + .Should().Pass() + .And.HaveStdOutContaining("Hello World") + .And.HaveStdOutContaining(TestContext.MicrosoftNETCoreAppVersion); + } + [Fact] public void RuntimeConfig_FilePath_Breaks_MAX_PATH_Threshold() { diff --git a/src/installer/tests/HostActivation.Tests/SelfContainedAppLaunch.cs b/src/installer/tests/HostActivation.Tests/SelfContainedAppLaunch.cs index 0ebb0912af4f3f..fe18bf10fdd73c 100644 --- a/src/installer/tests/HostActivation.Tests/SelfContainedAppLaunch.cs +++ b/src/installer/tests/HostActivation.Tests/SelfContainedAppLaunch.cs @@ -156,6 +156,29 @@ public void DotNetRoot_IncorrectLayout_Fails() .And.HaveStdErrContaining($"The required library {Binaries.HostFxr.FileName} could not be found."); } + [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + public void DevicePath() + { + string appExe = $@"\\?\{sharedTestState.App.AppExe}"; + Command.Create(appExe) + .CaptureStdErr() + .CaptureStdOut() + .Execute() + .Should().Pass() + .And.HaveStdOutContaining("Hello World") + .And.HaveStdOutContaining(TestContext.MicrosoftNETCoreAppVersion); + + appExe = $@"\\.\{sharedTestState.App.AppExe}"; + Command.Create(appExe) + .CaptureStdErr() + .CaptureStdOut() + .Execute() + .Should().Pass() + .And.HaveStdOutContaining("Hello World") + .And.HaveStdOutContaining(TestContext.MicrosoftNETCoreAppVersion); + } + public class SharedTestState : IDisposable { public TestApp App { get; } diff --git a/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp b/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp index c8e5000805289a..84c726ddbf75c0 100644 --- a/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp +++ b/src/native/corehost/apphost/standalone/hostfxr_resolver.cpp @@ -118,7 +118,7 @@ hostfxr_resolver_t::hostfxr_resolver_t(const pal::string_t& app_root) { m_status_code = StatusCode::CoreHostLibMissingFailure; } - else if (!pal::is_path_rooted(m_fxr_path)) + else if (!pal::is_path_fully_qualified(m_fxr_path)) { // We should always be loading hostfxr from an absolute path m_status_code = StatusCode::CoreHostLibMissingFailure; diff --git a/src/native/corehost/corehost.cpp b/src/native/corehost/corehost.cpp index c233a52237a9fb..c359c30fd7dd89 100644 --- a/src/native/corehost/corehost.cpp +++ b/src/native/corehost/corehost.cpp @@ -200,6 +200,7 @@ int exe_start(const int argc, const pal::char_t* argv[]) int rc = fxr.status_code(); if (rc != StatusCode::Success) { + trace::error(_X("Failed to resolve %s [%s]. Error code: 0x%x"), LIBFXR_NAME, fxr.fxr_path().empty() ? _X("not found") : fxr.fxr_path().c_str(), rc); return rc; } diff --git a/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp b/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp index 6092fea3cd8d9f..ff68220193d47b 100644 --- a/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp +++ b/src/native/corehost/fxr/standalone/hostpolicy_resolver.cpp @@ -181,7 +181,7 @@ int hostpolicy_resolver::load( } // We should always be loading hostpolicy from an absolute path - if (!pal::is_path_rooted(host_path)) + if (!pal::is_path_fully_qualified(host_path)) return StatusCode::CoreHostLibMissingFailure; // Load library diff --git a/src/native/corehost/fxr_resolver.h b/src/native/corehost/fxr_resolver.h index 88fc9f8781efdd..4764783b2afc7f 100644 --- a/src/native/corehost/fxr_resolver.h +++ b/src/native/corehost/fxr_resolver.h @@ -56,7 +56,7 @@ int load_fxr_and_get_delegate(hostfxr_delegate_type type, THostPathToConfigCallb } // We should always be loading hostfxr from an absolute path - if (!pal::is_path_rooted(fxr_path)) + if (!pal::is_path_fully_qualified(fxr_path)) return StatusCode::CoreHostLibMissingFailure; // Load library diff --git a/src/native/corehost/hostmisc/pal.h b/src/native/corehost/hostmisc/pal.h index bde8446cc22cdf..94166e65d6f63a 100644 --- a/src/native/corehost/hostmisc/pal.h +++ b/src/native/corehost/hostmisc/pal.h @@ -335,6 +335,7 @@ namespace pal bool get_default_breadcrumb_store(string_t* recv); bool is_path_rooted(const string_t& path); + bool is_path_fully_qualified(const string_t& path); // Returns a platform-specific, user-private directory // that can be used for extracting out components of a single-file app. diff --git a/src/native/corehost/hostmisc/pal.unix.cpp b/src/native/corehost/hostmisc/pal.unix.cpp index 613902b5eaf3ac..265ad809d9af19 100644 --- a/src/native/corehost/hostmisc/pal.unix.cpp +++ b/src/native/corehost/hostmisc/pal.unix.cpp @@ -192,7 +192,7 @@ bool pal::get_loaded_library( { pal::string_t library_name_local; #if defined(TARGET_OSX) - if (!pal::is_path_rooted(library_name)) + if (!pal::is_path_fully_qualified(library_name)) library_name_local.append("@rpath/"); #endif library_name_local.append(library_name); @@ -200,7 +200,7 @@ bool pal::get_loaded_library( dll_t dll_maybe = dlopen(library_name_local.c_str(), RTLD_LAZY | RTLD_NOLOAD); if (dll_maybe == nullptr) { - if (pal::is_path_rooted(library_name)) + if (pal::is_path_fully_qualified(library_name)) return false; // dlopen on some systems only finds loaded libraries when given the full path @@ -265,6 +265,11 @@ bool pal::is_path_rooted(const pal::string_t& path) return path.front() == '/'; } +bool pal::is_path_fully_qualified(const pal::string_t& path) +{ + return is_path_rooted(path); +} + bool pal::get_default_breadcrumb_store(string_t* recv) { recv->clear(); diff --git a/src/native/corehost/hostmisc/pal.windows.cpp b/src/native/corehost/hostmisc/pal.windows.cpp index 3479c72aced1de..dacafb182899ec 100644 --- a/src/native/corehost/hostmisc/pal.windows.cpp +++ b/src/native/corehost/hostmisc/pal.windows.cpp @@ -641,9 +641,31 @@ pal::string_t pal::get_current_os_rid_platform() return ridOS; } +namespace +{ + bool is_directory_separator(pal::char_t c) + { + return c == DIR_SEPARATOR || c == L'/'; + } +} + bool pal::is_path_rooted(const string_t& path) { - return path.length() >= 2 && path[1] == L':'; + return (path.length() >= 1 && is_directory_separator(path[0])) // UNC or device paths + || (path.length() >= 2 && path[1] == L':'); // Drive letter paths +} + +bool pal::is_path_fully_qualified(const string_t& path) +{ + if (path.length() < 2) + return false; + + // Check for UNC and DOS device paths + if (is_directory_separator(path[0])) + return path[1] == L'?' || is_directory_separator(path[1]); + + // Check for drive absolute path - for example C:\. + return path.length() >= 3 && path[1] == L':' && is_directory_separator(path[2]); } // Returns true only if an env variable can be read successfully to be non-empty. diff --git a/src/native/corehost/hostpolicy/deps_resolver.cpp b/src/native/corehost/hostpolicy/deps_resolver.cpp index 0e87b791cfbfc4..88cb29ce6bffdb 100644 --- a/src/native/corehost/hostpolicy/deps_resolver.cpp +++ b/src/native/corehost/hostpolicy/deps_resolver.cpp @@ -601,7 +601,7 @@ void deps_resolver_t::init_known_entry_path(const deps_entry_t& entry, const pal return; } - assert(pal::is_path_rooted(path)); + assert(pal::is_path_fully_qualified(path)); if (m_coreclr_path.empty() && utils::ends_with(path, DIR_SEPARATOR_STR LIBCORECLR_NAME, false)) { m_coreclr_path = path; diff --git a/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp b/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp index 8df8e395e3f259..adcebeb9a029c5 100644 --- a/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp +++ b/src/native/corehost/hostpolicy/standalone/coreclr_resolver.cpp @@ -14,7 +14,7 @@ bool coreclr_resolver_t::resolve_coreclr(const pal::string_t& libcoreclr_path, c append_path(&coreclr_dll_path, LIBCORECLR_NAME); // We should always be loading coreclr from an absolute path - if (!pal::is_path_rooted(coreclr_dll_path)) + if (!pal::is_path_fully_qualified(coreclr_dll_path)) return false; if (!pal::load_library(&coreclr_dll_path, &coreclr_resolver_contract.coreclr)) From 3f2f679e4339c07711e45113b337a2fc442c2960 Mon Sep 17 00:00:00 2001 From: Nikola Milosavljevic Date: Thu, 26 Jun 2025 09:54:11 -0700 Subject: [PATCH 07/33] Update openssl dependency for SLES (#116922) --- .../dotnet-runtime-deps/dotnet-runtime-deps-sles.12.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer/pkg/sfx/installers/dotnet-runtime-deps/dotnet-runtime-deps-sles.12.proj b/src/installer/pkg/sfx/installers/dotnet-runtime-deps/dotnet-runtime-deps-sles.12.proj index 912692f5d7f26f..f007b2acb63ee8 100644 --- a/src/installer/pkg/sfx/installers/dotnet-runtime-deps/dotnet-runtime-deps-sles.12.proj +++ b/src/installer/pkg/sfx/installers/dotnet-runtime-deps/dotnet-runtime-deps-sles.12.proj @@ -5,6 +5,6 @@ - + \ No newline at end of file From b161846b48b068dcb0636c654b27a4312d932ecc Mon Sep 17 00:00:00 2001 From: Manish Godse <61718172+mangod9@users.noreply.github.com> Date: Thu, 26 Jun 2025 23:31:21 -0700 Subject: [PATCH 08/33] [9.0] Backport 115546 FLS initialization fix to 9. (#116872) * Move FLS init before EventPipeAdapter::FinishInitialize and the first SetupThread() (#115546) * fix * PR feedback Co-authored-by: Jan Kotas * moved profiler init before FinalizerThreadCreate * Update src/coreclr/vm/ceemain.cpp Co-authored-by: Jan Kotas * create finalizer thread earlier only on Windows. * Update src/coreclr/vm/ceemain.cpp Co-authored-by: Jan Kotas --------- Co-authored-by: Jan Kotas * Fix merge conflict --------- Co-authored-by: Vladimir Sadov Co-authored-by: Jan Kotas --- src/coreclr/vm/ceemain.cpp | 81 ++++++++++++++++++------------ src/coreclr/vm/finalizerthread.cpp | 1 + src/coreclr/vm/syncblk.cpp | 7 --- 3 files changed, 51 insertions(+), 38 deletions(-) diff --git a/src/coreclr/vm/ceemain.cpp b/src/coreclr/vm/ceemain.cpp index 4143d763fbca04..3df24664ff2df5 100644 --- a/src/coreclr/vm/ceemain.cpp +++ b/src/coreclr/vm/ceemain.cpp @@ -862,36 +862,19 @@ void EEStartupHelper() #ifdef PROFILING_SUPPORTED // Initialize the profiling services. + // This must happen before Thread::HasStarted() that fires profiler notifications is called on the finalizer thread. hr = ProfilingAPIUtility::InitializeProfiling(); _ASSERTE(SUCCEEDED(hr)); IfFailGo(hr); #endif // PROFILING_SUPPORTED - InitializeExceptionHandling(); - - // - // Install our global exception filter - // - if (!InstallUnhandledExceptionFilter()) - { - IfFailGo(E_FAIL); - } - - // throws on error - SetupThread(); - -#ifdef DEBUGGING_SUPPORTED - // Notify debugger once the first thread is created to finish initialization. - if (g_pDebugInterface != NULL) - { - g_pDebugInterface->StartupPhase2(GetThread()); - } -#endif - - // This isn't done as part of InitializeGarbageCollector() above because - // debugger must be initialized before creating EE thread objects +#ifdef TARGET_WINDOWS + // Create the finalizer thread on windows earlier, as we will need to wait for + // the completion of its initialization part that initializes COM as that has to be done + // before the first Thread is attached. Thus we want to give the thread a bit more time. FinalizerThread::FinalizerThreadCreate(); +#endif InitPreStubManager(); @@ -906,8 +889,6 @@ void EEStartupHelper() InitJITHelpers1(); InitJITHelpers2(); - SyncBlockCache::Attach(); - // Set up the sync block SyncBlockCache::Start(); @@ -922,6 +903,48 @@ void EEStartupHelper() IfFailGo(hr); + InitializeExceptionHandling(); + + // + // Install our global exception filter + // + if (!InstallUnhandledExceptionFilter()) + { + IfFailGo(E_FAIL); + } + +#ifdef TARGET_WINDOWS + // g_pGCHeap->Initialize() above could take nontrivial time, so by now the finalizer thread + // should have initialized FLS slot for thread cleanup notifications. + // And ensured that COM is initialized (must happen before allocating FLS slot). + // Make sure that this was done before we start creating Thread objects + // Ex: The call to SetupThread below will create and attach a Thread object. + // Event pipe might also do that. + FinalizerThread::WaitForFinalizerThreadStart(); +#endif + + // throws on error + _ASSERTE(GetThreadNULLOk() == NULL); + SetupThread(); + +#ifdef DEBUGGING_SUPPORTED + // Notify debugger once the first thread is created to finish initialization. + if (g_pDebugInterface != NULL) + { + g_pDebugInterface->StartupPhase2(GetThread()); + } +#endif + +#ifndef TARGET_WINDOWS + // This isn't done as part of InitializeGarbageCollector() above because + // debugger must be initialized before creating EE thread objects + FinalizerThread::FinalizerThreadCreate(); +#else + // On windows the finalizer thread is already partially created and is waiting + // right before doing HasStarted(). We will release it now. + FinalizerThread::EnableFinalization(); +#endif + #ifdef FEATURE_PERFTRACING // Finish setting up rest of EventPipe - specifically enable SampleProfiler if it was requested at startup. // SampleProfiler needs to cooperate with the GC which hasn't fully finished setting up in the first part of the @@ -982,12 +1005,6 @@ void EEStartupHelper() g_MiniMetaDataBuffMaxSize, MEM_COMMIT, PAGE_READWRITE); #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS -#ifdef TARGET_WINDOWS - // By now finalizer thread should have initialized FLS slot for thread cleanup notifications. - // And ensured that COM is initialized (must happen before allocating FLS slot). - // Make sure that this was done. - FinalizerThread::WaitForFinalizerThreadStart(); -#endif g_fEEStarted = TRUE; g_EEStartupStatus = S_OK; hr = S_OK; @@ -1794,6 +1811,8 @@ void InitFlsSlot() // thread - thread to attach static void OsAttachThread(void* thread) { + _ASSERTE(g_flsIndex != FLS_OUT_OF_INDEXES); + if (t_flsState == FLS_STATE_INVOKED) { _ASSERTE_ALL_BUILDS(!"Attempt to execute managed code after the .NET runtime thread state has been destroyed."); diff --git a/src/coreclr/vm/finalizerthread.cpp b/src/coreclr/vm/finalizerthread.cpp index 546a8d1eba240f..ef666c863eed2e 100644 --- a/src/coreclr/vm/finalizerthread.cpp +++ b/src/coreclr/vm/finalizerthread.cpp @@ -445,6 +445,7 @@ DWORD WINAPI FinalizerThread::FinalizerThreadStart(void *args) // handshake with EE initialization, as now we can attach Thread objects to native threads. hEventFinalizerDone->Set(); + WaitForFinalizerEvent (hEventFinalizer); #endif s_FinalizerThreadOK = GetFinalizerThread()->HasStarted(); diff --git a/src/coreclr/vm/syncblk.cpp b/src/coreclr/vm/syncblk.cpp index 868fffca0c0552..4186bccd8846a9 100644 --- a/src/coreclr/vm/syncblk.cpp +++ b/src/coreclr/vm/syncblk.cpp @@ -625,13 +625,6 @@ void SyncBlockCache::CleanupSyncBlocks() } EE_END_FINALLY; } -// create the sync block cache -/* static */ -void SyncBlockCache::Attach() -{ - LIMITED_METHOD_CONTRACT; -} - // create the sync block cache /* static */ void SyncBlockCache::Start() From a876220f8e43e8d4735f5474967ef80f9453651b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 15:43:59 -0500 Subject: [PATCH 09/33] Update dependencies from https://github.com/dotnet/roslyn build 20250629.7 (#117137) Microsoft.SourceBuild.Intermediate.roslyn , Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset From Version 4.12.0-3.25275.3 -> To Version 4.12.0-3.25329.7 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 5 +++-- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/NuGet.config b/NuGet.config index e4806514865c0f..cd65b636a861b8 100644 --- a/NuGet.config +++ b/NuGet.config @@ -10,10 +10,11 @@ + + + - - - + https://github.com/dotnet/roslyn 3f5cf9fbbd91f2047e988801a5142ca1cb6bab45 diff --git a/eng/Versions.props b/eng/Versions.props index 1658031bdfbee1..e30d8da020f3ad 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,9 +44,9 @@ Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure they do not break the local dev experience. --> - 4.12.0-3.25275.3 - 4.12.0-3.25275.3 - 4.12.0-3.25275.3 + 4.12.0-3.25329.7 + 4.12.0-3.25329.7 + 4.12.0-3.25329.7 9.0.0-rtm.24511.16 - 9.0.0-rtm.25304.1 + 9.0.0-rtm.25326.1 9.0.0-rtm.24466.4 2.4.8 From bab8497f90a6c54bbcb8fd3a4c0e55dfa3af6b2f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:00:37 -0500 Subject: [PATCH 11/33] [release/9.0-staging] Update dependencies from dotnet/cecil (#116455) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update dependencies from https://github.com/dotnet/cecil build 20250608.1 Microsoft.SourceBuild.Intermediate.cecil , Microsoft.DotNet.Cecil From Version 0.11.5-alpha.25275.2 -> To Version 0.11.5-alpha.25308.1 * Update dependencies from https://github.com/dotnet/cecil build 20250615.1 Microsoft.SourceBuild.Intermediate.cecil , Microsoft.DotNet.Cecil From Version 0.11.5-alpha.25275.2 -> To Version 0.11.5-alpha.25315.1 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: David Cantú --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b32e9104843cb5..524fd399e7fb33 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,14 +54,14 @@ 803d8598f98fb4efd94604b32627ee9407f246db - + https://github.com/dotnet/cecil - bbb895e8e9f2d566eae04f09977b8c5f895057d2 + a4ebe32b930a045687dd68e4e7b799a59cd75629 - + https://github.com/dotnet/cecil - bbb895e8e9f2d566eae04f09977b8c5f895057d2 + a4ebe32b930a045687dd68e4e7b799a59cd75629 diff --git a/eng/Versions.props b/eng/Versions.props index 87c7e00419f387..2f8c7a122c33c1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -215,7 +215,7 @@ 9.0.0-preview-20241010.1 - 0.11.5-alpha.25275.2 + 0.11.5-alpha.25315.1 9.0.0-rtm.24511.16 From fcd77a948e0f774c77d3f0503889a2f36a562b3f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:02:41 -0500 Subject: [PATCH 12/33] [release/9.0-staging] Update dependencies from dotnet/arcade (#116948) * Update dependencies from https://github.com/dotnet/arcade build 20250623.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.25302.2 -> To Version 9.0.0-beta.25323.2 * Update dependencies from https://github.com/dotnet/arcade build 20250625.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.25302.2 -> To Version 9.0.0-beta.25325.4 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 84 +++++++++++++-------------- eng/Versions.props | 32 +++++----- eng/common/core-templates/job/job.yml | 4 ++ eng/common/internal/NuGet.config | 3 + global.json | 10 ++-- 5 files changed, 70 insertions(+), 63 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 524fd399e7fb33..cf5d1510c593b5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -92,87 +92,87 @@ - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d https://github.com/dotnet/runtime-assets @@ -332,9 +332,9 @@ https://github.com/dotnet/xharness 4d797652fa667e94a39db06cbb5a3cad4f72a51f - + https://github.com/dotnet/arcade - 0d52a8b262d35fa2fde84e398cb2e791b8454bd2 + 13b20849f8294593bf150a801cab639397e6c29d https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/eng/Versions.props b/eng/Versions.props index 2f8c7a122c33c1..a88c01ba5ac070 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -85,22 +85,22 @@ 9.0.107 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 2.9.0-beta.25302.2 - 9.0.0-beta.25302.2 - 2.9.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 - 9.0.0-beta.25302.2 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 2.9.0-beta.25325.4 + 9.0.0-beta.25325.4 + 2.9.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 + 9.0.0-beta.25325.4 1.4.0 diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml index ba53ebfbd51334..abe80a2a0e09c9 100644 --- a/eng/common/core-templates/job/job.yml +++ b/eng/common/core-templates/job/job.yml @@ -134,6 +134,10 @@ jobs: signType: $(_SignType) zipSources: false feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: + ConnectedPMEServiceName: 6cc74545-d7b9-4050-9dfa-ebefcc8961ea + ${{ else }}: + ConnectedPMEServiceName: 248d384a-b39b-46e3-8ad5-c2c210d5e7ca env: TeamName: $(_TeamName) MicroBuildOutputFolderOverride: '$(Agent.TempDirectory)' diff --git a/eng/common/internal/NuGet.config b/eng/common/internal/NuGet.config index 19d3d311b166f5..f70261ed689bce 100644 --- a/eng/common/internal/NuGet.config +++ b/eng/common/internal/NuGet.config @@ -4,4 +4,7 @@ + + + diff --git a/global.json b/global.json index e7a948a8c83a06..060c5f7a5532be 100644 --- a/global.json +++ b/global.json @@ -1,16 +1,16 @@ { "sdk": { - "version": "9.0.106", + "version": "9.0.107", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "9.0.106" + "dotnet": "9.0.107" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25302.2", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25302.2", - "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.25302.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25325.4", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25325.4", + "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.25325.4", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", "Microsoft.NET.Sdk.IL": "9.0.0-rtm.24511.16" From badb219e043edb9f70873d31219a1b7dda8dd9dd Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 21:52:47 +0000 Subject: [PATCH 13/33] [release/9.0-staging] Update dependencies from dotnet/hotreload-utils (#115596) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update dependencies from https://github.com/dotnet/hotreload-utils build 20250514.1 Microsoft.DotNet.HotReload.Utils.Generator.BuildTool From Version 9.0.0-alpha.0.25209.2 -> To Version 9.0.0-alpha.0.25264.1 * Update dependencies from https://github.com/dotnet/hotreload-utils build 20250515.2 Microsoft.DotNet.HotReload.Utils.Generator.BuildTool From Version 9.0.0-alpha.0.25209.2 -> To Version 9.0.0-alpha.0.25265.2 * Update dependencies from https://github.com/dotnet/hotreload-utils build 20250613.1 Microsoft.DotNet.HotReload.Utils.Generator.BuildTool From Version 9.0.0-alpha.0.25209.2 -> To Version 9.0.0-alpha.0.25313.1 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: David Cantú --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cf5d1510c593b5..4ad938fddb6e94 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -352,9 +352,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-optimization 9d7532585ce71e30ab55f0364d3cecccaf0775d1 - + https://github.com/dotnet/hotreload-utils - 46df3d5e763fdd0e57eeafcb898a86bb955483cb + 8a0acc36f3c3a65aed35fee6e6213b59325a64a9 https://github.com/dotnet/runtime-assets diff --git a/eng/Versions.props b/eng/Versions.props index a88c01ba5ac070..d1edccd13fcff0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -187,7 +187,7 @@ 9.0.0-prerelease.25269.3 9.0.0-prerelease.25269.3 9.0.0-prerelease.25269.3 - 9.0.0-alpha.0.25209.2 + 9.0.0-alpha.0.25313.1 3.12.0 4.5.0 6.0.0 From db6f174c145e46e8b8cc63edb1e3fceaa3d0d8fe Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 21:53:58 +0000 Subject: [PATCH 14/33] [release/9.0-staging] Update dependencies from dotnet/source-build-reference-packages (#115588) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250423.3 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25081.6 -> To Version 9.0.0-alpha.1.25223.3 * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250522.2 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25081.6 -> To Version 9.0.0-alpha.1.25272.2 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: David Cantú --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4ad938fddb6e94..628c0198ee1c63 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -79,9 +79,9 @@ - + https://github.com/dotnet/source-build-reference-packages - 1cec3b4a8fb07138136a1ca1e04763bfcf7841db + 9859d82ffce48f49b5e93fa46a38bdddc4ba26be From f377282db58c81d162b06dd1b74c96c930f1075c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 11:32:57 +0200 Subject: [PATCH 15/33] Map version for Tahoe compatibility. (#116641) macOS Tahoe returns a compatibility version, 16, for macOS 26 unless it is built with Xcode 26's SDK. As we did with Big Sur, this maps the compatibility version 16 to 26. The intention is that we will be on the new SDK by the time macOS 27 rolls out. If not, then we will need to add another compatibility map, most likely. It does not appear that iOS, tvOS, or Catalyst return compatibility numbers, so they are excluded from doing any mapping. Co-authored-by: Kevin Jones --- .../Common/src/Interop/OSX/Interop.libobjc.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs b/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs index 7274cb569051d7..73c57af7ec249c 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs @@ -46,14 +46,17 @@ internal static Version GetOperatingSystemVersion() } } - if (major == 10 && minor == 16) +#if TARGET_OSX + if (major == 16) { - // We get "compat" version for 11.0 unless we build with updated SDK. - // Hopefully that will be before 11.x comes out - // For now, this maps 10.16 to 11.0. - major = 11; - minor = 0; + // MacOS Tahoe returns a compatibility version unless it is built with a new SDK. Map the compatibility + // version to the "correct" version. This assumes the minor versions will map unchanged. + // 16.0 => 26.0 + // 16.1 => 26.1 + // etc + major = 26; } +#endif return new Version(major, minor, patch); } From b6f30ed1b8a05613817b2b632e64af8689ff8c2e Mon Sep 17 00:00:00 2001 From: Rich Lander Date: Tue, 1 Jul 2025 10:17:23 -0700 Subject: [PATCH 16/33] [9.0] Update CI OSes (#115503) * [0.0] Update CI OSes * Update to match main * Switch to CentOS Stream 9 * Update bad yaml * Update VMs and container references * Update Alma Linux 9 image * Add Mariner 2.0 back * Switch back to older Alpine for older LLVM * Removing conditions from linux-musl-x64 legs * Apply changes from main and release/8.0-staging * Match outerloop to main * Update queue typo --- .../templates/pipeline-with-resources.yml | 9 +-- .../coreclr/templates/helix-queues-setup.yml | 20 +++--- .../libraries/helix-queues-setup.yml | 70 +++++++++---------- 3 files changed, 45 insertions(+), 54 deletions(-) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 18bcf3a5e5ff05..b99d425f52b58f 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -21,11 +21,6 @@ extends: env: ROOTFS_DIR: /crossrootfs/arm - linux_armv6: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-armv6-raspbian-10 - env: - ROOTFS_DIR: /crossrootfs/armv6 - linux_arm64: image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm64 env: @@ -72,7 +67,7 @@ extends: image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04 linux_musl_x64_dev_innerloop: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode + image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-amd64 linux_x64_sanitizer: image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64-sanitizer @@ -84,7 +79,7 @@ extends: image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9 # AlmaLinux 8 is a RHEL 8 rebuild, so we use it to test building from source on RHEL 8. SourceBuild_linux_x64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-8-source-build + image: mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-9-source-build-amd64 linux_s390x: image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-s390x diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml index 9ccad909568543..4d05678f0b7293 100644 --- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml +++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml @@ -70,37 +70,37 @@ jobs: # Linux arm64 - ${{ if eq(parameters.platform, 'linux_arm64') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Ubuntu.2004.Arm64.Open)Ubuntu.2204.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-arm64v8 + - (Ubuntu.2204.Arm64.Open)Ubuntu.2204.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-arm64v8 - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Ubuntu.2004.Arm64)Ubuntu.2204.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-arm64v8 + - (Ubuntu.2204.Arm64)Ubuntu.2204.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-arm64v8 # Linux musl x64 - ${{ if eq(parameters.platform, 'linux_musl_x64') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Alpine.321.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-amd64 + - (Alpine.322.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-helix-amd64 - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Alpine.321.Amd64)Ubuntu.2204.Amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-amd64 + - (Alpine.322.Amd64)AzureLinux.3.Amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-helix-amd64 # Linux musl arm32 - ${{ if eq(parameters.platform, 'linux_musl_arm') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Alpine.321.Arm32.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-arm32v7 + - (Alpine.322.Arm32.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-helix-arm32v7 - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Alpine.321.Arm32)Ubuntu.2204.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-arm32v7 + - (Alpine.322.Arm32)Ubuntu.2204.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-helix-arm32v7 # Linux musl arm64 - ${{ if eq(parameters.platform, 'linux_musl_arm64') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Alpine.320.Arm64.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.20-helix-arm64v8 + - (Alpine.322.Arm64.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-helix-arm64v8 - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Alpine.320.Arm64)Ubuntu.2204.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.20-helix-arm64v8 + - (Alpine.322.Arm64)Ubuntu.2204.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-helix-arm64v8 # Linux x64 - ${{ if eq(parameters.platform, 'linux_x64') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - Ubuntu.2204.Amd64.Open + - AzureLinux.3.Amd64.Open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - Ubuntu.2204.Amd64 + - AzureLinux.3.Amd64 # OSX arm64 - ${{ if eq(parameters.platform, 'osx_arm64') }}: diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 7b849e1bea38c5..cb8447877b09d4 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -27,53 +27,49 @@ jobs: - ${{ if eq(parameters.platform, 'linux_arm') }}: - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - (Debian.12.Arm32.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm32v7 - - # Linux armv6 - - ${{ if eq(parameters.platform, 'linux_armv6') }}: - - (Raspbian.10.Armv6.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:raspbian-10-helix-arm32v6 - # Linux arm64 - ${{ if eq(parameters.platform, 'linux_arm64') }}: - - (Ubuntu.2204.Arm64.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-arm64v8 + - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: + - (Ubuntu.2204.ArmArch.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-arm64v8 - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Debian.12.Arm64.Open)Ubuntu.2204.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm64v8 + - (AzureLinux.3.0.ArmArch.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-arm64v8 # Linux musl x64 - ${{ if eq(parameters.platform, 'linux_musl_x64') }}: - - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Alpine.321.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-amd64 - - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Alpine.321.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-amd64 + - (Alpine.322.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-helix-amd64 # Linux musl arm64 - - ${{ if and(eq(parameters.platform, 'linux_musl_arm64'), or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true))) }}: - - (Alpine.320.Arm64.Open)ubuntu.2004.armarch.open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.20-helix-arm64v8 + - ${{ if eq(parameters.platform, 'linux_musl_arm64') }}: + - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: + - (Alpine.322.Arm64.Open)Ubuntu.2204.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-helix-arm64v8 + # Linux x64 - ${{ if eq(parameters.platform, 'linux_x64') }}: - - ${{ if and(eq(parameters.jobParameters.interpreter, ''), ne(parameters.jobParameters.isSingleFile, true)) }}: - - ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - - SLES.15.Amd64.Open - - (Centos.9.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9-helix - - (Fedora.41.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-41-helix - - (Ubuntu.2204.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-amd64 - - (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 - - ${{ if or(ne(parameters.jobParameters.testScope, 'outerloop'), ne(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - SLES.15.Amd64.Open - - (Fedora.41.Amd64.Open)ubuntu.2204.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-41-helix - - Ubuntu.2204.Amd64.Open - - (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 - - (Mariner.2.0.Amd64.Open)Ubuntu.2204.Amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-helix-amd64 - - (AzureLinux.3.0.Amd64.Open)Ubuntu.2204.Amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64 - - (openSUSE.15.6.Amd64.Open)Ubuntu.2204.Amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.6-helix-amd64 - - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Centos.9.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9-helix - - (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 - - Ubuntu.2204.Amd64.Open - ${{ if or(eq(parameters.jobParameters.interpreter, 'true'), eq(parameters.jobParameters.isSingleFile, true)) }}: # Limiting interp runs as we don't need as much coverage. - - (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 + - (Debian.12.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 + + - ${{ else }}: + - ${{ if eq(parameters.jobParameters.runtimeFlavor, 'mono') }}: + # Mono path - test minimal scenario + - Ubuntu.2204.Amd64.Open + - ${{ else }}: + # CoreCLR path + - ${{ if and(eq(parameters.jobParameters.isExtraPlatformsBuild, true), ne(parameters.jobParameters.testScope, 'outerloop'))}}: + # extra-platforms CoreCLR (inner loop only) + - (Debian.12.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 + - (Mariner.2.0.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-helix-amd64 + + - ${{ if eq(parameters.jobParameters.testScope, 'outerloop') }}: + # outerloop only CoreCLR + - AzureLinux.3.Amd64.Open + + - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true))}}: + # inner and outer loop CoreCLR (general set) + - Ubuntu.2204.Amd64.Open + - (AzureLinux.3.0.Amd64.Open)AzureLinux.3.Amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64 + - (Centos.10.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-helix-amd64 # OSX arm64 - ${{ if eq(parameters.platform, 'osx_arm64') }}: @@ -156,15 +152,15 @@ jobs: # WASI - ${{ if eq(parameters.platform, 'wasi_wasm') }}: - - (Ubuntu.2204.Amd64)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-webassembly + - (Ubuntu.2204.Amd64)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-webassembly # Browser WebAssembly - ${{ if eq(parameters.platform, 'browser_wasm') }}: - - (Ubuntu.2204.Amd64)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-webassembly + - (Ubuntu.2204.Amd64)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-webassembly # Browser WebAssembly Firefox - ${{ if eq(parameters.platform, 'browser_wasm_firefox') }}: - - (Ubuntu.2204.Amd64)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-webassembly + - (Ubuntu.2204.Amd64)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-webassembly # Browser WebAssembly windows - ${{ if in(parameters.platform, 'browser_wasm_win', 'wasi_wasm_win') }}: From 74b6c766ee294bfa71a066c980c1e524f5a13b2a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 05:56:15 +0000 Subject: [PATCH 17/33] [release/9.0-staging] Update dependencies from dotnet/sdk (#116683) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update dependencies from https://github.com/dotnet/sdk build 20250613.39 Microsoft.SourceBuild.Intermediate.sdk , Microsoft.DotNet.ApiCompat.Task From Version 9.0.107-servicing.25272.8 -> To Version 9.0.108-servicing.25313.39 * Update dependencies from https://github.com/dotnet/sdk build 20250617.14 Microsoft.SourceBuild.Intermediate.sdk , Microsoft.DotNet.ApiCompat.Task From Version 9.0.107-servicing.25272.8 -> To Version 9.0.108-servicing.25317.14 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: David Cantú --- NuGet.config | 1 + eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NuGet.config b/NuGet.config index cd65b636a861b8..ad5774f65cfc3f 100644 --- a/NuGet.config +++ b/NuGet.config @@ -15,6 +15,7 @@ + - + https://github.com/dotnet/sdk - 38e51fe4e1fa36644ea66191001e82078989f051 + 525adf54d5abc1f40737bb9a9bbe53f25622398a diff --git a/eng/Versions.props b/eng/Versions.props index d1edccd13fcff0..53d5a3aaf04513 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -83,7 +83,7 @@ 0.2.0 - 9.0.107 + 9.0.108 9.0.0-beta.25325.4 9.0.0-beta.25325.4 From f1308f0ef98dcea07573b54921c9c91253dd5b2a Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Tue, 8 Jul 2025 17:13:06 +0300 Subject: [PATCH 18/33] Disable odbc tests on net9 interpreter (#117245) --- .../System.Data.Odbc/tests/CommandBuilderTests.cs | 2 ++ src/libraries/System.Data.Odbc/tests/ConnectionTests.cs | 1 + .../System.Data.Odbc/tests/DependencyCheckTest.cs | 1 + src/libraries/System.Data.Odbc/tests/ReaderTests.cs | 8 ++++++++ src/libraries/System.Data.Odbc/tests/SmokeTest.cs | 1 + 5 files changed, 13 insertions(+) diff --git a/src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs b/src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs index 5b3c38bf894059..48f7dd90506e93 100644 --- a/src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs +++ b/src/libraries/System.Data.Odbc/tests/CommandBuilderTests.cs @@ -7,6 +7,7 @@ namespace System.Data.Odbc.Tests { public class CommandBuilderTests : IntegrationTestBase { + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void QuoteIdentifier_UseConnection() { @@ -36,6 +37,7 @@ public void QuoteIdentifier_UseConnection() Assert.Throws(() => commandBuilder.UnquoteIdentifier("Test")); } + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void QuoteIdentifier_CustomPrefixSuffix() { diff --git a/src/libraries/System.Data.Odbc/tests/ConnectionTests.cs b/src/libraries/System.Data.Odbc/tests/ConnectionTests.cs index 24c42a5bc72401..a468a0f0e2a39d 100644 --- a/src/libraries/System.Data.Odbc/tests/ConnectionTests.cs +++ b/src/libraries/System.Data.Odbc/tests/ConnectionTests.cs @@ -9,6 +9,7 @@ namespace System.Data.Odbc.Tests { public class ConnectionTests : IntegrationTestBase { + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] // Bug #96278 fixed only on .NET, not on .NET Framework [ConditionalFact] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] diff --git a/src/libraries/System.Data.Odbc/tests/DependencyCheckTest.cs b/src/libraries/System.Data.Odbc/tests/DependencyCheckTest.cs index d2eee47618689f..2937d2a15c6232 100644 --- a/src/libraries/System.Data.Odbc/tests/DependencyCheckTest.cs +++ b/src/libraries/System.Data.Odbc/tests/DependencyCheckTest.cs @@ -8,6 +8,7 @@ namespace System.Data.Odbc.Tests public class DependencyCheckTest { [ConditionalFact(Helpers.OdbcNotAvailable)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] public void OdbcConnection_OpenWhenOdbcNotInstalled_ThrowsException() { if (PlatformDetection.IsWindowsServerCore && !Environment.Is64BitProcess) diff --git a/src/libraries/System.Data.Odbc/tests/ReaderTests.cs b/src/libraries/System.Data.Odbc/tests/ReaderTests.cs index 79ea6ffa93c485..1010e02870f5d8 100644 --- a/src/libraries/System.Data.Odbc/tests/ReaderTests.cs +++ b/src/libraries/System.Data.Odbc/tests/ReaderTests.cs @@ -8,6 +8,7 @@ namespace System.Data.Odbc.Tests { public class ReaderTests : IntegrationTestBase { + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void EmptyReader() { @@ -42,6 +43,7 @@ public void EmptyReader() } } + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void GetValues() { @@ -75,6 +77,7 @@ public void GetValues() } } + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void GetValueFailsWithBigIntWithBackwardsCompatibility() { @@ -110,6 +113,7 @@ public void GetValueFailsWithBigIntWithBackwardsCompatibility() } } + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void GetDataTypeName() { @@ -136,6 +140,7 @@ public void GetDataTypeName() } } + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void GetFieldTypeIsNotSupportedInSqlite() { @@ -167,6 +172,7 @@ public void GetFieldTypeIsNotSupportedInSqlite() } } + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void IsDbNullIsNotSupportedInSqlite() { @@ -198,6 +204,7 @@ public void IsDbNullIsNotSupportedInSqlite() } } + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void InvalidRowIndex() { @@ -230,6 +237,7 @@ public void InvalidRowIndex() } } + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void InvalidRowName() { diff --git a/src/libraries/System.Data.Odbc/tests/SmokeTest.cs b/src/libraries/System.Data.Odbc/tests/SmokeTest.cs index f508673fbde2f5..2733b0a0aa620e 100644 --- a/src/libraries/System.Data.Odbc/tests/SmokeTest.cs +++ b/src/libraries/System.Data.Odbc/tests/SmokeTest.cs @@ -7,6 +7,7 @@ namespace System.Data.Odbc.Tests { public class SmokeTest : IntegrationTestBase { + [ActiveIssue("https://github.com/dotnet/runtime/issues/116482", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [ConditionalFact] public void CreateInsertSelectTest() { From fb553ef0e54669ee0782145726285cbbd4e0ae79 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:05:25 -0700 Subject: [PATCH 19/33] Update dependencies from https://github.com/dotnet/cecil build 20250629.2 (#117228) Microsoft.SourceBuild.Intermediate.cecil , Microsoft.DotNet.Cecil From Version 0.11.5-alpha.25315.1 -> To Version 0.11.5-alpha.25329.2 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 024bcc98325b2c..9b1131d158af46 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,14 +54,14 @@ 803d8598f98fb4efd94604b32627ee9407f246db - + https://github.com/dotnet/cecil - a4ebe32b930a045687dd68e4e7b799a59cd75629 + 862b4c8bf05585cc44ceb32dc0fd060ceed06cd2 - + https://github.com/dotnet/cecil - a4ebe32b930a045687dd68e4e7b799a59cd75629 + 862b4c8bf05585cc44ceb32dc0fd060ceed06cd2 diff --git a/eng/Versions.props b/eng/Versions.props index 53d5a3aaf04513..b69a9e0dece2d6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -215,7 +215,7 @@ 9.0.0-preview-20241010.1 - 0.11.5-alpha.25315.1 + 0.11.5-alpha.25329.2 9.0.0-rtm.24511.16 From 31582636dc36f91a63b93cf7570781051405952e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:06:24 -0700 Subject: [PATCH 20/33] [release/9.0-staging] Update dependencies from dotnet/icu (#117257) * Update dependencies from https://github.com/dotnet/icu build 20250701.1 Microsoft.NETCore.Runtime.ICU.Transport From Version 9.0.0-rtm.25326.1 -> To Version 9.0.0-rtm.25351.1 * Update dependencies from https://github.com/dotnet/icu build 20250703.1 Microsoft.NETCore.Runtime.ICU.Transport From Version 9.0.0-rtm.25326.1 -> To Version 9.0.0-rtm.25353.1 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9b1131d158af46..fa89ce301747d4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/icu - c261632f3483ac6f08c6468c46cbdb395672770d + 50d7c192bf19a9a3d20ea7ca7a30c3f3526c1a7e https://github.com/dotnet/msquic diff --git a/eng/Versions.props b/eng/Versions.props index b69a9e0dece2d6..381309e9cca47c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -219,7 +219,7 @@ 9.0.0-rtm.24511.16 - 9.0.0-rtm.25326.1 + 9.0.0-rtm.25353.1 9.0.0-rtm.24466.4 2.4.8 From dc5d92b62e77aed998d3fc891e029b2eb8073063 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:07:28 -0700 Subject: [PATCH 21/33] Update dependencies from https://github.com/dotnet/hotreload-utils build 20250630.3 (#117184) Microsoft.DotNet.HotReload.Utils.Generator.BuildTool From Version 9.0.0-alpha.0.25313.1 -> To Version 9.0.0-alpha.0.25330.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fa89ce301747d4..4b22a32ddacd32 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -352,9 +352,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-optimization 9d7532585ce71e30ab55f0364d3cecccaf0775d1 - + https://github.com/dotnet/hotreload-utils - 8a0acc36f3c3a65aed35fee6e6213b59325a64a9 + 3eb23e965fcc8cf3f6bec6e3e2543a81e52b6d20 https://github.com/dotnet/runtime-assets diff --git a/eng/Versions.props b/eng/Versions.props index 381309e9cca47c..41b6ed0f438e0e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -187,7 +187,7 @@ 9.0.0-prerelease.25269.3 9.0.0-prerelease.25269.3 9.0.0-prerelease.25269.3 - 9.0.0-alpha.0.25313.1 + 9.0.0-alpha.0.25330.3 3.12.0 4.5.0 6.0.0 From 7bdbb792c1110a7b3ff486d812c0cb941b32a3d4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:23:18 -0700 Subject: [PATCH 22/33] Update dependencies from https://github.com/dotnet/runtime-assets build 20250613.1 (#116664) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData From Version 9.0.0-beta.25266.2 -> To Version 9.0.0-beta.25313.1 Co-authored-by: dotnet-maestro[bot] Co-authored-by: David Cantú --- eng/Version.Details.xml | 56 ++++++++++++++++++++--------------------- eng/Versions.props | 28 ++++++++++----------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4b22a32ddacd32..4bcc11cbd07592 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -174,57 +174,57 @@ https://github.com/dotnet/arcade 13b20849f8294593bf150a801cab639397e6c29d - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 https://github.com/dotnet/llvm-project @@ -356,9 +356,9 @@ https://github.com/dotnet/hotreload-utils 3eb23e965fcc8cf3f6bec6e3e2543a81e52b6d20 - + https://github.com/dotnet/runtime-assets - 7f6eab719b1c6834f694cfddb73c3891942e31e4 + c77fd5058ea46e9d0b58f5c11b6808d6170e4e32 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index 41b6ed0f438e0e..1ad471c29dcc50 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -141,20 +141,20 @@ 8.0.0 8.0.0 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 - 9.0.0-beta.25266.2 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 + 9.0.0-beta.25313.1 1.0.0-prerelease.24462.2 1.0.0-prerelease.24462.2 From f572ba34d591f29847a741384eb134ad3637a948 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 22:10:29 +0000 Subject: [PATCH 23/33] Update dependencies from https://github.com/dotnet/xharness build 20250617.3 (#116908) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 9.0.0-prerelease.25269.3 -> To Version 9.0.0-prerelease.25317.3 Co-authored-by: dotnet-maestro[bot] Co-authored-by: David Cantú --- .config/dotnet-tools.json | 2 +- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e21dd9e89bf8a1..8da877c2f72151 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "9.0.0-prerelease.25269.3", + "version": "9.0.0-prerelease.25317.3", "commands": [ "xharness" ] diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4bcc11cbd07592..3083f4c7654724 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -320,17 +320,17 @@ https://github.com/dotnet/runtime b030c4dfdfa1bf287f10f96006619a06bc2000ae - + https://github.com/dotnet/xharness - 4d797652fa667e94a39db06cbb5a3cad4f72a51f + d20661676ca197f1f09a4322817b20a45da84290 - + https://github.com/dotnet/xharness - 4d797652fa667e94a39db06cbb5a3cad4f72a51f + d20661676ca197f1f09a4322817b20a45da84290 - + https://github.com/dotnet/xharness - 4d797652fa667e94a39db06cbb5a3cad4f72a51f + d20661676ca197f1f09a4322817b20a45da84290 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 1ad471c29dcc50..e8764ed43797cc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -184,9 +184,9 @@ 1.4.0 17.4.0-preview-20220707-01 - 9.0.0-prerelease.25269.3 - 9.0.0-prerelease.25269.3 - 9.0.0-prerelease.25269.3 + 9.0.0-prerelease.25317.3 + 9.0.0-prerelease.25317.3 + 9.0.0-prerelease.25317.3 9.0.0-alpha.0.25330.3 3.12.0 4.5.0 From 6ccaf09ac88b95442c9ee07d7ae51df50518f151 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Wed, 9 Jul 2025 12:19:49 +0200 Subject: [PATCH 24/33] [release/9.0-staging][wbt] Prevent `InvalidOperationException` on `TestOutputHelper` logging. (#116916) * Prevent InvalidOperationException when process output handlers try to write to xUnit TestOutputHelper after test context has expired. * Don't run WBT with NodeJS. * Prevent all other tests with template: "wasmconsole" from running as they also randomly timeout. --- eng/Versions.props | 2 +- .../runtime-extra-platforms-wasm.yml | 21 +- eng/pipelines/runtime-official.yml | 36 ++- eng/pipelines/runtime.yml | 21 +- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 46 ++- .../wasm/Wasm.Build.Tests/Common/RunHost.cs | 2 +- .../Wasm.Build.Tests/Common/ToolCommand.cs | 39 +-- .../wasm/Wasm.Build.Tests/IcuShardingTests.cs | 4 +- .../Wasm.Build.Tests/IcuShardingTests2.cs | 4 +- src/mono/wasm/Wasm.Build.Tests/IcuTests.cs | 8 +- .../Wasm.Build.Tests/MainWithArgsTests.cs | 14 +- .../Templates/NativeBuildTests.cs | 36 --- .../Templates/WasmTemplateTests.cs | 279 ------------------ 13 files changed, 115 insertions(+), 397 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index a48b8ef415336f..37a9a6142aee6d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -263,7 +263,7 @@ 1.0.406601 - 9.0.106 + 9.0.107 9.0.0-alpha.1.24175.1 $(MicrosoftNETRuntimeEmscriptenVersion) $(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 006faf47674290..ea18dd02459c90 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -233,17 +233,16 @@ jobs: publishArtifactsForWorkload: true publishWBT: true - # disabled: https://github.com/dotnet/runtime/issues/116492 - # - template: /eng/pipelines/common/templates/wasm-build-only.yml - # parameters: - # platforms: - # - browser_wasm - # - browser_wasm_win - # nameSuffix: MultiThreaded - # extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - # condition: ne(variables['wasmMultiThreadedBuildOnlyNeededOnDefaultPipeline'], true) - # publishArtifactsForWorkload: true - # publishWBT: false + - template: /eng/pipelines/common/templates/wasm-build-only.yml + parameters: + platforms: + - browser_wasm + - browser_wasm_win + nameSuffix: MultiThreaded + extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + condition: ne(variables['wasmMultiThreadedBuildOnlyNeededOnDefaultPipeline'], true) + publishArtifactsForWorkload: true + publishWBT: false # Browser Wasm.Build.Tests - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index b8bd6a82fc8aa1..22375d5c37c81a 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -364,25 +364,23 @@ extends: parameters: name: MonoRuntimePacks - # disabled: https://github.com/dotnet/runtime/issues/116492 - # - template: /eng/pipelines/common/platform-matrix.yml - # parameters: - # jobTemplate: /eng/pipelines/common/global-build-job.yml - # buildConfig: release - # runtimeFlavor: mono - # platforms: - # - browser_wasm - # jobParameters: - # templatePath: 'templates-official' - # buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - # nameSuffix: Mono_multithread - # isOfficialBuild: ${{ variables.isOfficialBuild }} - # runtimeVariant: multithread - # postBuildSteps: - # - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml - # parameters: - # name: MonoRuntimePacks - + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - browser_wasm + jobParameters: + templatePath: 'templates-official' + buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + nameSuffix: Mono_multithread + isOfficialBuild: ${{ variables.isOfficialBuild }} + runtimeVariant: multithread + postBuildSteps: + - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml + parameters: + name: MonoRuntimePacks # Build Mono AOT offset headers once, for consumption elsewhere # diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index be54c885cce17f..8f6e4ab408dd08 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -888,17 +888,16 @@ extends: publishArtifactsForWorkload: true publishWBT: true - # disabled: https://github.com/dotnet/runtime/issues/116492 - # - template: /eng/pipelines/common/templates/wasm-build-only.yml - # parameters: - # platforms: - # - browser_wasm - # - browser_wasm_win - # condition: or(eq(variables.isRollingBuild, true), eq(variables.wasmSingleThreadedBuildOnlyNeededOnDefaultPipeline, true)) - # nameSuffix: MultiThreaded - # extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) - # publishArtifactsForWorkload: true - # publishWBT: false + - template: /eng/pipelines/common/templates/wasm-build-only.yml + parameters: + platforms: + - browser_wasm + - browser_wasm_win + condition: or(eq(variables.isRollingBuild, true), eq(variables.wasmSingleThreadedBuildOnlyNeededOnDefaultPipeline, true)) + nameSuffix: MultiThreaded + extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + publishArtifactsForWorkload: true + publishWBT: false # Browser Wasm.Build.Tests - template: /eng/pipelines/common/templates/browser-wasm-build-tests.yml diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index 44c7d67ba22e1c..53f25caa3a525f 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -487,6 +487,7 @@ public static (int exitCode, string buildOutput) RunProcess(string path, _testOutput.WriteLine($"WorkingDirectory: {workingDir}"); StringBuilder outputBuilder = new(); object syncObj = new(); + bool isDisposed = false; var processStartInfo = new ProcessStartInfo { @@ -542,11 +543,13 @@ public static (int exitCode, string buildOutput) RunProcess(string path, using CancellationTokenSource cts = new(); cts.CancelAfter(timeoutMs ?? s_defaultPerTestTimeoutMs); - await process.WaitForExitAsync(cts.Token); - - if (cts.IsCancellationRequested) + try + { + await process.WaitForExitAsync(cts.Token); + } + catch (OperationCanceledException) { - // process didn't exit + // process didn't exit within timeout process.Kill(entireProcessTree: true); lock (syncObj) { @@ -560,6 +563,12 @@ public static (int exitCode, string buildOutput) RunProcess(string path, // https://learn.microsoft.com/dotnet/api/system.diagnostics.process.waitforexit?view=net-5.0#System_Diagnostics_Process_WaitForExit_System_Int32_ process.WaitForExit(); + // Mark as disposed before detaching handlers to prevent further TestOutput access + lock (syncObj) + { + isDisposed = true; + } + process.ErrorDataReceived -= logStdErr; process.OutputDataReceived -= logStdOut; process.CancelErrorRead(); @@ -573,7 +582,12 @@ public static (int exitCode, string buildOutput) RunProcess(string path, } catch (Exception ex) { - _testOutput.WriteLine($"-- exception -- {ex}"); + // Mark as disposed before writing to avoid potential race condition + lock (syncObj) + { + isDisposed = true; + } + TryWriteToTestOutput(_testOutput, $"-- exception -- {ex}", outputBuilder); throw; } @@ -581,9 +595,11 @@ void LogData(string label, string? message) { lock (syncObj) { + if (isDisposed) + return; if (message != null) { - _testOutput.WriteLine($"{label} {message}"); + TryWriteToTestOutput(_testOutput, $"{label} {message}", outputBuilder, label); } outputBuilder.AppendLine($"{label} {message}"); } @@ -627,6 +643,24 @@ public static string AddItemsPropertiesToProject(string projectFile, string? ext return projectFile; } + private static void TryWriteToTestOutput(ITestOutputHelper testOutput, string message, StringBuilder? outputBuffer = null, string? warningPrefix = null) + { + try + { + testOutput.WriteLine(message); + } + catch (InvalidOperationException) + { + // Test context has expired, but we still want to capture output in buffer + // for potential debugging purposes + if (outputBuffer != null) + { + string prefix = warningPrefix ?? ""; + outputBuffer.AppendLine($"{prefix}[WARNING: Test context expired, subsequent output may be incomplete]"); + } + } + } + public void Dispose() { if (_projectDir != null && _enablePerTestCleanup) diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/RunHost.cs b/src/mono/wasm/Wasm.Build.Tests/Common/RunHost.cs index 137316ebb546c5..1208060464a9e7 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/RunHost.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/RunHost.cs @@ -15,6 +15,6 @@ public enum RunHost Firefox = 8, NodeJS = 16, - All = V8 | NodeJS | Chrome//| Firefox//Safari + All = V8 | Chrome//| NodeJS//Firefox//Safari } } diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs b/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs index fb7a43bf19d826..4c7531a889007d 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs @@ -110,12 +110,12 @@ public virtual void Dispose() } protected virtual string GetFullArgs(params string[] args) => string.Join(" ", args); - private async Task ExecuteAsyncInternal(string executable, string args) { var output = new List(); CurrentProcess = CreateProcess(executable, args); - DataReceivedEventHandler errorHandler = (s, e) => + + void HandleDataReceived(DataReceivedEventArgs e, DataReceivedEventHandler? additionalHandler) { if (e.Data == null || isDisposed) return; @@ -127,24 +127,13 @@ private async Task ExecuteAsyncInternal(string executable, string string msg = $"[{_label}] {e.Data}"; output.Add(msg); - _testOutput.WriteLine(msg); - ErrorDataReceived?.Invoke(s, e); + TryWriteToTestOutput(msg, output); + additionalHandler?.Invoke(this, e); } - }; - - DataReceivedEventHandler outputHandler = (s, e) => - { - lock (_lock) - { - if (e.Data == null || isDisposed) - return; + } - string msg = $"[{_label}] {e.Data}"; - output.Add(msg); - _testOutput.WriteLine(msg); - OutputDataReceived?.Invoke(s, e); - } - }; + DataReceivedEventHandler errorHandler = (s, e) => HandleDataReceived(e, ErrorDataReceived); + DataReceivedEventHandler outputHandler = (s, e) => HandleDataReceived(e, OutputDataReceived); CurrentProcess.ErrorDataReceived += errorHandler; CurrentProcess.OutputDataReceived += outputHandler; @@ -165,6 +154,20 @@ private async Task ExecuteAsyncInternal(string executable, string string.Join(System.Environment.NewLine, output)); } + private void TryWriteToTestOutput(string message, List output) + { + try + { + _testOutput.WriteLine(message); + } + catch (InvalidOperationException) + { + // Test context may have expired, continue without logging to test output + // Add a marker to the output buffer so we know this happened + output.Add($"[{_label}] [WARNING: Test context expired, subsequent output may be incomplete]"); + } + } + private Process CreateProcess(string executable, string args) { var psi = new ProcessStartInfo diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs index dbaeba4bb1165b..6381b1ac41b944 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs @@ -35,8 +35,8 @@ public IcuShardingTests(ITestOutputHelper output, SharedBuildPerTestClassFixture .UnwrapItemsAsArrays(); [Theory] - [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { false, RunHost.NodeJS | RunHost.Chrome })] - [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { true, RunHost.NodeJS | RunHost.Chrome })] + [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { false, RunHost.Chrome })] + [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { true, RunHost.Chrome })] public void CustomIcuShard(BuildArgs buildArgs, string shardName, string testedLocales, bool onlyPredefinedCultures, RunHost host, string id) => TestIcuShards(buildArgs, shardName, testedLocales, host, id, onlyPredefinedCultures); diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs index c04d5c1114dc00..221850f27a188d 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs @@ -32,8 +32,8 @@ public IcuShardingTests2(ITestOutputHelper output, SharedBuildPerTestClassFixtur [Theory] - [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { false, RunHost.NodeJS | RunHost.Chrome })] - [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { true, RunHost.NodeJS | RunHost.Chrome })] + [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { false, RunHost.Chrome })] + [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { true, RunHost.Chrome })] public void DefaultAvailableIcuShardsFromRuntimePack(BuildArgs buildArgs, string shardName, string testedLocales, RunHost host, string id) => TestIcuShards(buildArgs, shardName, testedLocales, host, id); } \ No newline at end of file diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs b/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs index 0f58d24ac9f3d0..5137de3c096a2b 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs @@ -37,8 +37,8 @@ public IcuTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildCo .UnwrapItemsAsArrays(); [Theory] - [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { false, RunHost.NodeJS | RunHost.Chrome })] - [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { true, RunHost.NodeJS | RunHost.Chrome })] + [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { false, RunHost.Chrome })] + [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { true, RunHost.Chrome })] public void FullIcuFromRuntimePackWithInvariant(BuildArgs buildArgs, bool invariant, bool fullIcu, string testedLocales, RunHost host, string id) { string projectName = $"fullIcuInvariant_{fullIcu}_{invariant}_{buildArgs.Config}_{buildArgs.AOT}"; @@ -60,8 +60,8 @@ public void FullIcuFromRuntimePackWithInvariant(BuildArgs buildArgs, bool invari } [Theory] - [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { false, RunHost.NodeJS | RunHost.Chrome })] - [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { true, RunHost.NodeJS | RunHost.Chrome })] + [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { false, RunHost.Chrome })] + [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { true, RunHost.Chrome })] public void FullIcuFromRuntimePackWithCustomIcu(BuildArgs buildArgs, bool fullIcu, RunHost host, string id) { string projectName = $"fullIcuCustom_{fullIcu}_{buildArgs.Config}_{buildArgs.AOT}"; diff --git a/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs b/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs index fc6099fb727987..c931fe0beeb6de 100644 --- a/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs @@ -38,13 +38,13 @@ public static async System.Threading.Tasks.Task Main(string[] args) }", buildArgs, args, host, id); - [Theory] - [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false, RunHost.NodeJS })] - //[MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ true, RunHost.All })] - public void TopLevelWithArgs(BuildArgs buildArgs, string[] args, RunHost host, string id) - => TestMainWithArgs("top_level_args", - @"##CODE## return await System.Threading.Tasks.Task.FromResult(42 + count);", - buildArgs, args, host, id); + // [Theory] + // [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false, RunHost.NodeJS })] + // //[MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ true, RunHost.All })] + // public void TopLevelWithArgs(BuildArgs buildArgs, string[] args, RunHost host, string id) + // => TestMainWithArgs("top_level_args", + // @"##CODE## return await System.Threading.Tasks.Task.FromResult(42 + count);", + // buildArgs, args, host, id); [Theory] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false, RunHost.All })] diff --git a/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs b/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs index ff111d60207aa2..5a72a3da5a7713 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs @@ -61,41 +61,5 @@ public void BuildWithUndefinedNativeSymbol(bool allowUndefined) Assert.Contains("Use '-p:WasmAllowUndefinedSymbols=true' to allow undefined symbols", result.Output); } } - - [Theory] - [InlineData("Debug")] - [InlineData("Release")] - public void ProjectWithDllImportsRequiringMarshalIlGen_ArrayTypeParameter(string config) - { - string id = $"dllimport_incompatible_{GetRandomId()}"; - string projectPath = CreateWasmTemplateProject(id, template: "wasmconsole"); - - string nativeSourceFilename = "incompatible_type.c"; - string nativeCode = "void call_needing_marhsal_ilgen(void *x) {}"; - File.WriteAllText(path: Path.Combine(_projectDir!, nativeSourceFilename), nativeCode); - - AddItemsPropertiesToProject( - projectPath, - extraItems: "" - ); - - File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "marshal_ilgen_test.cs"), - Path.Combine(_projectDir!, "Program.cs"), - overwrite: true); - - using DotNetCommand cmd = new DotNetCommand(s_buildEnv, _testOutput); - CommandResult result = cmd.WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .ExecuteWithCapturedOutput("build", $"-c {config} -bl"); - - Assert.True(result.ExitCode == 0, "Expected build to succeed"); - - using RunCommand runCmd = new RunCommand(s_buildEnv, _testOutput); - CommandResult res = runCmd.WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config}") - .EnsureSuccessful(); - Assert.Contains("Hello, Console!", res.Output); - Assert.Contains("Hello, World! Greetings from node version", res.Output); - } } } diff --git a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs index df96cac3f9ba6c..64c7a954325ea3 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs @@ -167,117 +167,9 @@ public void BrowserBuildThenPublish(string config) UseCache: false)); } - [Theory] - [InlineData("Debug")] - [InlineData("Release")] - public void ConsoleBuildThenPublish(string config) - { - string id = $"{config}_{GetRandomId()}"; - string projectFile = CreateWasmTemplateProject(id, "wasmconsole"); - string projectName = Path.GetFileNameWithoutExtension(projectFile); - - UpdateConsoleMainJs(); - - var buildArgs = new BuildArgs(projectName, config, false, id, null); - buildArgs = ExpandBuildArgs(buildArgs); - - BuildTemplateProject(buildArgs, - id: id, - new BuildProjectOptions( - DotnetWasmFromRuntimePack: true, - CreateProject: false, - HasV8Script: false, - MainJS: "main.mjs", - Publish: false, - TargetFramework: BuildTestBase.DefaultTargetFramework, - IsBrowserProject: false - )); - - using RunCommand cmd = new RunCommand(s_buildEnv, _testOutput); - CommandResult res = cmd.WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config}") - .EnsureSuccessful(); - Assert.Contains("Hello, Console!", res.Output); - - if (!_buildContext.TryGetBuildFor(buildArgs, out BuildProduct? product)) - throw new XunitException($"Test bug: could not get the build product in the cache"); - - File.Move(product!.LogFile, Path.ChangeExtension(product.LogFile!, ".first.binlog")); - - _testOutput.WriteLine($"{Environment.NewLine}Publishing with no changes ..{Environment.NewLine}"); - - bool expectRelinking = config == "Release"; - BuildTemplateProject(buildArgs, - id: id, - new BuildProjectOptions( - DotnetWasmFromRuntimePack: !expectRelinking, - CreateProject: false, - HasV8Script: false, - MainJS: "main.mjs", - Publish: true, - TargetFramework: BuildTestBase.DefaultTargetFramework, - UseCache: false, - IsBrowserProject: false)); - } - - [Theory] - [InlineData("Debug", false)] - [InlineData("Debug", true)] - [InlineData("Release", false)] - [InlineData("Release", true)] - public void ConsoleBuildAndRunDefault(string config, bool relinking) - => ConsoleBuildAndRun(config, relinking, string.Empty, DefaultTargetFramework, addFrameworkArg: true); - - [Theory] - // [ActiveIssue("https://github.com/dotnet/runtime/issues/79313")] - // [InlineData("Debug", "-f net7.0", "net7.0")] - //[InlineData("Debug", "-f net8.0", "net8.0")] - [InlineData("Debug", "-f net9.0", "net9.0")] - public void ConsoleBuildAndRunForSpecificTFM(string config, string extraNewArgs, string expectedTFM) - => ConsoleBuildAndRun(config, false, extraNewArgs, expectedTFM, addFrameworkArg: extraNewArgs?.Length == 0); - - private void ConsoleBuildAndRun(string config, bool relinking, string extraNewArgs, string expectedTFM, bool addFrameworkArg) - { - string id = $"{config}_{GetRandomId()}"; - string projectFile = CreateWasmTemplateProject(id, "wasmconsole", extraNewArgs, addFrameworkArg: addFrameworkArg); - string projectName = Path.GetFileNameWithoutExtension(projectFile); - - UpdateConsoleProgramCs(); - UpdateConsoleMainJs(); - if (relinking) - AddItemsPropertiesToProject(projectFile, "true"); - - var buildArgs = new BuildArgs(projectName, config, false, id, null); - buildArgs = ExpandBuildArgs(buildArgs); - - BuildTemplateProject(buildArgs, - id: id, - new BuildProjectOptions( - DotnetWasmFromRuntimePack: !relinking, - CreateProject: false, - HasV8Script: false, - MainJS: "main.mjs", - Publish: false, - TargetFramework: expectedTFM, - IsBrowserProject: false - )); - - using RunCommand cmd = new RunCommand(s_buildEnv, _testOutput); - CommandResult res = cmd.WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config} x y z") - .EnsureExitCode(42); - - Assert.Contains("args[0] = x", res.Output); - Assert.Contains("args[1] = y", res.Output); - Assert.Contains("args[2] = z", res.Output); - } - public static TheoryData TestDataForAppBundleDir() { var data = new TheoryData(); - AddTestData(forConsole: true, runOutsideProjectDirectory: false); - AddTestData(forConsole: true, runOutsideProjectDirectory: true); - AddTestData(forConsole: false, runOutsideProjectDirectory: false); AddTestData(forConsole: false, runOutsideProjectDirectory: true); @@ -380,77 +272,6 @@ private Task ConsoleRunWithAndThenWithoutBuildAsync(string config, string extraP return Task.CompletedTask; } - public static TheoryData TestDataForConsolePublishAndRun() - { - var data = new TheoryData(); - data.Add("Debug", false, false); - data.Add("Debug", false, true); - data.Add("Release", false, false); // Release relinks by default - data.Add("Release", true, false); - - return data; - } - - [Theory] - [MemberData(nameof(TestDataForConsolePublishAndRun))] - public void ConsolePublishAndRun(string config, bool aot, bool relinking) - { - string id = $"{config}_{GetRandomId()}"; - string projectFile = CreateWasmTemplateProject(id, "wasmconsole"); - string projectName = Path.GetFileNameWithoutExtension(projectFile); - - UpdateConsoleProgramCs(); - UpdateConsoleMainJs(); - - if (aot) - { - // FIXME: pass envvars via the environment, once that is supported - UpdateMainJsEnvironmentVariables(("MONO_LOG_MASK", "aot"), ("MONO_LOG_LEVEL", "debug")); - AddItemsPropertiesToProject(projectFile, "true"); - } - else if (relinking) - { - AddItemsPropertiesToProject(projectFile, "true"); - } - - var buildArgs = new BuildArgs(projectName, config, aot, id, null); - buildArgs = ExpandBuildArgs(buildArgs); - - bool expectRelinking = config == "Release" || aot || relinking; - BuildTemplateProject(buildArgs, - id: id, - new BuildProjectOptions( - DotnetWasmFromRuntimePack: !expectRelinking, - CreateProject: false, - HasV8Script: false, - MainJS: "main.mjs", - Publish: true, - TargetFramework: BuildTestBase.DefaultTargetFramework, - UseCache: false, - IsBrowserProject: false)); - - using (RunCommand cmd = new RunCommand(s_buildEnv, _testOutput, label: id)) - { - cmd.WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput("--info") - .EnsureExitCode(0); - } - - string runArgs = $"run --no-silent --no-build -c {config} -v diag"; - runArgs += " x y z"; - using (RunCommand cmd = new RunCommand(s_buildEnv, _testOutput, label: id)) - { - CommandResult res = cmd.WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput(runArgs) - .EnsureExitCode(42); - if (aot) - Assert.Contains($"AOT: image '{Path.GetFileNameWithoutExtension(projectFile)}' found", res.Output); - Assert.Contains("args[0] = x", res.Output); - Assert.Contains("args[1] = y", res.Output); - Assert.Contains("args[2] = z", res.Output); - } - } - public static IEnumerable BrowserBuildAndRunTestData() { yield return new object?[] { "", BuildTestBase.DefaultTargetFramework, DefaultRuntimeAssetsRelativePath }; @@ -491,106 +312,6 @@ public async Task BrowserBuildAndRun(string extraNewArgs, string targetFramework Assert.Contains("Hello, Browser!", string.Join(Environment.NewLine, runner.OutputLines)); } - [Theory] - [InlineData("Debug", /*appendRID*/ true, /*useArtifacts*/ false)] - [InlineData("Debug", /*appendRID*/ true, /*useArtifacts*/ true)] - [InlineData("Debug", /*appendRID*/ false, /*useArtifacts*/ true)] - [InlineData("Debug", /*appendRID*/ false, /*useArtifacts*/ false)] - public void BuildAndRunForDifferentOutputPaths(string config, bool appendRID, bool useArtifacts) - { - string id = $"{config}_{GetRandomId()}"; - string projectFile = CreateWasmTemplateProject(id, "wasmconsole"); - string projectName = Path.GetFileNameWithoutExtension(projectFile); - - string extraPropertiesForDBP = ""; - if (appendRID) - extraPropertiesForDBP += "true"; - if (useArtifacts) - extraPropertiesForDBP += "true."; - - string projectDirectory = Path.GetDirectoryName(projectFile)!; - if (!string.IsNullOrEmpty(extraPropertiesForDBP)) - AddItemsPropertiesToProject(Path.Combine(projectDirectory, "Directory.Build.props"), - extraPropertiesForDBP); - - var buildOptions = new BuildProjectOptions( - DotnetWasmFromRuntimePack: true, - CreateProject: false, - HasV8Script: false, - MainJS: "main.mjs", - Publish: false, - TargetFramework: DefaultTargetFramework, - IsBrowserProject: false); - if (useArtifacts) - { - buildOptions = buildOptions with - { - BinFrameworkDir = Path.Combine( - projectDirectory, - "bin", - id, - $"{config.ToLower()}_{BuildEnvironment.DefaultRuntimeIdentifier}", - "AppBundle", - "_framework") - }; - } - - var buildArgs = new BuildArgs(projectName, config, false, id, null); - buildArgs = ExpandBuildArgs(buildArgs); - BuildTemplateProject(buildArgs, id: id, buildOptions); - - CommandResult res = new RunCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .ExecuteWithCapturedOutput($"run --no-silent --no-build -c {config} x y z") - .EnsureSuccessful(); - } - - [Theory] - [InlineData("", true)] // Default case - [InlineData("false", false)] // the other case - public void Test_WasmStripILAfterAOT(string stripILAfterAOT, bool expectILStripping) - { - string config = "Release"; - string id = $"strip_{config}_{GetRandomId()}"; - string projectFile = CreateWasmTemplateProject(id, "wasmconsole"); - string projectName = Path.GetFileNameWithoutExtension(projectFile); - string projectDirectory = Path.GetDirectoryName(projectFile)!; - bool aot = true; - - UpdateConsoleProgramCs(); - UpdateConsoleMainJs(); - - string extraProperties = "true"; - if (!string.IsNullOrEmpty(stripILAfterAOT)) - extraProperties += $"{stripILAfterAOT}"; - AddItemsPropertiesToProject(projectFile, extraProperties); - - var buildArgs = new BuildArgs(projectName, config, aot, id, null); - buildArgs = ExpandBuildArgs(buildArgs); - - BuildTemplateProject(buildArgs, - id: id, - new BuildProjectOptions( - CreateProject: false, - HasV8Script: false, - MainJS: "main.mjs", - Publish: true, - TargetFramework: BuildTestBase.DefaultTargetFramework, - UseCache: false, - IsBrowserProject: false, - AssertAppBundle: false)); - - string runArgs = $"run --no-silent --no-build -c {config}"; - using ToolCommand cmd = new RunCommand(s_buildEnv, _testOutput, label: id) - .WithWorkingDirectory(_projectDir!); - CommandResult res = cmd.ExecuteWithCapturedOutput(runArgs) - .EnsureExitCode(42); - - string frameworkDir = Path.Combine(projectDirectory, "bin", config, BuildTestBase.DefaultTargetFramework, "browser-wasm", "AppBundle", "_framework"); - string objBuildDir = Path.Combine(projectDirectory, "obj", config, BuildTestBase.DefaultTargetFramework, "browser-wasm", "wasm", "for-publish"); - TestWasmStripILAfterAOTOutput(objBuildDir, frameworkDir, expectILStripping, _testOutput); - } - internal static void TestWasmStripILAfterAOTOutput(string objBuildDir, string frameworkDir, bool expectILStripping, ITestOutputHelper testOutput) { string origAssemblyDir = Path.Combine(objBuildDir, "aot-in"); From ae731f65f1a3cad762c00ccdd01acd6a9b6405c4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 13:24:46 +0200 Subject: [PATCH 25/33] [release/9.0-staging] Harden `Ping_TimedOut_*` tests (#116630) * harden Ping_TimedOut_* tests * improve comments --------- Co-authored-by: antonfirsov Co-authored-by: Anton Firszov --- .../tests/FunctionalTests/PingTest.cs | 81 +++++++++++-------- .../tests/FunctionalTests/TestSettings.cs | 3 + 2 files changed, 49 insertions(+), 35 deletions(-) diff --git a/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs b/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs index f21cbce950a543..808887732dd5fd 100644 --- a/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs +++ b/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs @@ -745,53 +745,64 @@ public async Task SendPingToExternalHostWithLowTtlTest() Assert.NotEqual(IPAddress.Any, pingReply.Address); } - [Fact] - [OuterLoop] - public void Ping_TimedOut_Sync_Success() + private async Task Ping_TimedOut_Core(Func> sendPing) { - var sender = new Ping(); - PingReply reply = sender.Send(TestSettings.UnreachableAddress); + Ping sender = new Ping(); + PingReply reply = await sendPing(sender, TestSettings.UnreachableAddress); + if (reply.Status == IPStatus.DestinationNetworkUnreachable) + { + // A network middleware has dropped the packed and replied with DestinationNetworkUnreachable. Repeat the PING attempt on another address. + reply = await sendPing(sender, TestSettings.UnreachableAddress2); + } + + if (reply.Status == IPStatus.DestinationNetworkUnreachable) + { + // Do yet another attempt. + reply = await sendPing(sender, TestSettings.UnreachableAddress3); + } + Assert.Equal(IPStatus.TimedOut, reply.Status); } [Fact] [OuterLoop] - public async Task Ping_TimedOut_EAP_Success() - { - var sender = new Ping(); - sender.PingCompleted += (s, e) => - { - var tcs = (TaskCompletionSource)e.UserState; + public Task Ping_TimedOut_Sync_Success() + => Ping_TimedOut_Core((sender, address) => Task.Run(() => sender.Send(address))); - if (e.Cancelled) - { - tcs.TrySetCanceled(); - } - else if (e.Error != null) - { - tcs.TrySetException(e.Error); - } - else + [Fact] + [OuterLoop] + public Task Ping_TimedOut_EAP_Success() + => Ping_TimedOut_Core(async (sender, address) => + { + static void PingCompleted(object sender, PingCompletedEventArgs e) { - tcs.TrySetResult(e.Reply); - } - }; + var tcs = (TaskCompletionSource)e.UserState; - var tcs = new TaskCompletionSource(); - sender.SendAsync(TestSettings.UnreachableAddress, tcs); - - PingReply reply = await tcs.Task; - Assert.Equal(IPStatus.TimedOut, reply.Status); - } + if (e.Cancelled) + { + tcs.TrySetCanceled(); + } + else if (e.Error != null) + { + tcs.TrySetException(e.Error); + } + else + { + tcs.TrySetResult(e.Reply); + } + } + sender.PingCompleted += PingCompleted; + var tcs = new TaskCompletionSource(); + sender.SendAsync(address, tcs); + PingReply reply = await tcs.Task; + sender.PingCompleted -= PingCompleted; + return reply; + }); [Fact] [OuterLoop] - public async Task Ping_TimedOut_TAP_Success() - { - var sender = new Ping(); - PingReply reply = await sender.SendPingAsync(TestSettings.UnreachableAddress); - Assert.Equal(IPStatus.TimedOut, reply.Status); - } + public Task Ping_TimedOut_TAP_Success() + => Ping_TimedOut_Core((sender, address) => sender.SendPingAsync(address)); private static bool IsRemoteExecutorSupportedAndPrivilegedProcess => RemoteExecutor.IsSupported && PlatformDetection.IsPrivilegedProcess; diff --git a/src/libraries/System.Net.Ping/tests/FunctionalTests/TestSettings.cs b/src/libraries/System.Net.Ping/tests/FunctionalTests/TestSettings.cs index 0e48bb4777b2e1..78b2be986651e6 100644 --- a/src/libraries/System.Net.Ping/tests/FunctionalTests/TestSettings.cs +++ b/src/libraries/System.Net.Ping/tests/FunctionalTests/TestSettings.cs @@ -11,6 +11,9 @@ internal static class TestSettings { public static readonly string LocalHost = "localhost"; public static readonly string UnreachableAddress = "192.0.2.0"; // TEST-NET-1 + public static readonly string UnreachableAddress2 = "100.64.0.1"; // CGNAT block + public static readonly string UnreachableAddress3 = "10.255.255.1"; // High address in the private 10.0.0.0/8 range. Likely unused and unrouted. + public const int PingTimeout = 10 * 1000; public const string PayloadAsString = "'Post hoc ergo propter hoc'. 'After it, therefore because of it'. It means one thing follows the other, therefore it was caused by the other. But it's not always true. In fact it's hardly ever true."; From 14d268b2f0481f13b8f26d7bf274634ca10a541e Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed <10833894+tarekgh@users.noreply.github.com> Date: Thu, 10 Jul 2025 09:44:03 -0700 Subject: [PATCH 26/33] Add missing feed --- NuGet.config | 1 + 1 file changed, 1 insertion(+) diff --git a/NuGet.config b/NuGet.config index cd65b636a861b8..e9d93076b37fef 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,6 +9,7 @@ + From 06e084551552299f0dd9f0130ce295632abd70b9 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed <10833894+tarekgh@users.noreply.github.com> Date: Thu, 10 Jul 2025 09:49:15 -0700 Subject: [PATCH 27/33] remove un-needed feed --- NuGet.config | 1 - 1 file changed, 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index e9d93076b37fef..6c2588e1fb61cf 100644 --- a/NuGet.config +++ b/NuGet.config @@ -10,7 +10,6 @@ - From a2c3690c7ca19547fdb848d462199cdf2cd8f3b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 12:17:24 -0700 Subject: [PATCH 28/33] [release/9.0-staging] Fix ILogB for subnormal values (#116973) * Fix LeadingZeroCount in ILogB * Add test --------- Co-authored-by: Huo Yaoyuan --- src/libraries/System.Private.CoreLib/src/System/Half.cs | 2 +- src/libraries/System.Private.CoreLib/src/System/Math.cs | 2 +- src/libraries/System.Private.CoreLib/src/System/MathF.cs | 2 +- .../tests/System.Runtime.Extensions.Tests/System/Math.cs | 1 + .../tests/System.Runtime.Extensions.Tests/System/MathF.cs | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Half.cs b/src/libraries/System.Private.CoreLib/src/System/Half.cs index 73cf14403d59e8..a9159790641707 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Half.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Half.cs @@ -1568,7 +1568,7 @@ public static int ILogB(Half x) } Debug.Assert(IsSubnormal(x)); - return MinExponent - (BitOperations.TrailingZeroCount(x.TrailingSignificand) - BiasedExponentLength); + return MinExponent - (BitOperations.LeadingZeroCount(x.TrailingSignificand) - BiasedExponentLength); } return x.Exponent; diff --git a/src/libraries/System.Private.CoreLib/src/System/Math.cs b/src/libraries/System.Private.CoreLib/src/System/Math.cs index 32c3eee4712bfc..d87123697c9812 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Math.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Math.cs @@ -880,7 +880,7 @@ public static int ILogB(double x) } Debug.Assert(double.IsSubnormal(x)); - return double.MinExponent - (BitOperations.TrailingZeroCount(x.TrailingSignificand) - double.BiasedExponentLength); + return double.MinExponent - (BitOperations.LeadingZeroCount(x.TrailingSignificand) - double.BiasedExponentLength); } return x.Exponent; diff --git a/src/libraries/System.Private.CoreLib/src/System/MathF.cs b/src/libraries/System.Private.CoreLib/src/System/MathF.cs index 31e74906022666..6a26c29cfef535 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MathF.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MathF.cs @@ -210,7 +210,7 @@ public static int ILogB(float x) } Debug.Assert(float.IsSubnormal(x)); - return float.MinExponent - (BitOperations.TrailingZeroCount(x.TrailingSignificand) - float.BiasedExponentLength); + return float.MinExponent - (BitOperations.LeadingZeroCount(x.TrailingSignificand) - float.BiasedExponentLength); } return x.Exponent; diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Math.cs b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Math.cs index 2550b706b41063..316650591fd64f 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Math.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Math.cs @@ -2287,6 +2287,7 @@ public static void FusedMultiplyAdd(double x, double y, double z, double expecte [InlineData( 0.561760, -1)] [InlineData( 0.774152, -1)] [InlineData( -0.678764, -1)] + [InlineData( 1e-308, -1024)] public static void ILogB(double value, int expectedResult) { Assert.Equal(expectedResult, Math.ILogB(value)); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/MathF.cs b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/MathF.cs index 1363a2b407b016..e5d2b224734b13 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/MathF.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/MathF.cs @@ -742,6 +742,7 @@ public static void IEEERemainder() [InlineData(0.561760f, -1)] [InlineData(0.774152f, -1)] [InlineData(-0.678764f, -1)] + [InlineData(1e-44f, -147)] public static void ILogB(float value, int expectedResult) { Assert.Equal(expectedResult, MathF.ILogB(value)); From ccf556df560288571a12efa37c28e6c4ffb062b9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:57:00 -0700 Subject: [PATCH 29/33] Fix interface trimming order (#114509) Co-authored-by: Sven Boemer Co-authored-by: Andy Gocke --- src/tools/illink/src/linker/Linker.Steps/MarkStep.cs | 2 +- .../Attributes/OnlyKeepUsed/MethodWithUnmanagedConstraint.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs index 2e41771ee39634..ef88f6d4d007c4 100644 --- a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs +++ b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs @@ -417,8 +417,8 @@ bool ProcessPrimaryQueue () while (!QueueIsEmpty ()) { ProcessQueue (); - ProcessInterfaceMethods (); ProcessMarkedTypesWithInterfaces (); + ProcessInterfaceMethods (); ProcessDynamicCastableImplementationInterfaces (); ProcessPendingBodies (); DoAdditionalProcessing (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/MethodWithUnmanagedConstraint.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/MethodWithUnmanagedConstraint.cs index 6b58c1dbf0de9c..1a97ef3fa1e972 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/MethodWithUnmanagedConstraint.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/MethodWithUnmanagedConstraint.cs @@ -6,6 +6,11 @@ namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed { [SetupCSharpCompilerToUse ("csc")] [SetupLinkerArgument ("--used-attrs-only", "true")] + + // Necessary to allow trimming the attribute instance from types in CoreLib. + [SetupLinkerTrimMode ("link")] + // When we allow trimming CoreLib, some well-known types expected by ILVerify are removed. + [SkipILVerify] public class MethodWithUnmanagedConstraint { public static void Main () From 3dd878b073866cd2914581b9a30d088831542d12 Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Fri, 11 Jul 2025 09:09:59 +0300 Subject: [PATCH 30/33] [mono][gc] Fix gc descriptor computation for InlineArray structs (#116951) `compute_class_bitmap` iterates over all ref field slots in the current class so we can produce a GC descriptor. `field_iter` represents how many times the type in question is repeated in the current struct. Instead of bumping the current offset by the size of the repeated field, for each iteration, we were adding `field_offset` which is wrong. --- src/mono/mono/metadata/object.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index fe952d04c25a41..8ff1295057db10 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -906,9 +906,13 @@ compute_class_bitmap (MonoClass *klass, gsize *bitmap, int size, int offset, int guint32 field_iter = 1; guint32 field_instance_offset = field_offset; + int field_size = 0; // If struct has InlineArray attribute, iterate `length` times to set a bitmap - if (m_class_is_inlinearray (p)) + if (m_class_is_inlinearray (p)) { + int align; field_iter = m_class_inlinearray_value (p); + field_size = mono_type_size (field->type, &align); + } if (field_iter > 500) g_warning ("Large number of iterations detected when creating a GC bitmap, might affect performance."); @@ -973,7 +977,7 @@ compute_class_bitmap (MonoClass *klass, gsize *bitmap, int size, int offset, int break; } - field_instance_offset += field_offset; + field_instance_offset += field_size; field_iter--; } } From 49930c38946a7905342df268c9be2a6c21f71aab Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Fri, 11 Jul 2025 10:50:17 +0200 Subject: [PATCH 31/33] [release/9.0-staging] Fix few RandomAccess.Write edge case bugs (#109646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: NicoAvanzDev <35104310+NicoAvanzDev@users.noreply.github.com> Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> Co-authored-by: Stephen Toub Co-authored-by: Michał Petryka <35800402+MichalPetryka@users.noreply.github.com> --- .../src/System/IO/RandomAccess.Unix.cs | 62 +++---- .../src/System/IO/RandomAccess.Windows.cs | 2 +- .../RandomAccess/WriteGatherAsync.cs | 170 ++++++++++++++++++ src/native/libs/System.Native/pal_io.c | 53 +++++- 4 files changed, 254 insertions(+), 33 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Unix.cs index e06187b5a3de54..147e3815812d0c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Unix.cs @@ -168,37 +168,30 @@ internal static unsafe void WriteGatherAtOffset(SafeFileHandle handle, IReadOnly var handles = new MemoryHandle[buffersCount]; Span vectors = buffersCount <= IovStackThreshold ? - stackalloc Interop.Sys.IOVector[IovStackThreshold] : + stackalloc Interop.Sys.IOVector[IovStackThreshold].Slice(0, buffersCount) : new Interop.Sys.IOVector[buffersCount]; try { - int buffersOffset = 0, firstBufferOffset = 0; - while (true) + long totalBytesToWrite = 0; + for (int i = 0; i < buffersCount; i++) { - long totalBytesToWrite = 0; - - for (int i = buffersOffset; i < buffersCount; i++) - { - ReadOnlyMemory buffer = buffers[i]; - totalBytesToWrite += buffer.Length; - - MemoryHandle memoryHandle = buffer.Pin(); - vectors[i] = new Interop.Sys.IOVector { Base = firstBufferOffset + (byte*)memoryHandle.Pointer, Count = (UIntPtr)(buffer.Length - firstBufferOffset) }; - handles[i] = memoryHandle; - - firstBufferOffset = 0; - } + ReadOnlyMemory buffer = buffers[i]; + totalBytesToWrite += buffer.Length; - if (totalBytesToWrite == 0) - { - break; - } + MemoryHandle memoryHandle = buffer.Pin(); + vectors[i] = new Interop.Sys.IOVector { Base = (byte*)memoryHandle.Pointer, Count = (UIntPtr)buffer.Length }; + handles[i] = memoryHandle; + } + int buffersOffset = 0; + while (totalBytesToWrite > 0) + { long bytesWritten; - fixed (Interop.Sys.IOVector* pinnedVectors = &MemoryMarshal.GetReference(vectors)) + Span left = vectors.Slice(buffersOffset); + fixed (Interop.Sys.IOVector* pinnedVectors = &MemoryMarshal.GetReference(left)) { - bytesWritten = Interop.Sys.PWriteV(handle, pinnedVectors, buffersCount, fileOffset); + bytesWritten = Interop.Sys.PWriteV(handle, pinnedVectors, left.Length, fileOffset); } FileStreamHelpers.CheckFileCall(bytesWritten, handle.Path); @@ -208,22 +201,31 @@ internal static unsafe void WriteGatherAtOffset(SafeFileHandle handle, IReadOnly } // The write completed successfully but for fewer bytes than requested. + // We need to perform next write where the previous one has finished. + fileOffset += bytesWritten; + totalBytesToWrite -= bytesWritten; // We need to try again for the remainder. - for (int i = 0; i < buffersCount; i++) + while (buffersOffset < buffersCount && bytesWritten > 0) { - int n = buffers[i].Length; + int n = (int)vectors[buffersOffset].Count; if (n <= bytesWritten) { - buffersOffset++; bytesWritten -= n; - if (bytesWritten == 0) - { - break; - } + buffersOffset++; } else { - firstBufferOffset = (int)(bytesWritten - n); + // A partial read: the vector needs to point to the new offset. + // But that offset needs to be relative to the previous attempt. + // Example: we have a single buffer with 30 bytes and the first read returned 10. + // The next read should try to read the remaining 20 bytes, but in case it also reads just 10, + // the third attempt should read last 10 bytes (not 20 again). + Interop.Sys.IOVector current = vectors[buffersOffset]; + vectors[buffersOffset] = new Interop.Sys.IOVector + { + Base = current.Base + (int)(bytesWritten), + Count = current.Count - (UIntPtr)(bytesWritten) + }; break; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs index 3b02cf579934ba..56a72756f10be6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs @@ -435,7 +435,7 @@ internal static long ReadScatterAtOffset(SafeFileHandle handle, IReadOnlyList> buffers, long fileOffset) { // WriteFileGather does not support sync handles, so we just call WriteFile in a loop - int bytesWritten = 0; + long bytesWritten = 0; int buffersCount = buffers.Count; for (int i = 0; i < buffersCount; i++) { diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/RandomAccess/WriteGatherAsync.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/RandomAccess/WriteGatherAsync.cs index abf945b2d46bcc..8cf7d5233c6d3a 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/RandomAccess/WriteGatherAsync.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/RandomAccess/WriteGatherAsync.cs @@ -1,17 +1,20 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Buffers; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; +using Microsoft.DotNet.XUnitExtensions; using Microsoft.Win32.SafeHandles; using Xunit; namespace System.IO.Tests { [SkipOnPlatform(TestPlatforms.Browser, "async file IO is not supported on browser")] + [Collection(nameof(DisableParallelization))] // don't run in parallel, as some of these tests use a LOT of resources public class RandomAccess_WriteGatherAsync : RandomAccess_Base { protected override ValueTask MethodUnderTest(SafeFileHandle handle, byte[] bytes, long fileOffset) @@ -133,5 +136,172 @@ public async Task DuplicatedBufferDuplicatesContentAsync(FileOptions options) Assert.Equal(repeatCount, actualContent.Length); Assert.All(actualContent, actual => Assert.Equal(value, actual)); } + + [OuterLoop("It consumes a lot of resources (disk space and memory).")] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess), nameof(PlatformDetection.IsReleaseRuntime))] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, true)] + [InlineData(true, false)] + public async Task NoInt32OverflowForLargeInputs(bool asyncFile, bool asyncMethod) + { + // We need to write more than Int32.MaxValue bytes to the disk to reproduce the problem. + // To reduce the number of used memory, we allocate only one write buffer and simply repeat it multiple times. + // For reading, we need unique buffers to ensure that all of them are getting populated with the right data. + + const int BufferCount = 1002; + const int BufferSize = int.MaxValue / 1000; + const long FileSize = (long)BufferCount * BufferSize; + string filePath = GetTestFilePath(); + + FileOptions options = asyncFile ? FileOptions.Asynchronous : FileOptions.None; // we need to test both code paths + options |= FileOptions.DeleteOnClose; + + SafeFileHandle? sfh; + try + { + sfh = File.OpenHandle(filePath, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None, options, preallocationSize: FileSize); + } + catch (IOException) + { + throw new SkipTestException("Not enough disk space."); + } + + using (sfh) + { + ReadOnlyMemory writeBuffer = RandomNumberGenerator.GetBytes(BufferSize); + List> writeBuffers = Enumerable.Repeat(writeBuffer, BufferCount).ToList(); + + List memoryManagers = new List(BufferCount); + List> readBuffers = new List>(BufferCount); + + try + { + try + { + for (int i = 0; i < BufferCount; i++) + { + // We are using native memory here to get OOM as soon as possible. + NativeMemoryManager nativeMemoryManager = new(BufferSize); + memoryManagers.Add(nativeMemoryManager); + readBuffers.Add(nativeMemoryManager.Memory); + } + } + catch (OutOfMemoryException) + { + throw new SkipTestException("Not enough memory."); + } + + await Verify(asyncMethod, FileSize, sfh, writeBuffer, writeBuffers, readBuffers); + } + finally + { + foreach (IDisposable memoryManager in memoryManagers) + { + memoryManager.Dispose(); + } + } + } + + static async Task Verify(bool asyncMethod, long FileSize, SafeFileHandle sfh, ReadOnlyMemory writeBuffer, List> writeBuffers, List> readBuffers) + { + if (asyncMethod) + { + await RandomAccess.WriteAsync(sfh, writeBuffers, 0); + } + else + { + RandomAccess.Write(sfh, writeBuffers, 0); + } + + Assert.Equal(FileSize, RandomAccess.GetLength(sfh)); + + long fileOffset = 0; + while (fileOffset < FileSize) + { + long bytesRead = asyncMethod + ? await RandomAccess.ReadAsync(sfh, readBuffers, fileOffset) + : RandomAccess.Read(sfh, readBuffers, fileOffset); + + Assert.InRange(bytesRead, 0, FileSize); + + while (bytesRead > 0) + { + Memory readBuffer = readBuffers[0]; + if (bytesRead >= readBuffer.Length) + { + AssertExtensions.SequenceEqual(writeBuffer.Span, readBuffer.Span); + + bytesRead -= readBuffer.Length; + fileOffset += readBuffer.Length; + + readBuffers.RemoveAt(0); + } + else + { + // A read has finished somewhere in the middle of one of the read buffers. + // Example: buffer had 30 bytes and only 10 were read. + // We don't read the missing part, but try to read the whole buffer again. + // It's not optimal from performance perspective, but it keeps the test logic simple. + break; + } + } + } + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, true)] + [InlineData(true, false)] + public async Task IovLimitsAreRespected(bool asyncFile, bool asyncMethod) + { + // We need to write and read more than IOV_MAX buffers at a time. + // IOV_MAX typical value is 1024. + const int BufferCount = 1026; + const int BufferSize = 1; // the less resources we use, the better + const int FileSize = BufferCount * BufferSize; + + ReadOnlyMemory writeBuffer = RandomNumberGenerator.GetBytes(BufferSize); + ReadOnlyMemory[] writeBuffers = Enumerable.Repeat(writeBuffer, BufferCount).ToArray(); + Memory[] readBuffers = Enumerable.Range(0, BufferCount).Select(_ => new byte[BufferSize].AsMemory()).ToArray(); + + FileOptions options = asyncFile ? FileOptions.Asynchronous : FileOptions.None; // we need to test both code paths + options |= FileOptions.DeleteOnClose; + + using SafeFileHandle sfh = File.OpenHandle(GetTestFilePath(), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None, options); + + if (asyncMethod) + { + await RandomAccess.WriteAsync(sfh, writeBuffers, 0); + } + else + { + RandomAccess.Write(sfh, writeBuffers, 0); + } + + Assert.Equal(FileSize, RandomAccess.GetLength(sfh)); + + long fileOffset = 0; + int bufferOffset = 0; + while (fileOffset < FileSize) + { + ArraySegment> left = new ArraySegment>(readBuffers, bufferOffset, readBuffers.Length - bufferOffset); + + long bytesRead = asyncMethod + ? await RandomAccess.ReadAsync(sfh, left, fileOffset) + : RandomAccess.Read(sfh, left, fileOffset); + + fileOffset += bytesRead; + // The following operation is correct only because the BufferSize is 1. + bufferOffset += (int)bytesRead; + } + + for (int i = 0; i < BufferCount; ++i) + { + Assert.Equal(writeBuffers[i], readBuffers[i]); + } + } } } diff --git a/src/native/libs/System.Native/pal_io.c b/src/native/libs/System.Native/pal_io.c index 0b6eab7e8c22bd..9bdd28616ad475 100644 --- a/src/native/libs/System.Native/pal_io.c +++ b/src/native/libs/System.Native/pal_io.c @@ -1883,6 +1883,53 @@ int32_t SystemNative_PWrite(intptr_t fd, void* buffer, int32_t bufferSize, int64 return (int32_t)count; } +#if (HAVE_PREADV || HAVE_PWRITEV) && !defined(TARGET_WASM) +static int GetAllowedVectorCount(IOVector* vectors, int32_t vectorCount) +{ +#if defined(IOV_MAX) + const int IovMax = IOV_MAX; +#else + // In theory all the platforms that we support define IOV_MAX, + // but we want to be extra safe and provde a fallback + // in case it turns out to not be true. + // 16 is low, but supported on every platform. + const int IovMax = 16; +#endif + + int allowedCount = (int)vectorCount; + + // We need to respect the limit of items that can be passed in iov. + // In case of writes, the managed code is responsible for handling incomplete writes. + // In case of reads, we simply returns the number of bytes read and it's up to the users. + if (IovMax < allowedCount) + { + allowedCount = IovMax; + } + +#if defined(TARGET_APPLE) + // For macOS preadv and pwritev can fail with EINVAL when the total length + // of all vectors overflows a 32-bit integer. + size_t totalLength = 0; + for (int i = 0; i < allowedCount; i++) + { + assert(INT_MAX >= vectors[i].Count); + + totalLength += vectors[i].Count; + + if (totalLength > INT_MAX) + { + allowedCount = i; + break; + } + } +#else + (void)vectors; +#endif + + return allowedCount; +} +#endif // (HAVE_PREADV || HAVE_PWRITEV) && !defined(TARGET_WASM) + int64_t SystemNative_PReadV(intptr_t fd, IOVector* vectors, int32_t vectorCount, int64_t fileOffset) { assert(vectors != NULL); @@ -1891,7 +1938,8 @@ int64_t SystemNative_PReadV(intptr_t fd, IOVector* vectors, int32_t vectorCount, int64_t count = 0; int fileDescriptor = ToFileDescriptor(fd); #if HAVE_PREADV && !defined(TARGET_WASM) // preadv is buggy on WASM - while ((count = preadv(fileDescriptor, (struct iovec*)vectors, (int)vectorCount, (off_t)fileOffset)) < 0 && errno == EINTR); + int allowedVectorCount = GetAllowedVectorCount(vectors, vectorCount); + while ((count = preadv(fileDescriptor, (struct iovec*)vectors, allowedVectorCount, (off_t)fileOffset)) < 0 && errno == EINTR); #else int64_t current; for (int i = 0; i < vectorCount; i++) @@ -1931,7 +1979,8 @@ int64_t SystemNative_PWriteV(intptr_t fd, IOVector* vectors, int32_t vectorCount int64_t count = 0; int fileDescriptor = ToFileDescriptor(fd); #if HAVE_PWRITEV && !defined(TARGET_WASM) // pwritev is buggy on WASM - while ((count = pwritev(fileDescriptor, (struct iovec*)vectors, (int)vectorCount, (off_t)fileOffset)) < 0 && errno == EINTR); + int allowedVectorCount = GetAllowedVectorCount(vectors, vectorCount); + while ((count = pwritev(fileDescriptor, (struct iovec*)vectors, allowedVectorCount, (off_t)fileOffset)) < 0 && errno == EINTR); #else int64_t current; for (int i = 0; i < vectorCount; i++) From 5c36d02b69d7758515b77d0d31f0c8e3d2e9bb75 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 11:27:07 -0700 Subject: [PATCH 32/33] Update dependencies from https://github.com/dotnet/xharness build 20250710.3 (#117594) Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 9.0.0-prerelease.25317.3 -> To Version 9.0.0-prerelease.25360.3 Co-authored-by: dotnet-maestro[bot] --- .config/dotnet-tools.json | 2 +- NuGet.config | 5 +---- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8da877c2f72151..00da25c312abbb 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "9.0.0-prerelease.25317.3", + "version": "9.0.0-prerelease.25360.3", "commands": [ "xharness" ] diff --git a/NuGet.config b/NuGet.config index 6c2588e1fb61cf..f723377edc2b5e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,10 +9,7 @@ - - - - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c0c9e7e81652f8..8f5935a1e84732 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -320,17 +320,17 @@ https://github.com/dotnet/runtime b030c4dfdfa1bf287f10f96006619a06bc2000ae - + https://github.com/dotnet/xharness - d20661676ca197f1f09a4322817b20a45da84290 + 0827ec37403702d48974c727c09e579c6aa9748a - + https://github.com/dotnet/xharness - d20661676ca197f1f09a4322817b20a45da84290 + 0827ec37403702d48974c727c09e579c6aa9748a - + https://github.com/dotnet/xharness - d20661676ca197f1f09a4322817b20a45da84290 + 0827ec37403702d48974c727c09e579c6aa9748a https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index d78a4c2d90144e..a5ff2701000aa5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -184,9 +184,9 @@ 1.4.0 17.4.0-preview-20220707-01 - 9.0.0-prerelease.25317.3 - 9.0.0-prerelease.25317.3 - 9.0.0-prerelease.25317.3 + 9.0.0-prerelease.25360.3 + 9.0.0-prerelease.25360.3 + 9.0.0-prerelease.25360.3 9.0.0-alpha.0.25330.3 3.12.0 4.5.0 From 6531bade8e8fdb3c1cebda65ca9a3dec59d2d7d4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 15:31:49 -0700 Subject: [PATCH 33/33] [release/9.0-staging] Update dependencies from dotnet/sdk (#117595) * Update dependencies from https://github.com/dotnet/sdk build 20250710.24 Microsoft.SourceBuild.Intermediate.sdk , Microsoft.DotNet.ApiCompat.Task From Version 9.0.108-servicing.25353.4 -> To Version 9.0.109-servicing.25360.24 * Add SDK missing feed * Update NuGet.config --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Tarek Mahmoud Sayed <10833894+tarekgh@users.noreply.github.com> Co-authored-by: Matt Mitchell --- NuGet.config | 1 + eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NuGet.config b/NuGet.config index f723377edc2b5e..7ac3f710d770bf 100644 --- a/NuGet.config +++ b/NuGet.config @@ -13,6 +13,7 @@ + - + https://github.com/dotnet/sdk - 525adf54d5abc1f40737bb9a9bbe53f25622398a + 8128984181a05a7dc0de748ad3371e0a7f153f35 diff --git a/eng/Versions.props b/eng/Versions.props index a5ff2701000aa5..f772dc0fc00585 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -83,7 +83,7 @@ 0.2.0 - 9.0.108 + 9.0.109 9.0.0-beta.25325.4 9.0.0-beta.25325.4